nv50: shadow mapping
authorBen Skeggs <skeggsb@gmail.com>
Tue, 13 Jan 2009 00:58:17 +0000 (10:58 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Tue, 13 Jan 2009 03:57:22 +0000 (13:57 +1000)
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_state.c

index 381b3e2f39276d9b72f607e2db3388d9c31dde8e..8e084e67147093ca995f8a9cb80800ff30bb2b54 100644 (file)
@@ -106,7 +106,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param)
        case PIPE_CAP_OCCLUSION_QUERY:
                return 1;
        case PIPE_CAP_TEXTURE_SHADOW_MAP:
-               return 0;
+               return 1;
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
                return 13;
        case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
index cabe54bde3a9d78ff406130efabfc1986757d4dc..38c1d938b8e1de022b6ffb09897cafc80def496f 100644 (file)
@@ -196,6 +196,11 @@ nv50_sampler_state_create(struct pipe_context *pipe,
        if (cso->max_anisotropy >= 2.0)
                tsc[0] |= (1 << 20);
 
+       if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
+               tsc[0] |= (1 << 8);
+               tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7);
+       }
+
        return (void *)tsc;
 }