Mesa (master): gallivm/nir: add subpass sampler type support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 31 03:35:23 UTC 2020


Module: Mesa
Branch: master
Commit: 6596957641ff1e070d4790669a449e1d1d550e86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6596957641ff1e070d4790669a449e1d1d550e86

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Jun 19 16:50:55 2020 +1000

gallivm/nir: add subpass sampler type support

Fixes:
dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.*
dEQP-VK.renderpass.dedicated_allocation.formats*input*

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

---

 src/gallium/auxiliary/gallivm/lp_bld_nir.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index d4d35a11594..9a60452479b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -111,12 +111,14 @@ static unsigned glsl_sampler_to_pipe(int sampler_dim, bool is_array)
       pipe_target = is_array ? PIPE_TEXTURE_1D_ARRAY : PIPE_TEXTURE_1D;
       break;
    case GLSL_SAMPLER_DIM_2D:
+   case GLSL_SAMPLER_DIM_SUBPASS:
       pipe_target = is_array ? PIPE_TEXTURE_2D_ARRAY : PIPE_TEXTURE_2D;
       break;
    case GLSL_SAMPLER_DIM_3D:
       pipe_target = PIPE_TEXTURE_3D;
       break;
    case GLSL_SAMPLER_DIM_MS:
+   case GLSL_SAMPLER_DIM_SUBPASS_MS:
       pipe_target = is_array ? PIPE_TEXTURE_2D_ARRAY : PIPE_TEXTURE_2D;
       break;
    case GLSL_SAMPLER_DIM_CUBE:
@@ -1121,8 +1123,8 @@ static void visit_load_image(struct lp_build_nir_context *bld_base,
    params.coords = coords;
    params.outdata = result;
    params.img_op = LP_IMG_LOAD;
-   if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_MS)
-      params.ms_index = get_src(bld_base, instr->src[2]);
+   if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_MS || glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_SUBPASS_MS)
+      params.ms_index = cast_type(bld_base, get_src(bld_base, instr->src[2]), nir_type_uint, 32);
    params.image_index = var->data.binding + (indir_index ? 0 : const_index);
    params.image_index_offset = indir_index;
    bld_base->image_op(bld_base, &params);



More information about the mesa-commit mailing list