<div dir="ltr"><div><br></div>Hi<br><br><div><div class="gmail_quote"><div dir="ltr">On Wed, Sep 7, 2016 at 10:02 PM <<a href="mailto:marcandre.lureau@redhat.com">marcandre.lureau@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Marc-André Lureau <<a href="mailto:marcandre.lureau@redhat.com" target="_blank">marcandre.lureau@redhat.com</a>><br>
<br>
The benchmark fails to start, the translation of gl_Identity is incorrect,<br>
<br>
UMUL TEMP[0].x, SV[0].xxxx, IMM[0].xxxx<br>
<br>
is translated to:<br>
<br>
temp0[0] = vec4(uintBitsToFloat((gl_InstanceID * floatBitsToUint(temp0[0].xxxx) + floatBitsToUint(temp0[1]))));<br>
<br>
Which results in the following error:<br>
shader failed to compile<br>
0:23(34): error: could not implicitly convert operands to arithmetic operator<br>
0:23(34): error: operands to arithmetic operators must be numeric<br>
0:23(17): error: no matching function for call to `uintBitsToFloat(error)'; candidates are:<br>
<br>
It seems we can use the same workaround as gl_VertexID, I didn't<br>
observe any regression running various gl_InstanceId tests from<br>
piglit:<br>
<br>
temp0[0].x = float(uintBitsToFloat((uvec4(floatBitsToUint(vec4(intBitsToFloat(gl_InstanceID)))) * uvec4(uvec4(ivec4(3,3,3,3))))).x);<br></blockquote><div><br></div><div>wrong examples, I got confused by the various dumps, trying to find the right ones.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Marc-André Lureau <<a href="mailto:marcandre.lureau@redhat.com" target="_blank">marcandre.lureau@redhat.com</a>><br>
---<br>
src/vrend_shader.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/vrend_shader.c b/src/vrend_shader.c<br>
index 0350b12..a80c3f1 100644<br>
--- a/src/vrend_shader.c<br>
+++ b/src/vrend_shader.c<br>
@@ -1632,7 +1632,7 @@ iter_instruction(struct tgsi_iterate_context *iter,<br>
} else if (src->Register.File == TGSI_FILE_SYSTEM_VALUE) {<br>
for (j = 0; j < ctx->num_system_values; j++)<br>
if (ctx->system_values[j].first == src->Register.Index) {<br>
- if (ctx->system_values[j].name == TGSI_SEMANTIC_VERTEXID)<br>
+ if (ctx->system_values[j].name == TGSI_SEMANTIC_VERTEXID || ctx->system_values[j].name == TGSI_SEMANTIC_INSTANCEID)<br>
snprintf(srcs[i], 255, "%s(vec4(intBitsToFloat(%s)))", stypeprefix, ctx->system_values[j].glsl_name);<br>
else<br>
snprintf(srcs[i], 255, "%s%s", prefix, ctx->system_values[j].glsl_name);<br>
--<br>
2.10.0<br>
<br>
_______________________________________________<br>
virglrenderer-devel mailing list<br>
<a href="mailto:virglrenderer-devel@lists.freedesktop.org" target="_blank">virglrenderer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel</a><br>
</blockquote></div></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Marc-André Lureau<br></div></div>