<div dir="auto">Yeah, the typo was a last second edit, as always. Thanks for making a sample failing case, will investigate. I hate all these interpolateat tests :( so many edge cases...</div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 4, 2017 2:51 PM, "Marek Olšák" <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There is a typo, so it doesn't build.<br>
<br>
It breaks these CTS tests:<br>
gl45-cts@shader_multisample_<wbr>interpolation@render@<wbr>interpolate_at_offset*<br>
<br>
Error:<br>
state_tracker/st_glsl_to_tgsi.<wbr>cpp:1347: void<br>
glsl_to_tgsi_visitor::visit_<wbr>expression(ir_expression*, st_src_reg*):<br>
Assertion `ir->operands[1]->type-><wbr>vector_elements == 1' failed.<br>
<br>
The CTS shader is attached. (to be run with shader-db)<br>
<br>
Marek<br>
<br>
<br>
On Sat, Dec 2, 2017 at 5:35 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br>
> GLSL IR operation arguments can sometimes have an implicit swizzle as a<br>
> result of a vector arg and a scalar arg, where the scalar argument is<br>
> implicitly expanded to the size of the vector argument.<br>
><br>
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=103955" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=103955</a><br>
> Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
> ---<br>
><br>
> I'm *pretty* sure I looked at all of ir_validate to make sure that this will<br>
> be fine, but I wouldn't exclude the possibility that I missed some extremely<br>
> odd case. Could use a piglit run.<br>
><br>
> src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp | 21 +++++++++++++++++++++<br>
> 1 file changed, 21 insertions(+)<br>
><br>
> diff --git a/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> index 0772b736275..8ca337d16ec 100644<br>
> --- a/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> +++ b/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> @@ -1342,9 +1342,30 @@ glsl_to_tgsi_visitor::visit_<wbr>expression(ir_expression* ir, st_src_reg *op)<br>
><br>
> int vector_elements = ir->operands[0]->type->vector_<wbr>elements;<br>
> if (ir->operands[1]) {<br>
> + st_src_reg *swz_op = NULL;<br>
> + if (vector_elements > ir->operands[1]->type->vector_<wbr>elements) {<br>
> + assert(ir->operands[1]->type-><wbr>vector_elements == 1);<br>
> + swz_op = &op[1];<br>
> + } else if (vector_elements < ir->operands[1]->type->vector_<wbr>elements) {<br>
> + assert(ir->operands[0]->type-><wbr>vector_elements == 1);<br>
> + swz_op = &op[0];<br>
> + }<br>
> + if (swz_op) {<br>
> + uint16_t swizzle_x = GET_SWZ(swz_op->swizzle, 0);<br>
> + swz_op->swizzle = MAKE_SWIZZLE4(swizzle_x, swizzle_x,<br>
> + swizzle_x, swizzle_x);<br>
> + }<br>
> vector_elements = MAX2(vector_elements,<br>
> ir->operands[1]->type->vector_<wbr>elements);<br>
> }<br>
> + if (ir->operands[2] &&<br>
> + ir->operands[2]->type->vector_<wbr>elements != vector_elements) {<br>
> + /* This can happen with ir_triop_lrp, i.e. glsl mix */<br>
> + assert(ir->operands[2]->type-><wbr>vector_elements == 1);<br>
> + uint16_t swizzle_x = GET_SWZ(op[2]->swizzle, 0);<br>
> + op[2].swizzle = MAKE_SWIZZLE4(swizzle_x, swizzle_x,<br>
> + swizzle_x, swizzle_x);<br>
> + }<br>
><br>
> this->result.file = PROGRAM_UNDEFINED;<br>
><br>
> --<br>
> 2.13.6<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>