26 lines
510 B
GLSL
26 lines
510 B
GLSL
#version 450
|
|
#extension GL_EXT_buffer_reference : require
|
|
|
|
layout(std430, buffer_reference) readonly buffer Ray {
|
|
vec4 a;
|
|
vec4 b;
|
|
};
|
|
|
|
layout(std430, buffer_reference) readonly buffer HexContext {
|
|
mat4 proj;
|
|
mat4 view;
|
|
};
|
|
|
|
layout(push_constant, std430) uniform PushConstant {
|
|
Ray ray;
|
|
HexContext context;
|
|
} pc;
|
|
|
|
void main() {
|
|
if(gl_VertexIndex == 0) {
|
|
gl_Position = pc.context.proj * pc.context.view * pc.ray.a;
|
|
} else {
|
|
gl_Position = pc.context.proj * pc.context.view * pc.ray.b;
|
|
}
|
|
}
|