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.
This commit is contained in:
Arcady Goldmints-Orlov
2023-10-12 13:42:32 -04:00
committed by arcady-lunarg
parent 48f9ed8b08
commit 0504953b35
4 changed files with 219 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
#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);
}