summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-26 01:04:13 +0200
committerbunnei <bunneidev@gmail.com>2018-10-26 06:42:57 +0200
commit58444a0376f67c38a35fed2b0f67feccff49afd3 (patch)
treee14a7fc0f3bd80faa32c0b7257bb2eb76744374c /src/video_core/renderer_opengl/gl_state.cpp
parentMerge pull request #1533 from FernandoS27/lmem (diff)
downloadyuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar.gz
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar.bz2
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar.lz
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar.xz
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.tar.zst
yuzu-58444a0376f67c38a35fed2b0f67feccff49afd3.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index ba6c6919a..f9d41ca24 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -24,6 +24,9 @@ OpenGLState::OpenGLState() {
depth.depth_range_near = 0.0f;
depth.depth_range_far = 1.0f;
+ primitive_restart.enabled = false;
+ primitive_restart.index = 0;
+
color_mask.red_enabled = GL_TRUE;
color_mask.green_enabled = GL_TRUE;
color_mask.blue_enabled = GL_TRUE;
@@ -127,6 +130,18 @@ void OpenGLState::Apply() const {
glDepthRange(depth.depth_range_near, depth.depth_range_far);
}
+ // Primitive restart
+ if (primitive_restart.enabled != cur_state.primitive_restart.enabled) {
+ if (primitive_restart.enabled) {
+ glEnable(GL_PRIMITIVE_RESTART);
+ } else {
+ glDisable(GL_PRIMITIVE_RESTART);
+ }
+ }
+ if (primitive_restart.index != cur_state.primitive_restart.index) {
+ glPrimitiveRestartIndex(primitive_restart.index);
+ }
+
// Color mask
if (color_mask.red_enabled != cur_state.color_mask.red_enabled ||
color_mask.green_enabled != cur_state.color_mask.green_enabled ||