feat: draw meshes with instanced multi-draw indirect
This commit is contained in:
@@ -4,17 +4,18 @@
|
||||
#extension GL_EXT_buffer_reference : require
|
||||
#extension GL_EXT_scalar_block_layout : require
|
||||
|
||||
#include "vertex.glsl"
|
||||
#include "instance_data.glsl"
|
||||
|
||||
layout (push_constant, scalar) uniform constants
|
||||
{
|
||||
mat4 modelToLightClip;
|
||||
VertexBuffer vertexBuffer;
|
||||
mat4 lightViewProj;
|
||||
InstanceBuffer instanceBuffer;
|
||||
} pcs;
|
||||
|
||||
void main()
|
||||
{
|
||||
Vertex v = pcs.vertexBuffer.vertices[gl_VertexIndex];
|
||||
InstanceData instance = pcs.instanceBuffer.instances[gl_InstanceIndex];
|
||||
Vertex v = instance.vertexBuffer.vertices[gl_VertexIndex];
|
||||
|
||||
gl_Position = pcs.modelToLightClip * vec4(v.position, 1.0f);
|
||||
gl_Position = pcs.lightViewProj * instance.transform * vec4(v.position, 1.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user