cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

angelcoder
Adept I

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

6 Replies

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

Hello!

Is there any news regarding this bug?

Regards!

AgentMaxx
Journeyman III

I can confirm that the issue still exists. Any news about the progress of the fix?

Cheers!

Hi,

This has been fixed in Adrenalin 23.7.1, can you check to confirm?

Thanks,

Owen

0 Likes

Hello Owen,

The example I ve provided seems to work now , I can confirm that. Unfortunately I still have the same issues in my program and still require that workaround you saw in the example.  As soon as I have a bit more time I ll investigate further and try to write a new, maybe more complex example.
As soon as I have something I ll update the post!
Cheers!

0 Likes