using AcDream.App.Rendering.Gpu;
namespace AcDream.App.Rendering;
///
/// Campaign FW stage FW2: the one depth-compare operator every world-space
/// pipeline uses, named instead of repeated as a literal at each of the
/// world's own pipeline-creation sites.
///
/// Why , not
/// 's/GpuDepthState's own
/// LessOrEqual convention default: the GL-era world frame ran under
/// GL_LESS and never called glDepthFunc to change it, so every
/// world-space renderer inherited GL_LESS by omission rather than by
/// design. LessOrEqual would flip which of two exactly-coplanar retail
/// surfaces wins the depth test — visible wherever terrain meets a road or a
/// building footing, or wherever two retail-authored polygons share a plane.
/// FW2's decomp verification (plan §FW2, read 2026-08-30) confirms retail's
/// own world raster state is D3DCMP_LESS: the .data default
/// Render::zfuncVal @0x00820e1c is 0x2, and
/// RenderDeviceD3D::SetDepthBufferMode @0x005a2d10 writes that enum
/// value DIRECTLY as D3DRS_ZFUNC (render state 0x17) — the enum IS
/// D3DCMPFUNC, so 0x2 = D3DCMP_LESS. The surface-state applier
/// @0x0059c80a–0x0059c866 applies it to all world geometry with Z-write
/// toggled by blend state (on for opaque, off for blended), exactly this
/// pipeline set's per-variant depthWrite. The DEPTHTEST_LESSEQUAL
/// sites in the decomp are SKY-local (GameSky::Draw @0x00506ff0, drawn
/// at 4× zfar) — never world state. So Less is not merely "what the
/// port happened to inherit" — it is retail's actual world depth-compare
/// operator, now named as a citable contract instead of a bare literal
/// repeated at each call site.
///
/// Scope: WORLD-SPACE geometry only (terrain, EnvCell shells, entity
/// meshes, particles, portal punches, the directional shadow caster/receiver
/// pair). The two RetailDetail pipelines
/// ('s Equal/LessOrEqual
/// pair, used by the building-detail overlay replay) are a documented
/// exception with their own citation and are untouched by this contract.
///
internal static class WorldDepthContract
{
/// Retail's world-space depth-compare operator. See the type
/// doc comment for the full citation; every world pipeline site should
/// reference this constant rather than spelling GpuCompareOp.Less
/// again.
public const GpuCompareOp WorldCompare = GpuCompareOp.Less;
}