summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-05-22 01:28:09 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-05-30 18:21:01 +0200
commitb76df62c00c28244f2fdd657b809853907f0070f (patch)
treedfba6fc3c4fa662f9ee6825595597596811873ec /src/video_core/renderer_opengl/gl_state.cpp
parentgl_rasterizer: Use GL_QUADS to emulate quads rendering (diff)
downloadyuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar.gz
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar.bz2
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar.lz
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar.xz
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.tar.zst
yuzu-b76df62c00c28244f2fdd657b809853907f0070f.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 7425fbe5d..d86e137ac 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -156,6 +156,10 @@ OpenGLState::OpenGLState() {
polygon_offset.factor = 0.0f;
polygon_offset.units = 0.0f;
polygon_offset.clamp = 0.0f;
+
+ alpha_test.enabled = false;
+ alpha_test.func = GL_ALWAYS;
+ alpha_test.ref = 0.0f;
}
void OpenGLState::ApplyDefaultState() {
@@ -461,6 +465,14 @@ void OpenGLState::ApplyPolygonOffset() const {
}
}
+void OpenGLState::ApplyAlphaTest() const {
+ Enable(GL_ALPHA_TEST, cur_state.alpha_test.enabled, alpha_test.enabled);
+ if (UpdateTie(std::tie(cur_state.alpha_test.func, cur_state.alpha_test.ref),
+ std::tie(alpha_test.func, alpha_test.ref))) {
+ glAlphaFunc(alpha_test.func, alpha_test.ref);
+ }
+}
+
void OpenGLState::ApplyTextures() const {
bool has_delta{};
std::size_t first{};
@@ -533,6 +545,7 @@ void OpenGLState::Apply() const {
ApplyTextures();
ApplySamplers();
ApplyPolygonOffset();
+ ApplyAlphaTest();
}
void OpenGLState::EmulateViewportWithScissor() {