Hi, Dear all,
When I recently used opengl to write a compute shader(use version 430, not 450 or 460), I encountered a compilation error as follows:
ERROR: 0:50: '' : cannot use layout qualifiers on a function parameter
ERROR: 0:50: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
Part of the shader code is as follows:
#version 430
#extension GL_ARB_shader_image_load_store : require
layout(binding = 0, r32ui) uniform volatile coherent uimage3D voxelAlbedo;
layout(binding = 1, r32ui) uniform volatile coherent uimage3D voxelNormal;
layout(binding = 2, r32ui) uniform volatile coherent uimage3D voxelEmission;
void imageAtomicRGBA8Avg(layout(r32ui) volatile coherent uimage3D grid, ivec3 coords, vec4 value)
{
//do something.
}
void main()
{
imageAtomicRGBA8Avg(voxelNormal, position, normal);
imageAtomicRGBA8Avg(voxelAlbedo, position, albedo);
imageAtomicRGBA8Avg(voxelEmission, position, emissive);
}
This means that the function can not use layout(r32ui). But in Nvidia card, It can work fine!
How can I deal with this problem? If you have any comments or suggestions, please let me know.
This is the demo:
https://github.com/jose-villegas/VCTRenderer
If you use vs2022, there is a small issue in the code, you need to add a header file in scene_cameras.cpp like this #include <iterator>.
Thank you!
Solved! Go to Solution.
Thanks for the information.
Could you please try the latest Adrenalin 23.7.2 to check if the issue is still reproducible?
Thanks.
Yes, the issue has been fixed! Can you tell me what happened inside the driver? I was very curious....
Hi @joren_1147 ,
Thanks for reporting the issue and providing the demo. I will forward it to the OpenGL team.
Thanks.
Could you please provide the setup information like OS, driver version etc.?
Thanks.
OS: Windows11 pro(64bits) version : 22H2 -----22621.1992
Driver version: 22.40.37.17-230424a-391195c-AMD-Software-PRO-Edition
AMD Windows Driver version : 31.0.14037.17019
Thanks for the information.
Could you please try the latest Adrenalin 23.7.2 to check if the issue is still reproducible?
Thanks.
Yes, the issue has been fixed! Can you tell me what happened inside the driver? I was very curious....
Thanks for confirming the fix.
>> Can you tell me what happened inside the driver? I was very curious....
We didn't create any ticket for this issue. You were using an older driver, so I asked you to try the latest driver. It seems the issue was already fixed in that driver.
Thanks.