diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-26 12:03:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-31 12:42:10 +0000 |
commit | ea22206baf208d3a811279b7fe5c1fe3396d0be3 (patch) | |
tree | 20109cd20dde8c25d0edb3229f42f8a22d4b76eb /src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp | |
parent | c9cffe61291d265e05f05087275daa6625b1aea2 (diff) |
D3D12: Drop QVectors from QSGD3D12Engine
Results in a more than 3x drop (and now below GL, as expected) in CPU usage
in the 500 Image elements test.
There is zero value in using a dynamic data structure for these anyhow,
apart from getting == and qHash. However, writing our own hash provides
further opportunities for optimizing, for instance there is not much point
in hashing the individual input elements since the same shader code pointers
imply that the input elements match too. Thus hashing becomes faster without
more collisions in practice.
Change-Id: Iae766bd44d30ec37080369c8b37677e633c37a88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp')
-rw-r--r-- | src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp index f76927c0bd..e870d8a7f1 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderer.cpp @@ -75,7 +75,6 @@ QSGD3D12Renderer::QSGD3D12Renderer(QSGRenderContext *context) m_cboData(4096) { setNodeUpdater(new DummyUpdater); - m_freshPipelineState.shaders.rootSig.textureViews.reserve(4); } QSGD3D12Renderer::~QSGD3D12Renderer() @@ -554,7 +553,7 @@ void QSGD3D12Renderer::renderElement(int elementIndex) void QSGD3D12Renderer::setInputLayout(const QSGGeometry *g, QSGD3D12PipelineState *pipelineState) { - pipelineState->inputElements.resize(g->attributeCount()); + pipelineState->inputElementCount = g->attributeCount(); const QSGGeometry::Attribute *attrs = g->attributes(); quint32 offset = 0; for (int i = 0; i < g->attributeCount(); ++i) { |