<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi. I'm still around to some extent,
although I still need to submit the changes to the ML for my
geometry shader work from a couple of months ago. I don't have
much free time anymore, but I'll try to take a look at this soon.<br>
<br>
-Bryan<br>
<br>
On 10/15/2012 03:35 PM, Brian Paul wrote:<br>
</div>
<blockquote cite="mid:507C73A2.3080509@vmware.com" type="cite">Jose
found a problem in the GLSL->TGSI translater with respect to
boolean array comparisions when PIPE_SHADER_CAP_INTEGERS=1. I dug
into it a bit.
<br>
<br>
The attached shader_runner case shows the issue.
<br>
<br>
Basically, the comparison of boolean values (which are unsigned
integers) winds up being done with TGSI_OPCODE_SEQ instead of
USEQ:
<br>
<br>
VERT
<br>
DCL IN[0]
<br>
DCL OUT[0], POSITION
<br>
DCL OUT[1], GENERIC[12]
<br>
DCL CONST[0..1]
<br>
DCL TEMP[0], LOCAL
<br>
DCL TEMP[1], LOCAL
<br>
IMM UINT32 {4294967295, 0, 0, 0}
<br>
IMM FLT32 { 1.0000, 0.0000, 0.0000, 0.0000}
<br>
0: SEQ TEMP[0].x, CONST[0].xxxx, IMM[0].xxxx <<< UINT
operands!
<br>
1: F2I TEMP[0].x, -TEMP[0]
<br>
2: SEQ TEMP[1].x, CONST[1].xxxx, IMM[0].xxxx <<< UINT
operands!
<br>
3: F2I TEMP[1].x, -TEMP[1]
<br>
4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
<br>
5: IF TEMP[0].xxxx :0
<br>
6: MOV TEMP[0], IMM[1].xyyx
<br>
7: ELSE :0
<br>
8: MOV TEMP[0], IMM[1].yxyx
<br>
9: ENDIF
<br>
10: MOV OUT[1], TEMP[0]
<br>
11: MOV OUT[0], IN[0]
<br>
12: END
<br>
<br>
The correct code sequence should be:
<br>
<br>
0: USEQ TEMP[0].x, CONST[0].xxxx, IMM[0].xxxx
<br>
1: USEQ TEMP[1].x, CONST[1].xxxx, IMM[0].xxxx
<br>
2: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
<br>
3: IF TEMP[0].xxxx :0
<br>
4: MOV TEMP[0], IMM[1].xyyx
<br>
5: ELSE :0
<br>
6: MOV TEMP[0], IMM[1].yxyx
<br>
7: ENDIF
<br>
8: MOV OUT[1], TEMP[0]
<br>
9: MOV OUT[0], IN[0]
<br>
10: END
<br>
<br>
The attached patch for glsl_to_tgsi_visitor::get_opcode() fixes
the issue but the first assert which I added fails if it's
enabled. AFAICT, by time we get into
glsl_to_tgsi_visitor::get_opcode() we should have scalar operands,
not arrays. It's not clear to me how to fix that.
<br>
<br>
I'm hoping someone who's spent more time on glsl_to_tgsi.cpp (is
Bryan Cain still around?) can take a look at this. Thanks.
<br>
<br>
-Brian
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
mesa-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>