diff --git a/src/compiler/nir/nir_builtin_builder.c b/src/compiler/nir/nir_builtin_builder.c index 2301191bbc4..7b2cca4f212 100644 --- a/src/compiler/nir/nir_builtin_builder.c +++ b/src/compiler/nir/nir_builtin_builder.c @@ -344,7 +344,7 @@ nir_get_texture_size(nir_builder *b, nir_tex_instr *tex) txs->is_new_style_shadow = tex->is_new_style_shadow; txs->texture_index = tex->texture_index; txs->sampler_index = tex->sampler_index; - txs->dest_type = nir_type_int; + txs->dest_type = nir_type_int32; unsigned idx = 0; for (unsigned i = 0; i < tex->num_srcs; i++) { @@ -398,7 +398,7 @@ nir_get_texture_lod(nir_builder *b, nir_tex_instr *tex) tql->is_new_style_shadow = tex->is_new_style_shadow; tql->texture_index = tex->texture_index; tql->sampler_index = tex->sampler_index; - tql->dest_type = nir_type_float; + tql->dest_type = nir_type_float32; unsigned idx = 0; for (unsigned i = 0; i < tex->num_srcs; i++) { diff --git a/src/compiler/nir/nir_lower_bitmap.c b/src/compiler/nir/nir_lower_bitmap.c index 3b806bc53ff..ffb3b4945d1 100644 --- a/src/compiler/nir/nir_lower_bitmap.c +++ b/src/compiler/nir/nir_lower_bitmap.c @@ -95,7 +95,7 @@ lower_bitmap(nir_shader *shader, nir_builder *b, tex->op = nir_texop_tex; tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; - tex->dest_type = nir_type_float; + tex->dest_type = nir_type_float32; tex->src[0].src_type = nir_tex_src_texture_deref; tex->src[0].src = nir_src_for_ssa(&tex_deref->dest.ssa); tex->src[1].src_type = nir_tex_src_sampler_deref; diff --git a/src/compiler/nir/nir_lower_drawpixels.c b/src/compiler/nir/nir_lower_drawpixels.c index 147f4a3828c..6bf34fad1e1 100644 --- a/src/compiler/nir/nir_lower_drawpixels.c +++ b/src/compiler/nir/nir_lower_drawpixels.c @@ -146,7 +146,7 @@ lower_color(lower_drawpixels_state *state, nir_intrinsic_instr *intr) tex->op = nir_texop_tex; tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; - tex->dest_type = nir_type_float; + tex->dest_type = nir_type_float32; tex->src[0].src_type = nir_tex_src_texture_deref; tex->src[0].src = nir_src_for_ssa(&tex_deref->dest.ssa); tex->src[1].src_type = nir_tex_src_sampler_deref; @@ -188,7 +188,7 @@ lower_color(lower_drawpixels_state *state, nir_intrinsic_instr *intr) tex->coord_components = 2; tex->sampler_index = state->options->pixelmap_sampler; tex->texture_index = state->options->pixelmap_sampler; - tex->dest_type = nir_type_float; + tex->dest_type = nir_type_float32; tex->src[0].src_type = nir_tex_src_texture_deref; tex->src[0].src = nir_src_for_ssa(&pixelmap_deref->dest.ssa); tex->src[1].src_type = nir_tex_src_sampler_deref; @@ -206,7 +206,7 @@ lower_color(lower_drawpixels_state *state, nir_intrinsic_instr *intr) tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; tex->sampler_index = state->options->pixelmap_sampler; - tex->dest_type = nir_type_float; + tex->dest_type = nir_type_float32; tex->src[0].src_type = nir_tex_src_coord; tex->src[0].src = nir_src_for_ssa(nir_channels(b, def, 0xc)); diff --git a/src/compiler/nir/nir_lower_fb_read.c b/src/compiler/nir/nir_lower_fb_read.c index 07bff1ad2f6..90924690266 100644 --- a/src/compiler/nir/nir_lower_fb_read.c +++ b/src/compiler/nir/nir_lower_fb_read.c @@ -60,7 +60,7 @@ lower_fb_read(nir_builder *b, nir_intrinsic_instr *intr) tex->op = nir_texop_txf_ms_fb; tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; - tex->dest_type = nir_type_float; + tex->dest_type = nir_type_float32; tex->src[0].src_type = nir_tex_src_coord; tex->src[0].src = nir_src_for_ssa(nir_channels(b, fragcoord, 0x3)); tex->src[1].src_type = nir_tex_src_ms_index; diff --git a/src/compiler/nir/nir_lower_input_attachments.c b/src/compiler/nir/nir_lower_input_attachments.c index 2380b0cc88a..c35c53ad0e0 100644 --- a/src/compiler/nir/nir_lower_input_attachments.c +++ b/src/compiler/nir/nir_lower_input_attachments.c @@ -108,19 +108,8 @@ try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load, tex->op = nir_texop_txf; tex->sampler_dim = image_dim; - switch (glsl_get_sampler_result_type(deref->type)) { - case GLSL_TYPE_FLOAT: - tex->dest_type = nir_type_float; - break; - case GLSL_TYPE_INT: - tex->dest_type = nir_type_int; - break; - case GLSL_TYPE_UINT: - tex->dest_type = nir_type_uint; - break; - default: - unreachable("Invalid image type"); - } + tex->dest_type = + nir_get_nir_type_for_glsl_base_type(glsl_get_sampler_result_type(deref->type)); tex->is_array = true; tex->is_shadow = false; tex->is_sparse = load->intrinsic == nir_intrinsic_image_deref_sparse_load; diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index ce4ab666e9c..1ea72e49539 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -264,7 +264,7 @@ sample_plane(nir_builder *b, nir_tex_instr *tex, int plane, plane_tex->src[tex->num_srcs].src_type = nir_tex_src_plane; plane_tex->op = nir_texop_tex; plane_tex->sampler_dim = GLSL_SAMPLER_DIM_2D; - plane_tex->dest_type = nir_type_float; + plane_tex->dest_type = nir_type_float | nir_dest_bit_size(tex->dest); plane_tex->coord_components = 2; plane_tex->texture_index = tex->texture_index;