Fix all uninitialized variable warnings (C26495)

This commit is contained in:
Pokechu22
2021-09-03 21:43:19 -07:00
parent 525e6b2194
commit 78bfd25964
111 changed files with 638 additions and 651 deletions

View File

@ -26,7 +26,7 @@ private:
struct ActiveQuery
{
ComPtr<ID3D11Query> query;
PerfQueryGroup query_type;
PerfQueryGroup query_type{};
};
void WeakFlush();

View File

@ -34,7 +34,7 @@ private:
ComPtr<ID3D12Resource> m_gpu_buffer;
ComPtr<ID3D12Resource> m_readback_buffer;
StreamBuffer m_upload_buffer;
DescriptorHandle m_gpu_descriptor;
DescriptorHandle m_gpu_descriptor{};
};
} // namespace DX12

View File

@ -66,7 +66,7 @@ private:
u32 m_descriptor_increment_size = 0;
u32 m_current_offset = 0;
D3D12_CPU_DESCRIPTOR_HANDLE m_heap_base_cpu;
D3D12_CPU_DESCRIPTOR_HANDLE m_heap_base_cpu{};
std::unordered_map<SamplerState::StorageType, D3D12_CPU_DESCRIPTOR_HANDLE> m_sampler_map;
};

View File

@ -59,7 +59,7 @@ struct PipelineProgramKeyHash
struct PipelineProgram
{
PipelineProgramKey key;
PipelineProgramKey key{};
SHADER shader;
std::atomic_size_t reference_count{1};
bool binary_retrieved = false;

View File

@ -25,6 +25,6 @@ protected:
void SetFormat(u8 attributeIndex, u8 primitiveType);
void ParseVertex(const PortableVertexDeclaration& vdec, int index);
InputVertexData m_vertex;
InputVertexData m_vertex{};
SetupUnit m_setup_unit;
};

View File

@ -8,12 +8,12 @@
class SetupUnit
{
u8 m_PrimType;
int m_VertexCounter;
u8 m_PrimType = 0;
int m_VertexCounter = 0;
OutputVertexData m_Vertices[3];
OutputVertexData* m_VertPointer[3];
OutputVertexData* m_VertWritePointer;
OutputVertexData* m_VertPointer[3]{};
OutputVertexData* m_VertWritePointer{};
void SetupQuad();
void SetupTriangle();

View File

@ -11,7 +11,7 @@ class Vec3
public:
float x, y, z;
Vec3() {}
Vec3() = default;
explicit Vec3(float f) { x = y = z = f; }
explicit Vec3(const float* f)
{

View File

@ -120,7 +120,7 @@ private:
u64 m_completed_fence_counter = 0;
std::array<FrameResources, NUM_COMMAND_BUFFERS> m_frame_resources;
u32 m_current_frame;
u32 m_current_frame = 0;
// Threaded command buffer execution
// Semaphore determines when a command buffer can be queued

View File

@ -86,7 +86,7 @@ private:
struct SwapChainImage
{
VkImage image;
VkImage image{};
std::unique_ptr<VKTexture> texture;
std::unique_ptr<VKFramebuffer> framebuffer;
};