diff --git a/src/graphics/guest_gpu/gpu_format.cpp b/src/graphics/guest_gpu/gpu_format.cpp index 5eb99ff0..4fdaaac8 100644 --- a/src/graphics/guest_gpu/gpu_format.cpp +++ b/src/graphics/guest_gpu/gpu_format.cpp @@ -61,8 +61,8 @@ constexpr FormatInfo kFormatInfo[] = { {BufferFormat::k32_32_32_32UInt, 16, 0, 16, true, true}, {BufferFormat::k32_32_32_32SInt, 16, 0, 16, true, false, true}, {BufferFormat::k32_32_32_32Float, 16, 0, 16, true, false}, - {BufferFormat::k8Srgb, 1, 0, 0, true, false}, - {BufferFormat::k8_8Srgb, 2, 0, 0, true, false}, + {BufferFormat::k8Srgb, 1, 0, 1, true, false}, + {BufferFormat::k8_8Srgb, 2, 0, 2, true, false}, {BufferFormat::k8_8_8_8Srgb, 4, 0, 4, true, false}, {BufferFormat::k9_9_9_5Float, 4, 0, 0, true, false}, {BufferFormat::k5_6_5UNorm, 2, 0, 2, true, false}, diff --git a/tests/ShaderRecompilerComputeTests.cpp b/tests/ShaderRecompilerComputeTests.cpp index e7e3cc0c..2b4ffa7a 100644 --- a/tests/ShaderRecompilerComputeTests.cpp +++ b/tests/ShaderRecompilerComputeTests.cpp @@ -16033,15 +16033,26 @@ public: {Prospero::TileMode::kStandard64KB, TileBlockFamily::Standard64KB}, {Prospero::TileMode::kPrt, TileBlockFamily::Prt64KB}, }; - for (const auto format : - {Prospero::BufferFormat::k8Srgb, Prospero::BufferFormat::k8_8Srgb, - Prospero::BufferFormat::k9_9_9_5Float}) { + struct RenderTargetFormatCase { + Prospero::BufferFormat format; + u32 bytes_per_element; + }; + constexpr RenderTargetFormatCase render_target_formats[] = { + {Prospero::BufferFormat::k8Srgb, 1}, + {Prospero::BufferFormat::k8_8Srgb, 2}, + {Prospero::BufferFormat::k9_9_9_5Float, 0}, + }; + for (const auto &test : render_target_formats) { for (const auto tile : {Prospero::TileMode::kDepth, Prospero::TileMode::kRenderTarget}) { TileTextureBlockLayout texture{}; + const bool supported = + TileGetTextureBlockLayout(test.format, tile, false, texture); Require(name, "RT format policy", - !TileGetTextureBlockLayout(format, tile, false, texture), - "non-render-target format admitted by an RT/depth tile family"); + supported == (test.bytes_per_element != 0) && + (!supported || texture.block.bytes_per_element == + test.bytes_per_element), + "RT/depth tile format support or element size is incorrect"); } } {