ADD: debug draw

This commit is contained in:
2025-12-24 23:26:06 +09:00
parent f02086bc32
commit c5e656d585
12 changed files with 1413 additions and 0 deletions

10
shaders/debug_lines.frag Normal file
View File

@@ -0,0 +1,10 @@
#version 450
layout(location = 0) in vec4 inColor;
layout(location = 0) out vec4 outColor;
void main()
{
outColor = inColor;
}

31
shaders/debug_lines.vert Normal file
View File

@@ -0,0 +1,31 @@
#version 450
#extension GL_EXT_buffer_reference : require
layout(location = 0) out vec4 outColor;
struct DebugVertex
{
vec3 position;
float _pad0;
vec4 color;
};
layout(buffer_reference, std430) readonly buffer DebugVertexBuffer
{
DebugVertex vertices[];
};
layout(push_constant) uniform DebugPush
{
mat4 viewproj;
DebugVertexBuffer vertexBuffer;
} pc;
void main()
{
DebugVertex v = pc.vertexBuffer.vertices[gl_VertexIndex];
gl_Position = pc.viewproj * vec4(v.position, 1.0);
outColor = v.color;
}