Files
sharpemu/tests/SharpEmu.Libs.Tests/VideoOut/VulkanGuestImageByteCountTests.cs
T
MarcelMediaDev 5228335f15 fix(gpu): support Gen5 flat memory and 3D images (#587)
Vector-mesh UI text samples type-10 volume LUTs; treat MIMG DIM=2 as
Dim3D and transport depth through AGC and Vulkan so Z slices no longer
collapse into a single 2D plane.
2026-07-24 15:44:58 +03:00

59 lines
1.4 KiB
C#

// Copyright (C) 2026 SharpEmu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
using SharpEmu.Libs.VideoOut;
using Xunit;
namespace SharpEmu.Libs.Tests.VideoOut;
public sealed class VulkanGuestImageByteCountTests
{
[Theory]
[InlineData(10u, 642u, 362u, 929616UL)]
[InlineData(12u, 642u, 362u, 1859232UL)]
[InlineData(13u, 2u, 2u, 48UL)]
public void UsesGuestSurfaceTexelSize(
uint format,
uint width,
uint height,
ulong expected)
{
Assert.Equal(
expected,
VulkanVideoPresenter.GetGuestImageByteCount(format, width, height));
}
[Theory]
[InlineData(169u, 4u, 4u, 8UL)]
[InlineData(173u, 5u, 5u, 64UL)]
public void UsesCompressedBlockExtent(
uint format,
uint width,
uint height,
ulong expected)
{
Assert.Equal(
expected,
VulkanVideoPresenter.GetGuestImageByteCount(format, width, height));
}
[Theory]
[InlineData(10u, 8u, 4u, 3u, 384UL)]
[InlineData(169u, 5u, 5u, 7u, 224UL)]
public void MultipliesSurfaceSizeByVolumeDepth(
uint format,
uint width,
uint height,
uint depth,
ulong expected)
{
Assert.Equal(
expected,
VulkanVideoPresenter.GetGuestImageByteCount(
format,
width,
height,
depth));
}
}