1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 22:29:15 +01:00

[dxso] Fix uninitialized variables and other static analysis hints

This commit is contained in:
WinterSnowfall 2025-03-08 02:57:02 +02:00
parent c900424d66
commit a79f3bd36e
No known key found for this signature in database
6 changed files with 11 additions and 17 deletions

View File

@ -34,7 +34,7 @@ namespace dxvk {
DxsoAnalysisInfo* m_analysis = nullptr; DxsoAnalysisInfo* m_analysis = nullptr;
DxsoOpcode m_parentOpcode; DxsoOpcode m_parentOpcode = DxsoOpcode::Nop;
}; };

View File

@ -1163,8 +1163,7 @@ namespace dxvk {
return m_vs.oPSize; return m_vs.oPSize;
default: { default: {
DxsoRegisterPointer nullPointer; DxsoRegisterPointer nullPointer = { };
nullPointer.id = 0;
return nullPointer; return nullPointer;
} }
} }
@ -1274,8 +1273,7 @@ namespace dxvk {
default: { default: {
//Logger::warn(str::format("emitGetOperandPtr: unhandled reg type: ", reg.id.type)); //Logger::warn(str::format("emitGetOperandPtr: unhandled reg type: ", reg.id.type));
DxsoRegisterPointer nullPointer; DxsoRegisterPointer nullPointer = { };
nullPointer.id = 0;
return nullPointer; return nullPointer;
} }
} }
@ -2702,7 +2700,7 @@ void DxsoCompiler::emitControlFlowGenericLoop(
const DxsoOpcode opcode = ctx.instruction.opcode; const DxsoOpcode opcode = ctx.instruction.opcode;
DxsoRegisterValue texcoordVar; DxsoRegisterValue texcoordVar;
uint32_t samplerIdx; uint32_t samplerIdx = 0u;
DxsoRegMask vec3Mask(true, true, true, false); DxsoRegMask vec3Mask(true, true, true, false);
DxsoRegMask srcMask (true, true, true, true); DxsoRegMask srcMask (true, true, true, true);

View File

@ -279,7 +279,7 @@ namespace dxvk {
// Predicate registers // Predicate registers
std::array< std::array<
DxsoRegisterPointer, DxsoRegisterPointer,
1> m_pRegs; 1> m_pRegs = { };
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// Array of input values. Since v# and o# registers are indexable // Array of input values. Since v# and o# registers are indexable
@ -313,7 +313,7 @@ namespace dxvk {
// Working tex/coord registers (PS) // Working tex/coord registers (PS)
std::array< std::array<
DxsoRegisterPointer, DxsoRegisterPointer,
DxsoMaxTextureRegs> m_tRegs; DxsoMaxTextureRegs> m_tRegs = { };
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Control flow information. Stores labels for // Control flow information. Stores labels for
@ -327,7 +327,7 @@ namespace dxvk {
//////////// ////////////
// Samplers // Samplers
std::array<DxsoSampler, 17> m_samplers; std::array<DxsoSampler, 17> m_samplers = { };
//////////////////////////////////////////// ////////////////////////////////////////////
// What io regswe need to // What io regswe need to

View File

@ -77,12 +77,12 @@ namespace dxvk {
DxsoCode m_code; DxsoCode m_code;
DxsoIsgn m_isgn; DxsoIsgn m_isgn;
uint32_t m_usedSamplers; uint32_t m_usedSamplers = 0u;
uint32_t m_usedRTs; uint32_t m_usedRTs = 0u;
uint32_t m_textureTypes; uint32_t m_textureTypes = 0u;
DxsoShaderMetaInfo m_meta; DxsoShaderMetaInfo m_meta;
uint32_t m_maxDefinedConst; uint32_t m_maxDefinedConst = 0u;
DxsoDefinedConstants m_constants; DxsoDefinedConstants m_constants;
}; };

View File

@ -23,8 +23,6 @@ namespace dxvk::util {
public: public:
DxvkDebugLabel() = default;
DxvkDebugLabel(const VkDebugUtilsLabelEXT& label, DxvkDebugLabelType type) DxvkDebugLabel(const VkDebugUtilsLabelEXT& label, DxvkDebugLabelType type)
: m_text(label.pLabelName ? label.pLabelName : ""), m_type(type) { : m_text(label.pLabelName ? label.pLabelName : ""), m_type(type) {
for (uint32_t i = 0; i < m_color.size(); i++) for (uint32_t i = 0; i < m_color.size(); i++)

View File

@ -685,8 +685,6 @@ namespace dxvk::bit {
* \brief 48-bit integer storage type * \brief 48-bit integer storage type
*/ */
struct uint48_t { struct uint48_t {
uint48_t() = default;
explicit uint48_t(uint64_t n) explicit uint48_t(uint64_t n)
: a(uint16_t(n)), b(uint16_t(n >> 16)), c(uint16_t(n >> 32)) { } : a(uint16_t(n)), b(uint16_t(n >> 16)), c(uint16_t(n >> 32)) { }