graphics: log image descriptor specialization mismatches

This commit is contained in:
nmzik
2026-08-03 01:57:22 +02:00
parent 05d14f5421
commit 53feb6cb19
@@ -200,8 +200,8 @@ bool ValidateResourceSpecialization(const Program& program, const ResourceSnapsh
if (dimension == Decoder::ImageDimension::Unknown || dimension != image.dimension || if (dimension == Decoder::ImageDimension::Unknown || dimension != image.dimension ||
DescriptorIsCube(descriptor) != image.cube) { DescriptorIsCube(descriptor) != image.cube) {
if (error != nullptr) { if (error != nullptr) {
*error = fmt::format( *error =
"image descriptor {} no longer matches specialized dimension: " fmt::format("image descriptor {} no longer matches specialized dimension: "
"{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x}", "{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x}",
i, descriptor.dwords[0], descriptor.dwords[1], descriptor.dwords[2], i, descriptor.dwords[0], descriptor.dwords[1], descriptor.dwords[2],
descriptor.dwords[3], descriptor.dwords[4], descriptor.dwords[5], descriptor.dwords[3], descriptor.dwords[4], descriptor.dwords[5],
@@ -224,14 +224,17 @@ bool ValidateResourceSpecialization(const Program& program, const ResourceSnapsh
const bool raw_sint_storage = const bool raw_sint_storage =
storage && format == Prospero::GpuEnumValue(Prospero::BufferFormat::k32SInt) && storage && format == Prospero::GpuEnumValue(Prospero::BufferFormat::k32SInt) &&
!image.read && !image.atomic; !image.read && !image.atomic;
const bool uint_descriptor = const bool uint_descriptor = Prospero::IsUintTextureFormat(format) || raw_sint_storage;
Prospero::IsUintTextureFormat(format) || raw_sint_storage;
const auto uint_program = image.kind == ResourceKind::ImageUint || const auto uint_program = image.kind == ResourceKind::ImageUint ||
image.kind == ResourceKind::StorageImageUint; image.kind == ResourceKind::StorageImageUint;
if (uint_descriptor != uint_program && !(image.atomic && uint_program)) { if (uint_descriptor != uint_program && !(image.atomic && uint_program)) {
if (error != nullptr) { if (error != nullptr) {
*error = *error = fmt::format(
fmt::format("image descriptor {} no longer matches specialized format", i); "image descriptor {} no longer matches specialized format: "
"{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x},{:08x}",
i, descriptor.dwords[0], descriptor.dwords[1], descriptor.dwords[2],
descriptor.dwords[3], descriptor.dwords[4], descriptor.dwords[5],
descriptor.dwords[6], descriptor.dwords[7]);
} }
return false; return false;
} }