aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-12-18 21:25:15 +0000
committerDave Airlie <[email protected]>2011-12-19 11:53:07 +0000
commit417aad5a992c8d7659438d20f82b4cf405c9c7b2 (patch)
tree730c5306edf7c98d2e1948b716d74e11e38bb973 /src/gallium/drivers
parent07eeb92abcd32653c9e6f6f60689bb1d059f5799 (diff)
softpipe: fix depth sampling for linear vs nearest.
This sample compare was always doing linear, and this makes the glsl-fs-shadow1DArray test render like the Intel driver. fix wrong 0->j from initial patch Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 72629a0bcac..43f201f7784 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2172,13 +2172,22 @@ sample_compare(struct tgsi_sampler *tgsi_sampler,
break;
}
- /* convert four pass/fail values to an intensity in [0,1] */
- val = 0.25F * (k0 + k1 + k2 + k3);
-
- /* XXX returning result for default GL_DEPTH_TEXTURE_MODE = GL_LUMINANCE */
- for (j = 0; j < 4; j++) {
- rgba[0][j] = rgba[1][j] = rgba[2][j] = val;
- rgba[3][j] = 1.0F;
+ if (sampler->mag_img_filter == PIPE_TEX_FILTER_LINEAR) {
+ /* convert four pass/fail values to an intensity in [0,1] */
+ val = 0.25F * (k0 + k1 + k2 + k3);
+
+ /* XXX returning result for default GL_DEPTH_TEXTURE_MODE = GL_LUMINANCE */
+ for (j = 0; j < 4; j++) {
+ rgba[0][j] = rgba[1][j] = rgba[2][j] = val;
+ rgba[3][j] = 1.0F;
+ }
+ } else {
+ for (j = 0; j < 4; j++) {
+ rgba[0][j] = k0;
+ rgba[1][j] = k1;
+ rgba[2][j] = k2;
+ rgba[3][j] = 1.0F;
+ }
}
}