[Mesa-dev] [PATCH 2/2] softpipe: fix depth sampling for linear vs nearest.
Brian Paul
brian.e.paul at gmail.com
Sun Dec 18 19:10:43 PST 2011
On Sun, Dec 18, 2011 at 2:39 PM, Dave Airlie <airlied at gmail.com> wrote:
> On Sun, Dec 18, 2011 at 9:27 PM, Dave Airlie <airlied at gmail.com> wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This sample compare was always doing linear, and this makes the
>> glsl-fs-shadow1DArray test render like the Intel driver.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>> src/gallium/drivers/softpipe/sp_tex_sample.c | 23 ++++++++++++++++-------
>> 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 72629a0..40ad786 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][0] = 1.0F;
>
> ^ assume 0 should be j here, though it would be good if someone could
> check my thinking, I mostly ported from swrast.
Yes, it should be rgba[3][j].
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list