[Mesa-dev] [Bug 104553] mat4: m[i][j] incorrect result with row_major UBO

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jun 27 08:27:29 UTC 2018


--- Comment #11 from florian.will at googlemail.com ---
> And now totally off-topic, but probably it is worth to mention here to not
> forget: VK-GL-CTS doesn't catch this problem either. And they have tons of
> row_major tests, for example:
> KHR-GL45.shaders.uniform_block.single_basic_type.std140.row_major_mediump_mat4

> is passing properly. So or the test is wrong or it is incomplete. I tried to
> take a look to the test, but it is somewhat hard to understand.
> https://github.com/KhronosGroup/VK-GL-CTS/blob/master/external/openglcts/modules/common/glcUniformBlockCase.cpp#L1346

That one probably works because it compares "mat"s by delegating to compare
"vec"s. Getting a vector from a mat using the [i] syntax works, if I remember
correctly, but getting a float out of a mat directly using the [i][j] syntax
fails. At least that's my take on lines 671-695 of that file. I assume that it
fails (unless this bug has been fixed in Mesa by now and nobody noticed?) if
the compare_mat* lines are expanded to include "*compare_float(a[i][j],
b[i][j])" for all valid i,j.

I'm on Ubuntu 18.04's mesa right now (called "18.0.0~rc5-1ubuntu1"). There's a
rather simple piglit test case attached to my original bug report, and that one
still fails on that 18.0.0 version:
$ ./bin/shader_runner 104553.shader_test 
Probe color at (0,0)
  Expected: 2 33 10
  Observed: 3 33 33
Test failure on line 83

I marked that test case obsolete because I modified the piglit "UBO test
generator" to produce many, many failing test cases that helped me validate my
patch a bit in lots of different situations. But those generated test cases are
quite huge, so they are probably not fit for inclusion in piglit.

Maybe that older, simpler, "obsolete" test case attached to this bug report can
be added to piglit instead? It simply writes floats into two uniform matrices
using piglit script, where one matrix is row_major and the other column_major,
and then extracts four values using the [i][j] ("index") and the [i].{x,y,z,w}
("swizzle") methods in a shader and compares them to the expected values in the
piglit script.

My plans to submit the mesa patch for inclusion are canceled as I'm not
confident enough it doesn't break anything, but so far I haven't found any
issues in my limited testing, so if someone wants to pick it up, feel free to
do so.

> As you imply below, this problem also affects ssbo. So perhaps it would be
> a good idea to update the bug description?

Yep. :-)

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/20180627/18fe5ec3/attachment.html>

More information about the mesa-dev mailing list