From b155e1d0ebcf344943fa3dced10c2ee889b8a43f Mon Sep 17 00:00:00 2001 From: hamb3r <48532909+hamb3r@users.noreply.github.com> Date: Fri, 16 Oct 2026 02:46:00 +0300 Subject: [PATCH] test(shader,agc): cover Image2DMultisampleArray descriptor binding and dimension check --- .../tests/GuestTextureResource.cpp | 2 ++ .../prx/libSceAgcDriver/tests/ShaderMemory.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp b/core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp index 6a8e0d8e7a..78d1dc5529 100644 --- a/core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp @@ -507,6 +507,8 @@ void RunGuestTextureResourceTests() { Require(MatchesGuestDimension(Shape::Image2DArray, TextureDimension::k2DArray), "2D array shape must match 2D array dimension"); Require(MatchesGuestDimension(Shape::Image2DMultisample, TextureDimension::k2DMsaa), "multisampled shape must match the multisampled dimension"); Require(!MatchesGuestDimension(Shape::Image2DMultisample, TextureDimension::k2D), "multisampled shape must not match 2D dimension"); + Require(MatchesGuestDimension(Shape::Image2DMultisampleArray, TextureDimension::k2DMsaa), "multisampled array shape must match the multisampled dimension"); + Require(!MatchesGuestDimension(Shape::Image2DMultisampleArray, TextureDimension::k2DArray), "multisampled array shape must not match 2D array dimension"); Require(!MatchesGuestDimension(Shape::Image2D, TextureDimension::k2DMsaa), "2D shape must not match the multisampled dimension"); Require(MatchesGuestDimension(Shape::Image2DArray, TextureDimension::kCube), "a cube must be readable as a 2D array of its faces"); Require(MatchesGuestDimension(Shape::ImageCube, TextureDimension::kCube), "cube shape must match cube dimension"); diff --git a/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp b/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp index a3294a30fe..06e81fca46 100644 --- a/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp @@ -4295,6 +4295,21 @@ void verifyUnusedUnnormalizedSampler() { require(normalized[0].imageUnnormalized == std::vector{false} && normalized[1].samplerUnnormalized == std::vector{false}, "unnormalized samplers: a normalized S# was flagged"); static_cast(populate(offset)); expectFailure([&] { static_cast(populate(foldOnly)); }, "normalized guest sampler is used with a texel offset that is not a constant", "unnormalized samplers: a normalized S# was accepted for an offset that only folds"); + ImageResource msaaArrayImage{}; + msaaArrayImage.resourceClass = ImageResourceClass::Sampled; + msaaArrayImage.numericClass = IrTextureNumericClass::Float; + msaaArrayImage.dimension = RdnaImageDimension::Dim2DMsaaArray; + msaaArrayImage.read = true; + ShaderInfo msaaArrayInfo; + msaaArrayInfo.images = {msaaArrayImage}; + msaaArrayInfo.runtimeImageModes = {ResourceMaterializer::RuntimeImageModes(msaaArrayImage)}; + BindingAllocationResult msaaArrayAllocation; + msaaArrayAllocation.layout.descriptors = {{DescriptorBindingForImage(msaaArrayImage), {0u}}}; + auto msaaArraySnapshot = snapshot; + msaaArraySnapshot.images[0].dwords[3] = 0xf0020facu; + msaaArraySnapshot.images[0].dwords[5] = 0x00000020u; + DescriptorBindingBuilder{}.Populate(msaaArrayAllocation, msaaArrayInfo, IrShaderStage::Compute, 0u, msaaArraySnapshot, {}); + require(msaaArrayAllocation.bindings.size() == 1u && msaaArrayAllocation.bindings[0].imageShape == DescriptorImageShape::Image2DMultisampleArray, "multisampled array image resource did not receive Image2DMultisampleArray descriptor shape"); } void verifyWaveUniformValues() {