[Bug 89597] Implement SSBOs in GLSL front-end and i965

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 10 08:56:29 PDT 2015


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

--- Comment #10 from Iago Toral <itoral at igalia.com> ---
(In reply to Iago Toral from comment #9)
> (In reply to Iago Toral from comment #8)
> > Kristian, I have a question concerting writes to row_major matrices:
> 
> Actually, the problem is more general than row_major matrices, for example
> this:
> 
> struct TB {
>     float a, b, c, d;
> };
> 
> layout(std140, binding=2) buffer Fragments {
>    TB s[3];
>    int index;
> };
> 
> uniform mat4 MVP;
> 
> void main()
> {
>    s[index].d = -1.0;
> }
> 
> Generally, we have the problem when using dynamic indices into row_major
> matrices or arrays of types that are not a vec4 (if the type is a vec4 it
> works because the offset of a vec4 is always 16-byte aligned, so we can
> ignore the offset and just set the writemask based on the vec4 channels
> being written).

It seems that I can fix this example (and others like this) by ignoring the
index into the array (for the purpose of computing the writemask, not when
computing the offset where we will write of course) and simply take the
constant offset of the element being accessed ('d') within the type (that would
be the constant value 12 in this specific. Since arrays are aligned to 16-byte
boundaries this works fine for the purpose of computing the writemask.

Row-major matrices are still an issue though, so my question from comment #8
still applies.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150410/c87c4645/attachment-0001.html>


More information about the intel-3d-bugs mailing list