From: Dave Airlie Date: Fri, 19 Jun 2020 06:50:55 +0000 (+1000) Subject: gallivm/nir: add subpass sampler type support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6596957641ff1e070d4790669a449e1d1d550e86;p=mesa.git 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 Part-of: --- 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, ¶ms);