Files
psxrecomp/runtime/shaders/geo_tex.vert
T
Matthew Stanley 0ac63b655c vulkan: 3rd renderer backend (WIP) — emitter, GPU-direct present, full-frame readback
Vulkan backend alongside software + OpenGL: geometry/textured-prim
pipelines, GPU-authoritative VRAM image, deferred-submit + drain-at-present
perf model, GPU-direct present (vk_renderer_present_vram), and a
full-VRAM-pack readback path (ensure_cpu rect_adds the whole VRAM rect
before pack_flush so screenshots/guest VRAM reads reflect live content,
not just the incremental pack-dirty rect — readback-only, no per-frame cost).

Runtime plumbing: --debug-port / --renderer / --window-title CLI overrides
(multi-instance fleet), latency_ring, SPIR-V shaders + embed_spirv.py,
config_loader renderer selection, debug_server screenshot wiring.

All on feat/vulkan-renderer; snapshot in backup/vulkan-wip-20260617.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 14:56:12 -07:00

45 lines
1.6 KiB
GLSL

#version 450
/* Textured primitives. Per-prim texture state (texpage, clut, depth, raw, uv
* limits) rides in FLAT vertex attributes so consecutive prims with the same
* blend/mask/texture-window/filter coalesce into one draw (see flush_tex_batch).
* The push-constant block carries the vertex transform (u_shift/u_xoff/u_xhalf)
* and the fragment batch keys (semipass/maskset/filter/twin). Ported from the
* GL backend's TEX_VS. */
layout(location = 0) in vec2 a_pos;
layout(location = 1) in vec2 a_uv;
layout(location = 2) in vec4 a_col;
layout(location = 3) in vec2 a_tpage;
layout(location = 4) in vec2 a_clut;
layout(location = 5) in float a_depth;
layout(location = 6) in float a_raw;
layout(location = 7) in vec4 a_limits;
layout(push_constant) uniform PC {
float u_shift;
float u_xoff;
float u_xhalf;
int u_semipass;
int u_maskset;
int u_filter;
ivec4 u_twin;
} pc;
layout(location = 0) noperspective out vec2 v_uv;
layout(location = 1) noperspective out vec4 v_col;
layout(location = 2) flat out ivec2 v_tpage;
layout(location = 3) flat out ivec2 v_clut;
layout(location = 4) flat out int v_depth;
layout(location = 5) flat out int v_raw;
layout(location = 6) flat out ivec4 v_limits;
void main() {
v_uv = a_uv; v_col = a_col;
v_tpage = ivec2(a_tpage + 0.5);
v_clut = ivec2(a_clut + 0.5);
v_depth = int(a_depth + 0.5);
v_raw = int(a_raw + 0.5);
v_limits = ivec4(floor(a_limits + 0.5));
gl_Position = vec4((a_pos.x + pc.u_shift + pc.u_xoff) / pc.u_xhalf - 1.0,
(a_pos.y + pc.u_shift) / 256.0 - 1.0, 0.0, 1.0);
}