summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c3
-rw-r--r--src/compiler/spirv/vtn_glsl450.c10
2 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 235003e872a..48154303ff2 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -2858,8 +2858,7 @@ vtn_ssa_transpose(struct vtn_builder *b, struct vtn_ssa_value *src)
nir_ssa_def *
vtn_vector_extract(struct vtn_builder *b, nir_ssa_def *src, unsigned index)
{
- unsigned swiz[4] = { index };
- return nir_swizzle(&b->nb, src, swiz, 1, false);
+ return nir_channel(&b->nb, src, index);
}
nir_ssa_def *
diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_glsl450.c
index 8393450f2f4..9ef066e8e6d 100644
--- a/src/compiler/spirv/vtn_glsl450.c
+++ b/src/compiler/spirv/vtn_glsl450.c
@@ -36,7 +36,7 @@
static nir_ssa_def *
build_mat2_det(nir_builder *b, nir_ssa_def *col[2])
{
- unsigned swiz[4] = {1, 0, 0, 0};
+ unsigned swiz[2] = {1, 0 };
nir_ssa_def *p = nir_fmul(b, col[0], nir_swizzle(b, col[1], swiz, 2, true));
return nir_fsub(b, nir_channel(b, p, 0), nir_channel(b, p, 1));
}
@@ -44,8 +44,8 @@ build_mat2_det(nir_builder *b, nir_ssa_def *col[2])
static nir_ssa_def *
build_mat3_det(nir_builder *b, nir_ssa_def *col[3])
{
- unsigned yzx[4] = {1, 2, 0, 0};
- unsigned zxy[4] = {2, 0, 1, 0};
+ unsigned yzx[3] = {1, 2, 0 };
+ unsigned zxy[3] = {2, 0, 1 };
nir_ssa_def *prod0 =
nir_fmul(b, col[0],
@@ -602,8 +602,8 @@ handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
return;
case GLSLstd450Cross: {
- unsigned yzx[4] = { 1, 2, 0, 0 };
- unsigned zxy[4] = { 2, 0, 1, 0 };
+ unsigned yzx[3] = { 1, 2, 0 };
+ unsigned zxy[3] = { 2, 0, 1 };
val->ssa->def =
nir_fsub(nb, nir_fmul(nb, nir_swizzle(nb, src[0], yzx, 3, true),
nir_swizzle(nb, src[1], zxy, 3, true)),