Commit 078273af authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Add support for ARB_depth_clamp.

parent 89e7addf
......@@ -56,6 +56,7 @@ static const struct {
/* ARB */
{"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT, 0 },
{"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT, 0 },
{"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP, 0 },
{"GL_ARB_depth_texture", ARB_DEPTH_TEXTURE, 0 },
{"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS, 0 },
{"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM, 0 },
......@@ -1662,6 +1663,11 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
TRACE_(d3d_caps)(" IMPLIED: NVIDIA (NV) Texture Gen Reflection support.\n");
gl_info->supported[NV_TEXGEN_REFLECTION] = TRUE;
}
if (!gl_info->supported[ARB_DEPTH_CLAMP] && gl_info->supported[NV_DEPTH_CLAMP])
{
TRACE_(d3d_caps)(" IMPLIED: ARB_depth_clamp support (by NV_depth_clamp).\n");
gl_info->supported[ARB_DEPTH_CLAMP] = TRUE;
}
if (gl_info->supported[NV_TEXTURE_SHADER2])
{
if (gl_info->supported[NV_REGISTER_COMBINERS])
......
......@@ -564,16 +564,18 @@ static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
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)");
if (GL_SUPPORT(ARB_DEPTH_CLAMP))
{
glDisable(GL_DEPTH_CLAMP);
checkGLcall("glDisable(GL_DEPTH_CLAMP)");
}
} else {
disable = 0xffffffff;
enable = 0x00;
if(GL_SUPPORT(NV_DEPTH_CLAMP)) {
glEnable(GL_DEPTH_CLAMP_NV);
checkGLcall("glEnable(GL_DEPTH_CLAMP_NV)");
if (GL_SUPPORT(ARB_DEPTH_CLAMP))
{
glEnable(GL_DEPTH_CLAMP);
checkGLcall("glEnable(GL_DEPTH_CLAMP)");
}
}
......
......@@ -1528,6 +1528,12 @@ typedef void (WINE_GLAPI *PGLFNCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8dad
#endif
/* GL_ARB_depth_clamp */
#ifndef GL_ARB_depth_clamp
#define GL_ARB_depth_clamp 1
#define GL_DEPTH_CLAMP 0x864f
#endif
/* GL_ARB_depth_texture */
#ifndef GL_ARB_depth_texture
#define GL_ARB_depth_texture 1
......@@ -3405,6 +3411,7 @@ typedef enum _GL_SupportedExt {
/* ARB */
ARB_COLOR_BUFFER_FLOAT,
ARB_DEPTH_BUFFER_FLOAT,
ARB_DEPTH_CLAMP,
ARB_DEPTH_TEXTURE,
ARB_DRAW_BUFFERS,
ARB_FRAGMENT_PROGRAM,
......
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