radv: fix return type for meta resolve shaders

this should match the image type

cc: mesa-stable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17874>
This commit is contained in:
Mike Blumenkrantz 2022-08-09 18:30:41 -04:00 committed by Marge Bot
parent 524f173c03
commit 632e1b66f5
4 changed files with 12 additions and 8 deletions

View File

@ -590,7 +590,7 @@ radv_meta_build_resolve_shader_core(nir_builder *b, bool is_integer, int samples
tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0));
tex->src[2].src_type = nir_tex_src_texture_deref;
tex->src[2].src = nir_src_for_ssa(input_img_deref);
tex->dest_type = nir_type_float32;
tex->dest_type = nir_get_nir_type_for_glsl_base_type(glsl_get_sampler_result_type(input_img->type));
tex->is_array = false;
tex->coord_components = 2;

View File

@ -106,7 +106,7 @@ build_fmask_copy_compute_shader(struct radv_device *dev, int samples)
frag_fetch->src[2].src = nir_src_for_ssa(input_img_deref);
frag_fetch->src[3].src_type = nir_tex_src_ms_index;
frag_fetch->src[3].src = nir_src_for_ssa(sample_id);
frag_fetch->dest_type = nir_type_uint32;
frag_fetch->dest_type = nir_type_float32;
frag_fetch->is_array = false;
frag_fetch->coord_components = 2;

View File

@ -61,9 +61,10 @@ radv_meta_build_resolve_srgb_conversion(nir_builder *b, nir_ssa_def *input)
static nir_shader *
build_resolve_compute_shader(struct radv_device *dev, bool is_integer, bool is_srgb, int samples)
{
enum glsl_base_type img_base_type = is_integer ? GLSL_TYPE_UINT : GLSL_TYPE_FLOAT;
const struct glsl_type *sampler_type =
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, false, GLSL_TYPE_FLOAT);
const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D, false, GLSL_TYPE_FLOAT);
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, false, img_base_type);
const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D, false, img_base_type);
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_COMPUTE, "meta_resolve_cs-%d-%s", samples,
is_integer ? "int" : (is_srgb ? "srgb" : "float"));
b.shader->info.workgroup_size[0] = 8;
@ -130,9 +131,10 @@ static nir_shader *
build_depth_stencil_resolve_compute_shader(struct radv_device *dev, int samples, int index,
VkResolveModeFlagBits resolve_mode)
{
enum glsl_base_type img_base_type = index == DEPTH_RESOLVE ? GLSL_TYPE_FLOAT : GLSL_TYPE_UINT;
const struct glsl_type *sampler_type =
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, true, GLSL_TYPE_FLOAT);
const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D, true, GLSL_TYPE_FLOAT);
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, true, img_base_type);
const struct glsl_type *img_type = glsl_image_type(GLSL_SAMPLER_DIM_2D, true, img_base_type);
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_COMPUTE, "meta_resolve_cs_%s-%s-%d",
index == DEPTH_RESOLVE ? "depth" : "stencil",

View File

@ -33,9 +33,10 @@
static nir_shader *
build_resolve_fragment_shader(struct radv_device *dev, bool is_integer, int samples)
{
enum glsl_base_type img_base_type = is_integer ? GLSL_TYPE_UINT : GLSL_TYPE_FLOAT;
const struct glsl_type *vec4 = glsl_vec4_type();
const struct glsl_type *sampler_type =
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, false, GLSL_TYPE_FLOAT);
glsl_sampler_type(GLSL_SAMPLER_DIM_MS, false, false, img_base_type);
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_FRAGMENT, "meta_resolve_fs-%d-%s",
samples, is_integer ? "int" : "float");
@ -250,9 +251,10 @@ static nir_shader *
build_depth_stencil_resolve_fragment_shader(struct radv_device *dev, int samples, int index,
VkResolveModeFlagBits resolve_mode)
{
enum glsl_base_type img_base_type = index == DEPTH_RESOLVE ? GLSL_TYPE_FLOAT : GLSL_TYPE_UINT;
const struct glsl_type *vec4 = glsl_vec4_type();
const struct glsl_type *sampler_type =
glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, false, GLSL_TYPE_FLOAT);
glsl_sampler_type(GLSL_SAMPLER_DIM_2D, false, false, img_base_type);
nir_builder b = radv_meta_init_shader(dev, MESA_SHADER_FRAGMENT, "meta_resolve_fs_%s-%s-%d",
index == DEPTH_RESOLVE ? "depth" : "stencil",