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

@ -484,12 +484,14 @@ public:
m_width = WidthSpecifier::Width64Bit; m_width = WidthSpecifier::Width64Bit;
if (shift == 64) if (shift == 64)
m_shift = 0; m_shift = 0;
m_extend = ExtendSpecifier::UXTX;
} }
else else
{ {
m_width = WidthSpecifier::Width32Bit; m_width = WidthSpecifier::Width32Bit;
if (shift == 32) if (shift == 32)
m_shift = 0; m_shift = 0;
m_extend = ExtendSpecifier::UXTW;
} }
} }
ARM64Reg GetReg() const { return m_destReg; } ARM64Reg GetReg() const { return m_destReg; }

View File

@ -31,7 +31,7 @@ struct InstructionAttributes
struct TraceOutput struct TraceOutput
{ {
u32 address; u32 address = 0;
std::optional<u32> memory_target = std::nullopt; std::optional<u32> memory_target = std::nullopt;
std::string instruction; std::string instruction;
}; };

View File

@ -160,8 +160,8 @@ public:
return GetSystemTimeFAT(); return GetSystemTimeFAT();
} }
File::IOFile* m_image; File::IOFile* m_image = nullptr;
bool m_deterministic; bool m_deterministic = false;
}; };
} // namespace } // namespace

View File

@ -124,7 +124,7 @@ struct AudioInterfaceState::Data
u32 ais_sample_rate_divisor = Mixer::FIXED_SAMPLE_RATE_DIVIDEND / 48000; u32 ais_sample_rate_divisor = Mixer::FIXED_SAMPLE_RATE_DIVIDEND / 48000;
u32 aid_sample_rate_divisor = Mixer::FIXED_SAMPLE_RATE_DIVIDEND / 32000; u32 aid_sample_rate_divisor = Mixer::FIXED_SAMPLE_RATE_DIVIDEND / 32000;
CoreTiming::EventType* event_type_ai; CoreTiming::EventType* event_type_ai = nullptr;
}; };
AudioInterfaceState::AudioInterfaceState() : m_data(std::make_unique<Data>()) AudioInterfaceState::AudioInterfaceState() : m_data(std::make_unique<Data>())

View File

@ -137,16 +137,16 @@ struct DSPState::Data
// Contains bitfields for some stuff we don't care about (and nothing ever reads): // Contains bitfields for some stuff we don't care about (and nothing ever reads):
// CAS latency/burst length/addressing mode/write mode // CAS latency/burst length/addressing mode/write mode
// We care about the LSB tho. It indicates that the ARAM controller has finished initializing // We care about the LSB tho. It indicates that the ARAM controller has finished initializing
u16 aram_mode; u16 aram_mode = 0;
u16 aram_refresh; u16 aram_refresh = 0;
int dsp_slice = 0; int dsp_slice = 0;
std::unique_ptr<DSPEmulator> dsp_emulator; std::unique_ptr<DSPEmulator> dsp_emulator;
bool is_lle = false; bool is_lle = false;
CoreTiming::EventType* event_type_generate_dsp_interrupt; CoreTiming::EventType* event_type_generate_dsp_interrupt = nullptr;
CoreTiming::EventType* event_type_complete_aram; CoreTiming::EventType* event_type_complete_aram = nullptr;
}; };
DSPState::DSPState() : m_data(std::make_unique<Data>()) DSPState::DSPState() : m_data(std::make_unique<Data>())

View File

@ -138,11 +138,11 @@ struct DVDInterfaceState::Data
// Hardware registers // Hardware registers
UDISR DISR; UDISR DISR;
UDICVR DICVR; UDICVR DICVR;
u32 DICMDBUF[3]; std::array<u32, 3> DICMDBUF{};
u32 DIMAR; u32 DIMAR = 0;
u32 DILENGTH; u32 DILENGTH = 0;
UDICR DICR; UDICR DICR;
u32 DIIMMBUF; u32 DIIMMBUF = 0;
UDICFG DICFG; UDICFG DICFG;
StreamADPCM::ADPCMDecoder adpcm_decoder; StreamADPCM::ADPCMDecoder adpcm_decoder;
@ -150,36 +150,36 @@ struct DVDInterfaceState::Data
// DTK // DTK
bool stream = false; bool stream = false;
bool stop_at_track_end = false; bool stop_at_track_end = false;
u64 audio_position; u64 audio_position = 0;
u64 current_start; u64 current_start = 0;
u32 current_length; u32 current_length = 0;
u64 next_start; u64 next_start = 0;
u32 next_length; u32 next_length = 0;
u32 pending_samples; u32 pending_samples = 0;
bool enable_dtk = false; bool enable_dtk = false;
u8 dtk_buffer_length = 0; // TODO: figure out how this affects the regular buffer u8 dtk_buffer_length = 0; // TODO: figure out how this affects the regular buffer
// Disc drive state // Disc drive state
DriveState drive_state; DriveState drive_state = DriveState::Ready;
DriveError error_code; DriveError error_code = DriveError::None;
u64 disc_end_offset; u64 disc_end_offset = 0;
// Disc drive timing // Disc drive timing
u64 read_buffer_start_time; u64 read_buffer_start_time = 0;
u64 read_buffer_end_time; u64 read_buffer_end_time = 0;
u64 read_buffer_start_offset; u64 read_buffer_start_offset = 0;
u64 read_buffer_end_offset; u64 read_buffer_end_offset = 0;
// Disc changing // Disc changing
std::string disc_path_to_insert; std::string disc_path_to_insert;
std::vector<std::string> auto_disc_change_paths; std::vector<std::string> auto_disc_change_paths;
size_t auto_disc_change_index; size_t auto_disc_change_index = 0;
// Events // Events
CoreTiming::EventType* finish_executing_command; CoreTiming::EventType* finish_executing_command = nullptr;
CoreTiming::EventType* auto_change_disc; CoreTiming::EventType* auto_change_disc = nullptr;
CoreTiming::EventType* eject_disc; CoreTiming::EventType* eject_disc = nullptr;
CoreTiming::EventType* insert_disc; CoreTiming::EventType* insert_disc = nullptr;
}; };
DVDInterfaceState::DVDInterfaceState() : m_data(std::make_unique<Data>()) DVDInterfaceState::DVDInterfaceState() : m_data(std::make_unique<Data>())

View File

@ -76,7 +76,7 @@ static void FinishRead(Core::System& system, u64 id, s64 cycles_late);
struct DVDThreadState::Data struct DVDThreadState::Data
{ {
CoreTiming::EventType* finish_read; CoreTiming::EventType* finish_read = nullptr;
u64 next_id = 0; u64 next_id = 0;

View File

@ -18,6 +18,6 @@ public:
private: private:
DiscIO::Partition m_previous_partition; DiscIO::Partition m_previous_partition;
u64 m_previous_file_offset; u64 m_previous_file_offset = 0;
}; };
} // namespace FileMonitor } // namespace FileMonitor

View File

@ -29,10 +29,10 @@ namespace ExpansionInterface
{ {
struct ExpansionInterfaceState::Data struct ExpansionInterfaceState::Data
{ {
CoreTiming::EventType* event_type_change_device; CoreTiming::EventType* event_type_change_device = nullptr;
CoreTiming::EventType* event_type_update_interrupts; CoreTiming::EventType* event_type_update_interrupts = nullptr;
std::array<std::unique_ptr<CEXIChannel>, MAX_EXI_CHANNELS> channels; std::array<std::unique_ptr<CEXIChannel>, MAX_EXI_CHANNELS> channels{};
bool using_overridden_sram = false; bool using_overridden_sram = false;
}; };

View File

@ -57,7 +57,7 @@ private:
void SetGatherPipeCount(size_t size); void SetGatherPipeCount(size_t size);
// More room for the fastmodes // More room for the fastmodes
alignas(GATHER_PIPE_SIZE) u8 m_gather_pipe[GATHER_PIPE_EXTRA_SIZE]; alignas(GATHER_PIPE_SIZE) u8 m_gather_pipe[GATHER_PIPE_EXTRA_SIZE]{};
Core::System& m_system; Core::System& m_system;
}; };

View File

@ -201,19 +201,19 @@ union USIEXIClockCount
struct SerialInterfaceState::Data struct SerialInterfaceState::Data
{ {
CoreTiming::EventType* event_type_change_device; CoreTiming::EventType* event_type_change_device = nullptr;
CoreTiming::EventType* event_type_tranfer_pending; CoreTiming::EventType* event_type_tranfer_pending = nullptr;
std::array<CoreTiming::EventType*, MAX_SI_CHANNELS> event_types_device; std::array<CoreTiming::EventType*, MAX_SI_CHANNELS> event_types_device{};
// User-configured device type. possibly overridden by TAS/Netplay // User-configured device type. possibly overridden by TAS/Netplay
std::array<std::atomic<SIDevices>, MAX_SI_CHANNELS> desired_device_types; std::array<std::atomic<SIDevices>, MAX_SI_CHANNELS> desired_device_types{};
std::array<SSIChannel, MAX_SI_CHANNELS> channel; std::array<SSIChannel, MAX_SI_CHANNELS> channel{};
USIPoll poll; USIPoll poll;
USIComCSR com_csr; USIComCSR com_csr;
USIStatusReg status_reg; USIStatusReg status_reg;
USIEXIClockCount exi_clock_count; USIEXIClockCount exi_clock_count;
std::array<u8, 128> si_buffer; std::array<u8, 128> si_buffer{};
}; };
SerialInterfaceState::SerialInterfaceState() : m_data(std::make_unique<Data>()) SerialInterfaceState::SerialInterfaceState() : m_data(std::make_unique<Data>())

View File

@ -122,9 +122,9 @@ struct SramSettingsEx
struct Sram struct Sram
{ {
Common::BigEndianValue<u32> rtc; Common::BigEndianValue<u32> rtc{};
SramSettings settings; SramSettings settings{};
SramSettingsEx settings_ex; SramSettingsEx settings_ex{};
// Allow access to this entire structure as a raw blob // Allow access to this entire structure as a raw blob
// Typical union-with-byte-array method can't be used here on GCC // Typical union-with-byte-array method can't be used here on GCC
u8& operator[](size_t offset) { return reinterpret_cast<u8*>(&rtc)[offset]; } u8& operator[](size_t offset) { return reinterpret_cast<u8*>(&rtc)[offset]; }

View File

@ -51,8 +51,8 @@ struct VideoInterfaceState::Data
UVIFBInfoRegister xfb_info_bottom; UVIFBInfoRegister xfb_info_bottom;
UVIFBInfoRegister xfb_3d_info_top; // Start making your stereoscopic demos! :p UVIFBInfoRegister xfb_3d_info_top; // Start making your stereoscopic demos! :p
UVIFBInfoRegister xfb_3d_info_bottom; UVIFBInfoRegister xfb_3d_info_bottom;
std::array<UVIInterruptRegister, 4> interrupt_register; std::array<UVIInterruptRegister, 4> interrupt_register{};
std::array<UVILatchRegister, 2> latch_register; std::array<UVILatchRegister, 2> latch_register{};
PictureConfigurationRegister picture_configuration; PictureConfigurationRegister picture_configuration;
UVIHorizontalScaling horizontal_scaling; UVIHorizontalScaling horizontal_scaling;
SVIFilterCoefTables filter_coef_tables; SVIFilterCoefTables filter_coef_tables;
@ -68,15 +68,15 @@ struct VideoInterfaceState::Data
u32 target_refresh_rate_numerator = 0; u32 target_refresh_rate_numerator = 0;
u32 target_refresh_rate_denominator = 1; u32 target_refresh_rate_denominator = 1;
u64 ticks_last_line_start; // number of ticks when the current full scanline started u64 ticks_last_line_start = 0; // number of ticks when the current full scanline started
u32 half_line_count; // number of halflines that have occurred for this full frame u32 half_line_count = 0; // number of halflines that have occurred for this full frame
u32 half_line_of_next_si_poll; // halfline when next SI poll results should be available u32 half_line_of_next_si_poll = 0; // halfline when next SI poll results should be available
// below indexes are 0-based // below indexes are 0-based
u32 even_field_first_hl; // index first halfline of the even field u32 even_field_first_hl = 0; // index first halfline of the even field
u32 odd_field_first_hl; // index first halfline of the odd field u32 odd_field_first_hl = 0; // index first halfline of the odd field
u32 even_field_last_hl; // index last halfline of the even field u32 even_field_last_hl = 0; // index last halfline of the even field
u32 odd_field_last_hl; // index last halfline of the odd field u32 odd_field_last_hl = 0; // index last halfline of the odd field
}; };
VideoInterfaceState::VideoInterfaceState() : m_data(std::make_unique<Data>()) VideoInterfaceState::VideoInterfaceState() : m_data(std::make_unique<Data>())

View File

