mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-25 20:28:48 +08:00
5228335f15
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.
59 lines
1.4 KiB
C#
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));
|
|
}
|
|
}
|