From bdd3e84d420a5e0cd66e415544f97c7d8c379e02 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 16 Feb 2023 01:09:31 +0100 Subject: [PATCH] early-access version 3404 --- README.md | 2 +- src/audio_core/renderer/adsp/audio_renderer.cpp | 2 +- .../renderer/command/effect/i3dl2_reverb.cpp | 8 ++++---- src/audio_core/renderer/command/effect/reverb.cpp | 8 ++++---- .../renderer/command/resample/upsample.cpp | 12 ++++++------ src/audio_core/renderer/system_manager.cpp | 2 +- src/audio_core/sink/sink_stream.cpp | 4 ++-- src/core/core_timing.cpp | 2 +- src/core/debugger/gdbstub_arch.cpp | 14 ++++---------- src/core/debugger/gdbstub_arch.h | 6 +++--- src/core/file_sys/ips_layer.cpp | 8 ++++---- src/core/file_sys/registered_cache.cpp | 2 +- src/core/hle/kernel/svc/svc_activity.cpp | 2 +- src/core/hle/service/am/am.cpp | 2 +- src/core/hle/service/apm/apm_controller.cpp | 2 +- .../hle/service/nvdrv/core/syncpoint_manager.h | 2 +- src/core/hle/service/time/time_zone_manager.cpp | 2 +- src/core/telemetry_session.cpp | 2 +- src/input_common/drivers/joycon.cpp | 2 +- src/input_common/drivers/sdl_driver.cpp | 4 ++-- src/video_core/engines/maxwell_3d.cpp | 2 +- src/video_core/memory_manager.h | 2 +- src/video_core/renderer_vulkan/vk_smaa.cpp | 14 +++++++------- src/video_core/renderer_vulkan/vk_texture_cache.h | 2 +- src/video_core/renderer_vulkan/vk_turbo_mode.cpp | 4 ++-- src/video_core/textures/decoders.cpp | 2 +- src/yuzu/main.cpp | 2 +- 27 files changed, 55 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index d9311385c..fe01d31be 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3403. +This is the source code for early-access 3404. ## Legal Notice diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp index fd038d7b3..733bf34ac 100755 --- a/src/audio_core/renderer/adsp/audio_renderer.cpp +++ b/src/audio_core/renderer/adsp/audio_renderer.cpp @@ -132,7 +132,7 @@ void AudioRenderer::CreateSinkStreams() { } void AudioRenderer::ThreadFunc() { - constexpr char name[]{"AudioRenderer"}; + static constexpr char name[]{"AudioRenderer"}; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp index 5003b916b..4f9543cd5 100755 --- a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp +++ b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp @@ -244,16 +244,16 @@ template static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, std::span> inputs, std::span> outputs, const u32 sample_count) { - constexpr std::array OutTapIndexes1Ch{ + static constexpr std::array OutTapIndexes1Ch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - constexpr std::array OutTapIndexes2Ch{ + static constexpr std::array OutTapIndexes2Ch{ 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, }; - constexpr std::array OutTapIndexes4Ch{ + static constexpr std::array OutTapIndexes4Ch{ 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, }; - constexpr std::array OutTapIndexes6Ch{ + static constexpr std::array OutTapIndexes6Ch{ 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, }; diff --git a/src/audio_core/renderer/command/effect/reverb.cpp b/src/audio_core/renderer/command/effect/reverb.cpp index 25c2910aa..0a823acad 100755 --- a/src/audio_core/renderer/command/effect/reverb.cpp +++ b/src/audio_core/renderer/command/effect/reverb.cpp @@ -252,16 +252,16 @@ template static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, std::vector>& inputs, std::vector>& outputs, const u32 sample_count) { - constexpr std::array OutTapIndexes1Ch{ + static constexpr std::array OutTapIndexes1Ch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - constexpr std::array OutTapIndexes2Ch{ + static constexpr std::array OutTapIndexes2Ch{ 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, }; - constexpr std::array OutTapIndexes4Ch{ + static constexpr std::array OutTapIndexes4Ch{ 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, }; - constexpr std::array OutTapIndexes6Ch{ + static constexpr std::array OutTapIndexes6Ch{ 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, }; diff --git a/src/audio_core/renderer/command/resample/upsample.cpp b/src/audio_core/renderer/command/resample/upsample.cpp index 25b4dc5c1..43eaaba43 100755 --- a/src/audio_core/renderer/command/resample/upsample.cpp +++ b/src/audio_core/renderer/command/resample/upsample.cpp @@ -19,24 +19,24 @@ namespace AudioCore::AudioRenderer { static void SrcProcessFrame(std::span output, std::span input, const u32 target_sample_count, const u32 source_sample_count, UpsamplerState* state) { - constexpr u32 WindowSize = 10; - constexpr std::array, WindowSize> WindowedSinc1{ + static constexpr u32 WindowSize = 10; + static constexpr std::array, WindowSize> WindowedSinc1{ 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, }; - constexpr std::array, WindowSize> WindowedSinc2{ + static constexpr std::array, WindowSize> WindowedSinc2{ 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, }; - constexpr std::array, WindowSize> WindowedSinc3{ + static constexpr std::array, WindowSize> WindowedSinc3{ 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, }; - constexpr std::array, WindowSize> WindowedSinc4{ + static constexpr std::array, WindowSize> WindowedSinc4{ 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, }; - constexpr std::array, WindowSize> WindowedSinc5{ + static constexpr std::array, WindowSize> WindowedSinc5{ 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, }; diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index 23320f01c..8b04e016a 100755 --- a/src/audio_core/renderer/system_manager.cpp +++ b/src/audio_core/renderer/system_manager.cpp @@ -94,7 +94,7 @@ bool SystemManager::Remove(System& system_) { } void SystemManager::ThreadFunc() { - constexpr char name[]{"AudioRenderSystemManager"}; + static constexpr char name[]{"AudioRenderSystemManager"}; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); Common::SetCurrentThreadPriority(Common::ThreadPriority::High); diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index bf57e85c5..8008b6917 100755 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -35,7 +35,7 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector& samples) { if (system_channels == 6 && device_channels == 2) { // We're given 6 channels, but our device only outputs 2, so downmix. - constexpr std::array down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; + static constexpr std::array down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; for (u32 read_index = 0, write_index = 0; read_index < samples.size(); read_index += system_channels, write_index += device_channels) { @@ -202,7 +202,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span output_buffer, std::siz // If we're paused or going to shut down, we don't want to consume buffers as coretiming is // paused and we'll desync, so just play silence. if (system.IsPaused() || system.IsShuttingDown()) { - constexpr std::array silence{}; + static constexpr std::array silence{}; for (size_t i = frames_written; i < num_frames; i++) { std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); } diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index cc23487a9..f5d2ade86 100755 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -45,7 +45,7 @@ CoreTiming::~CoreTiming() { } void CoreTiming::ThreadEntry(CoreTiming& instance) { - constexpr char name[] = "HostTiming"; + static constexpr char name[] = "HostTiming"; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); diff --git a/src/core/debugger/gdbstub_arch.cpp b/src/core/debugger/gdbstub_arch.cpp index d584a6b08..a7906e842 100755 --- a/src/core/debugger/gdbstub_arch.cpp +++ b/src/core/debugger/gdbstub_arch.cpp @@ -41,9 +41,8 @@ static void PutSIMDRegister(std::array& simd_regs, size_t offset, const // For sample XML files see the GDB source /gdb/features // This XML defines what the registers are for this specific ARM device -std::string GDBStubA64::GetTargetXML() const { - constexpr const char* target_xml = - R"( +std::string_view GDBStubA64::GetTargetXML() const { + return R"( aarch64 @@ -178,8 +177,6 @@ std::string GDBStubA64::GetTargetXML() const { )"; - - return target_xml; } std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const { @@ -270,9 +267,8 @@ u32 GDBStubA64::BreakpointInstruction() const { return 0xd4200000; } -std::string GDBStubA32::GetTargetXML() const { - constexpr const char* target_xml = - R"( +std::string_view GDBStubA32::GetTargetXML() const { + return R"( arm @@ -378,8 +374,6 @@ std::string GDBStubA32::GetTargetXML() const { )"; - - return target_xml; } std::string GDBStubA32::RegRead(const Kernel::KThread* thread, size_t id) const { diff --git a/src/core/debugger/gdbstub_arch.h b/src/core/debugger/gdbstub_arch.h index f082b02e1..8f02d437a 100755 --- a/src/core/debugger/gdbstub_arch.h +++ b/src/core/debugger/gdbstub_arch.h @@ -16,7 +16,7 @@ namespace Core { class GDBStubArch { public: virtual ~GDBStubArch() = default; - virtual std::string GetTargetXML() const = 0; + virtual std::string_view GetTargetXML() const = 0; virtual std::string RegRead(const Kernel::KThread* thread, size_t id) const = 0; virtual void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const = 0; virtual std::string ReadRegisters(const Kernel::KThread* thread) const = 0; @@ -27,7 +27,7 @@ public: class GDBStubA64 final : public GDBStubArch { public: - std::string GetTargetXML() const override; + std::string_view GetTargetXML() const override; std::string RegRead(const Kernel::KThread* thread, size_t id) const override; void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; std::string ReadRegisters(const Kernel::KThread* thread) const override; @@ -47,7 +47,7 @@ private: class GDBStubA32 final : public GDBStubArch { public: - std::string GetTargetXML() const override; + std::string_view GetTargetXML() const override; std::string RegRead(const Kernel::KThread* thread, size_t id) const override; void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; std::string ReadRegisters(const Kernel::KThread* thread) const override; diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index f8400f075..76369bd20 100755 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -41,12 +41,12 @@ static IPSFileType IdentifyMagic(const std::vector& magic) { return IPSFileType::Error; } - constexpr std::array patch_magic{{'P', 'A', 'T', 'C', 'H'}}; + static constexpr std::array patch_magic{{'P', 'A', 'T', 'C', 'H'}}; if (std::equal(magic.begin(), magic.end(), patch_magic.begin())) { return IPSFileType::IPS; } - constexpr std::array ips32_magic{{'I', 'P', 'S', '3', '2'}}; + static constexpr std::array ips32_magic{{'I', 'P', 'S', '3', '2'}}; if (std::equal(magic.begin(), magic.end(), ips32_magic.begin())) { return IPSFileType::IPS32; } @@ -55,12 +55,12 @@ static IPSFileType IdentifyMagic(const std::vector& magic) { } static bool IsEOF(IPSFileType type, const std::vector& data) { - constexpr std::array eof{{'E', 'O', 'F'}}; + static constexpr std::array eof{{'E', 'O', 'F'}}; if (type == IPSFileType::IPS && std::equal(data.begin(), data.end(), eof.begin())) { return true; } - constexpr std::array eeof{{'E', 'E', 'O', 'F'}}; + static constexpr std::array eeof{{'E', 'E', 'O', 'F'}}; return type == IPSFileType::IPS32 && std::equal(data.begin(), data.end(), eeof.begin()); } diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index ebcc7e323..fc7b6628f 100755 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -71,7 +71,7 @@ static std::string GetRelativePathFromNcaID(const std::array& nca_id, bo } static std::string GetCNMTName(TitleType type, u64 title_id) { - constexpr std::array TITLE_TYPE_NAMES{ + static constexpr std::array TITLE_TYPE_NAMES{ "SystemProgram", "SystemData", "SystemUpdate", diff --git a/src/core/hle/kernel/svc/svc_activity.cpp b/src/core/hle/kernel/svc/svc_activity.cpp index 2e7b680d0..63bc08555 100755 --- a/src/core/hle/kernel/svc/svc_activity.cpp +++ b/src/core/hle/kernel/svc/svc_activity.cpp @@ -16,7 +16,7 @@ Result SetThreadActivity(Core::System& system, Handle thread_handle, thread_activity); // Validate the activity. - constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { + static constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; }; R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 22d72343a..330ae04a0 100755 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -1570,7 +1570,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { const auto& version = res.first->GetVersionString(); std::copy(version.begin(), version.end(), version_string.begin()); } else { - constexpr char default_version[]{"1.0.0"}; + static constexpr char default_version[]{"1.0.0"}; std::memcpy(version_string.data(), default_version, sizeof(default_version)); } diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp index 0f6d4414b..512e0e8e8 100755 --- a/src/core/hle/service/apm/apm_controller.cpp +++ b/src/core/hle/service/apm/apm_controller.cpp @@ -56,7 +56,7 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode, } void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { - constexpr std::array BOOST_MODE_TO_CONFIG_MAP{{ + static constexpr std::array BOOST_MODE_TO_CONFIG_MAP{{ PerformanceConfiguration::Config7, PerformanceConfiguration::Config13, PerformanceConfiguration::Config15, diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.h b/src/core/hle/service/nvdrv/core/syncpoint_manager.h index e6c268964..499a4500c 100755 --- a/src/core/hle/service/nvdrv/core/syncpoint_manager.h +++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.h @@ -124,7 +124,7 @@ private: //!< value }; - constexpr static std::size_t SyncpointCount{192}; + static constexpr std::size_t SyncpointCount{192}; std::array syncpoints{}; std::mutex reservation_lock; diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index 990322e34..3256c3876 100755 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -286,7 +286,7 @@ static constexpr int TransitionTime(int year, Rule rule, int offset) { } static bool ParsePosixName(const char* name, TimeZoneRule& rule) { - constexpr char default_rule[]{",M4.1.0,M10.5.0"}; + static constexpr char default_rule[]{",M4.1.0,M10.5.0"}; const char* std_name{name}; int std_len{}; int offset{}; diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 954232501..12e08e894 100755 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -34,7 +34,7 @@ static u64 GenerateTelemetryId() { mbedtls_entropy_context entropy; mbedtls_entropy_init(&entropy); mbedtls_ctr_drbg_context ctr_drbg; - constexpr std::array personalization{{"yuzu Telemetry ID"}}; + static constexpr std::array personalization{{"yuzu Telemetry ID"}}; mbedtls_ctr_drbg_init(&ctr_drbg); ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index afc33db57..b4cd39a20 100755 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp @@ -390,7 +390,7 @@ void Joycons::OnMotionUpdate(std::size_t port, Joycon::ControllerType type, int void Joycons::OnRingConUpdate(f32 ring_data) { // To simplify ring detection it will always be mapped to an empty identifier for all // controllers - constexpr PadIdentifier identifier = { + static constexpr PadIdentifier identifier = { .guid = Common::UUID{}, .port = 0, .pad = 0, diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index fc577a5f7..20a533a54 100755 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -616,7 +616,7 @@ bool SDLDriver::IsVibrationEnabled(const PadIdentifier& identifier) { const auto joystick = GetSDLJoystickByGUID(identifier.guid.RawString(), static_cast(identifier.port)); - constexpr Common::Input::VibrationStatus test_vibration{ + static constexpr Common::Input::VibrationStatus test_vibration{ .low_amplitude = 1, .low_frequency = 160.0f, .high_amplitude = 1, @@ -624,7 +624,7 @@ bool SDLDriver::IsVibrationEnabled(const PadIdentifier& identifier) { .type = Common::Input::VibrationAmplificationType::Exponential, }; - constexpr Common::Input::VibrationStatus zero_vibration{ + static constexpr Common::Input::VibrationStatus zero_vibration{ .low_amplitude = 0, .low_frequency = 160.0f, .high_amplitude = 0, diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 323976be9..f7327ed92 100755 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -259,7 +259,7 @@ u32 Maxwell3D::GetMaxCurrentVertices() { size_t Maxwell3D::EstimateIndexBufferSize() { GPUVAddr start_address = regs.index_buffer.StartAddress(); GPUVAddr end_address = regs.index_buffer.EndAddress(); - constexpr std::array max_sizes = { + static constexpr std::array max_sizes = { std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()}; const size_t byte_size = regs.index_buffer.FormatSizeInBytes(); diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index b02478f79..577eb9ed6 100755 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -216,7 +216,7 @@ private: std::vector big_page_continous; std::vector> page_stash{}; - constexpr static size_t continous_bits = 64; + static constexpr size_t continous_bits = 64; const size_t unique_identifier; std::unique_ptr accumulator; diff --git a/src/video_core/renderer_vulkan/vk_smaa.cpp b/src/video_core/renderer_vulkan/vk_smaa.cpp index 8eb735489..f8735189d 100755 --- a/src/video_core/renderer_vulkan/vk_smaa.cpp +++ b/src/video_core/renderer_vulkan/vk_smaa.cpp @@ -468,7 +468,7 @@ VkWriteDescriptorSet CreateWriteDescriptorSet(std::vector } void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) { - constexpr std::array subresources{{{ + static constexpr std::array subresources{{{ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, .baseMipLevel = 0, .levelCount = 1, @@ -528,8 +528,8 @@ SMAA::SMAA(const Device& device, MemoryAllocator& allocator, size_t image_count, } void SMAA::CreateImages() { - constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; - constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; + static constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; + static constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; std::tie(m_static_images[Area], m_static_buffer_commits[Area]) = CreateWrappedImage(m_device, m_allocator, area_extent, VK_FORMAT_R8G8_UNORM); @@ -586,12 +586,12 @@ void SMAA::CreateSampler() { void SMAA::CreateShaders() { // These match the order of the SMAAStage enum - constexpr std::array vert_shader_sources{ + static constexpr std::array vert_shader_sources{ ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_VERT_SPV), ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_VERT_SPV), ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_VERT_SPV), }; - constexpr std::array frag_shader_sources{ + static constexpr std::array frag_shader_sources{ ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_FRAG_SPV), ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_FRAG_SPV), ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_FRAG_SPV), @@ -675,8 +675,8 @@ void SMAA::UploadImages(Scheduler& scheduler) { return; } - constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; - constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; + static constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; + static constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; UploadImage(m_device, m_allocator, scheduler, m_static_images[Area], area_extent, VK_FORMAT_R8G8_UNORM, ARRAY_TO_SPAN(areaTexBytes)); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 046250f5a..8609172ae 100755 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -113,7 +113,7 @@ public: std::optional astc_decoder_pass; const Settings::ResolutionScalingInfo& resolution; - constexpr static size_t indexing_slots = 8 * sizeof(size_t); + static constexpr size_t indexing_slots = 8 * sizeof(size_t); std::array buffers{}; std::array, indexing_slots> buffer_commits{}; }; diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp index c42594149..db04943eb 100755 --- a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp +++ b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp @@ -48,7 +48,7 @@ void TurboMode::Run(std::stop_token stop_token) { auto commit = m_allocator.Commit(buffer, MemoryUsage::DeviceLocal); // Create the descriptor pool to contain our descriptor. - constexpr VkDescriptorPoolSize pool_size{ + static constexpr VkDescriptorPoolSize pool_size{ .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, .descriptorCount = 1, }; @@ -63,7 +63,7 @@ void TurboMode::Run(std::stop_token stop_token) { }); // Create the descriptor set layout from the pool. - constexpr VkDescriptorSetLayoutBinding layout_binding{ + static constexpr VkDescriptorSetLayoutBinding layout_binding{ .binding = 0, .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, .descriptorCount = 1, diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 1861bdffc..a6b65f7fe 100755 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -29,7 +29,7 @@ constexpr u32 pdep(u32 value) { template void incrpdep(u32& value) { - constexpr u32 swizzled_incr = pdep(incr_amount); + static constexpr u32 swizzled_incr = pdep(incr_amount); value = ((value | ~mask) + swizzled_incr) & mask; } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index aca304a65..d40f8bc0a 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -219,7 +219,7 @@ static void LogRuntimes() { #ifdef _MSC_VER // It is possible that the name of the dll will change. // vcruntime140.dll is for 2015 and onwards - constexpr char runtime_dll_name[] = "vcruntime140.dll"; + static constexpr char runtime_dll_name[] = "vcruntime140.dll"; UINT sz = GetFileVersionInfoSizeA(runtime_dll_name, nullptr); bool runtime_version_inspection_worked = false; if (sz > 0) {