diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index d999dbd4e..46558d25f 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -1635,7 +1635,7 @@ EmulatorWindow::ControllerHotKey EmulatorWindow::ProcessControllerHotkey( } // Hotkey cool-down to prevent toggling too fast - const std::chrono::milliseconds delay(75); + constexpr std::chrono::milliseconds delay(75); // If the Xbox Gamebar is enabled or the Guide button is disabled then // replace the Guide button with the Back button without redeclaring the key @@ -1820,7 +1820,7 @@ EmulatorWindow::ControllerHotKey EmulatorWindow::ProcessControllerHotkey( void EmulatorWindow::VibrateController(xe::hid::InputSystem* input_sys, uint32_t user_index, bool toggle_rumble) { - const std::chrono::milliseconds rumble_duration(100); + constexpr std::chrono::milliseconds rumble_duration(100); // Hold lock while sleeping this thread for the duration of the rumble, // otherwise the rumble may fail. @@ -1842,7 +1842,7 @@ void EmulatorWindow::VibrateController(xe::hid::InputSystem* input_sys, void EmulatorWindow::GamepadHotKeys() { X_INPUT_STATE state; - const std::chrono::milliseconds thread_delay(75); + constexpr std::chrono::milliseconds thread_delay(75); auto input_sys = emulator_->input_system(); diff --git a/src/xenia/apu/audio_system.h b/src/xenia/apu/audio_system.h index e18ce7c1d..ad9414b48 100644 --- a/src/xenia/apu/audio_system.h +++ b/src/xenia/apu/audio_system.h @@ -32,7 +32,7 @@ class AudioSystem { public: // TODO(gibbed): respect XAUDIO2_MAX_QUEUED_BUFFERS somehow (ie min(64, // XAUDIO2_MAX_QUEUED_BUFFERS)) - static const size_t kMaximumQueuedFrames = 64; + static constexpr size_t kMaximumQueuedFrames = 64; virtual ~AudioSystem(); @@ -81,7 +81,7 @@ class AudioSystem { kernel::object_ref worker_thread_; xe::global_critical_region global_critical_region_; - static const size_t kMaximumClientCount = 8; + static constexpr size_t kMaximumClientCount = 8; struct { AudioDriver* driver; uint32_t callback; diff --git a/src/xenia/apu/xaudio2/xaudio2_audio_driver.h b/src/xenia/apu/xaudio2/xaudio2_audio_driver.h index 1de442375..f7382bddf 100644 --- a/src/xenia/apu/xaudio2/xaudio2_audio_driver.h +++ b/src/xenia/apu/xaudio2/xaudio2_audio_driver.h @@ -106,7 +106,7 @@ class XAudio2AudioDriver : public AudioDriver { uint32_t frame_size_; bool need_format_conversion_; - static const uint32_t frame_count_ = api::XE_XAUDIO2_MAX_QUEUED_BUFFERS; + static constexpr uint32_t frame_count_ = api::XE_XAUDIO2_MAX_QUEUED_BUFFERS; float frames_[frame_count_][kFrameSamplesMax]; uint32_t current_frame_ = 0; diff --git a/src/xenia/base/bit_map.h b/src/xenia/base/bit_map.h index 0509cff7d..867a30f56 100644 --- a/src/xenia/base/bit_map.h +++ b/src/xenia/base/bit_map.h @@ -46,8 +46,8 @@ class BitMap { std::vector& data() { return data_; } private: - const static size_t kDataSize = 8; - const static size_t kDataSizeBits = kDataSize * 8; + constexpr static size_t kDataSize = 8; + constexpr static size_t kDataSizeBits = kDataSize * 8; std::vector data_; inline size_t TryAcquireAt(size_t i); }; diff --git a/src/xenia/base/bit_range.h b/src/xenia/base/bit_range.h index 462d5e2cd..f82794241 100644 --- a/src/xenia/base/bit_range.h +++ b/src/xenia/base/bit_range.h @@ -30,7 +30,7 @@ std::pair NextUnsetRange(const Block* bits, size_t first, return std::make_pair(size_t(first), size_t(0)); } size_t last = first + length - 1; - const size_t block_bits = sizeof(Block) * CHAR_BIT; + constexpr size_t block_bits = sizeof(Block) * CHAR_BIT; size_t block_first = first / block_bits; size_t block_last = last / block_bits; size_t range_start = SIZE_MAX; @@ -80,7 +80,7 @@ void SetRange(Block* bits, size_t first, size_t length) { return; } size_t last = first + length - 1; - const size_t block_bits = sizeof(Block) * CHAR_BIT; + constexpr size_t block_bits = sizeof(Block) * CHAR_BIT; size_t block_first = first / block_bits; size_t block_last = last / block_bits; Block set_first = ~((Block(1) << (first & (block_bits - 1))) - 1); diff --git a/src/xenia/base/cvar.cc b/src/xenia/base/cvar.cc index 2f5168480..6f9615f5f 100644 --- a/src/xenia/base/cvar.cc +++ b/src/xenia/base/cvar.cc @@ -189,8 +189,8 @@ std::string EscapeMultilineBasicString(const std::string_view view) { } std::string EscapeString(const std::string_view view) { - const auto multiline_chars = std::string_view("\r\n"); - const auto escape_chars = std::string_view( + constexpr auto multiline_chars = std::string_view("\r\n"); + constexpr auto escape_chars = std::string_view( "\0\b\v\f" "\x01\x02\x03\x04\x05\x06\x07\x0E\x0F" "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F" diff --git a/src/xenia/base/logging.cc b/src/xenia/base/logging.cc index 427d73593..23a6f56a1 100644 --- a/src/xenia/base/logging.cc +++ b/src/xenia/base/logging.cc @@ -248,8 +248,8 @@ class Logger { uint8_t buffer_[kBufferSize]; static constexpr size_t kBlockSize = 256; - static const size_t kBlockCount = kBufferSize / kBlockSize; - static const size_t kBlockIndexMask = kBlockCount - 1; + static constexpr size_t kBlockCount = kBufferSize / kBlockSize; + static constexpr size_t kBlockIndexMask = kBlockCount - 1; static const size_t kClaimStrategyFootprint = sizeof(std::atomic[kBlockCount]); @@ -353,14 +353,14 @@ class Logger { ? line_range.second[line_range.second_length - 1] : line_range.first[line_range.first_length - 1]; if (last_char != '\n') { - const char suffix[1] = {'\n'}; + constexpr char suffix[1] = {'\n'}; Write(suffix, 1); } rb.EndRead(std::move(line_range)); } else { // Always ensure there is a newline. - const char suffix[1] = {'\n'}; + constexpr char suffix[1] = {'\n'}; Write(suffix, 1); } diff --git a/src/xenia/base/mapped_memory_win.cc b/src/xenia/base/mapped_memory_win.cc index 6e12954b6..ea3f79e17 100644 --- a/src/xenia/base/mapped_memory_win.cc +++ b/src/xenia/base/mapped_memory_win.cc @@ -29,7 +29,7 @@ class Win32MappedMemory : public MappedMemory { public: // CreateFile returns INVALID_HANDLE_VALUE in case of failure. // chrispy: made inline const to get around clang error - static inline const HANDLE kFileHandleInvalid = INVALID_HANDLE_VALUE; + static inline constexpr HANDLE kFileHandleInvalid = INVALID_HANDLE_VALUE; // CreateFileMapping returns nullptr in case of failure. static constexpr HANDLE kMappingHandleInvalid = nullptr; diff --git a/src/xenia/base/memory.cc b/src/xenia/base/memory.cc index 604cf2383..57d3a0195 100644 --- a/src/xenia/base/memory.cc +++ b/src/xenia/base/memory.cc @@ -473,7 +473,7 @@ void copy_and_swap_16_unaligned(void* dst_ptr, const void* src_ptr, auto dst = reinterpret_cast(dst_ptr); auto src = reinterpret_cast(src_ptr); - const uint8x16_t tbl_idx = + constexpr uint8x16_t tbl_idx = vcombine_u8(vcreate_u8(UINT64_C(0x0607040502030001)), vcreate_u8(UINT64_C(0x0E0F0C0D0A0B0809))); @@ -507,7 +507,7 @@ void copy_and_swap_32_unaligned(void* dst_ptr, const void* src_ptr, auto dst = reinterpret_cast(dst_ptr); auto src = reinterpret_cast(src_ptr); - const uint8x16_t tbl_idx = + constexpr uint8x16_t tbl_idx = vcombine_u8(vcreate_u8(UINT64_C(0x405060700010203)), vcreate_u8(UINT64_C(0x0C0D0E0F08090A0B))); @@ -539,7 +539,7 @@ void copy_and_swap_64_unaligned(void* dst_ptr, const void* src_ptr, auto dst = reinterpret_cast(dst_ptr); auto src = reinterpret_cast(src_ptr); - const uint8x16_t tbl_idx = + constexpr uint8x16_t tbl_idx = vcombine_u8(vcreate_u8(UINT64_C(0x0001020304050607)), vcreate_u8(UINT64_C(0x08090A0B0C0D0E0F))); diff --git a/src/xenia/base/system_win.cc b/src/xenia/base/system_win.cc index 3b0f14a03..503154477 100644 --- a/src/xenia/base/system_win.cc +++ b/src/xenia/base/system_win.cc @@ -65,8 +65,8 @@ bool SetProcessPriorityClass(const uint32_t priority_class) { } bool IsUseNexusForGameBarEnabled() { - const LPCWSTR reg_path = L"SOFTWARE\\Microsoft\\GameBar"; - const LPCWSTR key = L"UseNexusForGameBarEnabled"; + constexpr LPCWSTR reg_path = L"SOFTWARE\\Microsoft\\GameBar"; + constexpr LPCWSTR key = L"UseNexusForGameBarEnabled"; DWORD value = 0; DWORD dataSize = sizeof(value); diff --git a/src/xenia/config.cc b/src/xenia/config.cc index 77f8cceb7..a0b32e652 100644 --- a/src/xenia/config.cc +++ b/src/xenia/config.cc @@ -206,7 +206,7 @@ void SaveConfig() { line_count = xe::utf8::count(*last); } - const size_t value_alignment = 50; + constexpr size_t value_alignment = 50; const auto& description = config_var->description(); if (!description.empty()) { if (line_count < value_alignment) { diff --git a/src/xenia/cpu/backend/x64/x64_backend.cc b/src/xenia/cpu/backend/x64/x64_backend.cc index 334710258..dc8386673 100644 --- a/src/xenia/cpu/backend/x64/x64_backend.cc +++ b/src/xenia/cpu/backend/x64/x64_backend.cc @@ -636,7 +636,7 @@ HostToGuestThunk X64HelperEmitter::EmitHostToGuestThunk() { _code_offsets code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); @@ -681,7 +681,7 @@ HostToGuestThunk X64HelperEmitter::EmitHostToGuestThunk() { size_t tail; } code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); // rsp + 0 = return address @@ -735,7 +735,7 @@ GuestToHostThunk X64HelperEmitter::EmitGuestToHostThunk() { _code_offsets code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); @@ -781,7 +781,7 @@ GuestToHostThunk X64HelperEmitter::EmitGuestToHostThunk() { size_t tail; } code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); @@ -838,7 +838,7 @@ ResolveFunctionThunk X64HelperEmitter::EmitResolveFunctionThunk() { _code_offsets code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); @@ -878,7 +878,7 @@ ResolveFunctionThunk X64HelperEmitter::EmitResolveFunctionThunk() { size_t epilog; size_t tail; } code_offsets = {}; - const size_t stack_size = StackLayout::THUNK_STACK_SIZE; + constexpr size_t stack_size = StackLayout::THUNK_STACK_SIZE; code_offsets.prolog = getSize(); diff --git a/src/xenia/cpu/backend/x64/x64_op.h b/src/xenia/cpu/backend/x64/x64_op.h index 51bfdbf9e..68e67567c 100644 --- a/src/xenia/cpu/backend/x64/x64_op.h +++ b/src/xenia/cpu/backend/x64/x64_op.h @@ -298,7 +298,7 @@ struct I; template struct I : DestField { typedef DestField BASE; - static const hir::Opcode opcode = OPCODE; + static constexpr hir::Opcode opcode = OPCODE; static const uint32_t key = InstrKey::Construct::value; static const KeyType dest_type = DEST::key_type; @@ -318,7 +318,7 @@ struct I : DestField { template struct I : DestField { typedef DestField BASE; - static const hir::Opcode opcode = OPCODE; + static constexpr hir::Opcode opcode = OPCODE; static const uint32_t key = InstrKey::Construct::value; static const KeyType dest_type = DEST::key_type; @@ -341,7 +341,7 @@ struct I : DestField { template struct I : DestField { typedef DestField BASE; - static const hir::Opcode opcode = OPCODE; + static constexpr hir::Opcode opcode = OPCODE; static const uint32_t key = InstrKey::Construct::value; @@ -369,7 +369,7 @@ template struct I : DestField { typedef DestField BASE; - static const hir::Opcode opcode = OPCODE; + static constexpr hir::Opcode opcode = OPCODE; static const uint32_t key = InstrKey::Construct::value; diff --git a/src/xenia/cpu/backend/x64/x64_stack_layout.h b/src/xenia/cpu/backend/x64/x64_stack_layout.h index 2d5e35a3c..769b50179 100644 --- a/src/xenia/cpu/backend/x64/x64_stack_layout.h +++ b/src/xenia/cpu/backend/x64/x64_stack_layout.h @@ -95,7 +95,7 @@ class StackLayout { }); static_assert(sizeof(Thunk) % 16 == 0, "sizeof(Thunk) must be a multiple of 16!"); - static const size_t THUNK_STACK_SIZE = sizeof(Thunk) + 8; + static constexpr size_t THUNK_STACK_SIZE = sizeof(Thunk) + 8; /** * @@ -121,16 +121,16 @@ class StackLayout { * +------------------+ * */ - static const size_t GUEST_STACK_SIZE = 104; + static constexpr size_t GUEST_STACK_SIZE = 104; // was GUEST_CTX_HOME, can't remove because that'd throw stack alignment off. // instead, can be used as a temporary in sequences - static const size_t GUEST_SCRATCH = 0; + static constexpr size_t GUEST_SCRATCH = 0; // when profiling is on, this stores the nanosecond time at the start of the // function - static const size_t GUEST_PROFILER_START = 80; - static const size_t GUEST_RET_ADDR = 88; - static const size_t GUEST_CALL_RET_ADDR = 96; + static constexpr size_t GUEST_PROFILER_START = 80; + static constexpr size_t GUEST_RET_ADDR = 88; + static constexpr size_t GUEST_CALL_RET_ADDR = 96; }; } // namespace x64 diff --git a/src/xenia/debug/ui/debug_window.cc b/src/xenia/debug/ui/debug_window.cc index d7dcec0fa..3d830dd1f 100644 --- a/src/xenia/debug/ui/debug_window.cc +++ b/src/xenia/debug/ui/debug_window.cc @@ -55,7 +55,7 @@ void DebugWindow::DebugDialog::OnDraw(ImGuiIO& io) { debug_window_.DrawFrame(io); } -static const std::string kBaseTitle = "Xenia Debugger"; +static constexpr std::string_view kBaseTitle = "Xenia Debugger"; DebugWindow::DebugWindow(Emulator* emulator, xe::ui::WindowedAppContext& app_context) @@ -1460,7 +1460,7 @@ void DebugWindow::UpdateCache() { auto object_table = kernel_state->object_table(); app_context_.CallInUIThread([this]() { - std::string title = kBaseTitle; + std::string title = std::string(kBaseTitle); switch (processor_->execution_state()) { case cpu::ExecutionState::kEnded: title += " (ended)"; diff --git a/src/xenia/debug/ui/debug_window.h b/src/xenia/debug/ui/debug_window.h index d40ce484f..ce73734d7 100644 --- a/src/xenia/debug/ui/debug_window.h +++ b/src/xenia/debug/ui/debug_window.h @@ -137,8 +137,8 @@ class DebugWindow : public cpu::DebugListener { // The current state of the UI. Use this to synchronize multiple parts of the // UI. struct ImState { - static const int kRightPaneThreads = 0; - static const int kRightPaneMemory = 1; + static constexpr int kRightPaneThreads = 0; + static constexpr int kRightPaneMemory = 1; int right_pane_tab = kRightPaneThreads; cpu::ThreadDebugInfo* thread_info = nullptr; diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index 6337b8c80..7d5b7437a 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -285,7 +285,7 @@ void CommandProcessor::WorkerThreadMain() { do { // If we spin around too much, revert to a "low-power" state. if (loop_count > 500) { - const int wait_time_ms = 2; + constexpr int wait_time_ms = 2; xe::threading::Wait(write_ptr_index_event_.get(), true, std::chrono::milliseconds(wait_time_ms)); } else { diff --git a/src/xenia/gpu/d3d12/d3d12_render_target_cache.cc b/src/xenia/gpu/d3d12/d3d12_render_target_cache.cc index 9dc1798d5..767cd587b 100644 --- a/src/xenia/gpu/d3d12/d3d12_render_target_cache.cc +++ b/src/xenia/gpu/d3d12/d3d12_render_target_cache.cc @@ -109,7 +109,7 @@ namespace shaders { #include "xenia/gpu/shaders/bytecode/d3d12_5_1/resolve_full_8bpp_scaled_cs.h" } // namespace shaders -const D3D12RenderTargetCache::ResolveCopyShaderCode +constexpr D3D12RenderTargetCache::ResolveCopyShaderCode D3D12RenderTargetCache::kResolveCopyShaders[size_t( draw_util::ResolveCopyShaderIndex::kCount)] = { {shaders::resolve_fast_32bpp_1x2xmsaa_cs, @@ -146,7 +146,7 @@ const D3D12RenderTargetCache::ResolveCopyShaderCode sizeof(shaders::resolve_full_128bpp_scaled_cs)}, }; -const uint32_t D3D12RenderTargetCache::kTransferUsedRootParameters[size_t( +constexpr uint32_t D3D12RenderTargetCache::kTransferUsedRootParameters[size_t( TransferRootSignatureIndex::kCount)] = { // kColor kTransferUsedRootParameterColorSRVBit | @@ -184,7 +184,7 @@ const uint32_t D3D12RenderTargetCache::kTransferUsedRootParameters[size_t( kTransferUsedRootParameterHostDepthAddressConstantBit, }; -const D3D12RenderTargetCache::TransferModeInfo +constexpr D3D12RenderTargetCache::TransferModeInfo D3D12RenderTargetCache::kTransferModes[size_t(TransferMode::kCount)] = { // kColorToDepth {TransferOutput::kDepth, TransferRootSignatureIndex::kColor, diff --git a/src/xenia/gpu/d3d12/deferred_command_list.h b/src/xenia/gpu/d3d12/deferred_command_list.h index ab6d789bc..16b70a1e8 100644 --- a/src/xenia/gpu/d3d12/deferred_command_list.h +++ b/src/xenia/gpu/d3d12/deferred_command_list.h @@ -269,7 +269,7 @@ class DeferredCommandList { return; } static_assert(alignof(D3D12_RESOURCE_BARRIER) <= alignof(uintmax_t)); - const size_t header_size = + constexpr size_t header_size = xe::align(sizeof(UINT), alignof(D3D12_RESOURCE_BARRIER)); uint8_t* args = reinterpret_cast(WriteCommand( Command::kD3DResourceBarrier, diff --git a/src/xenia/gpu/d3d12/pipeline_cache.cc b/src/xenia/gpu/d3d12/pipeline_cache.cc index da0c8949c..4e898c244 100644 --- a/src/xenia/gpu/d3d12/pipeline_cache.cc +++ b/src/xenia/gpu/d3d12/pipeline_cache.cc @@ -272,7 +272,7 @@ void PipelineCache::InitializeShaderStorage( } pipeline_storage_file_flush_needed_ = false; // 'XEPS'. - const uint32_t pipeline_storage_magic = 0x53504558; + constexpr uint32_t pipeline_storage_magic = 0x53504558; // 'DXRO' or 'DXRT'. const uint32_t pipeline_storage_magic_api = edram_rov_used ? 0x4F525844 : 0x54525844; @@ -367,7 +367,7 @@ void PipelineCache::InitializeShaderStorage( uint32_t version_swapped; } shader_storage_file_header; // 'XESH'. - const uint32_t shader_storage_magic = 0x48534558; + constexpr uint32_t shader_storage_magic = 0x48534558; if (fread(&shader_storage_file_header, sizeof(shader_storage_file_header), 1, shader_storage_file_) && shader_storage_file_header.magic == shader_storage_magic && @@ -1577,7 +1577,7 @@ bool PipelineCache::GetCurrentStateDescription( // Render targets and blending state. 32 because of 0x1F mask, for safety // (all unknown to zero). - static const PipelineBlendFactor kBlendFactorMap[32] = { + static constexpr PipelineBlendFactor kBlendFactorMap[32] = { /* 0 */ PipelineBlendFactor::kZero, /* 1 */ PipelineBlendFactor::kOne, /* 2 */ PipelineBlendFactor::kZero, // ? @@ -1603,7 +1603,7 @@ bool PipelineCache::GetCurrentStateDescription( // Like kBlendFactorMap, but with color modes changed to alpha. Some // pipelines aren't created in 545407E0 because a color mode is used for // alpha. - static const PipelineBlendFactor kBlendFactorAlphaMap[32] = { + static constexpr PipelineBlendFactor kBlendFactorAlphaMap[32] = { /* 0 */ PipelineBlendFactor::kZero, /* 1 */ PipelineBlendFactor::kOne, /* 2 */ PipelineBlendFactor::kZero, // ? diff --git a/src/xenia/gpu/draw_util.cc b/src/xenia/gpu/draw_util.cc index 3feac0956..b30b57bbb 100644 --- a/src/xenia/gpu/draw_util.cc +++ b/src/xenia/gpu/draw_util.cc @@ -907,7 +907,7 @@ void GetResolveEdramTileSpan(ResolveEdramInfo edram_info, rows_out = y1 - y0; } -const ResolveCopyShaderInfo +constexpr ResolveCopyShaderInfo resolve_copy_shader_info[size_t(ResolveCopyShaderIndex::kCount)] = { {"Resolve Copy Fast 32bpp 1x/2xMSAA", false, 4, 4, 6, 3}, {"Resolve Copy Fast 32bpp 4xMSAA", false, 4, 4, 6, 3}, diff --git a/src/xenia/gpu/dxbc_shader_translator.cc b/src/xenia/gpu/dxbc_shader_translator.cc index 5edf920b8..44501ade6 100644 --- a/src/xenia/gpu/dxbc_shader_translator.cc +++ b/src/xenia/gpu/dxbc_shader_translator.cc @@ -2051,7 +2051,7 @@ void DxbcShaderTranslator::ProcessAllocInstruction( } } -const DxbcShaderTranslator::ShaderRdefType +constexpr DxbcShaderTranslator::ShaderRdefType DxbcShaderTranslator::rdef_types_[size_t( DxbcShaderTranslator::ShaderRdefTypeIndex::kCount)] = { // kFloat @@ -2104,7 +2104,7 @@ const DxbcShaderTranslator::ShaderRdefType dxbc::RdefVariableType::kUInt, 1, 4, 0, ShaderRdefTypeIndex::kUint4}, }; -const DxbcShaderTranslator::SystemConstantRdef +constexpr DxbcShaderTranslator::SystemConstantRdef DxbcShaderTranslator::system_constant_rdef_[size_t( DxbcShaderTranslator::SystemConstants::Index::kCount)] = { {"xe_flags", ShaderRdefTypeIndex::kUint, sizeof(uint32_t)}, diff --git a/src/xenia/gpu/packet_disassembler.cc b/src/xenia/gpu/packet_disassembler.cc index 90eebf9db..4f8ed5882 100644 --- a/src/xenia/gpu/packet_disassembler.cc +++ b/src/xenia/gpu/packet_disassembler.cc @@ -47,8 +47,8 @@ PacketCategory PacketDisassembler::GetPacketCategory(const uint8_t* base_ptr) { bool PacketDisassembler::DisasmPacketType0(const uint8_t* base_ptr, uint32_t packet, PacketInfo* out_info) { - static const PacketTypeInfo type_0_info = {PacketCategory::kGeneric, - "PM4_TYPE0"}; + static constexpr PacketTypeInfo type_0_info = {PacketCategory::kGeneric, + "PM4_TYPE0"}; out_info->type_info = &type_0_info; uint32_t count = ((packet >> 16) & 0x3FFF) + 1; @@ -72,8 +72,8 @@ bool PacketDisassembler::DisasmPacketType0(const uint8_t* base_ptr, bool PacketDisassembler::DisasmPacketType1(const uint8_t* base_ptr, uint32_t packet, PacketInfo* out_info) { - static const PacketTypeInfo type_1_info = {PacketCategory::kGeneric, - "PM4_TYPE1"}; + static constexpr PacketTypeInfo type_1_info = {PacketCategory::kGeneric, + "PM4_TYPE1"}; out_info->type_info = &type_1_info; out_info->count = 1 + 2; @@ -94,8 +94,8 @@ bool PacketDisassembler::DisasmPacketType1(const uint8_t* base_ptr, bool PacketDisassembler::DisasmPacketType2(const uint8_t* base_ptr, uint32_t packet, PacketInfo* out_info) { - static const PacketTypeInfo type_2_info = {PacketCategory::kGeneric, - "PM4_TYPE2"}; + static constexpr PacketTypeInfo type_2_info = {PacketCategory::kGeneric, + "PM4_TYPE2"}; out_info->type_info = &type_2_info; out_info->count = 1; @@ -106,8 +106,8 @@ bool PacketDisassembler::DisasmPacketType2(const uint8_t* base_ptr, bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, uint32_t packet, PacketInfo* out_info) { - static const PacketTypeInfo type_3_unknown_info = {PacketCategory::kGeneric, - "PM4_TYPE3_UNKNOWN"}; + static constexpr PacketTypeInfo type_3_unknown_info = { + PacketCategory::kGeneric, "PM4_TYPE3_UNKNOWN"}; out_info->type_info = &type_3_unknown_info; uint32_t opcode = (packet >> 8) & 0x7F; @@ -127,8 +127,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, switch (opcode) { case PM4_ME_INIT: { // initialize CP's micro-engine - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_ME_INIT"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_ME_INIT"}; out_actions.emplace_back(PacketAction::MeInit((uint32_t*)ptr, count)); @@ -138,15 +138,15 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, case PM4_NOP: { // skip N 32-bit words to get to the next packet // No-op, ignore some data. - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_NOP"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_NOP"}; out_info->type_info = &op_info; break; } case PM4_INTERRUPT: { // generate interrupt from the command stream - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_INTERRUPT"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_INTERRUPT"}; out_info->type_info = &op_info; PacketAction intaction; @@ -160,8 +160,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, // VdSwap will post this to tell us we need to swap the screen/fire an // interrupt. // 63 words here, but only the first has any data. - static const PacketTypeInfo op_info = {PacketCategory::kSwap, - "PM4_XE_SWAP"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kSwap, + "PM4_XE_SWAP"}; out_info->type_info = &op_info; PacketAction xsa; @@ -175,8 +175,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, case PM4_INDIRECT_BUFFER: case PM4_INDIRECT_BUFFER_PFD: { // indirect buffer dispatch - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_INDIRECT_BUFFER"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_INDIRECT_BUFFER"}; out_info->type_info = &op_info; PacketAction iba; @@ -189,8 +189,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_WAIT_REG_MEM: { // wait until a register or memory location is a specific value - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_WAIT_REG_MEM"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_WAIT_REG_MEM"}; out_info->type_info = &op_info; PacketAction wait_action; @@ -209,8 +209,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, case PM4_REG_RMW: { // register read/modify/write // ? (used during shader upload and edram setup) - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_REG_RMW"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_REG_RMW"}; out_info->type_info = &op_info; PacketAction rmw_action; rmw_action.type = PacketAction::Type::kRegRmw; @@ -227,8 +227,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_COND_WRITE: { // conditional write to memory or register - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_COND_WRITE"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_COND_WRITE"}; out_info->type_info = &op_info; PacketAction cwr_action; cwr_action.type = PacketAction::Type::kCondWrite; @@ -247,8 +247,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_EVENT_WRITE: { // generate an event that creates a write to memory when completed - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_EVENT_WRITE"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_EVENT_WRITE"}; out_info->type_info = &op_info; PacketAction evw_action; evw_action.type = Type::kEventWrite; @@ -260,8 +260,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_EVENT_WRITE_SHD: { // generate a VS|PS_done event - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_EVENT_WRITE_SHD"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_EVENT_WRITE_SHD"}; out_info->type_info = &op_info; PacketAction evws_action; evws_action.type = Type::kEventWriteSHD; @@ -276,8 +276,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_EVENT_WRITE_EXT: { // generate a screen extent event - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_EVENT_WRITE_EXT"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_EVENT_WRITE_EXT"}; out_info->type_info = &op_info; PacketAction eve_action; @@ -295,8 +295,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, case PM4_DRAW_INDX: { // initiate fetch of index buffer and draw // dword0 = viz query info - static const PacketTypeInfo op_info = {PacketCategory::kDraw, - "PM4_DRAW_INDX"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kDraw, + "PM4_DRAW_INDX"}; out_info->type_info = &op_info; uint32_t dword0 = xe::load_and_swap(ptr + 0); uint32_t dword1 = xe::load_and_swap(ptr + 4); @@ -337,8 +337,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_DRAW_INDX_2: { // draw using supplied indices in packet - static const PacketTypeInfo op_info = {PacketCategory::kDraw, - "PM4_DRAW_INDX_2"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kDraw, + "PM4_DRAW_INDX_2"}; out_info->type_info = &op_info; uint32_t dword0 = xe::load_and_swap(ptr + 0); uint32_t index_count = dword0 >> 16; @@ -372,8 +372,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, // load constant into chip and to memory // PM4_REG(reg) ((0x4 << 16) | (GSL_HAL_SUBBLOCK_OFFSET(reg))) // reg - 0x2000 - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_CONSTANT"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_CONSTANT"}; out_info->type_info = &op_info; uint32_t offset_type = xe::load_and_swap(ptr + 0); uint32_t index = offset_type & 0x7FF; @@ -407,8 +407,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_CONSTANT2: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_CONSTANT2"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_CONSTANT2"}; out_info->type_info = &op_info; uint32_t offset_type = xe::load_and_swap(ptr + 0); uint32_t index = offset_type & 0xFFFF; @@ -424,8 +424,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_LOAD_ALU_CONSTANT: { // load constants from memory - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_LOAD_ALU_CONSTANT"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_LOAD_ALU_CONSTANT"}; out_info->type_info = &op_info; uint32_t address = xe::load_and_swap(ptr + 0); address &= 0x3FFFFFFF; @@ -465,8 +465,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_SHADER_CONSTANTS: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_SHADER_CONSTANTS"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_SHADER_CONSTANTS"}; out_info->type_info = &op_info; uint32_t offset_type = xe::load_and_swap(ptr + 0); uint32_t index = offset_type & 0xFFFF; @@ -481,8 +481,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_IM_LOAD: { // load sequencer instruction memory (pointer-based) - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_IM_LOAD"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_IM_LOAD"}; out_info->type_info = &op_info; uint32_t addr_type = xe::load_and_swap(ptr + 0); auto shader_type = static_cast(addr_type & 0x3); @@ -506,8 +506,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_IM_LOAD_IMMEDIATE: { // load sequencer instruction memory (code embedded in packet) - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_IM_LOAD_IMMEDIATE"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_IM_LOAD_IMMEDIATE"}; out_info->type_info = &op_info; uint32_t dword0 = xe::load_and_swap(ptr + 0); uint32_t dword1 = xe::load_and_swap(ptr + 4); @@ -534,8 +534,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, } case PM4_INVALIDATE_STATE: { // selective invalidation of state pointers - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_INVALIDATE_STATE"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_INVALIDATE_STATE"}; out_info->type_info = &op_info; uint32_t mask = xe::load_and_swap(ptr + 0); @@ -547,8 +547,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_BIN_MASK_LO: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_BIN_MASK_LO"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_BIN_MASK_LO"}; out_info->type_info = &op_info; uint32_t value = xe::load_and_swap(ptr); // bin_mask_ = (bin_mask_ & 0xFFFFFFFF00000000ull) | value; @@ -561,8 +561,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_BIN_MASK_HI: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_BIN_MASK_HI"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_BIN_MASK_HI"}; out_info->type_info = &op_info; uint32_t value = xe::load_and_swap(ptr); @@ -573,8 +573,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_BIN_SELECT_LO: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_BIN_SELECT_LO"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_BIN_SELECT_LO"}; out_info->type_info = &op_info; uint32_t value = xe::load_and_swap(ptr); PacketAction action; @@ -585,8 +585,8 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, break; } case PM4_SET_BIN_SELECT_HI: { - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_SET_BIN_SELECT_HI"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_SET_BIN_SELECT_HI"}; out_info->type_info = &op_info; uint32_t value = xe::load_and_swap(ptr); @@ -670,14 +670,14 @@ bool PacketDisassembler::DisasmPacketType3(const uint8_t* base_ptr, // Ignored packets - useful if breaking on the default handler below. case 0x50: { // 0xC0015000 usually 2 words, 0xFFFFFFFF / 0x00000000 - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_TYPE3_0x50"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_TYPE3_0x50"}; out_info->type_info = &op_info; break; } case 0x51: { // 0xC0015100 usually 2 words, 0xFFFFFFFF / 0xFFFFFFFF - static const PacketTypeInfo op_info = {PacketCategory::kGeneric, - "PM4_TYPE3_0x51"}; + static constexpr PacketTypeInfo op_info = {PacketCategory::kGeneric, + "PM4_TYPE3_0x51"}; out_info->type_info = &op_info; break; } diff --git a/src/xenia/gpu/spirv_shader_translator_fetch.cc b/src/xenia/gpu/spirv_shader_translator_fetch.cc index 3990486b5..10eb5fa59 100644 --- a/src/xenia/gpu/spirv_shader_translator_fetch.cc +++ b/src/xenia/gpu/spirv_shader_translator_fetch.cc @@ -763,7 +763,7 @@ void SpirvShaderTranslator::ProcessTextureFetchInstruction( // multiplication in texture sampling apparently round differently, so // `mul` gives a value that would be floored as expected, but the // left/upper pixel is still sampled instead. - const float kRoundingOffset = 1.5f / 1024.0f; + constexpr float kRoundingOffset = 1.5f / 1024.0f; switch (instr.dimension) { case xenos::FetchOpDimension::k1D: offset_values[0] = instr.attributes.offset_x + kRoundingOffset; diff --git a/src/xenia/gpu/texture_info_formats.cc b/src/xenia/gpu/texture_info_formats.cc index 2ef0ed330..99f4516c3 100644 --- a/src/xenia/gpu/texture_info_formats.cc +++ b/src/xenia/gpu/texture_info_formats.cc @@ -19,7 +19,7 @@ using namespace xe::gpu::xenos; #define FORMAT_INFO(texture_format, format, block_width, block_height, bits_per_pixel) \ {xenos::TextureFormat::texture_format, FormatType::format, block_width, block_height, bits_per_pixel} const FormatInfo* FormatInfo::Get(uint32_t gpu_format) { - static const FormatInfo format_infos[64] = { + static constexpr FormatInfo format_infos[64] = { #include "texture_info_formats.inl" }; return &format_infos[gpu_format]; diff --git a/src/xenia/gpu/vulkan/deferred_command_buffer.h b/src/xenia/gpu/vulkan/deferred_command_buffer.h index 186639c86..f151ab3ba 100644 --- a/src/xenia/gpu/vulkan/deferred_command_buffer.h +++ b/src/xenia/gpu/vulkan/deferred_command_buffer.h @@ -306,7 +306,7 @@ class DeferredCommandBuffer { void CmdVkSetScissor(uint32_t first_scissor, uint32_t scissor_count, const VkRect2D* scissors) { - const size_t header_size = + constexpr size_t header_size = xe::align(sizeof(ArgsVkSetScissor), alignof(VkRect2D)); uint8_t* args_ptr = reinterpret_cast( WriteCommand(Command::kVkSetScissor, @@ -345,7 +345,7 @@ class DeferredCommandBuffer { void CmdVkSetViewport(uint32_t first_viewport, uint32_t viewport_count, const VkViewport* viewports) { - const size_t header_size = + constexpr size_t header_size = xe::align(sizeof(ArgsVkSetViewport), alignof(VkViewport)); uint8_t* args_ptr = reinterpret_cast( WriteCommand(Command::kVkSetViewport, diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index bdf509986..fe2c63404 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -54,18 +54,18 @@ namespace shaders { #include "xenia/gpu/shaders/bytecode/vulkan_spirv/fullscreen_cw_vs.h" } // namespace shaders -const VkDescriptorPoolSize +constexpr VkDescriptorPoolSize VulkanCommandProcessor::kDescriptorPoolSizeUniformBuffer = { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, SpirvShaderTranslator::kConstantBufferCount* kLinkedTypeDescriptorPoolSetCount}; -const VkDescriptorPoolSize +constexpr VkDescriptorPoolSize VulkanCommandProcessor::kDescriptorPoolSizeStorageBuffer = { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, kLinkedTypeDescriptorPoolSetCount}; // 2x descriptors for texture images because of unsigned and signed bindings. -const VkDescriptorPoolSize +constexpr VkDescriptorPoolSize VulkanCommandProcessor::kDescriptorPoolSizeTextures[2] = { {VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 2 * kLinkedTypeDescriptorPoolSetCount}, diff --git a/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc b/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc index cb5839106..729b3f0f5 100644 --- a/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc @@ -442,7 +442,7 @@ void VulkanPipelineCache::WritePipelineRenderTargetDescription( if (write_mask) { assert_zero(write_mask & ~uint32_t(0b1111)); // 32 because of 0x1F mask, for safety (all unknown to zero). - static const PipelineBlendFactor kBlendFactorMap[32] = { + static constexpr PipelineBlendFactor kBlendFactorMap[32] = { /* 0 */ PipelineBlendFactor::kZero, /* 1 */ PipelineBlendFactor::kOne, /* 2 */ PipelineBlendFactor::kZero, // ? diff --git a/src/xenia/gpu/vulkan/vulkan_texture_cache.cc b/src/xenia/gpu/vulkan/vulkan_texture_cache.cc index 142a212cd..3a18c2347 100644 --- a/src/xenia/gpu/vulkan/vulkan_texture_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_texture_cache.cc @@ -88,7 +88,7 @@ namespace shaders { static_assert(VK_FORMAT_UNDEFINED == VkFormat(0), "Assuming that skipping a VkFormat in an initializer results in " "VK_FORMAT_UNDEFINED"); -const VulkanTextureCache::HostFormatPair +constexpr VulkanTextureCache::HostFormatPair VulkanTextureCache::kBestHostFormats[64] = { // k_1_REVERSE {{kLoadShaderIndexUnknown}, @@ -408,14 +408,14 @@ const VulkanTextureCache::HostFormatPair // Always decompressing them to RGBA8, which is required to be linear-filterable // as UNORM and SNORM. -const VulkanTextureCache::HostFormatPair +constexpr VulkanTextureCache::HostFormatPair VulkanTextureCache::kHostFormatGBGRUnaligned = { {kLoadShaderIndexGBGR8ToRGB8, VK_FORMAT_R8G8B8A8_UNORM, false, true}, {kLoadShaderIndexGBGR8ToRGB8, VK_FORMAT_R8G8B8A8_SNORM, false, true}, xenos::XE_GPU_TEXTURE_SWIZZLE_RGBB, true}; -const VulkanTextureCache::HostFormatPair +constexpr VulkanTextureCache::HostFormatPair VulkanTextureCache::kHostFormatBGRGUnaligned = { {kLoadShaderIndexBGRG8ToRGB8, VK_FORMAT_R8G8B8A8_UNORM, false, true}, {kLoadShaderIndexBGRG8ToRGB8, VK_FORMAT_R8G8B8A8_SNORM, false, true}, diff --git a/src/xenia/hid/hid_demo.cc b/src/xenia/hid/hid_demo.cc index f3966a467..bfff92146 100644 --- a/src/xenia/hid/hid_demo.cc +++ b/src/xenia/hid/hid_demo.cc @@ -221,7 +221,7 @@ bool HidDemoApp::OnInitialize() { void HidDemoApp::HidDemoDialog::OnDraw(ImGuiIO& io) { app_.Draw(io); } void HidDemoApp::Draw(ImGuiIO& io) { - const ImGuiWindowFlags wflags = + constexpr ImGuiWindowFlags wflags = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar; diff --git a/src/xenia/kernel/xam/achievement_manager.h b/src/xenia/kernel/xam/achievement_manager.h index cb96a11f7..6e9ce86c2 100644 --- a/src/xenia/kernel/xam/achievement_manager.h +++ b/src/xenia/kernel/xam/achievement_manager.h @@ -51,7 +51,7 @@ struct X_ACHIEVEMENT_DETAILS { X_FILETIME unlock_time; xe::be flags; - static const size_t kStringBufferSize = 464; + static constexpr size_t kStringBufferSize = 464; }; static_assert_size(X_ACHIEVEMENT_DETAILS, 36); diff --git a/src/xenia/kernel/xam/xam_content_device.cc b/src/xenia/kernel/xam/xam_content_device.cc index 10b24522c..90e932859 100644 --- a/src/xenia/kernel/xam/xam_content_device.cc +++ b/src/xenia/kernel/xam/xam_content_device.cc @@ -32,13 +32,13 @@ namespace xam { // will not be recognized properly. #define ONE_GB (1024ull * 1024ull * 1024ull) -static const DummyDeviceInfo dummy_hdd_device_info_ = { +static constexpr DummyDeviceInfo dummy_hdd_device_info_ = { DummyDeviceId::HDD, DeviceType::HDD, 20ull * ONE_GB, // 20GB 3ull * ONE_GB, // 3GB, so it looks a little used. u"Dummy HDD", }; -static const DummyDeviceInfo dummy_odd_device_info_ = { +static constexpr DummyDeviceInfo dummy_odd_device_info_ = { DummyDeviceId::ODD, DeviceType::ODD, 7ull * ONE_GB, // 7GB (rough maximum) 0ull * ONE_GB, // read-only FS, so no free space diff --git a/src/xenia/kernel/xam/xam_net.cc b/src/xenia/kernel/xam/xam_net.cc index e47a7a057..9c0e8ce7c 100644 --- a/src/xenia/kernel/xam/xam_net.cc +++ b/src/xenia/kernel/xam/xam_net.cc @@ -550,11 +550,11 @@ DECLARE_XAM_EXPORT1(NetDll_XNetSetSystemLinkPort, kNetworking, kStub); // https://github.com/ILOVEPIE/Cxbx-Reloaded/blob/master/src/CxbxKrnl/EmuXOnline.h#L39 struct XEthernetStatus { - static const uint32_t XNET_ETHERNET_LINK_ACTIVE = 0x01; - static const uint32_t XNET_ETHERNET_LINK_100MBPS = 0x02; - static const uint32_t XNET_ETHERNET_LINK_10MBPS = 0x04; - static const uint32_t XNET_ETHERNET_LINK_FULL_DUPLEX = 0x08; - static const uint32_t XNET_ETHERNET_LINK_HALF_DUPLEX = 0x10; + static constexpr uint32_t XNET_ETHERNET_LINK_ACTIVE = 0x01; + static constexpr uint32_t XNET_ETHERNET_LINK_100MBPS = 0x02; + static constexpr uint32_t XNET_ETHERNET_LINK_10MBPS = 0x04; + static constexpr uint32_t XNET_ETHERNET_LINK_FULL_DUPLEX = 0x08; + static constexpr uint32_t XNET_ETHERNET_LINK_HALF_DUPLEX = 0x10; }; dword_result_t NetDll_XNetGetEthernetLinkStatus_entry(dword_t caller) { diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index fb1181233..85561146b 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -1554,7 +1554,7 @@ bool xeDrawProfileContent(ui::ImGuiDrawer* imgui_drawer, const uint64_t xuid, uint64_t* selected_xuid) { auto profile_manager = kernel_state()->xam_state()->profile_manager(); - const float default_image_size = 75.0f; + constexpr float default_image_size = 75.0f; const ImVec2 next_window_position = ImVec2(ImGui::GetWindowPos().x + ImGui::GetWindowSize().x + 20.f, ImGui::GetWindowPos().y); diff --git a/src/xenia/kernel/xiocompletion.h b/src/xenia/kernel/xiocompletion.h index a7d34889d..8a5a5ec7c 100644 --- a/src/xenia/kernel/xiocompletion.h +++ b/src/xenia/kernel/xiocompletion.h @@ -39,7 +39,7 @@ class XIOCompletion : public XObject { bool WaitForNotification(uint64_t wait_ticks, IONotification* notify); private: - static const uint32_t kMaxNotifications = 1024; + static constexpr uint32_t kMaxNotifications = 1024; std::mutex notification_lock_; std::queue notifications_; diff --git a/src/xenia/kernel/xthread.cc b/src/xenia/kernel/xthread.cc index fc32c2fa0..559afd6bd 100644 --- a/src/xenia/kernel/xthread.cc +++ b/src/xenia/kernel/xthread.cc @@ -307,7 +307,7 @@ X_STATUS XThread::Create() { module->GetOptHeader(XEX_HEADER_TLS_INFO, &tls_header); } - const uint32_t kDefaultTlsSlotCount = 1024; + constexpr uint32_t kDefaultTlsSlotCount = 1024; uint32_t tls_slots = kDefaultTlsSlotCount; uint32_t tls_extended_size = 0; if (tls_header && tls_header->slot_count) { diff --git a/src/xenia/patcher/plugin_loader.cc b/src/xenia/patcher/plugin_loader.cc index 002708080..a054a28a1 100644 --- a/src/xenia/patcher/plugin_loader.cc +++ b/src/xenia/patcher/plugin_loader.cc @@ -235,7 +235,7 @@ void PluginLoader::LoadTitlePlugin(const PluginInfoEntry& entry) { } void PluginLoader::CreatePluginDevice(const uint32_t title_id) { - const std::string mount_plugins = "\\Device\\Plugins"; + constexpr std::string_view mount_plugins = "\\Device\\Plugins"; const std::filesystem::path plugins_host_path = plugins_root_ / fmt::format("{:08X}", title_id); diff --git a/src/xenia/ui/d3d12/d3d12_util.cc b/src/xenia/ui/d3d12/d3d12_util.cc index caea2b296..d9afca622 100644 --- a/src/xenia/ui/d3d12/d3d12_util.cc +++ b/src/xenia/ui/d3d12/d3d12_util.cc @@ -17,9 +17,11 @@ namespace ui { namespace d3d12 { namespace util { -const D3D12_HEAP_PROPERTIES kHeapPropertiesDefault = {D3D12_HEAP_TYPE_DEFAULT}; -const D3D12_HEAP_PROPERTIES kHeapPropertiesUpload = {D3D12_HEAP_TYPE_UPLOAD}; -const D3D12_HEAP_PROPERTIES kHeapPropertiesReadback = { +constexpr D3D12_HEAP_PROPERTIES kHeapPropertiesDefault = { + D3D12_HEAP_TYPE_DEFAULT}; +constexpr D3D12_HEAP_PROPERTIES kHeapPropertiesUpload = { + D3D12_HEAP_TYPE_UPLOAD}; +constexpr D3D12_HEAP_PROPERTIES kHeapPropertiesReadback = { D3D12_HEAP_TYPE_READBACK}; ID3D12RootSignature* CreateRootSignature( diff --git a/src/xenia/ui/imgui_drawer.cc b/src/xenia/ui/imgui_drawer.cc index 1e935d29e..70c5d4698 100644 --- a/src/xenia/ui/imgui_drawer.cc +++ b/src/xenia/ui/imgui_drawer.cc @@ -42,7 +42,7 @@ namespace ui { // File: 'ProggyTiny.ttf' (35656 bytes) // Exported using binary_to_compressed_c.cpp -const char kProggyTinyCompressedDataBase85[10953 + 1] = +constexpr char kProggyTinyCompressedDataBase85[10953 + 1] = R"(7])#######LJg=:'/###[),##/l:$#Q6>##5[n42>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCm<]vf.r$<$u7k;hb';9C'mm?]XmKVeU2cD4Eo3R/[WB]b(MC;$jPfY.;h^`ItLw6Lh2TlS+f-s$o6Q#X14,MZ[Z##UE31#J&###Q-F%b>-nw'w++GM-]u)Nx0#,M[LH>#Zsvx+6O_^#l(FS7f`C_&E?g'&kcg-6Y,/;M#@2G`Bf%=(`5LF%fv$8#,+[0#veg>$EB&sQSSDgEKnIS7EM9>Z,KO_/78pQWqJE#$nt-4$F&###E`J&#uU'B#*9D6N;@;=-:U>hL&Y5<-%A9;-Y+Z&P^)9##._L&#awnk+ib*.-Z06X1>LcA#'rB#$o4ve6)fbA#kt72LN.72L=CG&#*iXZWt(F,>>#_03:)`(@2L@^x4Sj2B@PN#[xO8QkJNRR()N@#f.Mr#)t-L5FGMm8#&#/2TkLi3n##-/5##MwQ0#EB^1v&ols-)-mTMQ@-##qlQ08*lkA#aNRV7KRYML%4_s[kNa=_0Z%7Nd4[3#S@1g_/v`W#'`Fm#B$(Q#n$oqvc$&Svv$`,TM%,PS=%OeJE%s+]l%A=Fe%']K#&7aW5&O-Nd&q&>^&GZs1'w.bA'c>u>'B-1R'%gJ.(t1tx'_jH4(iNdc(GJ*X(l`uf(^Wqr(-=Jx(=[%5)')Gb)$1vV)57Vk),8n<*BYl/*qs%]*OI5R*Fkgb*H<+q*TQv(+Xak6+?C@H+5SaT+o2VhLKd)k+i$xl+4YW=,sJd,,C*oT,Eb:K,mSPgLsF8e,Z$=rJ[<5J`E:E&#k&bV7uVco]JfaJ2M'8L#xArJ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V7A4=onx4A1OY5EI0;6Ibgr6M$HS7Q<)58UT`l8Ym@M9^/x.:bGXf:f`9G;jxp((F+;?,_br?0wBS@49$5A8QZlAQ#]V-kw:8.o9ro.sQRP/wj320%-ki0)EKJ1-^,,21vcc258DD39P%&4=i[]4A+=>5ECtu5I[TV6Mt587Q6mo7tB'DW-fJcMxUq4S=Gj(N=eC]OkKu=Yc/;ip3#T(j:6s7R`?U+rH#5PSpL7]bIFtIqmW:YYdQqFrhod(WEH1VdDMSrZ>vViBn_t.CTp;JCbMMrdku.Sek+f4ft(XfCsOFlfOuo7[&+T.q6jHPA$HHPB*QHPC0ZHPD6dHPD3Q-P_aQL2> notification_icons = { @@ -4610,5 +4610,5 @@ static const std::vector> {player_any_notification_icon, player_any_notification_icon_len}, }; -static const std::pair locked_achievement_icon = { +static constexpr std::pair locked_achievement_icon = { locked_achievement_icon_data, locked_achievement_icon_len}; diff --git a/src/xenia/ui/vulkan/vulkan_presenter.cc b/src/xenia/ui/vulkan/vulkan_presenter.cc index c158415c4..b6428b81f 100644 --- a/src/xenia/ui/vulkan/vulkan_presenter.cc +++ b/src/xenia/ui/vulkan/vulkan_presenter.cc @@ -1027,12 +1027,12 @@ VkSwapchainKHR VulkanPresenter::PaintContext::CreateSwapchainForVulkanSurface( } #if XE_PLATFORM_ANDROID // Android uses R8G8B8A8. - static const VkFormat kFormat8888Primary = VK_FORMAT_R8G8B8A8_UNORM; - static const VkFormat kFormat8888Secondary = VK_FORMAT_B8G8R8A8_UNORM; + static constexpr VkFormat kFormat8888Primary = VK_FORMAT_R8G8B8A8_UNORM; + static constexpr VkFormat kFormat8888Secondary = VK_FORMAT_B8G8R8A8_UNORM; #else // GNU/Linux X11 and Windows DWM use B8G8R8A8. - static const VkFormat kFormat8888Primary = VK_FORMAT_B8G8R8A8_UNORM; - static const VkFormat kFormat8888Secondary = VK_FORMAT_R8G8B8A8_UNORM; + static constexpr VkFormat kFormat8888Primary = VK_FORMAT_B8G8R8A8_UNORM; + static constexpr VkFormat kFormat8888Secondary = VK_FORMAT_R8G8B8A8_UNORM; #endif VkSurfaceFormatKHR image_format; if (surface_formats.empty() || @@ -2504,7 +2504,7 @@ VkPipeline VulkanPresenter::CreateGuestOutputPaintPipeline( color_blend_state.attachmentCount = 1; color_blend_state.pAttachments = &color_blend_attachment_state; - static const VkDynamicState kPipelineDynamicStates[] = { + static constexpr VkDynamicState kPipelineDynamicStates[] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, }; diff --git a/src/xenia/ui/window_android.cc b/src/xenia/ui/window_android.cc index 8de82f400..0e675c05b 100644 --- a/src/xenia/ui/window_android.cc +++ b/src/xenia/ui/window_android.cc @@ -163,7 +163,7 @@ bool AndroidWindow::OnActivitySurfaceMotionEvent(jobject event) { event, jni_ids.motion_event_get_y, 0), 0.0f, float(GetActualPhysicalHeight())) + 0.5f); - static const MouseEvent::Button kMouseEventButtons[] = { + static constexpr MouseEvent::Button kMouseEventButtons[] = { MouseEvent::Button::kLeft, MouseEvent::Button::kRight, MouseEvent::Button::kMiddle, MouseEvent::Button::kX1, MouseEvent::Button::kX2,