#version 450 // Shadow pass vertex:光源视角写深度。 // GPUDriven:模型矩阵经 gl_InstanceIndex 从实例缓冲取(与 Forward // 共用同一份数据),push 只带 lightVP(全 pass 一次)。 layout(location = 0) in vec3 inPosition; layout(std430, set = 0, binding = 1) readonly buffer ObjectBuffer { mat4 models[]; } objects; layout(push_constant) uniform PushConstants { mat4 lightVP; } pc; void main() { gl_Position = pc.lightVP * objects.models[gl_InstanceIndex] * vec4(inPosition, 1.0); }