summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.h')
-rw-r--r--src/video_core/renderer_opengl/gl_state.h52
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