1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

rsx:: fixes for framebuffer setup

- provide a DSV if depth and/or stencil testing is enabled
This commit is contained in:
kd-11 2017-12-02 15:15:03 +03:00
parent cdd4fd9867
commit 960f26f84e
3 changed files with 18 additions and 19 deletions

View File

@ -168,10 +168,8 @@ void GLGSRender::begin()
{
rsx::thread::begin();
if (skip_frame)
return;
if (conditional_render_enabled && conditional_render_test_failed)
if (skip_frame ||
(conditional_render_enabled && conditional_render_test_failed))
return;
init_buffers(rsx::framebuffer_creation_context::context_draw);
@ -196,7 +194,9 @@ void GLGSRender::end()
{
std::chrono::time_point<steady_clock> state_check_start = steady_clock::now();
if (skip_frame || !framebuffer_status_valid || (conditional_render_enabled && conditional_render_test_failed) || !check_program_state())
if (skip_frame || !framebuffer_status_valid ||
(conditional_render_enabled && conditional_render_test_failed) ||
!check_program_state())
{
rsx::thread::end();
return;

View File

@ -191,7 +191,9 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk
if (depth_address)
{
if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none)
if (!rsx::method_registers.depth_test_enabled() &&
!rsx::method_registers.stencil_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);
@ -214,7 +216,7 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool sk
//TODO: Research clearing both depth AND color
//TODO: If context is creation_draw, deal with possibility of a lost buffer clear
if (context == rsx::framebuffer_creation_context::context_clear_depth ||
rsx::method_registers.depth_test_enabled() ||
rsx::method_registers.depth_test_enabled() || rsx::method_registers.stencil_test_enabled() ||
(!rsx::method_registers.color_write_enabled() && rsx::method_registers.depth_write_enabled()))
{
// Use address for depth data

View File

@ -924,7 +924,8 @@ void VKGSRender::begin()
{
rsx::thread::begin();
if (skip_frame || renderer_unavailable)
if (skip_frame || renderer_unavailable ||
(conditional_render_enabled && conditional_render_test_failed))
return;
init_buffers(rsx::framebuffer_creation_context::context_draw);
@ -1089,20 +1090,14 @@ void VKGSRender::close_render_pass()
void VKGSRender::end()
{
if (skip_frame || !framebuffer_status_valid || renderer_unavailable)
if (skip_frame || !framebuffer_status_valid || renderer_unavailable ||
(conditional_render_enabled && conditional_render_test_failed) ||
!check_program_status())
{
rsx::thread::end();
return;
}
//Load program here since it is dependent on vertex state
if (!check_program_status())
{
LOG_ERROR(RSX, "No valid program bound to pipeline. Skipping draw");
rsx::thread::end();
return;
}
//Programs data is dependent on vertex state
std::chrono::time_point<steady_clock> vertex_start = steady_clock::now();
auto upload_info = upload_vertex_data();
@ -2434,7 +2429,9 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
if (zeta_address)
{
if (!rsx::method_registers.depth_test_enabled() && target != rsx::surface_target::none)
if (!rsx::method_registers.depth_test_enabled() &&
!rsx::method_registers.stencil_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);
@ -2455,7 +2452,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
{
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 ||
rsx::method_registers.depth_test_enabled() ||
rsx::method_registers.depth_test_enabled() || rsx::method_registers.stencil_test_enabled() ||
(!rsx::method_registers.color_write_enabled() && rsx::method_registers.depth_write_enabled()))
{
// Use address for depth data