cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

angelcoder
Journeyman III

Shader Buffer Access Bug

Hello Dear AMD-Support Team,

I have possibly found a bug somewhere within SPIV-binaries to shader module (graphics pipeline) compiler.

Here is a simple example what shows the problem:

https://github.com/spfuetzner/AMD_shader_buffer_access_bug 

if everything works properly the left screen half should be red and the right green. In case the bug occurs  the right side remains blue (clear color).

Short explanation: If the workaround (in vertex.vert) is not used then Viewport 1 seems to be ignored. This is reproducible not only with push constants but with uniform and storage buffers too.
This Problem seems to be more general. If a buffer array provided through pipeline layout is being accessed by a Built-In or through another variable provided through the layout interface, then it can not be directly accessed and similar workaround to the one you can find in the example has to be made!

layout (set=0,binding = 0) uniform DATA // this could be storage buffer
{
uint buffer[100]; // storage buffer could be dynamic too 
};

layout (set=0,binding = 1) uimage2D Accessors;// one channel image with uints as color

void main()
{
// let it be a fragment shader
uvec4 idx = imageLoad(Accessors,vec2(gl_FragCoords.xy);
uint value_in_buffer = buffer[idx]; //idx is always between 0 - 99
// now do what ever you want with value_in_buffer ==> it will be faulted
}

 

Testet on:
RX 580 and Vega 56 with multiple Driver Version (the latest one is 22.5.2). All of them have the issue.

I might misunderstand something and this is not a bug at all, in this case i would ask you to provide some help with this!
Thank you in advance!
Regards angelcoder

0 Likes
2 Replies
Owen_Zhang
Staff

Hey @angelcoder 

Looks like this doesn't occur on non-AMD boards, I've created a ticket to track this issue, and will update you on its progress.

Thanks,

Owen

0 Likes

Hey Owen Zhang,


Looks like this doesn't occur on non-AMD boards

I can confirm this!


Thank you in advance!

Best regards,
angelcoder

0 Likes