rsx: Fix up the framebuffer width if the pitch fits scissor but not the clip width
This commit is contained in:
@@ -1519,9 +1519,11 @@ namespace rsx
|
|||||||
u16 corrected_width = umax;
|
u16 corrected_width = umax;
|
||||||
std::vector<u32*> pitch_fixups;
|
std::vector<u32*> pitch_fixups;
|
||||||
|
|
||||||
if (!depth_buffer_unused &&
|
if (!depth_buffer_unused)
|
||||||
layout.zeta_pitch < minimum_zeta_pitch)
|
|
||||||
{
|
{
|
||||||
|
if (layout.zeta_pitch < minimum_zeta_pitch)
|
||||||
|
{
|
||||||
|
// Observed in CoD3 where the depth buffer is clearly misconfigured.
|
||||||
if (layout.zeta_pitch > 64)
|
if (layout.zeta_pitch > 64)
|
||||||
{
|
{
|
||||||
corrected_width = layout.zeta_pitch / depth_texel_size;
|
corrected_width = layout.zeta_pitch / depth_texel_size;
|
||||||
@@ -1534,11 +1536,18 @@ namespace rsx
|
|||||||
layout.zeta_address = 0;
|
layout.zeta_address = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (layout.width * depth_texel_size > layout.zeta_pitch)
|
||||||
|
{
|
||||||
|
// This is ok, misconfigured raster dimensions, but we're only writing the pitch as determined by the scissor
|
||||||
|
corrected_width = layout.zeta_pitch / depth_texel_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!color_buffer_unused)
|
||||||
|
{
|
||||||
for (const auto& index : rsx::utility::get_rtt_indexes(layout.target))
|
for (const auto& index : rsx::utility::get_rtt_indexes(layout.target))
|
||||||
{
|
{
|
||||||
if (!color_buffer_unused &&
|
if (layout.color_pitch[index] < minimum_color_pitch)
|
||||||
layout.color_pitch[index] < minimum_color_pitch)
|
|
||||||
{
|
{
|
||||||
if (layout.color_pitch[index] > 64)
|
if (layout.color_pitch[index] > 64)
|
||||||
{
|
{
|
||||||
@@ -1551,6 +1560,15 @@ namespace rsx
|
|||||||
rsx_log.warning("Misconfigured surface could not fit color buffer %d. Dropping.", index);
|
rsx_log.warning("Misconfigured surface could not fit color buffer %d. Dropping.", index);
|
||||||
layout.color_addresses[index] = 0;
|
layout.color_addresses[index] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (layout.width * color_texel_size > layout.color_pitch[index])
|
||||||
|
{
|
||||||
|
// This is ok, misconfigured raster dimensions, but we're only writing the pitch as determined by the scissor
|
||||||
|
corrected_width = std::min<u16>(corrected_width, layout.color_pitch[index] / color_texel_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user