diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-30 19:20:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-02 13:14:04 +0200 |
commit | 3080194ae41128e91da59301a7e221303a2f04a5 (patch) | |
tree | 6a3ad11a61255fb5233f65bd220d0704e7f1fb6d /src/gui/rhi/qrhigles2_p_p.h | |
parent | c08592816a04fc864a9e694098beb084a5b37f1c (diff) |
rhi: gl: Attempt to reduce superfluous texture unit bindings
Change-Id: Iccfbe5fe8688245a5ff3f7d46a173638b362a3c8
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhigles2_p_p.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h index 65fb820a36..c380f3bc08 100644 --- a/src/gui/rhi/qrhigles2_p_p.h +++ b/src/gui/rhi/qrhigles2_p_p.h @@ -577,6 +577,12 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer } } computePassState; + struct TextureUnitState { + void *ps; + uint psGeneration; + uint texture; + } textureUnitState[16]; + QVarLengthArray<QByteArray, 4> dataRetainPool; QVarLengthArray<QRhiBufferData, 4> bufferDataRetainPool; QVarLengthArray<QImage, 4> imageRetainPool; @@ -618,6 +624,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer currentSrbGeneration = 0; graphicsPassState.reset(); computePassState.reset(); + memset(textureUnitState, 0, sizeof(textureUnitState)); } }; @@ -807,7 +814,8 @@ public: QRhiPassResourceTracker::TextureStage stage); void executeCommandBuffer(QRhiCommandBuffer *cb); void executeBindGraphicsPipeline(QGles2CommandBuffer *cbD, QGles2GraphicsPipeline *psD); - void bindShaderResources(QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, + void bindShaderResources(QGles2CommandBuffer *cbD, + QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs, QRhiShaderResourceBindings *srb, const uint *dynOfsPairs, int dynOfsCount); QGles2RenderTargetData *enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD, |