mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 10:19:47 -04:00
0ac63b655c
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>
25 lines
1.1 KiB
GLSL
25 lines
1.1 KiB
GLSL
#version 450
|
|
/* Untextured geometry (flat / gouraud triangles, lines, flat rects).
|
|
* Position is in PSX VRAM pixel space (0..1024, 0..512); map to NDC for the
|
|
* 1024x512 VRAM image (resolution-independent, so the SxS supersample is just
|
|
* a larger framebuffer). VRAM y increases downward; Vulkan clip y also points
|
|
* down, so VRAM y=0 lands at image row 0 (top) with no flip.
|
|
*
|
|
* u_shift = half an HR pixel (0.5/S in native units): the rasterizer samples
|
|
* coverage at pixel centers, the PS1 DDA at integer coords. The shift aligns
|
|
* the two grids (matches the GL backend's GEO_VS). u_xoff/u_xhalf carry the
|
|
* native-wide x translation / clip half-extent (0 / 512 canonical; Phase 4). */
|
|
layout(location = 0) in vec2 in_pos;
|
|
layout(location = 1) in vec4 in_col;
|
|
layout(push_constant) uniform PC {
|
|
float u_shift;
|
|
float u_xoff;
|
|
float u_xhalf;
|
|
} pc;
|
|
layout(location = 0) noperspective out vec4 v_col;
|
|
void main() {
|
|
gl_Position = vec4((in_pos.x + pc.u_shift + pc.u_xoff) / pc.u_xhalf - 1.0,
|
|
(in_pos.y + pc.u_shift) / 256.0 - 1.0, 0.0, 1.0);
|
|
v_col = in_col;
|
|
}
|