diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-12-21 16:04:30 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-07 01:03:47 +0100 |
commit | 7cbac745dcbc42a8bbb19246d4ad98939c3217f8 (patch) | |
tree | d7ac998a896eb6e7a1744b07225fa8cc03e94970 /src/gui/rhi/qrhid3d11.cpp | |
parent | 521fea91690174ddd6340fc6f82554613854b017 (diff) |
rhi: Returns mapping tables by value from QShader
As these are QList and QHash. All existing usages are based on this
anyway, no value in being able to indicate "not available" - an empty
container fulfills the same role.
Change-Id: I8059025fa7a4acb6fc674cd98b16fcafa19ed85d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhid3d11.cpp')
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 74abfdff87..eaaf0c6991 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -4156,8 +4156,7 @@ bool QD3D11GraphicsPipeline::create() return false; } vsByteCode = bytecode; - if (const QShader::NativeResourceBindingMap *map = shaderStage.shader().nativeResourceBindingMap(shaderKey)) - vs.nativeResourceBindingMap = *map; + vs.nativeResourceBindingMap = shaderStage.shader().nativeResourceBindingMap(shaderKey); rhiD->m_shaderCache.insert(shaderStage, QRhiD3D11::Shader(vs.shader, bytecode, vs.nativeResourceBindingMap)); vs.shader->AddRef(); break; @@ -4167,8 +4166,7 @@ bool QD3D11GraphicsPipeline::create() qWarning("Failed to create pixel shader: %s", qPrintable(comErrorMessage(hr))); return false; } - if (const QShader::NativeResourceBindingMap *map = shaderStage.shader().nativeResourceBindingMap(shaderKey)) - fs.nativeResourceBindingMap = *map; + fs.nativeResourceBindingMap = shaderStage.shader().nativeResourceBindingMap(shaderKey); rhiD->m_shaderCache.insert(shaderStage, QRhiD3D11::Shader(fs.shader, bytecode, fs.nativeResourceBindingMap)); fs.shader->AddRef(); break; @@ -4286,8 +4284,7 @@ bool QD3D11ComputePipeline::create() return false; } - if (const QShader::NativeResourceBindingMap *map = m_shaderStage.shader().nativeResourceBindingMap(shaderKey)) - cs.nativeResourceBindingMap = *map; + cs.nativeResourceBindingMap = m_shaderStage.shader().nativeResourceBindingMap(shaderKey); if (rhiD->m_shaderCache.count() >= QRhiD3D11::MAX_SHADER_CACHE_ENTRIES) rhiD->clearShaderCache(); |