summaryrefslogtreecommitdiffstats
path: root/src/render/graphicshelpers/graphicscontext_p.h
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-07-13 14:53:15 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-10-11 13:39:16 +0000
commitcc18c00908801d9c52a5e275cf487fd8cc0efa50 (patch)
treeede65d7b862cc24f348226578025ff47322ff05a /src/render/graphicshelpers/graphicscontext_p.h
parent8b13098e9571c2a09102a36679c502c6670d3cec (diff)
GraphicsContext: simplify active texture handling
Used to be split up into multiple vectors, bitarrays, even hashtables. In fact, all operations that have to do with active textures are identified by the respective texture unit. So there should be exactly one entry for each texture unit that encapsulates all important information. Change-Id: Ib1a0502f5b5f05a24516183b7eedf96a418c43be Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext_p.h')
-rw-r--r--src/render/graphicshelpers/graphicscontext_p.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h
index 647db9e47..c1f561a62 100644
--- a/src/render/graphicshelpers/graphicscontext_p.h
+++ b/src/render/graphicshelpers/graphicscontext_p.h
@@ -266,19 +266,19 @@ private:
QHash<QSurface *, GraphicsHelperInterface*> m_glHelpers;
// active textures, indexed by texture unit
- QVector<uint> m_activeTextures;
- QBitArray m_pinnedTextureUnits;
- QVector<TextureScope> m_textureScopes;
+ struct ActiveTexture {
+ uint textureDna = 0;
+ int score = 0;
+ TextureScope scope = TextureScopeMaterial;
+ bool pinned = false;
+ };
+ QVector<ActiveTexture> m_activeTextures;
// cache some current state, to make sure we don't issue unnecessary GL calls
int m_currClearStencilValue;
float m_currClearDepthValue;
QColor m_currClearColorValue;
- // recency score for all render-textures we've seen. Higher scores
- // mean more recently used.
- QHash<uint, int> m_textureScores;
-
Material* m_material;
QRectF m_viewport;
GLuint m_activeFBO;