Commit 8e717c31 authored by Jesse Natalie's avatar Jesse Natalie Committed by Erik Faye-Lund

nir/glsl: Handle type constant for load/store

parent 181afca5
......@@ -1313,6 +1313,7 @@ nir_visitor::visit(ir_call *ir)
} else if (op == nir_intrinsic_image_deref_load ||
op == nir_intrinsic_image_deref_store) {
instr->num_components = 4;
nir_intrinsic_set_type(instr, nir_get_nir_type_for_glsl_type(type));
}
if (op == nir_intrinsic_image_deref_size ||
......
......@@ -2269,6 +2269,9 @@ nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, nir_ssa_def *src,
bool bindless)
{
enum gl_access_qualifier access = nir_intrinsic_access(intrin);
nir_alu_type type = nir_type_invalid;
if (nir_intrinsic_infos[intrin->intrinsic].index_map[NIR_INTRINSIC_TYPE])
type = nir_intrinsic_type(intrin);
switch (intrin->intrinsic) {
#define CASE(op) \
......@@ -2305,6 +2308,8 @@ nir_rewrite_image_intrinsic(nir_intrinsic_instr *intrin, nir_ssa_def *src,
nir_intrinsic_set_image_array(intrin, glsl_sampler_type_is_array(deref->type));
nir_intrinsic_set_access(intrin, access | var->data.access);
nir_intrinsic_set_format(intrin, var->data.image.format);
if (nir_intrinsic_infos[intrin->intrinsic].index_map[NIR_INTRINSIC_TYPE])
nir_intrinsic_set_type(intrin, type);
nir_instr_rewrite_src(&intrin->instr, &intrin->src[0],
nir_src_for_ssa(src));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment