Fix uninitialized variable warnings (C26495)

This commit is contained in:
Pokechu22
2023-02-15 19:18:39 -08:00
parent 089eab96d7
commit 8802f96b7e
30 changed files with 182 additions and 180 deletions

View File

@ -40,16 +40,16 @@ enum class AbstractPipelineUsage
struct AbstractPipelineConfig
{
const NativeVertexFormat* vertex_format;
const AbstractShader* vertex_shader;
const AbstractShader* geometry_shader;
const AbstractShader* pixel_shader;
const NativeVertexFormat* vertex_format = nullptr;
const AbstractShader* vertex_shader = nullptr;
const AbstractShader* geometry_shader = nullptr;
const AbstractShader* pixel_shader = nullptr;
RasterizationState rasterization_state;
DepthState depth_state;
BlendingState blending_state;
FramebufferState framebuffer_state;
AbstractPipelineUsage usage;
AbstractPipelineUsage usage = AbstractPipelineUsage::GX;
bool operator==(const AbstractPipelineConfig& rhs) const
{

View File

@ -29,10 +29,10 @@ private:
{
void operator()(T* ptr);
};
std::unique_ptr<TransformedVertex[], BufferDeleter<TransformedVertex>> m_transform_buffer;
std::unique_ptr<TransformedVertex[], BufferDeleter<TransformedVertex>> m_transform_buffer{};
u32 m_transform_buffer_size = 0;
std::array<std::array<TransformFunction, 2>, 2> m_transform_table;
std::array<std::array<TransformFunction, 2>, 2> m_transform_table{};
Common::EnumMap<Common::EnumMap<CullFunction, CullMode::All>,
OpcodeDecoder::Primitive::GX_DRAW_TRIANGLE_FAN>
m_cull_table;
m_cull_table{};
};

View File

@ -69,7 +69,7 @@ private:
std::vector<std::unique_ptr<AbstractTexture>> m_imgui_textures;
std::unique_ptr<AbstractPipeline> m_imgui_pipeline;
std::mutex m_imgui_mutex;
u64 m_imgui_last_frame_time;
u64 m_imgui_last_frame_time = 0;
u32 m_backbuffer_width = 1;
u32 m_backbuffer_height = 1;

View File

@ -54,9 +54,9 @@ private:
mutable std::shared_mutex m_time_lock;
u8 m_time_index = 0;
std::array<TimePoint, 256> m_real_times;
std::array<TimePoint, 256> m_cpu_times;
DT m_time_sleeping;
std::array<TimePoint, 256> m_real_times{};
std::array<TimePoint, 256> m_cpu_times{};
DT m_time_sleeping{};
};
extern PerformanceMetrics g_perf_metrics;

View File

@ -53,7 +53,7 @@ union RasterizationState
BitField<0, 2, CullMode> cullmode;
BitField<3, 2, PrimitiveType> primitive;
u32 hex;
u32 hex = 0;
};
union FramebufferState
@ -80,7 +80,7 @@ union FramebufferState
BitField<16, 8, u32> samples;
BitField<24, 1, u32> per_sample_shading;
u32 hex;
u32 hex = 0;
};
union DepthState
@ -109,7 +109,7 @@ union DepthState
BitField<1, 1, u32> updateenable;
BitField<2, 3, CompareMode> func;
u32 hex;
u32 hex = 0;
};
union BlendingState
@ -155,7 +155,7 @@ union BlendingState
bool RequiresDualSrc() const;
u32 hex;
u32 hex = 0;
};
struct SamplerState
@ -200,14 +200,14 @@ struct SamplerState
BitField<8, 16, s32> lod_bias; // multiplied by 256, higher precision than normal
BitField<24, 1, bool, u32> lod_clamp; // TODO: This isn't currently implemented
BitField<25, 1, bool, u32> anisotropic_filtering; // TODO: This doesn't use the BP one yet
u32 hex;
u32 hex = 0;
};
union TM1
{
// Min is guaranteed to be less than or equal to max
BitField<0, 8, u32> min_lod; // multiplied by 16
BitField<8, 8, u32> max_lod; // multiplied by 16
u32 hex;
u32 hex = 0;
};
TM0 tm0;

View File

@ -10,22 +10,22 @@
struct Statistics
{
int num_pixel_shaders_created;
int num_pixel_shaders_alive;
int num_vertex_shaders_created;
int num_vertex_shaders_alive;
int num_pixel_shaders_created = 0;
int num_pixel_shaders_alive = 0;
int num_vertex_shaders_created = 0;
int num_vertex_shaders_alive = 0;
int num_textures_created;
int num_textures_uploaded;
int num_textures_alive;
int num_textures_created = 0;
int num_textures_uploaded = 0;
int num_textures_alive = 0;
int num_vertex_loaders;
int num_vertex_loaders = 0;
std::array<float, 6> proj;
std::array<float, 16> gproj;
std::array<float, 16> g2proj;
std::array<float, 6> proj{};
std::array<float, 16> gproj{};
std::array<float, 16> g2proj{};
std::vector<BPFunctions::ScissorResult> scissors;
std::vector<BPFunctions::ScissorResult> scissors{};
size_t current_scissor = 0; // 0 => all, otherwise index + 1
int scissor_scale = 10;
int scissor_expected_count = 0;
@ -37,44 +37,44 @@ struct Statistics
struct ThisFrame
{
int num_bp_loads;
int num_cp_loads;
int num_xf_loads;
int num_bp_loads = 0;
int num_cp_loads = 0;
int num_xf_loads = 0;
int num_bp_loads_in_dl;
int num_cp_loads_in_dl;
int num_xf_loads_in_dl;
int num_bp_loads_in_dl = 0;
int num_cp_loads_in_dl = 0;
int num_xf_loads_in_dl = 0;
int num_prims;
int num_dl_prims;
int num_shader_changes;
int num_prims = 0;
int num_dl_prims = 0;
int num_shader_changes = 0;
int num_primitive_joins;
int num_draw_calls;
int num_primitive_joins = 0;
int num_draw_calls = 0;
int num_dlists_called;
int num_dlists_called = 0;
int bytes_vertex_streamed;
int bytes_index_streamed;
int bytes_uniform_streamed;
int bytes_vertex_streamed = 0;
int bytes_index_streamed = 0;
int bytes_uniform_streamed = 0;
int num_triangles_clipped;
int num_triangles_in;
int num_triangles_rejected;
int num_triangles_culled;
int num_drawn_objects;
int rasterized_pixels;
int num_triangles_drawn;
int num_vertices_loaded;
int tev_pixels_in;
int tev_pixels_out;
int num_triangles_clipped = 0;
int num_triangles_in = 0;
int num_triangles_rejected = 0;
int num_triangles_culled = 0;
int num_drawn_objects = 0;
int rasterized_pixels = 0;
int num_triangles_drawn = 0;
int num_vertices_loaded = 0;
int tev_pixels_in = 0;
int tev_pixels_out = 0;
int num_efb_peeks;
int num_efb_pokes;
int num_efb_peeks = 0;
int num_efb_pokes = 0;
int num_draw_done;
int num_token;
int num_token_int;
int num_draw_done = 0;
int num_token = 0;
int num_token_int = 0;
};
ThisFrame this_frame;
void ResetFrame();

View File

@ -28,21 +28,21 @@ struct PresentInfo
};
// The number of (unique) frames since the emulated console booted
u64 frame_count;
u64 frame_count = 0;
// The number of presents since the video backend was initialized.
// never goes backwards.
u64 present_count;
u64 present_count = 0;
// The frame is identical to the previous frame
PresentReason reason;
PresentReason reason = PresentReason::Immediate;
// The exact emulated time of the when real hardware would have presented this frame
// FIXME: Immediate should predict the timestamp of this present
u64 emulated_timestamp;
u64 emulated_timestamp = 0;
// TODO:
// u64 intended_present_time;
// u64 intended_present_time = 0;
// AfterPresent only: The actual time the frame was presented
u64 actual_present_time = 0;