Bug 105320 - Storage texel buffer access produces wrong results (RX Vega)
Summary: Storage texel buffer access produces wrong results (RX Vega)
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/radeon (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
Depends on:
Reported: 2018-03-01 23:12 UTC by Józef Kucia
Modified: 2018-04-19 06:30 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Sample program (27.79 KB, text/x-csrc)
2018-03-01 23:12 UTC, Józef Kucia

Description Józef Kucia 2018-03-01 23:12:51 UTC
Created attachment 137738 [details]
Sample program

The attached program produces wrong results:

Got value 3735928559, expected 8.
Got value 8, expected 7.
Comment 1 Bas Nieuwenhuizen 2018-03-04 15:59:29 UTC

On which GPUs did you have this issue?

On Vega this suffers from a bug with buffers sizes, where if you use a buffer view with constant index, the HW interprets the number of elements as the number of bytes. As the example allocates buffers of size 4, and hence 1 elements, this means that all the accesses in the shader fail.

This is a radv/LLVM bug and we're working on fixing it. https://patchwork.freedesktop.org/patch/205590/ was a proposed fix, but causes other regressions.

However it seems to work for me on Polaris. I'd appreciate if you can tell whether you've seen the issue for pre-vega as well and that I hence need to look deeper there.

Comment 2 Józef Kucia 2018-03-04 16:50:24 UTC
Yes, the issue is RX Vega specific.
Comment 3 Samuel Pitoiset 2018-03-29 08:08:01 UTC
This should be fixed with https://cgit.freedesktop.org/mesa/mesa/commit/?id=4503ff760c794c3bb15b978a47c530037d56498e

Note that it's a workaround because we are waiting for a proper LLVM fix (Bas has one but it hasn't been pushed yet).

Thanks for the report Jozef.
Comment 4 Józef Kucia 2018-04-10 22:00:32 UTC
(In reply to Samuel Pitoiset from comment #3)
> This should be fixed with
> https://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=4503ff760c794c3bb15b978a47c530037d56498e

The attached sample program still doesn't work.

Comment 5 Bas Nieuwenhuizen 2018-04-15 22:02:07 UTC
You are right, seems I missed atomics in the fix.
Comment 6 Samuel Pitoiset 2018-04-17 19:53:59 UTC
Does it work now with https://cgit.freedesktop.org/mesa/mesa/commit/?id=b0e3a9b19f16ed1ce4c1f150718b0c0f0e6111f6 ?
Comment 7 Bas Nieuwenhuizen 2018-04-18 21:05:49 UTC
This should be fixed, the provided program works on my Raven now (and did not before the second fix).

It will be included in 18.0.2.
Comment 8 Józef Kucia 2018-04-19 06:30:23 UTC
(In reply to Samuel Pitoiset from comment #6)
> Does it work now with
> https://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=b0e3a9b19f16ed1ce4c1f150718b0c0f0e6111f6 ?
Yes, it works great. Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.