shader: remove unreachable mixed image specialization paths

This commit is contained in:
nmzik
2026-10-12 20:54:22 +02:00
parent 145578ac03
commit e2c8b61de6
6 changed files with 97 additions and 435 deletions
+4 -23
View File
@@ -14257,8 +14257,6 @@ void TestBoundedScalarMaterialImageKeys() {
uint64_t unavailable = 0;
bool clean = true;
bool mixed = false;
bool mixed_dimension = false;
bool mixed_conversion = false;
bool same_key = false;
uint32_t keys = 0;
uint32_t images = 0;
@@ -14287,13 +14285,10 @@ void TestBoundedScalarMaterialImageKeys() {
std::ranges::fill(words, 0u);
words[0] = key;
const bool integer = key == 5573u || key == 5588u;
words[1] = static_cast<uint32_t>(m.mixed_conversion && key == 5573u
? Prospero::BufferFormat::k11_11_10UInt
: integer && !(m.mixed && key == 5573u)
? Prospero::BufferFormat::k32UInt : Prospero::BufferFormat::k32Float) << 20u;
words[1] = static_cast<uint32_t>(integer && !(m.mixed && key == 5573u)
? Prospero::BufferFormat::k32UInt : Prospero::BufferFormat::k32Float) << 20u;
words[3] = DstSel(4, 5, 6, 7) |
(static_cast<uint32_t>(m.mixed_dimension && key == 5573u
? Prospero::ImageType::kColor2D : Prospero::ImageType::kColor3D) << 28u);
(static_cast<uint32_t>(Prospero::ImageType::kColor3D) << 28u);
return true;
}
return false;
@@ -14340,22 +14335,8 @@ void TestBoundedScalarMaterialImageKeys() {
Check(!MaterializeResources(plan, runtime, snapshot, specialization) && memory.keys == 0,
"scalar material byte range escaped V# bounds");
memory = {.mixed = true};
Check(MaterializeResources(plan, runtime, snapshot, specialization) &&
snapshot.images.size() == 4u &&
std::ranges::count_if(specialization.images, [](const auto& image) {
return image.numeric_class == Prospero::TextureNumericClass::Uint;
}) == 1,
"selected material fields lost their mixed float/uint image classes");
memory = {.mixed_dimension = true};
Check(MaterializeResources(plan, runtime, snapshot, specialization) &&
snapshot.images.size() == 4u &&
std::ranges::count_if(specialization.images, [](const auto& image) {
return image.dimension == ShaderRecompiler::Decoder::ImageDimension::Dim2D;
}) == 1,
"selected material fields lost their per-candidate image dimensions");
memory = {.mixed_conversion = true};
Check(!MaterializeResources(plan, runtime, snapshot, specialization),
"selected material fields bypassed image conversion compatibility");
"selected material fields bypassed image compatibility");
memory = {};
Check(MaterializeResources(plan, runtime, snapshot, specialization),
"native scalar material image selection did not recover after rejected candidates");