@ -133,7 +133,7 @@ union UVIDisplayControlRegister
union UVIHorizontalTiming0 union UVIHorizontalTiming0
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -151,7 +151,7 @@ union UVIHorizontalTiming0
union UVIHorizontalTiming1 union UVIHorizontalTiming1
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -168,7 +168,7 @@ union UVIHorizontalTiming1
// Exists for both odd and even fields // Exists for both odd and even fields
union UVIVBlankTimingRegister union UVIVBlankTimingRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -185,7 +185,7 @@ union UVIVBlankTimingRegister
// Exists for both odd and even fields // Exists for both odd and even fields
union UVIBurstBlankingRegister union UVIBurstBlankingRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -201,7 +201,7 @@ union UVIBurstBlankingRegister
union UVIFBInfoRegister union UVIFBInfoRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -221,7 +221,7 @@ union UVIFBInfoRegister
// VI Interrupt Register // VI Interrupt Register
union UVIInterruptRegister union UVIInterruptRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -240,7 +240,7 @@ union UVIInterruptRegister
union UVILatchRegister union UVILatchRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -257,7 +257,7 @@ union UVILatchRegister
union PictureConfigurationRegister union PictureConfigurationRegister
{ {
u16 Hex; u16 Hex = 0;
struct struct
{ {
u16 STD : 8; u16 STD : 8;
@ -284,7 +284,7 @@ union UVIHorizontalScaling
// Used for tables 0-2 // Used for tables 0-2
union UVIFilterCoefTable3 union UVIFilterCoefTable3
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -301,7 +301,7 @@ union UVIFilterCoefTable3
// Used for tables 3-6 // Used for tables 3-6
union UVIFilterCoefTable4 union UVIFilterCoefTable4
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -324,7 +324,7 @@ struct SVIFilterCoefTables
// Debug video mode only, probably never used in Dolphin... // Debug video mode only, probably never used in Dolphin...
union UVIBorderBlankRegister union UVIBorderBlankRegister
{ {
u32 Hex; u32 Hex = 0;
struct struct
{ {
u16 Lo, Hi; u16 Lo, Hi;
@ -341,7 +341,7 @@ union UVIBorderBlankRegister
// ntsc-j and component cable bits // ntsc-j and component cable bits
union UVIDTVStatus union UVIDTVStatus
{ {
u16 Hex; u16 Hex = 0;
struct struct
{ {
u16 component_plugged : 1; u16 component_plugged : 1;
@ -352,7 +352,7 @@ union UVIDTVStatus
union UVIHorizontalStepping union UVIHorizontalStepping
{ {
u16 Hex; u16 Hex = 0;
struct struct
{ {
u16 srcwidth : 10; u16 srcwidth : 10;

View File

@ -253,7 +253,7 @@ public:
int DiskIOCtl(u8 pdrv, u8 cmd, void* buff) override { return vff_ioctl(m_vff, pdrv, cmd, buff); } int DiskIOCtl(u8 pdrv, u8 cmd, void* buff) override { return vff_ioctl(m_vff, pdrv, cmd, buff); }
IOS::HLE::FS::FileHandle* m_vff; IOS::HLE::FS::FileHandle* m_vff = nullptr;
}; };
} // namespace } // namespace

View File

@ -40,7 +40,7 @@ struct CachedInterpreter::Instruction
union union
{ {
const CommonCallback common_callback; const CommonCallback common_callback = nullptr;
const ConditionalCallback conditional_callback; const ConditionalCallback conditional_callback;
}; };

View File

@ -13,37 +13,37 @@
struct TrampolineInfo final struct TrampolineInfo final
{ {
// The start of the store operation that failed -- we will patch a JMP here // The start of the store operation that failed -- we will patch a JMP here
u8* start; u8* start = nullptr;
// The start + len = end of the store operation (points to the next instruction) // The start + len = end of the store operation (points to the next instruction)
u32 len; u32 len = 0;
// The PPC PC for the current load/store block // The PPC PC for the current load/store block
u32 pc; u32 pc = 0;
// Saved because we need these to make the ABI call in the trampoline // Saved because we need these to make the ABI call in the trampoline
BitSet32 registersInUse; BitSet32 registersInUse{};
// The MOV operation // The MOV operation
Gen::X64Reg nonAtomicSwapStoreSrc; Gen::X64Reg nonAtomicSwapStoreSrc{};
// src/dest for load/store // src/dest for load/store
s32 offset; s32 offset = 0;
Gen::X64Reg op_reg; Gen::X64Reg op_reg{};
Gen::OpArg op_arg; Gen::OpArg op_arg{};
// Original SafeLoadXXX/SafeStoreXXX flags // Original SafeLoadXXX/SafeStoreXXX flags
u8 flags; u8 flags = 0;
// Memory access size (in bytes) // Memory access size (in bytes)
u8 accessSize : 4; u8 accessSize : 4 = 0;
// true if this is a read op vs a write // true if this is a read op vs a write
bool read : 1; bool read : 1 = false;
// for read operations, true if needs sign-extension after load // for read operations, true if needs sign-extension after load
bool signExtend : 1; bool signExtend : 1 = false;
// Set to true if we added the offset to the address and need to undo it // Set to true if we added the offset to the address and need to undo it
bool offsetAddedToAddress : 1; bool offsetAddedToAddress : 1 = false;
}; };

View File

@ -347,7 +347,7 @@ protected:
void Force25BitPrecision(Arm64Gen::ARM64Reg output, Arm64Gen::ARM64Reg input); void Force25BitPrecision(Arm64Gen::ARM64Reg output, Arm64Gen::ARM64Reg input);
// <Fastmem fault location, slowmem handler location> // <Fastmem fault location, slowmem handler location>
std::map<const u8*, FastmemArea> m_fault_to_handler; std::map<const u8*, FastmemArea> m_fault_to_handler{};
Arm64GPRCache gpr; Arm64GPRCache gpr;
Arm64FPRCache fpr; Arm64FPRCache fpr;
@ -359,11 +359,11 @@ protected:
bool m_in_far_code = false; bool m_in_far_code = false;
// Backed up when we switch to far code. // Backed up when we switch to far code.
u8* m_near_code; u8* m_near_code = nullptr;
u8* m_near_code_end; u8* m_near_code_end = nullptr;
bool m_near_code_write_failed; bool m_near_code_write_failed = false;
bool m_enable_blr_optimization; bool m_enable_blr_optimization = false;
bool m_cleanup_after_stackfault = false; bool m_cleanup_after_stackfault = false;
u8* m_stack_base = nullptr; u8* m_stack_base = nullptr;
u8* m_stack_pointer = nullptr; u8* m_stack_pointer = nullptr;

View File

@ -43,7 +43,7 @@ struct ContentFile
std::string m_filename; std::string m_filename;
// Offset from the start of the file where the first byte of this content chunk is. // Offset from the start of the file where the first byte of this content chunk is.
u64 m_offset; u64 m_offset = 0;
}; };
// Content chunk that loads data from a DirectoryBlobReader. // Content chunk that loads data from a DirectoryBlobReader.
@ -54,20 +54,20 @@ struct ContentPartition
DirectoryBlobReader* m_reader; DirectoryBlobReader* m_reader;
// Offset from the start of the partition for the first byte represented by this chunk. // Offset from the start of the partition for the first byte represented by this chunk.
u64 m_offset; u64 m_offset = 0;
// The value passed as partition_data_offset to EncryptPartitionData(). // The value passed as partition_data_offset to EncryptPartitionData().
u64 m_partition_data_offset; u64 m_partition_data_offset = 0;
}; };
// Content chunk that loads data from a Volume. // Content chunk that loads data from a Volume.
struct ContentVolume struct ContentVolume
{ {
// Offset from the start of the volume for the first byte represented by this chunk. // Offset from the start of the volume for the first byte represented by this chunk.
u64 m_offset; u64 m_offset = 0;
// The volume to read data from. // The volume to read data from.
const Volume* m_volume; const Volume* m_volume = nullptr;
// The partition passed to the Volume's Read() method. // The partition passed to the Volume's Read() method.
Partition m_partition; Partition m_partition;
@ -77,7 +77,7 @@ struct ContentVolume
// Useful for padding between chunks within a file. // Useful for padding between chunks within a file.
struct ContentFixedByte struct ContentFixedByte
{ {
u8 m_byte; u8 m_byte = 0;
}; };
// Content chunk representing an arbitrary byte sequence that's stored within the struct itself. // Content chunk representing an arbitrary byte sequence that's stored within the struct itself.
@ -96,15 +96,15 @@ using ContentSource = std::variant<ContentFile, // File
struct BuilderContentSource struct BuilderContentSource
{ {
u64 m_offset; u64 m_offset = 0;
u64 m_size; u64 m_size = 0;
ContentSource m_source; ContentSource m_source;
}; };
struct FSTBuilderNode struct FSTBuilderNode
{ {
std::string m_filename; std::string m_filename;
u64 m_size; u64 m_size = 0;
std::variant<std::vector<BuilderContentSource>, std::vector<FSTBuilderNode>> m_content; std::variant<std::vector<BuilderContentSource>, std::vector<FSTBuilderNode>> m_content;
void* m_user_data = nullptr; void* m_user_data = nullptr;

View File

@ -54,7 +54,7 @@ struct Option
// The currently selected patch choice in the m_choices vector. // The currently selected patch choice in the m_choices vector.
// Note that this index is 1-based; 0 means no choice is selected and this Option is disabled. // Note that this index is 1-based; 0 means no choice is selected and this Option is disabled.
u32 m_selected_choice; u32 m_selected_choice = 0;
}; };
// A single page of options presented to the user in the Riivolution GUI. // A single page of options presented to the user in the Riivolution GUI.
@ -177,7 +177,7 @@ struct Patch
struct Disc struct Disc
{ {
// Riivolution version. Only '1' exists at time of writing. // Riivolution version. Only '1' exists at time of writing.
int m_version; int m_version = 0;
// Info about which game and revision these patches are for. // Info about which game and revision these patches are for.
GameFilter m_game_filter; GameFilter m_game_filter;
@ -209,7 +209,7 @@ struct ConfigOption
std::string m_id; std::string m_id;
// The selected Choice index. // The selected Choice index.
u32 m_default; u32 m_default = 0;
}; };
struct Config struct Config

View File

@ -15,10 +15,10 @@ class QTableWidget;
struct Diff struct Diff
{ {
u32 addr; u32 addr = 0;
std::string symbol; std::string symbol;
u32 hits; u32 hits = 0;
u32 total_hits; u32 total_hits = 0;
bool operator<(const std::string& val) const { return symbol < val; } bool operator<(const std::string& val) const { return symbol < val; }
}; };

View File

@ -21,9 +21,9 @@ public:
struct DisassembleResult struct DisassembleResult
{ {
std::string text; std::string text;
u32 entry_address; u32 entry_address = 0;
u32 instruction_count; u32 instruction_count = 0;
u32 code_size; u32 code_size = 0;
}; };
std::unique_ptr<HostDisassembler> GetNewDisassembler(const std::string& arch); std::unique_ptr<HostDisassembler> GetNewDisassembler(const std::string& arch);

View File

@ -122,9 +122,9 @@ class Tev
static constexpr s16 V7_8 = 223; static constexpr s16 V7_8 = 223;
static constexpr s16 V1 = 255; static constexpr s16 V1 = 255;
u8 AlphaBump; u8 AlphaBump = 0;
u8 IndirectTex[4][4]; u8 IndirectTex[4][4]{};
TextureCoordinateType TexCoord; TextureCoordinateType TexCoord{};
const Common::EnumMap<TevColorRef, TevColorArg::Zero> m_ColorInputLUT{ const Common::EnumMap<TevColorRef, TevColorArg::Zero> m_ColorInputLUT{
TevColorRef::Color(Reg[TevOutput::Prev]), // prev.rgb TevColorRef::Color(Reg[TevOutput::Prev]), // prev.rgb
@ -213,13 +213,13 @@ class Tev
void Indirect(unsigned int stageNum, s32 s, s32 t); void Indirect(unsigned int stageNum, s32 s, s32 t);
public: public:
s32 Position[3]; s32 Position[3]{};
u8 Color[2][4]; // must be RGBA for correct swap table ordering u8 Color[2][4]{}; // must be RGBA for correct swap table ordering
TextureCoordinateType Uv[8]; TextureCoordinateType Uv[8]{};
s32 IndirectLod[4]; s32 IndirectLod[4]{};
bool IndirectLinear[4]; bool IndirectLinear[4]{};
s32 TextureLod[16]; s32 TextureLod[16]{};
bool TextureLinear[16]; bool TextureLinear[16]{};
enum enum
{ {

View File

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

View File

@ -29,10 +29,10 @@ private:
{ {
void operator()(T* ptr); 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; 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>, Common::EnumMap<Common::EnumMap<CullFunction, CullMode::All>,
OpcodeDecoder::Primitive::GX_DRAW_TRIANGLE_FAN> 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::vector<std::unique_ptr<AbstractTexture>> m_imgui_textures;
std::unique_ptr<AbstractPipeline> m_imgui_pipeline; std::unique_ptr<AbstractPipeline> m_imgui_pipeline;
std::mutex m_imgui_mutex; 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_width = 1;
u32 m_backbuffer_height = 1; u32 m_backbuffer_height = 1;

View File

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

View File

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

View File

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

View File

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