summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/spirv_to_nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-08-14 14:03:05 -0500
committerJason Ekstrand <[email protected]>2018-08-29 14:04:02 -0500
commit15d39f474b89093507a80813d149c40461b8f355 (patch)
tree0898b5f25a31037c16983d8f09e30ce425ef98d2 /src/compiler/spirv/spirv_to_nir.c
parent7cdf8f9339017ea5ee3c7f3a585c6bd5a815b99b (diff)
nir: Make image load/store intrinsics variable-width
Instead of requiring 4 components, this allows them to potentially use fewer. Both the SPIR-V and GLSL paths still generate vec4 intrinsics so drivers which assume 4 components should be safe. However, we want to be able to shrink them for i965. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/spirv/spirv_to_nir.c')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index b5ec2de7bf9..96224354057 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -2467,6 +2467,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
const uint32_t value_id = opcode == SpvOpAtomicStore ? w[4] : w[3];
nir_ssa_def *value = vtn_ssa_value(b, value_id)->def;
/* nir_intrinsic_image_deref_store always takes a vec4 value */
+ assert(op == nir_intrinsic_image_deref_store);
+ intrin->num_components = 4;
intrin->src[3] = nir_src_for_ssa(expand_to_vec4(&b->nb, value));
break;
}