<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 23, 2018 at 1:30 PM, Jose Maria Casanova Crespo <span dir="ltr"><<a href="mailto:jmcasanova@igalia.com" target="_blank">jmcasanova@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Range in 16-bit push constants load was being calculated<br>
wrongly using 4-bytes per element instead of 2-bytes as it<br>
should be.<br>
<br>
v2: Use glsl_get_bit_size instead of if statement<br>
(Jason Ekstrand)<br>
---<br>
src/compiler/spirv/vtn_<wbr>variables.c | 7 ++-----<br>
1 file changed, 2 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/vtn_<wbr>variables.c b/src/compiler/spirv/vtn_<wbr>variables.c<br>
index 78adab3ed2..e68551a336 100644<br>
--- a/src/compiler/spirv/vtn_<wbr>variables.c<br>
+++ b/src/compiler/spirv/vtn_<wbr>variables.c<br>
@@ -683,12 +683,9 @@ vtn_type_block_size(struct vtn_builder *b, struct vtn_type *type)<br>
if (cols > 1) {<br>
vtn_assert(type->stride > 0);<br>
return type->stride * cols;<br>
- } else if (base_type == GLSL_TYPE_DOUBLE ||<br>
- base_type == GLSL_TYPE_UINT64 ||<br>
- base_type == GLSL_TYPE_INT64) {<br>
- return glsl_get_vector_elements(type-<wbr>>type) * 8;<br>
} else {<br>
- return glsl_get_vector_elements(type-<wbr>>type) * 4;<br>
+ unsigned type_size = glsl_get_bit_size(type->type) / 8;<br>
+ return glsl_get_vector_elements(type-<wbr>>type) * type_size;<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.16.1<br>
<br>
</font></span></blockquote></div><br></div>