feat(render): shader ABI v2 - AtmosphericFrame gains clock/wind blocks; caster pass binds it (Campaign VM VM6a)
AtmosphericFrame (set 3/binding 5) grows additively from 160 to 192 bytes: two appended vec4 members, uAtmosphereClockWind and uAtmosphereWindAmplitude, carry the foliage-wind clock/weather and amplitude inputs VM6b's shader displacement will read. RenderPackShaderAbi renames the old constant to AtmosphericFrameSizeBytesV1 (160), adds AtmosphericFrameSizeBytesV2 (192), keeps AtmosphericFrameSizeBytes pointing at the current (v2) size, and adds ShaderAbiVersion = 2. RenderPackSpirvValidator.ValidateAtmosphericFrame accepts either the v1 (seven-member, 160-byte) or v2 (nine-member, 192-byte) shape and rejects anything else naming both — this is why the frozen external sample packs under samples/*/Shaders/*.spv, whose GLSL sources are not in this tree, need no rebuild: a v1 shader bound to the 192-byte buffer still reads correctly, since a bound range only needs to be >= the block's own declared size. DirectionalSunShadowRenderer's caster pass now binds AtmosphericFrame too (both the multiview and per-cascade sites), through a new AtmosphericFrameBufferBinding the graph owns and supplies via DirectionalSunShadowRenderInput. AtmosphericPostProcessGraph.RenderDirectionalShadows builds its own 192-byte ring allocation for this, separate from the world receiver's frame block, because the caster pass runs before RenderPostProcess constructs that block within the same frame. The four world caster pipeline variants (opaque/cutout, base/multiview) are now allowed to declare binding 5 in the validator; terrain casters are untouched. This commit is plumbing only: the two new members are always written but never read by any shader yet (zero placeholders), so pack-on and pack-off output are both pixel-identical to before. VM6b wires the real weather-driven values and the shader-side displacement. App hermetic filter: 5972/5974 (2 pre-existing failures unrelated to this change, confirmed against the unmodified baseline). Core.Tests hermetic: 4697/4697. RenderPackValidator.Tests: 30/30. VulkanShaderManifestTests (retail oracle set): 7/7, byte-identical. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
a0157693ec
commit
0930c35d1d
17 changed files with 340 additions and 32 deletions
|
|
@ -209,6 +209,15 @@ optional after a pass unconditionally declares them.
|
|||
these graphics declarations. Additive enum/record support stays compatible;
|
||||
a breaking contract requires a new render-pack API version and explicit
|
||||
compatibility path.
|
||||
- `RenderPackShaderAbi.ShaderAbiVersion` separately versions the numeric
|
||||
SPIR-V interface (set/binding numbers and std140 block layouts) declarations
|
||||
are validated against — distinct from `RenderPackApi`/`PluginApi`. Campaign
|
||||
VM VM6 shipped v2: `AtmosphericFrame` (set 3, binding 5) grew additively
|
||||
from 160 to 192 bytes (see `docs/render-packs/semantic-bindings-v1.md`'s
|
||||
"ABI v2 (additive)" section). `RenderPackSpirvValidator` accepts both the
|
||||
v1 and v2 shapes, so shader assets compiled before a version bump — the
|
||||
external sample packs among them — never need a rebuild for an additive
|
||||
change.
|
||||
- Persisted identity is pack ID + pack version + preset ID, never list index.
|
||||
User-authored setting strings are keyed by the same stable pack identity and
|
||||
stable setting ID, never declaration or menu index.
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ checked-in shared render-pack GLSL includes are the byte-offset SSOT; authors
|
|||
include those definitions rather than maintaining a private copy. The tables
|
||||
below state the same values for review and tool diagnostics.
|
||||
|
||||
### `AtmosphericFrame` — set 3, binding 5, 160 bytes
|
||||
### `AtmosphericFrame` — set 3, binding 5, 192 bytes (ABI v2; see below)
|
||||
|
||||
```glsl
|
||||
layout(std140, set = 3, binding = 5) uniform AtmosphericFrame {
|
||||
|
|
@ -134,6 +134,38 @@ curve without an exact 0-degree point must make its first positive point zero.
|
|||
from scene depth and the normalized viewport coordinates. Matrix convention
|
||||
and depth range match the shared push-block `viewProjection`.
|
||||
|
||||
### ABI v2 (additive) — Campaign VM VM6
|
||||
|
||||
`AtmosphericFrame` grew from 160 to 192 bytes by appending two members after
|
||||
`uAtmosphereInverseViewProjection`. Nothing above this line moved or changed
|
||||
meaning:
|
||||
|
||||
```glsl
|
||||
layout(std140, set = 3, binding = 5) uniform AtmosphericFrame {
|
||||
// ... the seven v1 members, unchanged ...
|
||||
vec4 uAtmosphereClockWind; // @160: elapsed seconds, wind mean [0..1], wind gust [0..1], wind direction radians
|
||||
vec4 uAtmosphereWindAmplitude; // @176: lean amplitude m, branch amplitude m, flutter amplitude m, max canopy height m
|
||||
};
|
||||
```
|
||||
|
||||
`uAtmosphereClockWind`/`uAtmosphereWindAmplitude` feed the shared
|
||||
`foliage_wind.glsl` include, which `mesh_atmospheric.vert` and the four
|
||||
`directional_shadow_world_*` (opaque/cutout, base and multiview) caster
|
||||
vertex shaders call identically so a displaced leaf's shadow moves with it.
|
||||
No other pass reads these members.
|
||||
|
||||
**Compatibility rule:** the host always allocates and binds the full 192-byte
|
||||
v2 block (`RenderPackShaderAbi.AtmosphericFrameSizeBytes`), but a v1 shader —
|
||||
one compiled before this campaign, declaring only the original seven members
|
||||
— binds and reads correctly against it: a bound range only needs to be at
|
||||
least as large as the block's declared size, so the shader simply never sees
|
||||
the appended bytes. `RenderPackSpirvValidator.ValidateAtmosphericFrame`
|
||||
accepts either the v1 shape (seven members, 160 bytes) or the v2 shape (nine
|
||||
members, 192 bytes); any other member count is rejected naming both. This is
|
||||
why the external sample packs under `samples/*/Shaders/*.spv` — whose GLSL
|
||||
sources are not in this tree and are never recompiled — needed no rebuild for
|
||||
this change.
|
||||
|
||||
### Colour space
|
||||
|
||||
The main-world colour target, `uAtmosphereSunColor` (sun-ray input), and any
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue