summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-01-02 22:30:41 -0300
committerGravatar ReinUsesLisp2020-02-28 17:56:42 -0300
commit98c8948b238793271154c1718eaabeaeb2f0bb1b (patch)
tree6c9a3ca4d872d2b03399d2d1110d1bda8f9bebdb /src
parentmaxwell_3d: Use two tables instead of three for dirty flags (diff)
downloadyuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.gz
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.xz
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.zip
gl_rasterizer: Minor sort changes to clearing
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 133ac6c0f..dabb22ae8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -408,13 +408,12 @@ void RasterizerOpenGL::ConfigureClearFramebuffer(bool using_color_fb, bool using
408} 408}
409 409
410void RasterizerOpenGL::Clear() { 410void RasterizerOpenGL::Clear() {
411 const auto& maxwell3d = system.GPU().Maxwell3D(); 411 const auto& gpu = system.GPU().Maxwell3D();
412 412 if (!gpu.ShouldExecute()) {
413 if (!maxwell3d.ShouldExecute()) {
414 return; 413 return;
415 } 414 }
416 415
417 const auto& regs = maxwell3d.regs; 416 const auto& regs = gpu.regs;
418 bool use_color{}; 417 bool use_color{};
419 bool use_depth{}; 418 bool use_depth{};
420 bool use_stencil{}; 419 bool use_stencil{};
@@ -424,14 +423,13 @@ void RasterizerOpenGL::Clear() {
424 use_color = true; 423 use_color = true;
425 } 424 }
426 if (use_color) { 425 if (use_color) {
427 // TODO: Signal state tracker about these changes
428 state_tracker.NotifyColorMask0(); 426 state_tracker.NotifyColorMask0();
429 glColorMaski(0, regs.clear_buffers.R != 0, regs.clear_buffers.G != 0, 427 glColorMaski(0, regs.clear_buffers.R != 0, regs.clear_buffers.G != 0,
430 regs.clear_buffers.B != 0, regs.clear_buffers.A != 0); 428 regs.clear_buffers.B != 0, regs.clear_buffers.A != 0);
431 429
432 SyncFramebufferSRGB();
433 // TODO(Rodrigo): Determine if clamping is used on clears 430 // TODO(Rodrigo): Determine if clamping is used on clears
434 SyncFragmentColorClampState(); 431 SyncFragmentColorClampState();
432 SyncFramebufferSRGB();
435 } 433 }
436 if (regs.clear_buffers.Z) { 434 if (regs.clear_buffers.Z) {
437 ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!"); 435 ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!");
@@ -441,7 +439,7 @@ void RasterizerOpenGL::Clear() {
441 glDepthMask(GL_TRUE); 439 glDepthMask(GL_TRUE);
442 } 440 }
443 if (regs.clear_buffers.S) { 441 if (regs.clear_buffers.S) {
444 ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!"); 442 ASSERT_MSG(regs.zeta_enable, "Tried to clear stencil but buffer is not enabled!");
445 use_stencil = true; 443 use_stencil = true;
446 } 444 }
447 445
@@ -450,20 +448,20 @@ void RasterizerOpenGL::Clear() {
450 return; 448 return;
451 } 449 }
452 450
453 ConfigureClearFramebuffer(use_color, use_depth, use_stencil);
454
455 SyncRasterizeEnable(); 451 SyncRasterizeEnable();
452
456 if (regs.clear_flags.scissor) { 453 if (regs.clear_flags.scissor) {
457 SyncScissorTest(); 454 SyncScissorTest();
458 } 455 }
459 456
460 // TODO: Signal state tracker about these changes 457 // TODO(Rodrigo): Find out if blending affects clearing
461 state_tracker.NotifyBlend0(); 458 state_tracker.NotifyBlend0();
462 // TODO(Rodrigo): Find out if these changes affect clearing
463 glDisablei(GL_BLEND, 0); 459 glDisablei(GL_BLEND, 0);
464 460
465 UNIMPLEMENTED_IF(regs.clear_flags.viewport); 461 UNIMPLEMENTED_IF(regs.clear_flags.viewport);
466 462
463 ConfigureClearFramebuffer(use_color, use_depth, use_stencil);
464
467 if (use_color) { 465 if (use_color) {
468 glClearBufferfv(GL_COLOR, 0, regs.clear_color); 466 glClearBufferfv(GL_COLOR, 0, regs.clear_color);
469 } 467 }