Component swizzling of `gl_MeshVerticesEXT[].gl_Position`, produces invalid code.
Try opened this issue · 4 comments
Try commented
Found while working on test-cases for cross-compiler:
// glsl - source
const vec3 vertices[3] = {vec3(1,0,0), vec3(0,1,0), vec3(0,0,1)};
gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.yxzw = vec4(vertices[gl_LocalInvocationIndex], 1);
Produces spir-v:
%38 = OpCompositeConstruct %v4float %35 %36 %37 %float_1
// vec4* _40 = &gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position;
%40 = OpAccessChain %_ptr_Output_v4float %gl_MeshVerticesEXT %18 %int_0
// vec4 _41 = *_40; // AFAIK this is illegal instruction, since meshlet is write-only
%41 = OpLoad %v4float %40
// _41 is referenced, but not used
%42 = OpVectorShuffle %v4float %41 %38 5 4 6 7
// *_40 = _42 // writing - should be fine
OpStore %40 %42
greg-lunarg commented
@pmistryNV Can you please take a look?
pmistryNV commented
Ok I will take a look in next 2 days
pmistryNV commented
Looking into the bug, will have to eliminate the shuffle all together.
greg-lunarg commented
@pmistryNV Do you have any status on the fix?