[Mesa-dev] [PATCH 07/29] nir/lower_tex: fix get_zero_or_one() to use sized types
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Mon Mar 21 12:05:46 UTC 2016
From: Iago Toral Quiroga <itoral at igalia.com>
v2 (Sam):
- Use helper to get type size from nir_alu_type enum.
---
src/compiler/nir/nir_lower_tex.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 4999603..a58385a 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -226,7 +226,8 @@ get_zero_or_one(nir_builder *b, nir_alu_type type, uint8_t swizzle_val)
v.u32[0] = v.u32[1] = v.u32[2] = v.u32[3] = 0;
} else {
assert(swizzle_val == 5);
- if (type == nir_type_float)
+ assert(nir_alu_type_get_type_size(type) < 64);
+ if (type == nir_type_float32)
v.f32[0] = v.f32[1] = v.f32[2] = v.f32[3] = 1.0;
else
v.u32[0] = v.u32[1] = v.u32[2] = v.u32[3] = 1;
--
2.5.0
More information about the mesa-dev
mailing list