test: remove known tautologies and scaffolds
This commit is contained in:
parent
8e884679e0
commit
52015f5052
9 changed files with 156 additions and 61 deletions
|
|
@ -2,6 +2,7 @@ using System.Numerics;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using AcDream.App.Rendering.Gpu;
|
||||
using AcDream.App.Rendering.Gpu.Vk;
|
||||
|
||||
namespace AcDream.App.Tests.Rendering.Gpu;
|
||||
|
||||
|
|
@ -242,19 +243,28 @@ public sealed class GpuContractTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void TheDepthStencilAttachmentFormatCarriesAStencilAspect()
|
||||
public void BackbufferClear_ClearsDepthAndStencil()
|
||||
{
|
||||
// The punch has nowhere to mark without one. The V5 capability gate
|
||||
// prefers D32_SFLOAT_S8_UINT and falls back to D24_UNORM_S8_UINT rather
|
||||
// than taking a depth-only format for exactly this reason, and the
|
||||
// backbuffer pass clears both aspects through one ClearDepthStencil.
|
||||
GpuPassDescription pass = GpuPassDescription.BackbufferClear(
|
||||
"world",
|
||||
Vector4.Zero,
|
||||
sampleCount: 4);
|
||||
Assert.Equal(0u, pass.Depth!.Value.ClearStencil);
|
||||
Assert.Equal(1f, pass.Depth.Value.ClearDepth);
|
||||
Assert.Equal(GpuLoadOp.Clear, pass.Depth!.Value.Load);
|
||||
Assert.Equal(GpuTextureFormat.Depth24Stencil8, GpuTextureFormat.Depth24Stencil8);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DepthStencilTextureFormat_MapsToDepthAndStencilAspects()
|
||||
{
|
||||
// The punch has nowhere to mark without a stencil aspect. The V5
|
||||
// capability gate prefers D32_SFLOAT_S8_UINT and falls back to
|
||||
// D24_UNORM_S8_UINT rather than accepting a depth-only format.
|
||||
Silk.NET.Vulkan.ImageAspectFlags aspects =
|
||||
VulkanTextureFormatMapping.AspectOf(GpuTextureFormat.Depth24Stencil8);
|
||||
|
||||
Assert.True(aspects.HasFlag(Silk.NET.Vulkan.ImageAspectFlags.DepthBit));
|
||||
Assert.True(aspects.HasFlag(Silk.NET.Vulkan.ImageAspectFlags.StencilBit));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue