mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 22:06:59 +01:00
tests: align GPU fixtures with binding architecture
This commit is contained in:
@@ -1350,6 +1350,18 @@ std::array<u32, 64> MakeStorageTextureData(Prospero::BufferFormat format) {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string StorageUint2DImageBindingName(bool atomic) {
|
||||||
|
ShaderRecompiler::IR::ImageResource image{};
|
||||||
|
image.resource_class = ShaderRecompiler::IR::ImageResourceClass::Storage;
|
||||||
|
image.numeric_class = Prospero::TextureNumericClass::Uint;
|
||||||
|
image.dimension = ShaderRecompiler::Decoder::ImageDimension::Dim2D;
|
||||||
|
image.atomic = atomic;
|
||||||
|
const auto binding = ShaderRecompiler::IR::DescriptorBindingForImage(image);
|
||||||
|
Require("StorageUint2DImageBindingName", "descriptor binding", binding.has_value(),
|
||||||
|
"storage image has no descriptor binding");
|
||||||
|
return "image_" + std::to_string(static_cast<uint32_t>(*binding));
|
||||||
|
}
|
||||||
|
|
||||||
CompiledShader CompileFragmentCase(const GraphicsCase &test) {
|
CompiledShader CompileFragmentCase(const GraphicsCase &test) {
|
||||||
const auto user_data =
|
const auto user_data =
|
||||||
MakeNativeUserData(test.has_user_data ? &test.user_data : nullptr);
|
MakeNativeUserData(test.has_user_data ? &test.user_data : nullptr);
|
||||||
@@ -8496,6 +8508,7 @@ public:
|
|||||||
phased_depth_target.stencil_info.format = Prospero::StencilFormat::k8UInt;
|
phased_depth_target.stencil_info.format = Prospero::StencilFormat::k8UInt;
|
||||||
phased_depth_target.stencil_info.texture_compatibility =
|
phased_depth_target.stencil_info.texture_compatibility =
|
||||||
Prospero::TextureCompatibleStencil::kEnable;
|
Prospero::TextureCompatibleStencil::kEnable;
|
||||||
|
phased_depth_target.stencil_info.htile_stencil_disabled = false;
|
||||||
phased_depth_target.z_read_base_addr = phased_depth_address;
|
phased_depth_target.z_read_base_addr = phased_depth_address;
|
||||||
phased_depth_target.z_write_base_addr = phased_depth_address;
|
phased_depth_target.z_write_base_addr = phased_depth_address;
|
||||||
phased_depth_target.stencil_read_base_addr = phased_stencil_address;
|
phased_depth_target.stencil_read_base_addr = phased_stencil_address;
|
||||||
@@ -18857,6 +18870,7 @@ TestCase ScratchIsPrivatePerInvocation() {
|
|||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if KYTY_PLATFORM != KYTY_PLATFORM_WINDOWS
|
||||||
TestCase FlatStoreVariants() {
|
TestCase FlatStoreVariants() {
|
||||||
using O = ShaderOpcode;
|
using O = ShaderOpcode;
|
||||||
|
|
||||||
@@ -18904,6 +18918,7 @@ TestCase FlatStoreVariants() {
|
|||||||
O::FLAT_STORE_DWORDX3, O::FLAT_STORE_DWORDX4, O::S_ENDPGM}};
|
O::FLAT_STORE_DWORDX3, O::FLAT_STORE_DWORDX4, O::S_ENDPGM}};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TestCase DsReadWriteVariants() {
|
TestCase DsReadWriteVariants() {
|
||||||
using O = ShaderOpcode;
|
using O = ShaderOpcode;
|
||||||
@@ -20988,7 +21003,7 @@ TestCase ImageStoreR32SintUsesRawUintView() {
|
|||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
test.expected_storage_image_r32ui = expected_image;
|
test.expected_storage_image_r32ui = expected_image;
|
||||||
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
||||||
"image_29"};
|
StorageUint2DImageBindingName(false)};
|
||||||
test.forbidden_spirv = {"R32ui"};
|
test.forbidden_spirv = {"R32ui"};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
@@ -21018,7 +21033,7 @@ TestCase ImageStoreR32UintUsesFormatlessStorageImage() {
|
|||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
test.expected_storage_image_r32ui = expected_image;
|
test.expected_storage_image_r32ui = expected_image;
|
||||||
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
||||||
"image_29"};
|
StorageUint2DImageBindingName(false)};
|
||||||
test.forbidden_spirv = {"R32ui"};
|
test.forbidden_spirv = {"R32ui"};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
@@ -21052,7 +21067,8 @@ TestCase ImageStorePackedUintSaturatesChannels() {
|
|||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
test.expected_storage_image_r32ui = std::move(expected_image);
|
test.expected_storage_image_r32ui = std::move(expected_image);
|
||||||
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
||||||
"image_29", "OpULessThan", "OpSelect"};
|
StorageUint2DImageBindingName(false), "OpULessThan",
|
||||||
|
"OpSelect"};
|
||||||
test.forbidden_spirv = {"R32ui"};
|
test.forbidden_spirv = {"R32ui"};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
@@ -21084,7 +21100,7 @@ TestCase ImageStorePackedUintHonorsSparseDmask() {
|
|||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
test.expected_storage_image_r32ui = std::move(expected_image);
|
test.expected_storage_image_r32ui = std::move(expected_image);
|
||||||
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
test.required_spirv = {"OpCapability StorageImageWriteWithoutFormat",
|
||||||
"image_29"};
|
StorageUint2DImageBindingName(false)};
|
||||||
test.forbidden_spirv = {"R32ui"};
|
test.forbidden_spirv = {"R32ui"};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
@@ -21145,9 +21161,10 @@ TestCase ImageStoreAndAtomicShareTypedBinding() {
|
|||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
test.expected_storage_image_r32ui = std::move(expected_image);
|
test.expected_storage_image_r32ui = std::move(expected_image);
|
||||||
test.required_spirv = {"OpImageWrite", "OpImageTexelPointer", "R32ui",
|
test.required_spirv = {"OpImageWrite", "OpImageTexelPointer", "R32ui",
|
||||||
"image_34"};
|
StorageUint2DImageBindingName(true)};
|
||||||
test.forbidden_spirv = {"StorageImageReadWithoutFormat",
|
test.forbidden_spirv = {"StorageImageReadWithoutFormat",
|
||||||
"StorageImageWriteWithoutFormat", "image_29"};
|
"StorageImageWriteWithoutFormat",
|
||||||
|
StorageUint2DImageBindingName(false)};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21219,8 +21236,8 @@ TestCase ImageStoreAndAtomicUseSeparateBindings() {
|
|||||||
"OpImageWrite",
|
"OpImageWrite",
|
||||||
"OpImageTexelPointer",
|
"OpImageTexelPointer",
|
||||||
"R32ui",
|
"R32ui",
|
||||||
"image_29",
|
StorageUint2DImageBindingName(false),
|
||||||
"image_34"};
|
StorageUint2DImageBindingName(true)};
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21251,10 +21268,12 @@ TestCase ImageAtomicVariants() {
|
|||||||
O::IMAGE_ATOMIC_UMIN, O::IMAGE_ATOMIC_AND,
|
O::IMAGE_ATOMIC_UMIN, O::IMAGE_ATOMIC_AND,
|
||||||
O::IMAGE_ATOMIC_OR, O::IMAGE_ATOMIC_XOR,
|
O::IMAGE_ATOMIC_OR, O::IMAGE_ATOMIC_XOR,
|
||||||
O::BUFFER_STORE_DWORD, O::S_ENDPGM};
|
O::BUFFER_STORE_DWORD, O::S_ENDPGM};
|
||||||
test.required_spirv = {"OpImageTexelPointer", "R32ui", "image_34"};
|
test.required_spirv = {"OpImageTexelPointer", "R32ui",
|
||||||
|
StorageUint2DImageBindingName(true)};
|
||||||
test.forbidden_spirv = {"OpTypeSampler", "OpTypeSampledImage",
|
test.forbidden_spirv = {"OpTypeSampler", "OpTypeSampledImage",
|
||||||
"StorageImageReadWithoutFormat",
|
"StorageImageReadWithoutFormat",
|
||||||
"StorageImageWriteWithoutFormat", "image_29"};
|
"StorageImageWriteWithoutFormat",
|
||||||
|
StorageUint2DImageBindingName(false)};
|
||||||
test.storage_image_rgba = MakeRgbaImage(4, 4);
|
test.storage_image_rgba = MakeRgbaImage(4, 4);
|
||||||
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
test.storage_image_r32ui = std::vector<u32>(16, 0);
|
||||||
for (u32 i = 0; i < static_cast<u32>(std::size(initial)); i++) {
|
for (u32 i = 0; i < static_cast<u32>(std::size(initial)); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user