summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-01-03 02:30:41 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 21:56:42 +0100
commit98c8948b238793271154c1718eaabeaeb2f0bb1b (patch)
tree6c9a3ca4d872d2b03399d2d1110d1bda8f9bebdb /src
parentmaxwell_3d: Use two tables instead of three for dirty flags (diff)
downloadyuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.gz
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.bz2
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.lz
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.xz
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.tar.zst
yuzu-98c8948b238793271154c1718eaabeaeb2f0bb1b.zip
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
}
void RasterizerOpenGL::Clear() {
- const auto& maxwell3d = system.GPU().Maxwell3D();
-
- if (!maxwell3d.ShouldExecute()) {
+ const auto& gpu = system.GPU().Maxwell3D();
+ if (!gpu.ShouldExecute()) {
return;
}
- const auto& regs = maxwell3d.regs;
+ const auto& regs = gpu.regs;
bool use_color{};
bool use_depth{};
bool use_stencil{};
@@ -424,14 +423,13 @@ void RasterizerOpenGL::Clear() {
use_color = true;
}
if (use_color) {
- // TODO: Signal state tracker about these changes
state_tracker.NotifyColorMask0();
glColorMaski(0, regs.clear_buffers.R != 0, regs.clear_buffers.G != 0,
regs.clear_buffers.B != 0, regs.clear_buffers.A != 0);
- SyncFramebufferSRGB();
// TODO(Rodrigo): Determine if clamping is used on clears
SyncFragmentColorClampState();
+ SyncFramebufferSRGB();
}
if (regs.clear_buffers.Z) {
ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!");
@@ -441,7 +439,7 @@ void RasterizerOpenGL::Clear() {
glDepthMask(GL_TRUE);
}
if (regs.clear_buffers.S) {
- ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!");
+ ASSERT_MSG(regs.zeta_enable, "Tried to clear stencil but buffer is not enabled!");
use_stencil = true;
}
@@ -450,20 +448,20 @@ void RasterizerOpenGL::Clear() {
return;
}
- ConfigureClearFramebuffer(use_color, use_depth, use_stencil);
-
SyncRasterizeEnable();
+
if (regs.clear_flags.scissor) {
SyncScissorTest();
}
- // TODO: Signal state tracker about these changes
+ // TODO(Rodrigo): Find out if blending affects clearing
state_tracker.NotifyBlend0();
- // TODO(Rodrigo): Find out if these changes affect clearing
glDisablei(GL_BLEND, 0);
UNIMPLEMENTED_IF(regs.clear_flags.viewport);
+ ConfigureClearFramebuffer(use_color, use_depth, use_stencil);
+
if (use_color) {
glClearBufferfv(GL_COLOR, 0, regs.clear_color);
}