[Mesa-dev] [Bug 103955] Using array in structure results in wrong GLSL compilation output

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 29 03:09:29 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=103955

--- Comment #5 from Ian Romanick <idr at freedesktop.org> ---
(In reply to Ian Romanick from comment #4)
> (In reply to Ilia Mirkin from comment #3)
> 
> >    (expression vec3 * (record_ref (var_ref u_s) color)
> >                       (array_ref (record_ref (var_ref u_s) arr) (constant int (0)))
> >    )
> 
> This should be fine.  For a bunch of things we allow mixing scalars and
> either vectors or matrices.  The shader_runner test passes on i965, so maybe
> the problem is in st_glsl_to_tgsi?

This is a thing that SPIR-V does not allow (except for multiply which has
special vector-times-scalar opcodes).  For part of the SPIR-V work I wrote a
pass that adds the missing swizzles.  It may be easiest to use that to massage
the GLSL IR before TGSI conversion.

We don't want to use this in general because may of the optimization passes
cannot "see through" a swizzle.  Algebraic optimizations, for example, can't
see that (+ (a) (swizzle xxxx (* (b) (c)))) is a MAD.  Also related to the
SPIR-V work, this is a topic I've been thinking about lately...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171129/d4763f15/attachment.html>


More information about the mesa-dev mailing list