summaryrefslogtreecommitdiffstats
path: root/src/render/renderstates/renderstates_p.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2016-07-01 23:34:09 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-07-17 18:53:02 +0000
commit2b4bb4fdce0630c71bc84c70f66e3c7943589602 (patch)
treeeaedf0d315f22a760af4f2d80ce844310bbae40d /src/render/renderstates/renderstates_p.h
parent5a2bcb04d3bccdf778826491df5f38371847059f (diff)
RenderStateSet/Node: store a StateVariant
Instead of dealing with pointer. This will make it easier to parallelize submission and simplifies things Change-Id: I4f4f97b070885e3cf635f145bd3d9092b82ca55d Task-number: QTBUG-54423 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/renderstates/renderstates_p.h')
-rw-r--r--src/render/renderstates/renderstates_p.h35
1 files changed, 12 insertions, 23 deletions
diff --git a/src/render/renderstates/renderstates_p.h b/src/render/renderstates/renderstates_p.h
index d8cfb85ff..c0062bb3d 100644
--- a/src/render/renderstates/renderstates_p.h
+++ b/src/render/renderstates/renderstates_p.h
@@ -59,25 +59,17 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
namespace Render {
-template<class State, typename ... Args>
-State *getOrCreateRenderStateImpl(Args... values)
-{
- State state;
- state.set(values...);
- return getOrCreateRenderStateEqualTo<State>(state);
-}
-
class Q_AUTOTEST_EXPORT BlendEquationArguments : public GenericState<BlendEquationArguments, BlendEquationArgumentsMask, GLenum, GLenum, GLenum, GLenum, bool, int>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT BlendEquation : public GenericState<BlendEquation, BlendStateMask, GLenum>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
@@ -85,62 +77,61 @@ public:
class Q_AUTOTEST_EXPORT AlphaFunc : public GenericState<AlphaFunc, AlphaTestMask, GLenum, GLclampf>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT MSAAEnabled : public GenericState<MSAAEnabled, MSAAEnabledStateMask, GLboolean>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT DepthTest : public GenericState<DepthTest, DepthTestStateMask, GLenum>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT NoDepthMask : public GenericState<NoDepthMask, DepthWriteStateMask, GLboolean>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT CullFace : public GenericState<CullFace, CullFaceStateMask, GLenum>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT FrontFace : public GenericState<FrontFace, FrontFaceStateMask, GLenum>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
-class Q_AUTOTEST_EXPORT Dithering : public MaskedRenderState<Dithering, DitheringStateMask>
+class Q_AUTOTEST_EXPORT Dithering : public GenericState<Dithering, DitheringStateMask>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT ScissorTest : public GenericState<ScissorTest, ScissorStateMask, int, int, int, int>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
- bool isPooledImpl() const Q_DECL_NOTHROW Q_DECL_OVERRIDE { return false; }
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT StencilTest : public GenericState<StencilTest, StencilTestStateMask, GLenum, int, uint, GLenum, int, uint>
{
public:
- virtual void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
+ void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
};
class Q_AUTOTEST_EXPORT AlphaCoverage : public GenericState<AlphaCoverage, AlphaCoverageStateMask, GLboolean>
@@ -154,7 +145,6 @@ class Q_AUTOTEST_EXPORT PointSize : public GenericState<PointSize, PointSizeMask
{
public:
void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
- bool isPooledImpl() const Q_DECL_NOTHROW Q_DECL_OVERRIDE { return false; }
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};
@@ -162,7 +152,6 @@ class Q_AUTOTEST_EXPORT PolygonOffset : public GenericState<PolygonOffset, Polyg
{
public:
void apply(GraphicsContext *gc) const Q_DECL_OVERRIDE;
- bool isPooledImpl() const Q_DECL_NOTHROW Q_DECL_OVERRIDE { return false; }
void updateProperty(const char *name, const QVariant &value) Q_DECL_OVERRIDE;
};