gallium/util: use uint sampler for stencil-reads
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 31 Aug 2020 08:14:02 +0000 (10:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 10:06:50 +0000 (10:06 +0000)
Some drivers can't use float-samplers to read integer textures, so let's
make sure the stenicil-sampler has the right type.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6512>

src/gallium/auxiliary/util/u_simple_shaders.c

index 1908f6198a33e672a545d26c6cb5c9605709f41a..e0e093ab575647b49444982b3121b526ec2428cd 100644 (file)
@@ -656,7 +656,8 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
          "FRAG\n"
          "DCL IN[0], GENERIC[0], LINEAR\n"
          "DCL SAMP[0..1]\n"
-         "DCL SVIEW[0..1], %s, FLOAT\n"
+         "DCL SVIEW[0], %s, FLOAT\n"
+         "DCL SVIEW[1], %s, UINT\n"
          "DCL OUT[0], POSITION\n"
          "DCL OUT[1], STENCIL\n"
          "DCL TEMP[0]\n"
@@ -674,7 +675,7 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
    assert(tgsi_tex == TGSI_TEXTURE_2D_MSAA ||
           tgsi_tex == TGSI_TEXTURE_2D_ARRAY_MSAA);
 
-   sprintf(text, shader_templ, type, type, type);
+   sprintf(text, shader_templ, type, type, type, type);
 
    if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
       assert(0);