mesa/st: set normalized coords for RECT samplers if rects are unsupported
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 12 Apr 2022 15:45:33 +0000 (11:45 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 14 Apr 2022 22:57:23 +0000 (22:57 +0000)
the shaders will never see these, so set the expected value for 2D

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15895>

src/mesa/state_tracker/st_atom_sampler.c

index 7f5a9a0..cdf267f 100644 (file)
@@ -72,7 +72,7 @@ st_convert_sampler(const struct st_context *st,
       sampler->mag_img_filter = PIPE_TEX_FILTER_NEAREST;
    }
 
-   if (texobj->Target != GL_TEXTURE_RECTANGLE_ARB)
+   if (texobj->Target != GL_TEXTURE_RECTANGLE_ARB || st->lower_rect_tex)
       sampler->normalized_coords = 1;
 
    sampler->lod_bias += tex_unit_lod_bias;