summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-10-30 01:12:42 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-10-30 01:27:23 +0100
commit28fece8e9bb2e4c95ba93fba3c63489a9e26fb47 (patch)
treec768cf4a7fa0c233aac9a14b7e4419dba16c887c /src/video_core/renderer_opengl/gl_state.cpp
parentMerge pull request #3004 from ReinUsesLisp/maxwell3d-cleanup (diff)
downloadyuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar.gz
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar.bz2
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar.lz
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar.xz
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.tar.zst
yuzu-28fece8e9bb2e4c95ba93fba3c63489a9e26fb47.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp99
1 files changed, 1 insertions, 98 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index bf86b5a0b..88c32bd4f 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -80,104 +80,7 @@ void Enable(GLenum cap, GLuint index, bool& current_value, bool new_value) {
} // namespace
-OpenGLState::OpenGLState() {
- // These all match default OpenGL values
- framebuffer_srgb.enabled = false;
-
- multisample_control.alpha_to_coverage = false;
- multisample_control.alpha_to_one = false;
-
- cull.enabled = false;
- cull.mode = GL_BACK;
- cull.front_face = GL_CCW;
-
- depth.test_enabled = false;
- depth.test_func = GL_LESS;
- depth.write_mask = GL_TRUE;
-
- primitive_restart.enabled = false;
- primitive_restart.index = 0;
-
- for (auto& item : color_mask) {
- item.red_enabled = GL_TRUE;
- item.green_enabled = GL_TRUE;
- item.blue_enabled = GL_TRUE;
- item.alpha_enabled = GL_TRUE;
- }
-
- const auto ResetStencil = [](auto& config) {
- config.test_func = GL_ALWAYS;
- config.test_ref = 0;
- config.test_mask = 0xFFFFFFFF;
- config.write_mask = 0xFFFFFFFF;
- config.action_depth_fail = GL_KEEP;
- config.action_depth_pass = GL_KEEP;
- config.action_stencil_fail = GL_KEEP;
- };
- stencil.test_enabled = false;
- ResetStencil(stencil.front);
- ResetStencil(stencil.back);
-
- for (auto& item : viewports) {
- item.x = 0;
- item.y = 0;
- item.width = 0;
- item.height = 0;
- item.depth_range_near = 0.0f;
- item.depth_range_far = 1.0f;
- item.scissor.enabled = false;
- item.scissor.x = 0;
- item.scissor.y = 0;
- item.scissor.width = 0;
- item.scissor.height = 0;
- }
-
- for (auto& item : blend) {
- item.enabled = true;
- item.rgb_equation = GL_FUNC_ADD;
- item.a_equation = GL_FUNC_ADD;
- item.src_rgb_func = GL_ONE;
- item.dst_rgb_func = GL_ZERO;
- item.src_a_func = GL_ONE;
- item.dst_a_func = GL_ZERO;
- }
-
- independant_blend.enabled = false;
-
- blend_color.red = 0.0f;
- blend_color.green = 0.0f;
- blend_color.blue = 0.0f;
- blend_color.alpha = 0.0f;
-
- logic_op.enabled = false;
- logic_op.operation = GL_COPY;
-
- draw.read_framebuffer = 0;
- draw.draw_framebuffer = 0;
- draw.vertex_array = 0;
- draw.shader_program = 0;
- draw.program_pipeline = 0;
-
- clip_distance = {};
-
- point.size = 1;
-
- fragment_color_clamp.enabled = false;
-
- depth_clamp.far_plane = false;
- depth_clamp.near_plane = false;
-
- polygon_offset.fill_enable = false;
- polygon_offset.line_enable = false;
- polygon_offset.point_enable = false;
- 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;
-}
+OpenGLState::OpenGLState() = default;
void OpenGLState::SetDefaultViewports() {
for (auto& item : viewports) {