From 7cbac745dcbc42a8bbb19246d4ad98939c3217f8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 21 Dec 2021 16:04:30 +0100 Subject: 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 --- src/gui/rhi/qrhid3d11.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/gui/rhi/qrhid3d11.cpp') 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(); -- cgit v1.2.3