diff options
author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-02 04:21:25 +0100 |
---|---|---|
committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-05 00:49:48 +0100 |
commit | 145ae369639af6f91a59b8217c5e9ba42b0c5f0b (patch) | |
tree | bd90ca5b095233fe18fc6f4470d2a44d4a0ad969 /src/video_core/renderer_opengl/gl_state.h | |
parent | Merge pull request #1625 from FernandoS27/astc (diff) | |
download | yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar.gz yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar.bz2 yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar.lz yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar.xz yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.tar.zst yuzu-145ae369639af6f91a59b8217c5e9ba42b0c5f0b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index fe648aff6..a027ca33c 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h @@ -46,11 +46,9 @@ public: } cull; struct { - bool test_enabled; // GL_DEPTH_TEST - GLenum test_func; // GL_DEPTH_FUNC - GLboolean write_mask; // GL_DEPTH_WRITEMASK - GLfloat depth_range_near; // GL_DEPTH_RANGE - GLfloat depth_range_far; // GL_DEPTH_RANGE + bool test_enabled; // GL_DEPTH_TEST + GLenum test_func; // GL_DEPTH_FUNC + GLboolean write_mask; // GL_DEPTH_WRITEMASK } depth; struct { @@ -78,22 +76,28 @@ public: } front, back; } stencil; - struct { + struct Blend { bool enabled; // GL_BLEND + bool separate_alpha; // Independent blend enabled GLenum rgb_equation; // GL_BLEND_EQUATION_RGB GLenum a_equation; // GL_BLEND_EQUATION_ALPHA GLenum src_rgb_func; // GL_BLEND_SRC_RGB GLenum dst_rgb_func; // GL_BLEND_DST_RGB GLenum src_a_func; // GL_BLEND_SRC_ALPHA GLenum dst_a_func; // GL_BLEND_DST_ALPHA + }; + std::array<Blend, Tegra::Engines::Maxwell3D::Regs::NumRenderTargets> blend; - struct { - GLclampf red; - GLclampf green; - GLclampf blue; - GLclampf alpha; - } color; // GL_BLEND_COLOR - } blend; + struct { + bool enabled; + } independant_blend; + + struct { + GLclampf red; + GLclampf green; + GLclampf blue; + GLclampf alpha; + } blend_color; // GL_BLEND_COLOR struct { bool enabled; // GL_LOGIC_OP_MODE @@ -138,6 +142,16 @@ public: GLuint program_pipeline; // GL_PROGRAM_PIPELINE_BINDING } draw; + struct viewport { + GLfloat x; + GLfloat y; + GLfloat width; + GLfloat height; + GLfloat depth_range_near; // GL_DEPTH_RANGE + GLfloat depth_range_far; // GL_DEPTH_RANGE + }; + std::array<viewport, Tegra::Engines::Maxwell3D::Regs::NumRenderTargets> viewports; + struct { bool enabled; // GL_SCISSOR_TEST GLint x; @@ -147,13 +161,6 @@ public: } scissor; struct { - GLint x; - GLint y; - GLsizei width; - GLsizei height; - } viewport; - - struct { float size; // GL_POINT_SIZE } point; @@ -194,11 +201,14 @@ private: void ApplyDepth() const; void ApplyPrimitiveRestart() const; void ApplyStencilTest() const; - void ApplyScissorTest() const; + void ApplyViewport() const; + void ApplyTargetBlending(int target, bool force) const; + void ApplyGlobalBlending() const; void ApplyBlending() const; void ApplyLogicOp() const; void ApplyTextures() const; void ApplySamplers() const; + void ApplyScissor() const; }; } // namespace OpenGL |