feat(render3d): every shader variant as Vulkan SPIR-V, built ahead of time
Vulkan cannot compile GLSL when the game starts, so the programs render3d builds are listed (shaders/variants.list, 45 of them, collected with R3D_PROGRAMS_LOG across the self-tests, the screens, the viewpoints and the debug switches) and `ludic-dev shaders` compiles each into shaders/spv/<id>.vert.spv and .frag.spv with a manifest of what the backend needs: each stage's uniform block and member offsets, the samplers' bindings, the vertex inputs. The GLSL is the renderer's own, assembled as programs.ludic assembles it, through glslang's relaxed Vulkan mode, so gpu_uniform / u_* can write the same uniforms into a block on Vulkan. Bindings are assigned by the tool (glslang's own numbering put several samplers of one stage on binding 0): the vertex block is 0, the fragment block 1, samplers from 2 in name order, shared across both stages. Every stage passes spirv-val; `ludic-dev test` rebuilds and compares wherever the Vulkan SDK is installed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
bd79b276e9
commit
3fb1b7cd87
97 changed files with 2657 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ var ov_clip_w: int = 0
|
|||
var ov_clip_h: int = 0
|
||||
|
||||
function overlay_init(font_dir: string) -> bool {
|
||||
r3d_program_log("overlay.vert", "overlay.frag", "")
|
||||
ov_prog = gl_program("#version 410 core\n" + r3d_shader_file("overlay.vert"), "#version 410 core\n" + r3d_shader_file("overlay.frag"))
|
||||
if ov_prog == 0 { print("overlay: program failed"); return false }
|
||||
ov_vao = gl_vao()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue