Merge pull request #7238 from gjonn/fix/recompiler-dynamic-storage-mip-slots

fix(recompiler): give a dynamic-mip storage image a slot for every level
This commit is contained in:
Dean authored and GitHub committed 2026-10-18 18:58:30 +13:00
commit 4827d822ec
2 files changed
+22 -2

No files matched your search

@@ -5753,6 +5753,25 @@ void verifyVolumeArrayLoadMode() {
expectFailure([&] { static_cast<void>(ResourceMaterializer::RuntimeImageMode(store, descriptor, ResourceMaterializer::RuntimeImageModes(store))); }, "incompatible with the static runtime image interface", "2D-array image atomic on a 3D T# was accepted");
}
void verifyDynamicStorageMipChain() {
using namespace ShaderRecompiler;
ImageResource image{};
image.resourceClass = ImageResourceClass::Storage;
image.numericClass = IrTextureNumericClass::Float;
image.dimension = RdnaImageDimension::Dim2D;
image.mipMode = ImageMipMode::DynamicStorage;
image.written = true;
image.fmaskCompatible = false;
const auto modes = ResourceMaterializer::RuntimeImageModes(image);
const DescriptorValue tenLevels{{0x12366e00u, 0xc2400000u, 0x007fc07fu, 0xd1b903acu, 0x17u, 0x00700090u, 0u, 0u}, 8u};
const auto selected = ResourceMaterializer::TryRuntimeImageMode(image, tenLevels, modes);
require(selected.mode.has_value(), "a dynamic-mip storage image of a 512x512 surface with ten levels was rejected");
require(modes[*selected.mode].mipCount >= 10u, "a dynamic-mip storage mode does not hold ten levels");
auto allLevels = tenLevels;
allLevels.dwords[3] |= 0xf0000u;
require(ResourceMaterializer::TryRuntimeImageMode(image, allLevels, modes).mode.has_value(), "a dynamic-mip storage image with sixteen levels was rejected");
}
void verifySrgbDepthCompareModes() {
using namespace ShaderRecompiler;
for (const auto decodeFormats : {0u, 1u, 2u, 3u}) {
@@ -5882,6 +5901,7 @@ int main(int argc, char** argv) {
verifyGuardedNullPointers();
verifyCubeDepthCompareMode();
verifyVolumeArrayLoadMode();
verifyDynamicStorageMipChain();
verifySrgbDepthCompareModes();
verifyQuadMaskNeighbourReads();
verifyCoherentGds();
+2 -2
View File
@@ -41,8 +41,8 @@ inline constexpr std::uint32_t BufferCapacity = 128u;
inline constexpr std::uint32_t ImageCapacity = 256u;
inline constexpr std::uint32_t SampledHeapCapacity = 64u;
inline constexpr std::uint32_t BindlessTableSlots = 16u;
inline constexpr std::uint32_t StorageMipSlots = 4u;
inline constexpr std::uint32_t StorageHeapCapacity = 16u;
inline constexpr std::uint32_t StorageMipSlots = 16u;
inline constexpr std::uint32_t StorageHeapCapacity = 64u;
inline constexpr std::uint32_t SamplerHeapCapacity = 64u;
inline constexpr std::uint32_t StateExportMappings = 0u;
inline constexpr std::uint32_t StateDwords = 2u;