summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h8
-rw-r--r--src/video_core/dma_pusher.cpp2
-rw-r--r--src/video_core/engines/fermi_2d.cpp2
-rw-r--r--src/video_core/engines/maxwell_3d.cpp2
-rw-r--r--src/video_core/engines/sw_blitter/converter.cpp10
-rw-r--r--src/video_core/gpu.cpp4
-rw-r--r--src/video_core/host1x/codecs/vp9.cpp4
-rw-r--r--src/video_core/query_cache.h2
-rw-r--r--src/video_core/renderer_opengl/gl_compute_pipeline.cpp3
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.cpp3
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp4
-rw-r--r--src/video_core/renderer_vulkan/blit_image.cpp5
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_smaa.cpp37
-rw-r--r--src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_turbo_mode.cpp4
-rw-r--r--src/video_core/surface.cpp2
-rw-r--r--src/video_core/textures/decoders.cpp2
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp4
24 files changed, 64 insertions, 58 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 627917ab6..b650d0e59 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -890,8 +890,8 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
890 buffer_id, 890 buffer_id,
891 }); 891 });
892 // Align up to avoid cache conflicts 892 // Align up to avoid cache conflicts
893 constexpr u64 align = 8ULL; 893 constexpr static u64 align = 8ULL;
894 constexpr u64 mask = ~(align - 1ULL); 894 constexpr static u64 mask = ~(align - 1ULL);
895 total_size_bytes += (new_size + align - 1) & mask; 895 total_size_bytes += (new_size + align - 1) & mask;
896 largest_copy = std::max(largest_copy, new_size); 896 largest_copy = std::max(largest_copy, new_size);
897 }; 897 };
@@ -1843,8 +1843,8 @@ void BufferCache<P>::DownloadBufferMemory(Buffer& buffer, VAddr cpu_addr, u64 si
1843 .size = new_size, 1843 .size = new_size,
1844 }); 1844 });
1845 // Align up to avoid cache conflicts 1845 // Align up to avoid cache conflicts
1846 constexpr u64 align = 256ULL; 1846 constexpr static u64 align = 256ULL;
1847 constexpr u64 mask = ~(align - 1ULL); 1847 constexpr static u64 mask = ~(align - 1ULL);
1848 total_size_bytes += (new_size + align - 1) & mask; 1848 total_size_bytes += (new_size + align - 1) & mask;
1849 largest_copy = std::max(largest_copy, new_size); 1849 largest_copy = std::max(largest_copy, new_size);
1850 }; 1850 };
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index 551929824..72ad3ccc8 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -75,7 +75,7 @@ bool DmaPusher::Step() {
75 75
76 // Push buffer non-empty, read a word 76 // Push buffer non-empty, read a word
77 command_headers.resize_destructive(command_list_header.size); 77 command_headers.resize_destructive(command_list_header.size);
78 constexpr u32 MacroRegistersStart = 0xE00; 78 constexpr static u32 MacroRegistersStart = 0xE00;
79 if (dma_state.method < MacroRegistersStart) { 79 if (dma_state.method < MacroRegistersStart) {
80 if (Settings::IsGPULevelHigh()) { 80 if (Settings::IsGPULevelHigh()) {
81 memory_manager.ReadBlock(dma_state.dma_get, command_headers.data(), 81 memory_manager.ReadBlock(dma_state.dma_get, command_headers.data(),
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp
index a126c359c..40176821b 100644
--- a/src/video_core/engines/fermi_2d.cpp
+++ b/src/video_core/engines/fermi_2d.cpp
@@ -72,7 +72,7 @@ void Fermi2D::Blit() {
72 UNIMPLEMENTED_IF_MSG(regs.clip_enable != 0, "Clipped blit enabled"); 72 UNIMPLEMENTED_IF_MSG(regs.clip_enable != 0, "Clipped blit enabled");
73 73
74 const auto& args = regs.pixels_from_memory; 74 const auto& args = regs.pixels_from_memory;
75 constexpr s64 null_derivate = 1ULL << 32; 75 constexpr static s64 null_derivate = 1ULL << 32;
76 Surface src = regs.src; 76 Surface src = regs.src;
77 const auto bytes_per_pixel = BytesPerBlock(PixelFormatFromRenderTargetFormat(src.format)); 77 const auto bytes_per_pixel = BytesPerBlock(PixelFormatFromRenderTargetFormat(src.format));
78 const bool delegate_to_gpu = src.width > 512 && src.height > 512 && bytes_per_pixel <= 8 && 78 const bool delegate_to_gpu = src.width > 512 && src.height > 512 && bytes_per_pixel <= 8 &&
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index ae9da6290..3c1af92c4 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -258,7 +258,7 @@ u32 Maxwell3D::GetMaxCurrentVertices() {
258size_t Maxwell3D::EstimateIndexBufferSize() { 258size_t Maxwell3D::EstimateIndexBufferSize() {
259 GPUVAddr start_address = regs.index_buffer.StartAddress(); 259 GPUVAddr start_address = regs.index_buffer.StartAddress();
260 GPUVAddr end_address = regs.index_buffer.EndAddress(); 260 GPUVAddr end_address = regs.index_buffer.EndAddress();
261 constexpr std::array<size_t, 4> max_sizes = { 261 constexpr static std::array<size_t, 4> max_sizes = {
262 std::numeric_limits<u8>::max(), std::numeric_limits<u16>::max(), 262 std::numeric_limits<u8>::max(), std::numeric_limits<u16>::max(),
263 std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()}; 263 std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()};
264 const size_t byte_size = regs.index_buffer.FormatSizeInBytes(); 264 const size_t byte_size = regs.index_buffer.FormatSizeInBytes();
diff --git a/src/video_core/engines/sw_blitter/converter.cpp b/src/video_core/engines/sw_blitter/converter.cpp
index 2419b5632..11674c748 100644
--- a/src/video_core/engines/sw_blitter/converter.cpp
+++ b/src/video_core/engines/sw_blitter/converter.cpp
@@ -694,16 +694,16 @@ private:
694 }; 694 };
695 const auto force_to_fp16 = [](f32 base_value) { 695 const auto force_to_fp16 = [](f32 base_value) {
696 u32 tmp = Common::BitCast<u32>(base_value); 696 u32 tmp = Common::BitCast<u32>(base_value);
697 constexpr size_t fp32_mantissa_bits = 23; 697 constexpr static size_t fp32_mantissa_bits = 23;
698 constexpr size_t fp16_mantissa_bits = 10; 698 constexpr static size_t fp16_mantissa_bits = 10;
699 constexpr size_t mantissa_mask = 699 constexpr static size_t mantissa_mask =
700 ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL); 700 ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL);
701 tmp = tmp & static_cast<u32>(mantissa_mask); 701 tmp = tmp & static_cast<u32>(mantissa_mask);
702 // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM 702 // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM
703 return Common::BitCast<f32>(tmp); 703 return Common::BitCast<f32>(tmp);
704 }; 704 };
705 const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) { 705 const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) {
706 constexpr size_t fp32_mantissa_bits = 23; 706 constexpr static size_t fp32_mantissa_bits = 23;
707 size_t shift_towards = fp32_mantissa_bits - mantissa; 707 size_t shift_towards = fp32_mantissa_bits - mantissa;
708 const u32 new_value = 708 const u32 new_value =
709 static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31)); 709 static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31));
@@ -770,7 +770,7 @@ private:
770 component_mask[which_component]; 770 component_mask[which_component];
771 }; 771 };
772 const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) { 772 const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) {
773 constexpr size_t fp32_mantissa_bits = 23; 773 constexpr static size_t fp32_mantissa_bits = 23;
774 u32 tmp_value = Common::BitCast<u32>(std::max(base_value, 0.0f)); 774 u32 tmp_value = Common::BitCast<u32>(std::max(base_value, 0.0f));
775 size_t shift_towards = fp32_mantissa_bits - mantissa; 775 size_t shift_towards = fp32_mantissa_bits - mantissa;
776 return tmp_value >> shift_towards; 776 return tmp_value >> shift_towards;
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 7024a19cf..caf241eac 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -194,8 +194,8 @@ struct GPU::Impl {
194 [[nodiscard]] u64 GetTicks() const { 194 [[nodiscard]] u64 GetTicks() const {
195 // This values were reversed engineered by fincs from NVN 195 // This values were reversed engineered by fincs from NVN
196 // The gpu clock is reported in units of 385/625 nanoseconds 196 // The gpu clock is reported in units of 385/625 nanoseconds
197 constexpr u64 gpu_ticks_num = 384; 197 constexpr static u64 gpu_ticks_num = 384;
198 constexpr u64 gpu_ticks_den = 625; 198 constexpr static u64 gpu_ticks_den = 625;
199 199
200 u64 nanoseconds = system.CoreTiming().GetGlobalTimeNs().count(); 200 u64 nanoseconds = system.CoreTiming().GetGlobalTimeNs().count();
201 if (Settings::values.use_fast_gpu_time.GetValue()) { 201 if (Settings::values.use_fast_gpu_time.GetValue()) {
diff --git a/src/video_core/host1x/codecs/vp9.cpp b/src/video_core/host1x/codecs/vp9.cpp
index cf40c9012..bb691f7d8 100644
--- a/src/video_core/host1x/codecs/vp9.cpp
+++ b/src/video_core/host1x/codecs/vp9.cpp
@@ -283,7 +283,7 @@ void VP9::EncodeTermSubExp(VpxRangeEncoder& writer, s32 value) {
283 } else { 283 } else {
284 value -= 64; 284 value -= 64;
285 285
286 constexpr s32 size = 8; 286 constexpr static s32 size = 8;
287 287
288 const s32 mask = (1 << size) - 191; 288 const s32 mask = (1 << size) - 191;
289 289
@@ -307,7 +307,7 @@ bool VP9::WriteLessThan(VpxRangeEncoder& writer, s32 value, s32 test) {
307void VP9::WriteCoefProbabilityUpdate(VpxRangeEncoder& writer, s32 tx_mode, 307void VP9::WriteCoefProbabilityUpdate(VpxRangeEncoder& writer, s32 tx_mode,
308 const std::array<u8, 1728>& new_prob, 308 const std::array<u8, 1728>& new_prob,
309 const std::array<u8, 1728>& old_prob) { 309 const std::array<u8, 1728>& old_prob) {
310 constexpr u32 block_bytes = 2 * 2 * 6 * 6 * 3; 310 constexpr static u32 block_bytes = 2 * 2 * 6 * 6 * 3;
311 311
312 const auto needs_update = [&](u32 base_index) { 312 const auto needs_update = [&](u32 base_index) {
313 return !std::equal(new_prob.begin() + base_index, 313 return !std::equal(new_prob.begin() + base_index,
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index 00ce53e3e..c9b482bbe 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -281,7 +281,7 @@ public:
281 explicit HostCounterBase(std::shared_ptr<HostCounter> dependency_) 281 explicit HostCounterBase(std::shared_ptr<HostCounter> dependency_)
282 : dependency{std::move(dependency_)}, depth{dependency ? (dependency->Depth() + 1) : 0} { 282 : dependency{std::move(dependency_)}, depth{dependency ? (dependency->Depth() + 1) : 0} {
283 // Avoid nesting too many dependencies to avoid a stack overflow when these are deleted. 283 // Avoid nesting too many dependencies to avoid a stack overflow when these are deleted.
284 constexpr u64 depth_threshold = 96; 284 constexpr static u64 depth_threshold = 96;
285 if (depth > depth_threshold) { 285 if (depth > depth_threshold) {
286 depth = 0; 286 depth = 0;
287 base_result = dependency->Query(); 287 base_result = dependency->Query();
diff --git a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
index 1a0cea9b7..e49b04975 100644
--- a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp
@@ -162,7 +162,8 @@ void ComputePipeline::Configure() {
162 buffer_cache.UnbindComputeTextureBuffers(); 162 buffer_cache.UnbindComputeTextureBuffers();
163 size_t texbuf_index{}; 163 size_t texbuf_index{};
164 const auto add_buffer{[&](const auto& desc) { 164 const auto add_buffer{[&](const auto& desc) {
165 constexpr bool is_image = std::is_same_v<decltype(desc), const ImageBufferDescriptor&>; 165 constexpr static bool is_image =
166 std::is_same_v<decltype(desc), const ImageBufferDescriptor&>;
166 for (u32 i = 0; i < desc.count; ++i) { 167 for (u32 i = 0; i < desc.count; ++i) {
167 bool is_written{false}; 168 bool is_written{false};
168 if constexpr (is_image) { 169 if constexpr (is_image) {
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 22ed16ebf..a5e27de73 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -126,9 +126,9 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) {
126 const bool is_intel = vendor_name == "Intel"; 126 const bool is_intel = vendor_name == "Intel";
127 127
128#ifdef __unix__ 128#ifdef __unix__
129 constexpr bool is_linux = true; 129 constexpr static bool is_linux = true;
130#else 130#else
131 constexpr bool is_linux = false; 131 constexpr static bool is_linux = false;
132#endif 132#endif
133 133
134 bool disable_fast_buffer_sub_data = false; 134 bool disable_fast_buffer_sub_data = false;
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
index 29491e762..c409d6ae7 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
@@ -385,7 +385,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
385 const auto bind_stage_info{[&](size_t stage) LAMBDA_FORCEINLINE { 385 const auto bind_stage_info{[&](size_t stage) LAMBDA_FORCEINLINE {
386 size_t index{}; 386 size_t index{};
387 const auto add_buffer{[&](const auto& desc) { 387 const auto add_buffer{[&](const auto& desc) {
388 constexpr bool is_image = std::is_same_v<decltype(desc), const ImageBufferDescriptor&>; 388 constexpr static bool is_image =
389 std::is_same_v<decltype(desc), const ImageBufferDescriptor&>;
389 for (u32 i = 0; i < desc.count; ++i) { 390 for (u32 i = 0; i < desc.count; ++i) {
390 bool is_written{false}; 391 bool is_written{false};
391 if constexpr (is_image) { 392 if constexpr (is_image) {
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 2a74c1d05..5d25b8a7d 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -237,7 +237,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuf
237 screen_info.display_texture = screen_info.texture.resource.handle; 237 screen_info.display_texture = screen_info.texture.resource.handle;
238 238
239 // TODO(Rodrigo): Read this from HLE 239 // TODO(Rodrigo): Read this from HLE
240 constexpr u32 block_height_log2 = 4; 240 constexpr static u32 block_height_log2 = 4;
241 const auto pixel_format{ 241 const auto pixel_format{
242 VideoCore::Surface::PixelFormatFromGPUPixelFormat(framebuffer.pixel_format)}; 242 VideoCore::Surface::PixelFormatFromGPUPixelFormat(framebuffer.pixel_format)};
243 const u32 bytes_per_pixel{VideoCore::Surface::BytesPerBlock(pixel_format)}; 243 const u32 bytes_per_pixel{VideoCore::Surface::BytesPerBlock(pixel_format)};
@@ -375,7 +375,7 @@ void RendererOpenGL::AddTelemetryFields() {
375 LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor); 375 LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
376 LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model); 376 LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
377 377
378 constexpr auto user_system = Common::Telemetry::FieldType::UserSystem; 378 constexpr static auto user_system = Common::Telemetry::FieldType::UserSystem;
379 telemetry_session.AddField(user_system, "GPU_Vendor", std::string(gpu_vendor)); 379 telemetry_session.AddField(user_system, "GPU_Vendor", std::string(gpu_vendor));
380 telemetry_session.AddField(user_system, "GPU_Model", std::string(gpu_model)); 380 telemetry_session.AddField(user_system, "GPU_Model", std::string(gpu_model));
381 telemetry_session.AddField(user_system, "GPU_OpenGL_Version", std::string(gl_version)); 381 telemetry_session.AddField(user_system, "GPU_OpenGL_Version", std::string(gl_version));
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp
index cf2964a3f..334087119 100644
--- a/src/video_core/renderer_vulkan/blit_image.cpp
+++ b/src/video_core/renderer_vulkan/blit_image.cpp
@@ -358,8 +358,9 @@ VkExtent2D GetConversionExtent(const ImageView& src_image_view) {
358 358
359void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, 359void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout,
360 VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) { 360 VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) {
361 constexpr VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | 361 constexpr static VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
362 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT}; 362 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
363 VK_ACCESS_SHADER_READ_BIT};
363 const VkImageMemoryBarrier barrier{ 364 const VkImageMemoryBarrier barrier{
364 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, 365 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
365 .pNext = nullptr, 366 .pNext = nullptr,
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index 2f0cc27e8..34a86a407 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -175,7 +175,7 @@ VkSemaphore BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer,
175 const u8* const host_ptr = cpu_memory.GetPointer(framebuffer_addr); 175 const u8* const host_ptr = cpu_memory.GetPointer(framebuffer_addr);
176 176
177 // TODO(Rodrigo): Read this from HLE 177 // TODO(Rodrigo): Read this from HLE
178 constexpr u32 block_height_log2 = 4; 178 constexpr static u32 block_height_log2 = 4;
179 const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer); 179 const u32 bytes_per_pixel = GetBytesPerPixel(framebuffer);
180 const u64 linear_size{GetSizeInBytes(framebuffer)}; 180 const u64 linear_size{GetSizeInBytes(framebuffer)};
181 const u64 tiled_size{Tegra::Texture::CalculateSize(true, bytes_per_pixel, 181 const u64 tiled_size{Tegra::Texture::CalculateSize(true, bytes_per_pixel,
@@ -1482,7 +1482,7 @@ u64 BlitScreen::CalculateBufferSize(const Tegra::FramebufferConfig& framebuffer)
1482 1482
1483u64 BlitScreen::GetRawImageOffset(const Tegra::FramebufferConfig& framebuffer, 1483u64 BlitScreen::GetRawImageOffset(const Tegra::FramebufferConfig& framebuffer,
1484 std::size_t image_index) const { 1484 std::size_t image_index) const {
1485 constexpr auto first_image_offset = static_cast<u64>(sizeof(BufferData)); 1485 constexpr static auto first_image_offset = static_cast<u64>(sizeof(BufferData));
1486 return first_image_offset + GetSizeInBytes(framebuffer) * image_index; 1486 return first_image_offset + GetSizeInBytes(framebuffer) * image_index;
1487} 1487}
1488 1488
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
index 2a0f0dbf0..326260b41 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
@@ -172,7 +172,8 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
172 buffer_cache.UnbindComputeTextureBuffers(); 172 buffer_cache.UnbindComputeTextureBuffers();
173 size_t index{}; 173 size_t index{};
174 const auto add_buffer{[&](const auto& desc) { 174 const auto add_buffer{[&](const auto& desc) {
175 constexpr bool is_image = std::is_same_v<decltype(desc), const ImageBufferDescriptor&>; 175 constexpr static bool is_image =
176 std::is_same_v<decltype(desc), const ImageBufferDescriptor&>;
176 for (u32 i = 0; i < desc.count; ++i) { 177 for (u32 i = 0; i < desc.count; ++i) {
177 bool is_written{false}; 178 bool is_written{false};
178 if constexpr (is_image) { 179 if constexpr (is_image) {
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index baedc4424..bdab00597 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -398,7 +398,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
398 const auto bind_stage_info{[&](size_t stage) LAMBDA_FORCEINLINE { 398 const auto bind_stage_info{[&](size_t stage) LAMBDA_FORCEINLINE {
399 size_t index{}; 399 size_t index{};
400 const auto add_buffer{[&](const auto& desc) { 400 const auto add_buffer{[&](const auto& desc) {
401 constexpr bool is_image = std::is_same_v<decltype(desc), const ImageBufferDescriptor&>; 401 constexpr static bool is_image =
402 std::is_same_v<decltype(desc), const ImageBufferDescriptor&>;
402 for (u32 i = 0; i < desc.count; ++i) { 403 for (u32 i = 0; i < desc.count; ++i) {
403 bool is_written{false}; 404 bool is_written{false};
404 if constexpr (is_image) { 405 if constexpr (is_image) {
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 719edbcfb..3d50f8edb 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -1109,9 +1109,9 @@ void RasterizerVulkan::UpdateDepthBiasEnable(Tegra::Engines::Maxwell3D::Regs& re
1109 if (!state_tracker.TouchDepthBiasEnable()) { 1109 if (!state_tracker.TouchDepthBiasEnable()) {
1110 return; 1110 return;
1111 } 1111 }
1112 constexpr size_t POINT = 0; 1112 constexpr static size_t POINT = 0;
1113 constexpr size_t LINE = 1; 1113 constexpr static size_t LINE = 1;
1114 constexpr size_t POLYGON = 2; 1114 constexpr static size_t POLYGON = 2;
1115 static constexpr std::array POLYGON_OFFSET_ENABLE_LUT = { 1115 static constexpr std::array POLYGON_OFFSET_ENABLE_LUT = {
1116 POINT, // Points 1116 POINT, // Points
1117 LINE, // Lines 1117 LINE, // Lines
diff --git a/src/video_core/renderer_vulkan/vk_smaa.cpp b/src/video_core/renderer_vulkan/vk_smaa.cpp
index 8eb735489..1cd354003 100644
--- a/src/video_core/renderer_vulkan/vk_smaa.cpp
+++ b/src/video_core/renderer_vulkan/vk_smaa.cpp
@@ -55,8 +55,9 @@ std::pair<vk::Image, MemoryCommit> CreateWrappedImage(const Device& device,
55 55
56void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout, 56void TransitionImageLayout(vk::CommandBuffer& cmdbuf, VkImage image, VkImageLayout target_layout,
57 VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) { 57 VkImageLayout source_layout = VK_IMAGE_LAYOUT_GENERAL) {
58 constexpr VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | 58 constexpr static VkFlags flags{VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
59 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT}; 59 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
60 VK_ACCESS_SHADER_READ_BIT};
60 const VkImageMemoryBarrier barrier{ 61 const VkImageMemoryBarrier barrier{
61 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, 62 .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
62 .pNext = nullptr, 63 .pNext = nullptr,
@@ -152,7 +153,7 @@ vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format) {
152 .finalLayout = VK_IMAGE_LAYOUT_GENERAL, 153 .finalLayout = VK_IMAGE_LAYOUT_GENERAL,
153 }; 154 };
154 155
155 constexpr VkAttachmentReference color_attachment_ref{ 156 constexpr static VkAttachmentReference color_attachment_ref{
156 .attachment = 0, 157 .attachment = 0,
157 .layout = VK_IMAGE_LAYOUT_GENERAL, 158 .layout = VK_IMAGE_LAYOUT_GENERAL,
158 }; 159 };
@@ -170,7 +171,7 @@ vk::RenderPass CreateWrappedRenderPass(const Device& device, VkFormat format) {
170 .pPreserveAttachments = nullptr, 171 .pPreserveAttachments = nullptr,
171 }; 172 };
172 173
173 constexpr VkSubpassDependency dependency{ 174 constexpr static VkSubpassDependency dependency{
174 .srcSubpass = VK_SUBPASS_EXTERNAL, 175 .srcSubpass = VK_SUBPASS_EXTERNAL,
175 .dstSubpass = 0, 176 .dstSubpass = 0,
176 .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 177 .srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
@@ -328,7 +329,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
328 }, 329 },
329 }}; 330 }};
330 331
331 constexpr VkPipelineVertexInputStateCreateInfo vertex_input_ci{ 332 constexpr static VkPipelineVertexInputStateCreateInfo vertex_input_ci{
332 .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, 333 .sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
333 .pNext = nullptr, 334 .pNext = nullptr,
334 .flags = 0, 335 .flags = 0,
@@ -338,7 +339,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
338 .pVertexAttributeDescriptions = nullptr, 339 .pVertexAttributeDescriptions = nullptr,
339 }; 340 };
340 341
341 constexpr VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{ 342 constexpr static VkPipelineInputAssemblyStateCreateInfo input_assembly_ci{
342 .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, 343 .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
343 .pNext = nullptr, 344 .pNext = nullptr,
344 .flags = 0, 345 .flags = 0,
@@ -346,7 +347,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
346 .primitiveRestartEnable = VK_FALSE, 347 .primitiveRestartEnable = VK_FALSE,
347 }; 348 };
348 349
349 constexpr VkPipelineViewportStateCreateInfo viewport_state_ci{ 350 constexpr static VkPipelineViewportStateCreateInfo viewport_state_ci{
350 .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, 351 .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
351 .pNext = nullptr, 352 .pNext = nullptr,
352 .flags = 0, 353 .flags = 0,
@@ -356,7 +357,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
356 .pScissors = nullptr, 357 .pScissors = nullptr,
357 }; 358 };
358 359
359 constexpr VkPipelineRasterizationStateCreateInfo rasterization_ci{ 360 constexpr static VkPipelineRasterizationStateCreateInfo rasterization_ci{
360 .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, 361 .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
361 .pNext = nullptr, 362 .pNext = nullptr,
362 .flags = 0, 363 .flags = 0,
@@ -372,7 +373,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
372 .lineWidth = 1.0f, 373 .lineWidth = 1.0f,
373 }; 374 };
374 375
375 constexpr VkPipelineMultisampleStateCreateInfo multisampling_ci{ 376 constexpr static VkPipelineMultisampleStateCreateInfo multisampling_ci{
376 .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, 377 .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
377 .pNext = nullptr, 378 .pNext = nullptr,
378 .flags = 0, 379 .flags = 0,
@@ -384,7 +385,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
384 .alphaToOneEnable = VK_FALSE, 385 .alphaToOneEnable = VK_FALSE,
385 }; 386 };
386 387
387 constexpr VkPipelineColorBlendAttachmentState color_blend_attachment{ 388 constexpr static VkPipelineColorBlendAttachmentState color_blend_attachment{
388 .blendEnable = VK_FALSE, 389 .blendEnable = VK_FALSE,
389 .srcColorBlendFactor = VK_BLEND_FACTOR_ZERO, 390 .srcColorBlendFactor = VK_BLEND_FACTOR_ZERO,
390 .dstColorBlendFactor = VK_BLEND_FACTOR_ZERO, 391 .dstColorBlendFactor = VK_BLEND_FACTOR_ZERO,
@@ -407,7 +408,7 @@ vk::Pipeline CreateWrappedPipeline(const Device& device, vk::RenderPass& renderp
407 .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, 408 .blendConstants = {0.0f, 0.0f, 0.0f, 0.0f},
408 }; 409 };
409 410
410 constexpr std::array dynamic_states{ 411 constexpr static std::array dynamic_states{
411 VK_DYNAMIC_STATE_VIEWPORT, 412 VK_DYNAMIC_STATE_VIEWPORT,
412 VK_DYNAMIC_STATE_SCISSOR, 413 VK_DYNAMIC_STATE_SCISSOR,
413 }; 414 };
@@ -468,7 +469,7 @@ VkWriteDescriptorSet CreateWriteDescriptorSet(std::vector<VkDescriptorImageInfo>
468} 469}
469 470
470void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) { 471void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) {
471 constexpr std::array<VkImageSubresourceRange, 1> subresources{{{ 472 constexpr static std::array<VkImageSubresourceRange, 1> subresources{{{
472 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, 473 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
473 .baseMipLevel = 0, 474 .baseMipLevel = 0,
474 .levelCount = 1, 475 .levelCount = 1,
@@ -528,8 +529,8 @@ SMAA::SMAA(const Device& device, MemoryAllocator& allocator, size_t image_count,
528} 529}
529 530
530void SMAA::CreateImages() { 531void SMAA::CreateImages() {
531 constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; 532 constexpr static VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT};
532 constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; 533 constexpr static VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT};
533 534
534 std::tie(m_static_images[Area], m_static_buffer_commits[Area]) = 535 std::tie(m_static_images[Area], m_static_buffer_commits[Area]) =
535 CreateWrappedImage(m_device, m_allocator, area_extent, VK_FORMAT_R8G8_UNORM); 536 CreateWrappedImage(m_device, m_allocator, area_extent, VK_FORMAT_R8G8_UNORM);
@@ -586,12 +587,12 @@ void SMAA::CreateSampler() {
586 587
587void SMAA::CreateShaders() { 588void SMAA::CreateShaders() {
588 // These match the order of the SMAAStage enum 589 // These match the order of the SMAAStage enum
589 constexpr std::array vert_shader_sources{ 590 constexpr static std::array vert_shader_sources{
590 ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_VERT_SPV), 591 ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_VERT_SPV),
591 ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_VERT_SPV), 592 ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_VERT_SPV),
592 ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_VERT_SPV), 593 ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_VERT_SPV),
593 }; 594 };
594 constexpr std::array frag_shader_sources{ 595 constexpr static std::array frag_shader_sources{
595 ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_FRAG_SPV), 596 ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_FRAG_SPV),
596 ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_FRAG_SPV), 597 ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_FRAG_SPV),
597 ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_FRAG_SPV), 598 ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_FRAG_SPV),
@@ -675,8 +676,8 @@ void SMAA::UploadImages(Scheduler& scheduler) {
675 return; 676 return;
676 } 677 }
677 678
678 constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; 679 constexpr static VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT};
679 constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; 680 constexpr static VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT};
680 681
681 UploadImage(m_device, m_allocator, scheduler, m_static_images[Area], area_extent, 682 UploadImage(m_device, m_allocator, scheduler, m_static_images[Area], area_extent,
682 VK_FORMAT_R8G8_UNORM, ARRAY_TO_SPAN(areaTexBytes)); 683 VK_FORMAT_R8G8_UNORM, ARRAY_TO_SPAN(areaTexBytes));
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp
index 74ca77216..172b6ed95 100644
--- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp
+++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp
@@ -299,7 +299,7 @@ void StagingBufferPool::ReleaseCache(MemoryUsage usage) {
299} 299}
300 300
301void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) { 301void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) {
302 constexpr size_t deletions_per_tick = 16; 302 constexpr static size_t deletions_per_tick = 16;
303 auto& staging = cache[log2]; 303 auto& staging = cache[log2];
304 auto& entries = staging.entries; 304 auto& entries = staging.entries;
305 const size_t old_size = entries.size(); 305 const size_t old_size = entries.size();
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp
index b6810eef9..0b24a98eb 100644
--- a/src/video_core/renderer_vulkan/vk_swapchain.cpp
+++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp
@@ -53,7 +53,7 @@ VkPresentModeKHR ChooseSwapPresentMode(vk::Span<VkPresentModeKHR> modes) {
53} 53}
54 54
55VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height) { 55VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, u32 width, u32 height) {
56 constexpr auto undefined_size{std::numeric_limits<u32>::max()}; 56 constexpr static auto undefined_size{std::numeric_limits<u32>::max()};
57 if (capabilities.currentExtent.width != undefined_size) { 57 if (capabilities.currentExtent.width != undefined_size) {
58 return capabilities.currentExtent; 58 return capabilities.currentExtent;
59 } 59 }
diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp
index c42594149..38c7e533d 100644
--- 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) {
48 auto commit = m_allocator.Commit(buffer, MemoryUsage::DeviceLocal); 48 auto commit = m_allocator.Commit(buffer, MemoryUsage::DeviceLocal);
49 49
50 // Create the descriptor pool to contain our descriptor. 50 // Create the descriptor pool to contain our descriptor.
51 constexpr VkDescriptorPoolSize pool_size{ 51 constexpr static VkDescriptorPoolSize pool_size{
52 .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 52 .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
53 .descriptorCount = 1, 53 .descriptorCount = 1,
54 }; 54 };
@@ -63,7 +63,7 @@ void TurboMode::Run(std::stop_token stop_token) {
63 }); 63 });
64 64
65 // Create the descriptor set layout from the pool. 65 // Create the descriptor set layout from the pool.
66 constexpr VkDescriptorSetLayoutBinding layout_binding{ 66 constexpr static VkDescriptorSetLayoutBinding layout_binding{
67 .binding = 0, 67 .binding = 0,
68 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 68 .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
69 .descriptorCount = 1, 69 .descriptorCount = 1,
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 1a76d4178..e69855cad 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -371,7 +371,7 @@ std::pair<u32, u32> GetASTCBlockSize(PixelFormat format) {
371} 371}
372 372
373u64 EstimatedDecompressedSize(u64 base_size, PixelFormat format) { 373u64 EstimatedDecompressedSize(u64 base_size, PixelFormat format) {
374 constexpr u64 RGBA8_PIXEL_SIZE = 4; 374 constexpr static u64 RGBA8_PIXEL_SIZE = 4;
375 const u64 base_block_size = static_cast<u64>(DefaultBlockWidth(format)) * 375 const u64 base_block_size = static_cast<u64>(DefaultBlockWidth(format)) *
376 static_cast<u64>(DefaultBlockHeight(format)) * RGBA8_PIXEL_SIZE; 376 static_cast<u64>(DefaultBlockHeight(format)) * RGBA8_PIXEL_SIZE;
377 return (base_size * base_block_size) / BytesPerBlock(format); 377 return (base_size * base_block_size) / BytesPerBlock(format);
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 59120cd09..436f228b3 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -29,7 +29,7 @@ constexpr u32 pdep(u32 value) {
29 29
30template <u32 mask, u32 incr_amount> 30template <u32 mask, u32 incr_amount>
31void incrpdep(u32& value) { 31void incrpdep(u32& value) {
32 constexpr u32 swizzled_incr = pdep<mask>(incr_amount); 32 constexpr static u32 swizzled_incr = pdep<mask>(incr_amount);
33 value = ((value | ~mask) + swizzled_incr) & mask; 33 value = ((value | ~mask) + swizzled_incr) & mask;
34} 34}
35 35
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
index 486d4dfaf..7efe83c9a 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
+++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
@@ -495,9 +495,9 @@ VkResult Free(VkDevice device, VkCommandPool handle, Span<VkCommandBuffer> buffe
495Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions, 495Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions,
496 InstanceDispatch& dispatch) { 496 InstanceDispatch& dispatch) {
497#ifdef __APPLE__ 497#ifdef __APPLE__
498 constexpr VkFlags ci_flags{VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR}; 498 constexpr static VkFlags ci_flags{VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR};
499#else 499#else
500 constexpr VkFlags ci_flags{}; 500 constexpr static VkFlags ci_flags{};
501#endif 501#endif
502 502
503 const VkApplicationInfo application_info{ 503 const VkApplicationInfo application_info{