diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index 8c617204b1..468869744e 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -186,17 +186,12 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk const auto depth_format = rsx::method_registers.surface_depth_fmt(); const auto target = rsx::method_registers.surface_color_target(); - const auto required_z_pitch = depth_format == rsx::surface_depth_format::z16 ? clip_horizontal * 2u : clip_horizontal * 4u; + //NOTE: Z buffers with pitch = 64 are valid even if they would not fit (GT HD Concept) const auto required_color_pitch = std::max((u32)rsx::utility::get_packed_pitch(surface_format, clip_horizontal), 64u); if (depth_address) { - //TODO: Verify that buffers <= 16 pixels in X (pitch=64) cannot have a depth buffer - if (zeta_pitch < required_z_pitch || zeta_pitch <= 64) - { - depth_address = 0; - } - else if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none) + if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none) { //Disable depth buffer if depth testing is not enabled, unless a clear command is targeting the depth buffer const bool is_depth_clear = !!(context & rsx::framebuffer_creation_context::context_clear_depth); @@ -213,8 +208,7 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk if (pitchs[index] < required_color_pitch) surface_addresses[index] = 0; - if (surface_addresses[index] == depth_address && - zeta_pitch >= required_z_pitch) + if (surface_addresses[index] == depth_address) { LOG_TRACE(RSX, "Framebuffer at 0x%X has aliasing color/depth targets, zeta_pitch = %d, color_pitch=%d", depth_address, zeta_pitch, pitchs[index]); //TODO: Research clearing both depth AND color @@ -376,11 +370,6 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk if (m_depth_surface_info.depth_format != rsx::surface_depth_format::z16) pitch *= 2; const u32 range = pitch * m_depth_surface_info.height; - - //TODO: Verify that depth surface pitch variance affects results - if (pitch != m_depth_surface_info.pitch) - LOG_WARNING(RSX, "Depth surface pitch does not match computed pitch, %d vs %d", m_depth_surface_info.pitch, pitch); - m_gl_texture_cache.lock_memory_region(std::get<1>(m_rtts.m_bound_depth_stencil), m_depth_surface_info.address, range, m_depth_surface_info.width, m_depth_surface_info.height, pitch, depth_format_gl.format, depth_format_gl.type, true); } diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 18c209d553..8fbc25df7f 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -2425,17 +2425,12 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context) const auto depth_fmt = rsx::method_registers.surface_depth_fmt(); const auto target = rsx::method_registers.surface_color_target(); - const auto required_z_pitch = depth_fmt == rsx::surface_depth_format::z16 ? clip_width * 2 : clip_width * 4; + //NOTE: Z buffers with pitch = 64 are valid even if they would not fit (GT HD Concept) const auto required_color_pitch = std::max((u32)rsx::utility::get_packed_pitch(color_fmt, clip_width), 64u); if (zeta_address) { - //TODO: Verify that buffers <= 16 pixels in X (pitch=64) cannot have a depth buffer - if (zeta_pitch < required_z_pitch || zeta_pitch <= 64) - { - zeta_address = 0; - } - else if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none) + if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none) { //Disable depth buffer if depth testing is not enabled, unless a clear command is targeting the depth buffer const bool is_depth_clear = !!(context & rsx::framebuffer_creation_context::context_clear_depth); @@ -2452,8 +2447,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context) if (surface_pitchs[index] < required_color_pitch) surface_addresses[index] = 0; - if (surface_addresses[index] == zeta_address && - zeta_pitch >= required_z_pitch) + if (surface_addresses[index] == zeta_address) { LOG_TRACE(RSX, "Framebuffer at 0x%X has aliasing color/depth targets, zeta_pitch = %d, color_pitch=%d", zeta_address, zeta_pitch, surface_pitchs[index]); if (context == rsx::framebuffer_creation_context::context_clear_depth || diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index aebce3cc08..72258b5410 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -1581,6 +1581,11 @@ namespace rsx bind(); bind(); bind(); + bind(); + bind(); + bind(); + bind(); + bind(); bind_range(); bind_range(); bind_range();