aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_amd.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-06-06 10:51:25 -0500
committerJason Ekstrand <[email protected]>2019-06-19 21:05:54 +0000
commit81e51b412e9fc72000868ebe5bbe2417b1f0486d (patch)
tree94f8f7f284fa5e5bb0659863babcec117cb69ee5 /src/compiler/spirv/vtn_amd.c
parentb019fe8a5b6cba6c6cefe62718b682da451e699e (diff)
nir: Make nir_constant a vector rather than a matrix
Most places in NIR, we treat matrices like arrays. The one annoying exception to this has been nir_constant where a matrix is a first-class thing. This commit changes that so a matrix nir_constant is the same as an array nir_constant. This makes matrix nir_constants a tiny bit more expensive but shrinks all others by 96B. Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_amd.c')
-rw-r--r--src/compiler/spirv/vtn_amd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/spirv/vtn_amd.c b/src/compiler/spirv/vtn_amd.c
index 23f8930faa2..efdcfdb514c 100644
--- a/src/compiler/spirv/vtn_amd.c
+++ b/src/compiler/spirv/vtn_amd.c
@@ -97,17 +97,17 @@ vtn_handle_amd_shader_ballot_instruction(struct vtn_builder *b, SpvOp ext_opcode
if (intrin->intrinsic == nir_intrinsic_quad_swizzle_amd) {
struct vtn_value *val = vtn_value(b, w[6], vtn_value_type_constant);
- unsigned mask = val->constant->values[0][0].u32 |
- val->constant->values[0][1].u32 << 2 |
- val->constant->values[0][2].u32 << 4 |
- val->constant->values[0][3].u32 << 6;
+ unsigned mask = val->constant->values[0].u32 |
+ val->constant->values[1].u32 << 2 |
+ val->constant->values[2].u32 << 4 |
+ val->constant->values[3].u32 << 6;
nir_intrinsic_set_swizzle_mask(intrin, mask);
} else if (intrin->intrinsic == nir_intrinsic_masked_swizzle_amd) {
struct vtn_value *val = vtn_value(b, w[6], vtn_value_type_constant);
- unsigned mask = val->constant->values[0][0].u32 |
- val->constant->values[0][1].u32 << 5 |
- val->constant->values[0][2].u32 << 10;
+ unsigned mask = val->constant->values[0].u32 |
+ val->constant->values[1].u32 << 5 |
+ val->constant->values[2].u32 << 10;
nir_intrinsic_set_swizzle_mask(intrin, mask);
}