From 45a41183dd5a31573df2649a1d7a4927e587e616 Mon Sep 17 00:00:00 2001 From: WinterSnowfall Date: Sat, 8 Mar 2025 17:30:12 +0200 Subject: [PATCH] [d3d11] Fix a few static analysis nits --- src/d3d11/d3d11_cuda.h | 20 ++++++++++---------- src/d3d11/d3d11_device.cpp | 2 +- src/d3d11/d3d11_device.h | 2 +- src/d3d11/d3d11_fence.cpp | 4 ++-- src/dxbc/dxbc_compiler.cpp | 3 ++- src/dxbc/dxbc_decoder.h | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/d3d11/d3d11_cuda.h b/src/d3d11/d3d11_cuda.h index 8e0c35c73..59c5b7514 100644 --- a/src/d3d11/d3d11_cuda.h +++ b/src/d3d11/d3d11_cuda.h @@ -49,14 +49,14 @@ namespace dxvk { CubinShaderLaunchInfo() = default; - CubinShaderLaunchInfo(CubinShaderLaunchInfo&& other) { - shader = std::move(other.shader); - params = std::move(other.params); - paramSize = std::move(other.paramSize); - nvxLaunchInfo = std::move(other.nvxLaunchInfo); - cuLaunchConfig = other.cuLaunchConfig; - buffers = std::move(other.buffers); - images = std::move(other.images); + CubinShaderLaunchInfo(CubinShaderLaunchInfo&& other) + : shader ( std::move(other.shader) ) + , params ( std::move(other.params) ) + , paramSize ( std::move(other.paramSize) ) + , nvxLaunchInfo ( std::move(other.nvxLaunchInfo) ) + , cuLaunchConfig ( other.cuLaunchConfig ) + , buffers ( std::move(other.buffers) ) + , images ( std::move(other.images) ) { other.cuLaunchConfig[1] = nullptr; other.cuLaunchConfig[3] = nullptr; other.nvxLaunchInfo.pExtras = nullptr; @@ -68,9 +68,9 @@ namespace dxvk { Com shader; std::vector params; - size_t paramSize; + size_t paramSize = 0; VkCuLaunchInfoNVX nvxLaunchInfo = { VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX }; - std::array cuLaunchConfig; + std::array cuLaunchConfig = { }; std::vector, DxvkAccessFlags>> buffers; std::vector, DxvkAccessFlags>> images; diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 3ba2b99e2..ec948919c 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -2012,7 +2012,7 @@ namespace dxvk { HRESULT D3D11Device::CreateShaderModule( D3D11CommonShader* pShaderModule, - DxvkShaderKey ShaderKey, + const DxvkShaderKey& ShaderKey, const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, diff --git a/src/d3d11/d3d11_device.h b/src/d3d11/d3d11_device.h index 66baa6add..f55da518d 100644 --- a/src/d3d11/d3d11_device.h +++ b/src/d3d11/d3d11_device.h @@ -521,7 +521,7 @@ namespace dxvk { HRESULT CreateShaderModule( D3D11CommonShader* pShaderModule, - DxvkShaderKey ShaderKey, + const DxvkShaderKey& ShaderKey, const void* pShaderBytecode, size_t BytecodeLength, ID3D11ClassLinkage* pClassLinkage, diff --git a/src/d3d11/d3d11_fence.cpp b/src/d3d11/d3d11_fence.cpp index 3eeb69467..f974b1e6c 100644 --- a/src/d3d11/d3d11_fence.cpp +++ b/src/d3d11/d3d11_fence.cpp @@ -9,10 +9,10 @@ namespace dxvk { UINT64 InitialValue, D3D11_FENCE_FLAG Flags, HANDLE hFence) - : D3D11DeviceChild(pDevice) { + : D3D11DeviceChild ( pDevice ) + , m_flags ( Flags ) { DxvkFenceCreateInfo fenceInfo; fenceInfo.initialValue = InitialValue; - m_flags = Flags; if (Flags & D3D11_FENCE_FLAG_SHARED) { fenceInfo.sharedType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT; diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 2bcb0a31f..2862c7343 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -5184,7 +5184,8 @@ namespace dxvk { if (modifiers.saturate) { DxbcRegMask mask; - DxbcRegisterValue vec0, vec1; + DxbcRegisterValue vec0 = { }; + DxbcRegisterValue vec1 = { }; if (value.type.ctype == DxbcScalarType::Float32) { mask = DxbcRegMask::firstN(value.type.ccount); diff --git a/src/dxbc/dxbc_decoder.h b/src/dxbc/dxbc_decoder.h index 771837152..f9c2fe116 100644 --- a/src/dxbc/dxbc_decoder.h +++ b/src/dxbc/dxbc_decoder.h @@ -480,7 +480,7 @@ namespace dxvk { private: - DxbcShaderInstruction m_instruction; + DxbcShaderInstruction m_instruction = { }; std::array m_dstOperands; std::array m_srcOperands;