diff options
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index efbb2317ac6..22419abc571 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -904,12 +904,17 @@ nir_visitor::visit(ir_call *ir) /* Set the intrinsic destination. */ if (ir->return_deref) { unsigned num_components = ir->return_deref->type->vector_elements; - if (instr->intrinsic == nir_intrinsic_image_deref_size) - instr->num_components = num_components; nir_ssa_dest_init(&instr->instr, &instr->dest, num_components, 32, NULL); } + if (op == nir_intrinsic_image_deref_size) { + instr->num_components = instr->dest.ssa.num_components; + } else if (op == nir_intrinsic_image_deref_load || + op == nir_intrinsic_image_deref_store) { + instr->num_components = 4; + } + if (op == nir_intrinsic_image_deref_size || op == nir_intrinsic_image_deref_samples) { nir_builder_instr_insert(&b, &instr->instr); |