Files
Verbatim/assets/shaders/cell.vert
T
Emil 139b60b8af fix: flip Y in vertex shader, dynamic viewport/scissor, clean debug
- Fix: Y coordinate was inverted (1.0 - 2.0*y → 2.0*y - 1.0)
  Vulkan clip space Y is already down-up, no need to flip
- Fix: dynamic viewport/scissor with viewport_count(1) + scissor_count(1)
  Required by validation layer even with dynamic state
- Clean: removed debug eprintlns, restored default clear color
- Shaders recompiled to SPIR-V
2026-06-21 00:41:34 +03:00

29 lines
701 B
GLSL

#version 450
layout(push_constant) uniform PC {
vec2 screen_size;
vec2 cell_size;
} pc;
layout(location = 0) in vec2 in_pos;
layout(location = 1) in vec2 in_grid;
layout(location = 2) in vec4 in_atlas;
layout(location = 3) in vec4 in_fg;
layout(location = 4) in vec4 in_bg;
layout(location = 0) out vec2 out_uv;
layout(location = 1) out vec4 out_fg;
layout(location = 2) out vec4 out_bg;
void main() {
vec2 pixel = (in_grid + in_pos) * pc.cell_size;
gl_Position = vec4(
2.0 * pixel.x / pc.screen_size.x - 1.0,
2.0 * pixel.y / pc.screen_size.y - 1.0,
0.0, 1.0
);
out_uv = in_atlas.xy + in_pos * in_atlas.zw;
out_fg = in_fg;
out_bg = in_bg;
}