using AcDream.App.Rendering.Gpu.Gl; namespace AcDream.App.Tests.Rendering.Gpu.Gl; public sealed class GlPushConstantUniformNamesTests { [Fact] public void EveryDocumentedFieldMapsToItsDocumentedUniformName() { Assert.Equal("uViewProjection", GlPushConstantUniformNames.ByFieldName["ViewProjection"]); Assert.Equal("uDrawIDOffset", GlPushConstantUniformNames.ByFieldName["DrawIdOffset"]); Assert.Equal("uLightingMode", GlPushConstantUniformNames.ByFieldName["LightingMode"]); Assert.Equal("uRenderPass", GlPushConstantUniformNames.ByFieldName["RenderPass"]); Assert.Equal("uLightDebug", GlPushConstantUniformNames.ByFieldName["LightDebug"]); Assert.Equal("uTextureIndexA", GlPushConstantUniformNames.ByFieldName["TextureIndexA"]); Assert.Equal("uTextureIndexB", GlPushConstantUniformNames.ByFieldName["TextureIndexB"]); Assert.Equal("uParamA", GlPushConstantUniformNames.ByFieldName["ParamA"]); Assert.Equal("uParamB", GlPushConstantUniformNames.ByFieldName["ParamB"]); } [Fact] public void TableCoversEveryFieldOnTheSharedStructWithNoStaleEntries() { // This is the drift guard: if a later slice adds/removes/renames a // GpuPushConstants field without updating the mapping table, this // test fails instead of the GL backend silently skipping a uniform. GlPushConstantUniformNames.AssertMapsEveryField(); } [Fact] public void TableHasExactlyNineEntries() { Assert.Equal(9, GlPushConstantUniformNames.ByFieldName.Count); } }