diff options
author | Wieland Hagen <wieland.hagen@kdab.com> | 2016-01-14 18:18:35 +0100 |
---|---|---|
committer | Wieland Hagen <wieland.hagen@kdab.com> | 2016-01-15 13:02:47 +0000 |
commit | 4a93090a7b51da4a1e9f66d9727003fac0df53ac (patch) | |
tree | f0584b66f9b83ff2ed80fec174146d4c491eac63 /src/render/renderstates/renderstates_p.h | |
parent | 0f50b649912d44eb75e37a3f17afcefbec40fba7 (diff) |
QBlendState: Target particular Draw Buffers (glBlendFunci())
There are 3 ways blending can be configured, depending on GL version:
pre-3.0: Globally
3.0-3.3: Individual GL_BLEND for each Draw Buffer, one glBlendFunc
4.0- : Individual GL_BLEND and glBlendFunci for each DrawBuffer
QBlendStates now allow to specify whether the blend state should be
enabled or not, and what Draw Buffer it is specifying. Defaults are
global and enabled.
Removed backend BlendStateSeparate, BlendState is going to handle
both calls.
Task-number: QTBUG-50005
Change-Id: I0059a53db0d629ef9818d933c3f14e5662c1d3df
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/renderstates/renderstates_p.h')
-rw-r--r-- | src/render/renderstates/renderstates_p.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/render/renderstates/renderstates_p.h b/src/render/renderstates/renderstates_p.h index e2fada4ea..0951fa4fb 100644 --- a/src/render/renderstates/renderstates_p.h +++ b/src/render/renderstates/renderstates_p.h @@ -58,28 +58,16 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { namespace Render { -class Q_AUTOTEST_EXPORT BlendState : public GenericState2<BlendState, GLenum, GLenum> +class Q_AUTOTEST_EXPORT BlendState : public GenericState6<BlendState, GLenum, GLenum, GLenum, GLenum, bool, int> { public: virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE; virtual StateMaskSet mask() const Q_DECL_OVERRIDE { return BlendStateMask; } - static BlendState *getOrCreate(GLenum src, GLenum dst); + static BlendState *getOrCreate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha, bool enabled, int buf); private: - BlendState(GLenum src, GLenum dst); -}; - -class Q_AUTOTEST_EXPORT BlendStateSeparate : public GenericState4<BlendStateSeparate, GLenum, GLenum, GLenum, GLenum> -{ -public: - virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE; - virtual StateMaskSet mask() const Q_DECL_OVERRIDE - { return BlendStateMask; } - - static BlendStateSeparate *getOrCreate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -private: - BlendStateSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + BlendState(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha, bool enabled, int buf); }; class Q_AUTOTEST_EXPORT BlendEquation : public GenericState1<BlendEquation, GLenum> |