Commit c5410a6f authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Use GL_NV_depth_clamp to implement clipping disable.

parent 9e340f0f
......@@ -117,6 +117,7 @@ static const struct {
{"GL_NV_vertex_program1_1", NV_VERTEX_PROGRAM1_1},
{"GL_NV_vertex_program2", NV_VERTEX_PROGRAM2},
{"GL_NV_vertex_program3", NV_VERTEX_PROGRAM3},
{"GL_NV_depth_clamp", NV_DEPTH_CLAMP},
/* SGI */
{"GL_SGIS_generate_mipmap", SGIS_GENERATE_MIPMAP},
......
......@@ -439,9 +439,17 @@ static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
if (stateblock->renderState[WINED3DRS_CLIPPING]) {
enable = stateblock->renderState[WINED3DRS_CLIPPLANEENABLE];
disable = ~stateblock->renderState[WINED3DRS_CLIPPLANEENABLE];
if(GL_SUPPORT(NV_DEPTH_CLAMP)) {
glDisable(GL_DEPTH_CLAMP_NV);
checkGLcall("glDisable(GL_DEPTH_CLAMP_NV)");
}
} else {
disable = 0xffffffff;
enable = 0x00;
if(GL_SUPPORT(NV_DEPTH_CLAMP)) {
glEnable(GL_DEPTH_CLAMP_NV);
checkGLcall("glEnable(GL_DEPTH_CLAMP_NV)");
}
}
if (enable & WINED3DCLIPPLANE0) { glEnable(GL_CLIP_PLANE0); checkGLcall("glEnable(clip plane 0)"); }
......
......@@ -2847,6 +2847,11 @@ typedef int (WINE_GLAPI * PGLXFNWAITVIDEOSYNCSGIPROC) (int, int, unsigned int *)
#define GLX_SGIS_generate_mipmap
#endif
/* GL_NV_depth_clamp */
#ifndef GL_NV_depth_clamp
#define GL_DEPTH_CLAMP_NV 0x864F
#endif
/* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_0
#define GL_VERSION_2_0 1
......@@ -3184,6 +3189,7 @@ typedef enum _GL_SupportedExt {
NV_VERTEX_PROGRAM2,
NV_VERTEX_PROGRAM3,
NV_FENCE,
NV_DEPTH_CLAMP,
/* ATI */
ATI_SEPARATE_STENCIL,
ATI_TEXTURE_ENV_COMBINE3,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment