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

gl_InstanceID-based array-access in SPIR-V #87

Open
Apprentice-Alchemist opened this issue Mar 10, 2022 · 0 comments
Open

gl_InstanceID-based array-access in SPIR-V #87

Apprentice-Alchemist opened this issue Mar 10, 2022 · 0 comments

Comments

@Apprentice-Alchemist
Copy link

The following shader

#version 450
in vec3 pos;
in vec2 uv;
in vec4 col;
out vec2 frag_uv;
uniform mat4 m[4];

void main() {
  gl_Position = m[gl_InstanceID] * vec4(pos, 1.0f);
  frag_uv = uv;
}

results in the following error:

Vulkan ERROR: Code 7060244 : Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x55a824ad8180, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: The result pointer storage class and base pointer storage class in OpAccessChain do not match.
  %25 = OpAccessChain %_ptr_UniformConstant_mat4v4float %59 %23

and if I remove the array access it gives:

Vulkan ERROR: Code 7060244 : Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x55ae7ee40290, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: Structure id 43 decorated as Block must be explicitly laid out with ArrayStride decorations.
  %_k_global_uniform_buffer_type = OpTypeStruct %_arr_mat4v4float_uint_4
@RobDangerous RobDangerous changed the title More Vulkan issues. gl_InstanceID-based array-access in SPIR-V Mar 10, 2022
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

No branches or pull requests

1 participant