r600g: Add support for PIPE_CAP_DEPTH_CLAMP.
authorHenri Verbeet <hverbeet@gmail.com>
Mon, 23 Aug 2010 19:13:59 +0000 (21:13 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Mon, 23 Aug 2010 20:13:18 +0000 (22:13 +0200)
src/gallium/drivers/r600/r600_screen.c
src/gallium/drivers/r600/r600_state.c

index 135843295706826d73c1b68536886410b6c31705..a047a49a6c55cd7d55e4f5dfd90b54dedf4fb8bb 100644 (file)
@@ -69,6 +69,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TEXTURE_SWIZZLE:
        case PIPE_CAP_INDEP_BLEND_ENABLE:
        case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
+       case PIPE_CAP_DEPTH_CLAMP:
                return 1;
 
        /* Unsupported features (boolean caps). */
@@ -77,7 +78,6 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_STREAM_OUTPUT:
        case PIPE_CAP_INDEP_BLEND_FUNC: /* FIXME allow this */
        case PIPE_CAP_GEOMETRY_SHADER4:
-       case PIPE_CAP_DEPTH_CLAMP: /* FIXME allow this */
                return 0;
 
        /* Texturing. */
index 12a61cacdad382095e61912cc3864de0420d8636..b5e5346163c749a615a301c5be10544301699c6f 100644 (file)
@@ -861,9 +861,10 @@ static struct radeon_state *r600_rasterizer(struct r600_context *rctx)
                }
        }
        rstate->states[R600_RASTERIZER__PA_CL_CLIP_CNTL] = 0;
-       if (clip && clip->nr) {
+       if (clip) {
                rstate->states[R600_RASTERIZER__PA_CL_CLIP_CNTL] = S_028810_PS_UCP_MODE(3) | ((1 << clip->nr) - 1);
-               rstate->states[R600_RASTERIZER__PA_CL_CLIP_CNTL] |= S_028810_CLIP_DISABLE(clip->depth_clamp);
+               rstate->states[R600_RASTERIZER__PA_CL_CLIP_CNTL] |= S_028810_ZCLIP_NEAR_DISABLE(clip->depth_clamp);
+               rstate->states[R600_RASTERIZER__PA_CL_CLIP_CNTL] |= S_028810_ZCLIP_FAR_DISABLE(clip->depth_clamp);
        }
        rstate->states[R600_RASTERIZER__PA_SU_SC_MODE_CNTL] =
                S_028814_PROVOKING_VTX_LAST(prov_vtx) |