mirror of
https://github.com/Kravickas/PS4-apps.git
synced 2026-10-17 11:00:56 +02:00
GPU shaders (GCN2 / Sea Islands). Headers only - main.c includes shaders.h;
nothing here is compiled on its own (the Makefile builds src/*.c/.cpp/.s as
CPU code, which is why GCN assembly must not live in src/).
vs_shader.h MVP vertex shader (sky, floor, cube, stars, post quads)
vs_shadow.h same code, own hash, for the shadow pass
ps_dark.h physically based sky + limb-darkened sun + lit moon (ps_dark.s)
ps_floor.h floor: POM on the height map, BC5 normal map, shadow, per-point sun / moon
light through the atmosphere (ps_floor.s)
ps_shader.h built-in cube: texture, Lambert, light colour, fog (ps_shader.s)
ps_model.h loaded model: parallax, relief shadow, BC5 normal map, shadow (ps_model.s)
vs_model.h loaded model VS: transform in user SGPRs, tangent export (vs_model.s)
vs_model_shadow.h loaded model, shadow pass (vs_model_shadow.s)
ps_shadow.h shadow pass: light-space depth
ps_shadow_clear.h shadow map clear
ps_stars.h stars (smooth splat, FP16 export for the additive blend) (ps_stars.s)
ps_resolve.h MSAA resolve + aerial perspective (ps_resolve.s)
ps_post_*.h bloom: down / blur / up-add (comp), final composite with the lens flare,
sRGB encode and dither (ps_post_*.s)
ps_ui.h the panels: frosted glass, text and icons over the frame (ps_ui.s)
ps_clock.h clock mode's glass clock (ps_clock.s, generated by tools/gen_ps_clock.py)
ps_clock_light.h the clock's internal light field, 1/4 resolution (ps_clock_light.s)
ps_blue.h the old GPU loading bar: still uploaded at startup, no longer drawn (the
loading screen is CPU-drawn); removing it shifts later GPU allocations
ps_blue, ps_shadow, ps_shadow_clear, vs_shader and vs_shadow have no .s source: they were
hand-encoded and their headers document the instructions. To rebuild a post shader:
llvm-mc -triple=amdgcn -mcpu=bonaire -show-encoding ps_post_down.s
then put the dwords between the SDK header token (0xBEEB03FF, n/2-1) and the
OrbShdr trailer (length = code bytes, new unique hash) in ps_post_down.h.
Inputs: s[0:1] = descriptor table (USER_SGPR 2); v2/v3 = POS_X/POS_Y_FLOAT
(SPI_PS_INPUT_ENA 0x302, pixel centres: PA_SU_VTX_CNTL.PIX_CENTER = 1).