quakeforge/libs/video/renderer/vulkan/shader/bsp_gbuf.vert
Bill Currie e3d403cada [vulkan] Mark read-only buffers as such
Recent vulkan validation layers started complaining about vertex
processing stages having read-write buffers without atomics enabled
(fair enough), but I decided to get all the buffers that don't need to
be written.
2024-09-24 10:44:59 +09:00

31 lines
714 B
GLSL

#version 450
#extension GL_GOOGLE_include_directive : enable
#include "entity.h"
layout (set = 0, binding = 0) uniform
#include "matrices.h"
;
layout (set = 1, binding = 0) readonly buffer Entities {
Entity entities[];
};
layout (location = 0) in vec4 vertex;
layout (location = 1) in vec4 tl_uv;
layout (location = 2) in uint entind;
layout (location = 0) out vec4 tl_st;
layout (location = 1) out vec3 direction;
layout (location = 2) out vec4 color;
void
main (void)
{
// geometry shader will take care of Projection and View
vec3 vert = vertex * entities[entind].transform;
gl_Position = vec4 (vert, 1);
direction = (Sky * vertex).xyz;
tl_st = tl_uv;
color = entities[entind].color;
}