summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-25 23:56:17 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 20:48:23 +0100
commitc8f5f54a44e9873134fab74eef97e875b9e6c565 (patch)
treecc900a57edeb1f888593a48a743ea553ad5054ec /src
parentgl_state: Remove front face tracking (diff)
downloadyuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.gz
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.bz2
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.lz
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.xz
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.tar.zst
yuzu-c8f5f54a44e9873134fab74eef97e875b9e6c565.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp9
-rw-r--r--src/video_core/renderer_opengl/gl_state.h6
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp2
4 files changed, 4 insertions, 19 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index e9e9f9794..a080c3e81 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -1020,10 +1020,8 @@ void RasterizerOpenGL::SyncClipCoef() {
void RasterizerOpenGL::SyncCullMode() {
const auto& regs = system.GPU().Maxwell3D().regs;
- state.cull.enabled = regs.cull.enabled != 0;
- if (state.cull.enabled) {
- state.cull.mode = MaxwellToGL::CullFace(regs.cull.cull_face);
- }
+ oglEnable(GL_CULL_FACE, regs.cull.enabled);
+ glCullFace(MaxwellToGL::CullFace(regs.cull.cull_face));
glFrontFace(MaxwellToGL::FrontFace(regs.cull.front_face));
}
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 817676505..08e86b599 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -164,14 +164,6 @@ void OpenGLState::ApplySRgb() {
}
}
-void OpenGLState::ApplyCulling() {
- Enable(GL_CULL_FACE, cur_state.cull.enabled, cull.enabled);
-
- if (UpdateValue(cur_state.cull.mode, cull.mode)) {
- glCullFace(cull.mode);
- }
-}
-
void OpenGLState::ApplyRasterizerDiscard() {
Enable(GL_RASTERIZER_DISCARD, cur_state.rasterizer_discard, rasterizer_discard);
}
@@ -441,7 +433,6 @@ void OpenGLState::Apply() {
ApplyViewport();
ApplyStencilTest();
ApplySRgb();
- ApplyCulling();
ApplyDepth();
ApplyPrimitiveRestart();
ApplyBlending();
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 1b5fde23a..ae30b9565 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -32,11 +32,6 @@ public:
} depth_clamp; // GL_DEPTH_CLAMP
struct {
- bool enabled = false; // GL_CULL_FACE
- GLenum mode = GL_BACK; // GL_CULL_FACE_MODE
- } cull;
-
- struct {
bool test_enabled = false; // GL_DEPTH_TEST
GLboolean write_mask = GL_TRUE; // GL_DEPTH_WRITEMASK
GLenum test_func = GL_LESS; // GL_DEPTH_FUNC
@@ -172,7 +167,6 @@ public:
void ApplyFragmentColorClamp();
void ApplyMultisample();
void ApplySRgb();
- void ApplyCulling();
void ApplyRasterizerDiscard();
void ApplyColorMask();
void ApplyDepth();
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 311053695..3d6125dc1 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -573,6 +573,8 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,
state.Apply();
// TODO: Signal state tracker about these changes
+ glEnable(GL_CULL_FACE);
+ glCullFace(GL_BACK);
glFrontFace(GL_CW);
glNamedBufferSubData(vertex_buffer.handle, 0, sizeof(vertices), std::data(vertices));