Skip to content

Commit

Permalink
check ARB_depth_clamp, then check NV_depth_clamp if it fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Aug 29, 2023
1 parent 5920d1a commit 1416441
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions Quake/gl_vidsdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ static void GL_CheckExtensions (void)
{
Con_Warning ("OpenGL version < 2, GLSL not available\n");
}

// GLSL gamma
//
if (COM_CheckParm("-noglslgamma"))
Expand All @@ -1260,9 +1259,8 @@ static void GL_CheckExtensions (void)
{
Con_Warning ("GLSL gamma not available, using hardware gamma\n");
}

// GLSL alias model rendering
//
// GLSL alias model rendering
//
if (COM_CheckParm("-noglslalias"))
Con_Warning ("GLSL alias model rendering disabled at command line\n");
else if (gl_glsl_able && gl_vbo_able && gl_max_texture_units >= 3)
Expand All @@ -1275,16 +1273,16 @@ static void GL_CheckExtensions (void)
Con_Warning ("GLSL alias model rendering not available, using Fitz renderer\n");
}

// packed_pixels
//
if (COM_CheckParm("-nopackedpixels"))
Con_Warning ("EXT_packed_pixels disabled at command line\n");
else if (gl_glsl_alias_able)
{
gl_packed_pixels = true;
Con_Printf("Enabled: EXT_packed_pixels\n");
}
#if 0 /* Disabling for non-GLSL path, needs more surgery. See: https://github.com/sezero/quakespasm/issues/47#issuecomment-1681540278 */
// packed_pixels
//
#if 0 /* Disabling for non-GLSL path, needs more surgery. */
else
{
if (GL_ParseExtensionList(gl_extensions, "GL_APPLE_packed_pixels"))
Expand All @@ -1302,17 +1300,26 @@ static void GL_CheckExtensions (void)
Con_Warning ("packed_pixels not supported\n");
}
}
#endif
#endif

// NV_depth_clamp
// ARB_depth_clamp
//
if (COM_CheckParm("-nodepthclamp"))
Con_Warning ("depth_clamp disabled at command line\n");
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_depth_clamp"))
{
Con_Printf("FOUND: ARB_depth_clamp\n");
gl_nv_depth_clamp = true;
}
else if (GL_ParseExtensionList(gl_extensions, "GL_NV_depth_clamp"))
{
Con_Printf("FOUND: GL_NV_depth_clamp\n");
Con_Printf("FOUND: NV_depth_clamp\n");
gl_nv_depth_clamp = true;
}
else
{
Con_Warning ("depth_clamp not supported\n");
}

// glGenerateMipmap for warp textures
if (COM_CheckParm("-nowarpmipmaps"))
Expand Down

0 comments on commit 1416441

Please sign in to comment.