I have a compute shader:
#version 450
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_gpu_shader_int64 : enable
layout(local_size_x_id = 0) in;
layout(set = 0, binding = 0) buffer Foo {
u64vec2[256] scratchpad;
} foo;
layout(set = 0, binding = 1) uniform Bar {
u64vec2 a;
u64vec2 b;
} bar;
void main() {
int foobar = 0;
int baz = 0;
}
I compiled this with glslangValidator from LunarG SDK 1.0.65.0 and checked it using spirv-val, which returned nothing. I enabled shaderInt64when creating the VkDevice. When loading this shader using vkCreateShaderModule I get this validation error:
SPIR-V module not valid: Invalid instruction word count: 0
The validation error goes away when I do any of the following:
- Remove the 64-bit extension and change all types to
int - Remove either
FooorBarbuffers - Remove either variables in
main - Remove
layout(local_size_x_id = 0) in
My question is, is this a bug in the compiler or validation layers, or am I using one of these features incorrectly?