feat(render): V6e — move the world mesh's texture lookup to where Vulkan can express it
Campaign V slice V6e, first of three. mesh_modern is the shader every world
static, every piece of scenery and every EnvCell surface draws through, and it
was one of the four production pairs the SPIR-V toolchain still refused.
The blocker was a varying. Since V2 the vertex stage looked a batch's table slot
up in the binding=9 handle table and forwarded the resulting 64-bit
GL_ARB_bindless_texture handle to the fragment stage as a `flat uvec2`. That
works on GL because a bindless handle is just a number a shader may carry
anywhere. It cannot work on Vulkan at all: the equivalent object is a descriptor
in set 2, and a descriptor is not a value a stage can hand to another stage. So
what travels between the stages is now the SLOT — a `flat uint` — and the
fragment stage does the lookup at the point of sampling.
That relocation needs one shared idea, because the two backends disagree about
what the lookup IS. `ACDREAM_SAMPLE_ARRAY(slot, uvw)` asks the dialect-neutral
question — "sample table slot N" — and expands to
`texture(sampler2DArray(gTextureTable[slot]), uvw)` under GL and to
`texture(uTextures[nonuniformEXT(slot)], uvw)` under Vulkan. It is deliberately
a SAMPLING macro rather than a sampler-returning one: `nonuniformEXT` belongs on
the indexing expression itself, and binding the result to a local
`sampler2DArray` first is exactly where an implementation is free to drop it.
That is the same shape V6d already used for the retained UI's 2-D reads, and it
now covers the array reads the world path needs.
`ACDREAM_TEXTURE_NONE` lands alongside it, unused here and used by the next
commit. GL can ask "does this slot hold a texture" of the payload, because an
unregistered slot holds the null handle; Vulkan cannot, because set 2 is opaque
and reading an unwritten element of a partially-bound array is undefined rather
than zero. The sentinel moves that answer into the index, where both dialects
test it identically.
On GL nothing about the sampled result changes — the same slot resolves to the
same handle to the same texel. The SSBO read simply happens one stage later,
and `flat` keeps it one scalar load per primitive rather than per fragment.
Also: RenderBootstrap has been loading mesh_modern without common.glsl since V2,
which cannot have linked — `ACDREAM_UBO_SET` sits inside a layout qualifier
there. The UI Studio path is the only caller. One argument, same pair, same way
WorldRenderComposition has always loaded it.
Gates: Release build clean; App tests 4,057 passed / 3 skipped (baseline);
offline pixel gate against 95f8c25f differing fraction 3.37e-05 (~19 px of
563,200), inside the documented 15–23 px same-commit noise band and ~30x under
the 0.001 threshold. mesh_modern is the shader that gate covers most heavily,
so this is the strongest automated evidence any V6e commit gets.
Manifest: 4/9 pairs compile (debug_line, mesh_modern, ui_text, vk_probe).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
95f8c25f31
commit
935f4dc3d9
8 changed files with 80 additions and 28 deletions
BIN
src/AcDream.App/Rendering/Shaders/spv/mesh_modern.frag.spv
Normal file
BIN
src/AcDream.App/Rendering/Shaders/spv/mesh_modern.frag.spv
Normal file
Binary file not shown.
BIN
src/AcDream.App/Rendering/Shaders/spv/mesh_modern.vert.spv
Normal file
BIN
src/AcDream.App/Rendering/Shaders/spv/mesh_modern.vert.spv
Normal file
Binary file not shown.
|
|
@ -25,31 +25,29 @@
|
|||
"stage": "vert",
|
||||
"sourceSha256": "c35f767ab07fa9df805f9e77f4851f517c153dd2ef2efa6d49d0c24b688e4f56",
|
||||
"compiled": false,
|
||||
"message": "mesh.vert:71: error: \u0027uModel\u0027 : undeclared identifier"
|
||||
"message": "mesh.vert:73: error: \u0027uModel\u0027 : undeclared identifier"
|
||||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "4d6478543a9a903a3453581fa847e096aaecf01f38ebb2921572663bad8e24ea",
|
||||
"compiled": false,
|
||||
"message": "mesh.frag:158: error: \u0027uDiffuse\u0027 : undeclared identifier"
|
||||
"message": "mesh.frag:160: error: \u0027uDiffuse\u0027 : undeclared identifier"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "mesh_modern",
|
||||
"vulkanReady": false,
|
||||
"vulkanReady": true,
|
||||
"stages": [
|
||||
{
|
||||
"stage": "vert",
|
||||
"sourceSha256": "1ec2f4af83e73102d87997244a35b69ad5e9ece4b1ad78e2b5ece4d58fab5530",
|
||||
"compiled": false,
|
||||
"message": "mesh_modern.vert:380: error: \u0027assign\u0027 : cannot convert from \u0027 global highp uint\u0027 to \u0027layout( location=4) flat out highp 2-component vector of uint\u0027"
|
||||
"sourceSha256": "770e6300e023bd2600e8fed52768c624d8fff2ff8d6f997f076980502d3f675b",
|
||||
"compiled": true
|
||||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "3aea96cba6c2afc49caae7545f9e42603b6b17afa50b3254beca60f95af5d2f3",
|
||||
"compiled": false,
|
||||
"message": "mesh_modern.frag:106: error: \u0027sampler2DArray\u0027 : sampler-constructor requires the extension GL_ARB_bindless_texture enabled"
|
||||
"sourceSha256": "12f2ceec9a8420bd273650e95251ca56c3bf3c3691fce1a539e4c5aea7abaabf",
|
||||
"compiled": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -61,13 +59,13 @@
|
|||
"stage": "vert",
|
||||
"sourceSha256": "6a6ebeaacba95e5e4e8a308ed7c4cd805b80f305650c1e9e03e2bdfc6c18f5e7",
|
||||
"compiled": false,
|
||||
"message": "particle.vert:83: error: \u0027assign\u0027 : cannot convert from \u0027layout( location=6) in highp uint\u0027 to \u0027layout( location=2) flat out highp 2-component vector of uint\u0027"
|
||||
"message": "particle.vert:85: error: \u0027assign\u0027 : cannot convert from \u0027layout( location=6) in highp uint\u0027 to \u0027layout( location=2) flat out highp 2-component vector of uint\u0027"
|
||||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "3924ecbabf051349bc6a13e6cff370725a0832f8baf515decdb7e0394304006d",
|
||||
"compiled": false,
|
||||
"message": "particle.frag:60: error: \u0027sampler2DArray\u0027 : sampler-constructor requires the extension GL_ARB_bindless_texture enabled"
|
||||
"message": "particle.frag:62: error: \u0027sampler2DArray\u0027 : sampler-constructor requires the extension GL_ARB_bindless_texture enabled"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -84,7 +82,7 @@
|
|||
"stage": "frag",
|
||||
"sourceSha256": "0da368243e967388990f4f4b90e2304044af6187de45f70499a3e4ece8dfd5a8",
|
||||
"compiled": false,
|
||||
"message": "particle_mesh.frag:62: error: \u0027uTextureIndex\u0027 : undeclared identifier"
|
||||
"message": "particle_mesh.frag:64: error: \u0027uTextureIndex\u0027 : undeclared identifier"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -96,13 +94,13 @@
|
|||
"stage": "vert",
|
||||
"sourceSha256": "d338e9b03686b7baf79d5121c5c8d0f24037979cc58f203957d7bd97b02b1cc2",
|
||||
"compiled": false,
|
||||
"message": "sky.vert:151: error: \u0027uUvScroll\u0027 : undeclared identifier"
|
||||
"message": "sky.vert:153: error: \u0027uUvScroll\u0027 : undeclared identifier"
|
||||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "8084af39f65ae399c73e3ca864376ef20ba8a1c495ee4774be6a82af3872c51c",
|
||||
"compiled": false,
|
||||
"message": "sky.frag:76: error: \u0027uDiffuse\u0027 : undeclared identifier"
|
||||
"message": "sky.frag:78: error: \u0027uDiffuse\u0027 : undeclared identifier"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -114,13 +112,13 @@
|
|||
"stage": "vert",
|
||||
"sourceSha256": "4de580ce11b8d755d3558dc49bf7ebccec54d307595d91c38b5c5d552d645c7e",
|
||||
"compiled": false,
|
||||
"message": "terrain_modern.vert:219: error: \u0027uProjection\u0027 : undeclared identifier"
|
||||
"message": "terrain_modern.vert:221: error: \u0027uProjection\u0027 : undeclared identifier"
|
||||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "6003b81df6da6cbea7f00310bd956348bc7b2525345dd490b0b6a3b6428340d9",
|
||||
"compiled": false,
|
||||
"message": "terrain_modern.frag:108: error: \u0027uTexTiling\u0027 : undeclared identifier"
|
||||
"message": "terrain_modern.frag:110: error: \u0027uTexTiling\u0027 : undeclared identifier"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue