Browse Source

GL: Added support for ARB_depth_clamp.

bkaradzic 12 years ago
parent
commit
c5025b769e
2 changed files with 7 additions and 1 deletions
  1. 0 1
      README.md
  2. 7 0
      src/renderer_gl.cpp

+ 0 - 1
README.md

@@ -266,7 +266,6 @@ Todo
  - Occlusion queries.
  - DX11: MSAA.
  - Fullscreen mode.
- - GL/DX11: Add support for ARB_depth_clamp, DepthBiasClamp.
 
 Contact
 -------

+ 7 - 0
src/renderer_gl.cpp

@@ -219,6 +219,7 @@ namespace bgfx
 			ANGLE_instanced_arrays,
 			ANGLE_translated_shader_source,
 			ARB_debug_output,
+			ARB_depth_clamp,
 			ARB_framebuffer_sRGB,
 			ARB_get_program_binary,
 			ARB_half_float_vertex,
@@ -279,6 +280,7 @@ namespace bgfx
 		{ "GL_ANGLE_instanced_arrays",            false,                             true  },
 		{ "GL_ANGLE_translated_shader_source",    false,                             true  },
 		{ "GL_ARB_debug_output",                  BGFX_CONFIG_RENDERER_OPENGL >= 43, true  },
+		{ "GL_ARB_depth_clamp",                   BGFX_CONFIG_RENDERER_OPENGL >= 31, true  },
 		{ "GL_ARB_framebuffer_sRGB",              false,                             true  },
 		{ "GL_ARB_get_program_binary",            BGFX_CONFIG_RENDERER_OPENGL >= 41, true  },
 		{ "GL_ARB_half_float_vertex",             false,                             true  },
@@ -2580,6 +2582,11 @@ namespace bgfx
 		{
 			GL_CHECK(glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) );
 		}
+
+		if (s_extension[Extension::ARB_depth_clamp].m_supported)
+		{
+			GL_CHECK(glEnable(GL_DEPTH_CLAMP) );
+		}
 #endif // BGFX_CONFIG_RENDERER_OPENGL
 	}