diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-04 13:52:08 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-05 09:42:12 +0000 |
commit | 3e35ea9dcf648482415a6b0c7e968e65502bdd94 (patch) | |
tree | 78f738c9b6f8ed7edebca6321c532336d66a560a /src/plugins/scenegraph | |
parent | 183eb088de2118f3b47bf95dbca11854e7381dde (diff) |
D3D12: Fix descriptor range reference
Prevent it from going out of scope.
Change-Id: I230937cdb59545e04a7da64a6a68970a2e1f5522
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/scenegraph')
-rw-r--r-- | src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp index 001e74b396..640c2f0d3c 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp @@ -1626,17 +1626,17 @@ void QSGD3D12EnginePrivate::finalizePipeline(const QSGD3D12PipelineState &pipeli rootParams[0].Descriptor.RegisterSpace = 0; ++rootParamCount; + D3D12_DESCRIPTOR_RANGE tvDescRange; if (pipelineState.shaders.rootSig.textureViewCount > 0) { rootParams[rootParamCount].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; rootParams[rootParamCount].ShaderVisibility = D3D12_SHADER_VISIBILITY_PIXEL; rootParams[rootParamCount].DescriptorTable.NumDescriptorRanges = 1; - D3D12_DESCRIPTOR_RANGE descRange; - descRange.RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; - descRange.NumDescriptors = pipelineState.shaders.rootSig.textureViewCount; - descRange.BaseShaderRegister = 0; // t0, t1, ... - descRange.RegisterSpace = 0; - descRange.OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; - rootParams[rootParamCount].DescriptorTable.pDescriptorRanges = &descRange; + tvDescRange.RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; + tvDescRange.NumDescriptors = pipelineState.shaders.rootSig.textureViewCount; + tvDescRange.BaseShaderRegister = 0; // t0, t1, ... + tvDescRange.RegisterSpace = 0; + tvDescRange.OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; + rootParams[rootParamCount].DescriptorTable.pDescriptorRanges = &tvDescRange; ++rootParamCount; } |