[Mesa-dev] [Bug 100613] Regression in Mesa 17 on s390x (zSystems)
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Apr 21 23:02:14 UTC 2017
https://bugs.freedesktop.org/show_bug.cgi?id=100613
--- Comment #5 from Roland Scheidegger <sroland at vmware.com> ---
I suppose this patch m(In reply to Ray Strode [halfline] from comment #4)
> Created attachment 130977 [details] [review]
> patch to aid in troubleshooting
I suppose this makes sense. Sort of. I was missing that even for array formats,
the shift in the channel description is different on big endian.
e.g. (from u_format_table.c)
const struct util_format_description
util_format_r32g32b32a32_float_description = {
PIPE_FORMAT_R32G32B32A32_FLOAT,
"PIPE_FORMAT_R32G32B32A32_FLOAT",
"r32g32b32a32_float",
{1, 1, 128}, /* block */
UTIL_FORMAT_LAYOUT_PLAIN,
4, /* nr_channels */
TRUE, /* is_array */
FALSE, /* is_bitmask */
FALSE, /* is_mixed */
#ifdef PIPE_ARCH_BIG_ENDIAN
{
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 96}, /* x = r */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 64}, /* y = g */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 32}, /* z = b */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 0} /* w = a */
},
#else
{
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 0}, /* x = r */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 32}, /* y = g */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 64}, /* z = b */
{UTIL_FORMAT_TYPE_FLOAT, FALSE, FALSE, 32, 96} /* w = a */
},
So maybe instead of chan_desc.shift / type.width
on big endian it needs to be (format_desc.block.bits - chan_desc.shift ) /
type.width. (Clearly you can't just use "i" since that would completely ignore
ordering albeit for most formats it should be the same.)
There's several places where we handle channeldesc shifts differently already
in gallivm, albeit usually that's for within-dwords shifts (e.g. 4x8 values
packed).
I still don't quite understand it though - if we had accessed that as an
ordinary array (as the format is an array format) then the addresses would
effectively be all the same on big or little endian (as it's just 4 floats
within an array), so I'm not quite sure why the shifts are actually different.
But I better don't think too much about it, it just gives me a headache.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170421/78b15875/attachment.html>
More information about the mesa-dev
mailing list