Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glslangValidator not emitting Int64Atomics when expected #2975

Closed
ncesario-lunarg opened this issue Jul 13, 2022 · 3 comments · Fixed by #2976
Closed

glslangValidator not emitting Int64Atomics when expected #2975

ncesario-lunarg opened this issue Jul 13, 2022 · 3 comments · Fixed by #2976
Assignees

Comments

@ncesario-lunarg
Copy link
Collaborator

The validation layers have a test that effectively uses the following GLSL (this is contrived code, but expected to at least pass spirv-val):

#version 450
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
#extension GL_EXT_shader_image_int64 : enable
#extension GL_KHR_memory_scope_semantics : enable

layout(set = 0, binding = 0) buffer ssbo { uint64_t y; };
layout(set = 0, binding = 1, r64ui) uniform u64image2D z;

void main() {
    imageAtomicStore(z, ivec2(1, 1), y, gl_ScopeDevice, gl_StorageSemanticsImage, gl_SemanticsRelaxed);
}

Which produces the following error when running spirv-val:

error: line 50: AtomicStore: 64-bit atomics require the Int64Atomics capability
  OpAtomicStore %25 %int_1 %uint_2048 %20

spirv-dis shows that indeed Int64Atomics is not there:

               OpCapability Shader
               OpCapability Int64
               OpCapability Int64ImageEXT

Other imageAtomic* functions seem to cause the Int64Atomics capability to get added. e.g., replacing imageAtomicStore with imageAtomicExchange emits Int64Atomics, and the resulting spirv validates successfully.

Is there something special about imageAtomicStore such that it shouldn't emit the Int64Atomics capability?

@ncesario-lunarg
Copy link
Collaborator Author

cc @jeremy-lunarg @paul-lunarg.

@ncesario-lunarg
Copy link
Collaborator Author

This is using glslang at commit adbf0d3106b26daa237b10b9bf72b1af7c31092d. I'll try this on an updated version and see if I get the same results.

@jeremy-lunarg jeremy-lunarg self-assigned this Jul 13, 2022
@ncesario-lunarg
Copy link
Collaborator Author

FWIW, same behavior on latest commit.

paul-lunarg added a commit to paul-lunarg/Vulkan-ValidationLayers that referenced this issue Jul 14, 2022
temporarily disable until issue fixed:
KhronosGroup/glslang#2975
jeremy-lunarg added a commit to jeremy-lunarg/glslang that referenced this issue Jul 14, 2022
This covers a corner case wherein imageAtomicStore is used exclusively.
The proxy type for imageAtomicStore is inferred from the image type.

Fix KhronosGroup#2975.
paul-lunarg added a commit to KhronosGroup/Vulkan-ValidationLayers that referenced this issue Jul 16, 2022
temporarily disable until issue fixed:
KhronosGroup/glslang#2975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants