glslang/Test/spv.debuginfo.bufferref.glsl.frag
Arcady Goldmints-Orlov 0504953b35 spirv: don't emit invalid debuginfo for buffer references
Currently no debug info is emitted for buffer reference types, which
resulted in the SPIR-V backend code asserting when trying to emit the
debug info for struct member that had such a type. Instead, the code now
skips such struct members. Full debug info for buffer references may
require forward references in the debug info instructions, which is
currently prohibited by the spec.
2023-10-13 17:49:26 -04:00

29 lines
710 B
GLSL

#version 450 core
#extension GL_EXT_buffer_reference : enable
layout(buffer_reference, std430) buffer MeshVertexPositions {
float data[];
};
struct Mesh {
MeshVertexPositions positions;
};
layout(set = 0, binding = 0) readonly buffer PerPass_meshes {
Mesh data[];
} perPass_meshes;
layout(location = 0) out vec4 out_fragColor;
layout(location = 0) in flat uint tri_idx0;
void main() {
Mesh meshData = perPass_meshes.data[tri_idx0];
vec3 vertex_pos0 = vec3(meshData.positions.data[3 * tri_idx0],
meshData.positions.data[3 * tri_idx0 + 1],
meshData.positions.data[3 * tri_idx0 + 2]);
out_fragColor = vec4(vertex_pos0, 1.0);
}