nv50: fix depth comparison func TSC bits
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 10 Dec 2009 19:54:18 +0000 (20:54 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 12 Dec 2009 15:38:59 +0000 (16:38 +0100)
Unfortunately it seems that if depth comparison is
active and we read a 2D texture, i.e. provide only
2 inputs, the second is used for comparison ...

src/gallium/drivers/nv50/nv50_state.c

index 9c8c0c261e54af42f1b3532c61ee1b6165896047..88aef52d08c6bb57218cea85a52d9af073581b7c 100644 (file)
@@ -196,8 +196,9 @@ nv50_sampler_state_create(struct pipe_context *pipe,
        }
 
        if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
-               tsc[0] |= (1 << 8);
-               tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7);
+               /* XXX: must be deactivated for non-shadow textures */
+               tsc[0] |= (1 << 9);
+               tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7) << 10;
        }
 
        limit = CLAMP(cso->lod_bias, -16.0, 15.0);