Revert "feat(render): Campaign V slice V4d-2 - move terrain onto the RHI"

This reverts commit b064668b63.
This commit is contained in:
Erik 2026-07-27 22:38:02 +02:00
parent b064668b63
commit ad61f250fb
7 changed files with 553 additions and 496 deletions

View file

@ -48,6 +48,9 @@ public sealed class GameWindow :
private GL? _gl;
private IInputContext? _input;
private TerrainModernRenderer? _terrain;
/// <summary>Phase N.5b: terrain_modern.vert/.frag program. Owned by
/// <see cref="_terrain"/> at draw time but allocated + disposed here.</summary>
private Shader? _terrainModernShader;
private CameraController? _cameraController;
private IDatReaderWriter? _dats;
private IPreparedAssetSource? _preparedAssets;
@ -894,6 +897,12 @@ public sealed class GameWindow :
value,
"bindless support");
void IGameWindowWorldRenderPublication.PublishTerrainShader(Shader value) =>
PublishCompositionOwner(
ref _terrainModernShader,
value,
"terrain shader");
void IGameWindowWorldRenderPublication.PublishSceneLighting(
SceneLightingUboBinding value) =>
PublishCompositionOwner(
@ -1672,6 +1681,7 @@ public sealed class GameWindow :
_wbMeshAdapter,
_meshShader,
_terrain,
_terrainModernShader,
_sceneLightingUbo,
_debugLines,
_textRenderer,

View file

@ -118,6 +118,7 @@ internal sealed record RenderShutdownRoots(
WbMeshAdapter? MeshAdapter,
Shader? MeshShader,
TerrainModernRenderer? Terrain,
Shader? TerrainShader,
SceneLightingUboBinding? SceneLighting,
DebugLineRenderer? DebugLines,
TextRenderer? TextRenderer,
@ -454,6 +455,7 @@ internal static class GameWindowShutdownManifest
[
Hard("mesh shader", () => render.MeshShader?.Dispose()),
Hard("terrain", () => render.Terrain?.Dispose()),
Hard("terrain shader", () => render.TerrainShader?.Dispose()),
Hard("scene lighting", () => render.SceneLighting?.Dispose()),
Hard("debug lines", () => render.DebugLines?.Dispose()),
Hard("text renderer", () => render.TextRenderer?.Dispose()),

View file

@ -30,26 +30,15 @@ out vec4 fragColor;
// Campaign V slice V2b (2026-07-27): uTerrainHandle/uAlphaHandle (uvec2, raw
// ARB_bindless_texture handles) became uTextureIndexA/uTextureIndexB (slots
// into the binding=9 handle table, ACDREAM_TEXTURE_HANDLE in common.glsl).
// Named to match the pinned GpuPushConstants.TextureIndexA/B fields, so slice
// V4d's move onto push constants was a rename rather than a redesign. The GL
// backend maps each push-constant field to the correspondingly named uniform,
// which is why these stay declared exactly as they are.
// Named to match the pinned GpuPushConstants.TextureIndexA/B fields so V4d's
// move to push constants is a rename, not a redesign — there is no
// push-constant plumbing yet, so these stay plain uniforms for now.
uniform uint uTextureIndexA;
uniform uint uTextureIndexB;
uniform float uTexTiling[36];
#define uTerrain sampler2DArray(ACDREAM_TEXTURE_HANDLE(uTextureIndexA))
#define uAlpha sampler2DArray(ACDREAM_TEXTURE_HANDLE(uTextureIndexB))
// Campaign V slice V4d: the per-layer tiling table moved out of a loose
// `uniform float uTexTiling[36]` and into a uniform block at
// GpuBindingModel.UniformTerrainTiling. At 144 bytes of payload it cannot ride
// in the 96-byte GpuPushConstants block (nor Vulkan's guaranteed 128-byte
// ceiling), and there is no RHI verb for setting a uniform array. std140 pads
// each array element to 16 bytes, so the block is 576 bytes; the element type
// is unchanged so uTexTiling[i] reads exactly as it did before.
layout(std140, ACDREAM_UBO_SET binding = 3) uniform TerrainTiling {
float uTexTiling[36];
};
struct Light {
vec4 posAndKind;
vec4 dirAndRange;

File diff suppressed because it is too large Load diff