feat(render): Campaign V slice V4t-1 — terrain crosses to GpuTextureSlot
V4t moves the world texture stack off the raw 64-bit ARB_bindless_texture handle and onto GpuTextureSlot. This first commit does terrain only, because terrain is the one branch of that stack whose producer and consumer are a single pair — TerrainAtlas and TerrainModernRenderer — so it can carry the new device seam on its own pixel gate before the mesh/composite/particle retype lands on top of it. Why the device's table can now be reached, when §5.2 said it could not. That paragraph's reason was the flush: GlGpuDevice drains its dirty table runs inside FlushBeforeDraw, which only an encoder-recorded draw reaches, so a raw-GL renderer would sample a stale table. §5.5.6 then closed the GL re-land of V4c/V4d, which means the world renderers stay raw GL through to V10 — so "wait for the encoder" stopped being a plan and became an indefinite block on V4t, which the Vulkan world arm cannot be written without. The resolution is the smallest one that keeps the seam honest: the drain is factored out as GlGpuDevice.FlushTextureTable, and a raw-GL renderer calls it and binds TextureTableGlName at binding 9 itself, immediately before its own draw — the same shape its retired private GlBindlessHandleTable had, against a table that is now the device's. Nothing else of the backend is exposed, and both members are deleted with the raw-GL world path. Residency ownership deliberately does NOT move. RegisterWorldTextureHandle interns an already-resident handle and owns only the table entry; the atlas still creates, makes resident and destroys its own textures. That is what separates it from RegisterTexture, which owns the residency it creates, and it is why this slice can retype the data model without also porting GL texture creation onto IGpuTexture. TerrainAtlas.GetBindlessHandles becomes GetTextureSlots(GlGpuDevice). Registration is idempotent by handle, so the per-draw call is two dictionary lookups — the cadence GetOrAdd already had. It is conditional on the handle having changed because SetAnisotropic makes both textures non-resident and re-acquires them: without that check a quality-preset change would strand a slot holding a non-resident handle, so the superseded entry is retired in the same step through the device's retirement queue. Ordering is unaffected. Terrain's two slots travel as loose uniforms (uTextureIndexA/B) and enter no sort and no bucket key, so a different slot NUMBER changes nothing about what is drawn or in what order — only which table index resolves to the same handle. Gates. GL offline pixel gate vscb2a70b8: 3.02e-05 (17 of 563,200 pixels), exactly a same-commit control value and inside the documented 15-23 px / <=4.1e-05 band. tools/run-repeat-connected-gate.ps1 -Runs 3: 3/3 RENDERED on both the desktop witness and the client capture. One Vulkan composition-host run with VK_LAYER_KHRONOS_validation proven inserted by the loader: zero errors, zero warnings, empty validation log, converged ownership ledger. App tests 4,075 / 3 skips (#250's zero-allocation test reran green singly). One connected run of an earlier 3-run attempt died in the render loop with "OpenGL returned unexpected fence wait status NoError (0x0)" from GpuFrameFlightController.RetireFence. It did not reproduce in the following three runs at this tree nor in three interleaved runs atcb2a70b8, and this diff creates, deletes and waits on no fence. Filed as #251 rather than attributed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
cb2a70b867
commit
b8bcaa3ef2
6 changed files with 228 additions and 83 deletions
|
|
@ -271,6 +271,7 @@ public sealed class WorldRenderCompositionTests
|
|||
BindlessSupport bindless,
|
||||
Shader shader,
|
||||
TerrainAtlas atlas,
|
||||
IGpuDevice gpuDevice,
|
||||
IGpuResourceRetirementQueue retirement) =>
|
||||
Resource<TerrainModernRenderer>("terrain");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue