Update gpu_format.cpp (#1003)
* Update gpu_format.cpp Fix SRGB render-target formats (k8Srgb, k8_8Srgb) Corrects render_target_bytes_per_element for SRGB formats: - k8Srgb: 1 byte (was 0) - k8_8Srgb: 2 bytes (was 0) These formats appear in ChannelLayout::k8 and k8_8 render-target paths. Incorrect RT byte sizes caused TextureCache render-target validation failures in Lucky's Tale * Fix narrow sRGB render-target format tests --------- Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
parent
f53e5d2283
commit
52c8ff18d0
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue