diff options
Diffstat (limited to 'src')
39 files changed, 305 insertions, 296 deletions
diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp index 1771bc939..59e586695 100644 --- a/src/video_core/command_classes/codecs/vp9.cpp +++ b/src/video_core/command_classes/codecs/vp9.cpp | |||
| @@ -374,43 +374,43 @@ void VP9::InsertEntropy(u64 offset, Vp9EntropyProbs& dst) { | |||
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | Vp9FrameContainer VP9::GetCurrentFrame(const NvdecCommon::NvdecRegisters& state) { | 376 | Vp9FrameContainer VP9::GetCurrentFrame(const NvdecCommon::NvdecRegisters& state) { |
| 377 | Vp9FrameContainer frame{}; | 377 | Vp9FrameContainer current_frame{}; |
| 378 | { | 378 | { |
| 379 | gpu.SyncGuestHost(); | 379 | gpu.SyncGuestHost(); |
| 380 | frame.info = GetVp9PictureInfo(state); | 380 | current_frame.info = GetVp9PictureInfo(state); |
| 381 | frame.bit_stream.resize(frame.info.bitstream_size); | 381 | current_frame.bit_stream.resize(current_frame.info.bitstream_size); |
| 382 | gpu.MemoryManager().ReadBlock(state.frame_bitstream_offset, frame.bit_stream.data(), | 382 | gpu.MemoryManager().ReadBlock(state.frame_bitstream_offset, current_frame.bit_stream.data(), |
| 383 | frame.info.bitstream_size); | 383 | current_frame.info.bitstream_size); |
| 384 | } | 384 | } |
| 385 | // Buffer two frames, saving the last show frame info | 385 | // Buffer two frames, saving the last show frame info |
| 386 | if (!next_next_frame.bit_stream.empty()) { | 386 | if (!next_next_frame.bit_stream.empty()) { |
| 387 | Vp9FrameContainer temp{ | 387 | Vp9FrameContainer temp{ |
| 388 | .info = frame.info, | 388 | .info = current_frame.info, |
| 389 | .bit_stream = std::move(frame.bit_stream), | 389 | .bit_stream = std::move(current_frame.bit_stream), |
| 390 | }; | 390 | }; |
| 391 | next_next_frame.info.show_frame = frame.info.last_frame_shown; | 391 | next_next_frame.info.show_frame = current_frame.info.last_frame_shown; |
| 392 | frame.info = next_next_frame.info; | 392 | current_frame.info = next_next_frame.info; |
| 393 | frame.bit_stream = std::move(next_next_frame.bit_stream); | 393 | current_frame.bit_stream = std::move(next_next_frame.bit_stream); |
| 394 | next_next_frame = std::move(temp); | 394 | next_next_frame = std::move(temp); |
| 395 | 395 | ||
| 396 | if (!next_frame.bit_stream.empty()) { | 396 | if (!next_frame.bit_stream.empty()) { |
| 397 | Vp9FrameContainer temp2{ | 397 | Vp9FrameContainer temp2{ |
| 398 | .info = frame.info, | 398 | .info = current_frame.info, |
| 399 | .bit_stream = std::move(frame.bit_stream), | 399 | .bit_stream = std::move(current_frame.bit_stream), |
| 400 | }; | 400 | }; |
| 401 | next_frame.info.show_frame = frame.info.last_frame_shown; | 401 | next_frame.info.show_frame = current_frame.info.last_frame_shown; |
| 402 | frame.info = next_frame.info; | 402 | current_frame.info = next_frame.info; |
| 403 | frame.bit_stream = std::move(next_frame.bit_stream); | 403 | current_frame.bit_stream = std::move(next_frame.bit_stream); |
| 404 | next_frame = std::move(temp2); | 404 | next_frame = std::move(temp2); |
| 405 | } else { | 405 | } else { |
| 406 | next_frame.info = frame.info; | 406 | next_frame.info = current_frame.info; |
| 407 | next_frame.bit_stream = std::move(frame.bit_stream); | 407 | next_frame.bit_stream = std::move(current_frame.bit_stream); |
| 408 | } | 408 | } |
| 409 | } else { | 409 | } else { |
| 410 | next_next_frame.info = frame.info; | 410 | next_next_frame.info = current_frame.info; |
| 411 | next_next_frame.bit_stream = std::move(frame.bit_stream); | 411 | next_next_frame.bit_stream = std::move(current_frame.bit_stream); |
| 412 | } | 412 | } |
| 413 | return frame; | 413 | return current_frame; |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | std::vector<u8> VP9::ComposeCompressedHeader() { | 416 | std::vector<u8> VP9::ComposeCompressedHeader() { |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index a2173edd2..ea4b7c1e6 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -243,8 +243,8 @@ std::string BuildCommaSeparatedExtensions(std::vector<std::string> available_ext | |||
| 243 | RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, | 243 | RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, |
| 244 | Core::Frontend::EmuWindow& emu_window, | 244 | Core::Frontend::EmuWindow& emu_window, |
| 245 | Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, | 245 | Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, |
| 246 | std::unique_ptr<Core::Frontend::GraphicsContext> context) | 246 | std::unique_ptr<Core::Frontend::GraphicsContext> context_) |
| 247 | : RendererBase{emu_window, std::move(context)}, telemetry_session{telemetry_session_}, | 247 | : RendererBase{emu_window, std::move(context_)}, telemetry_session{telemetry_session_}, |
| 248 | cpu_memory{cpu_memory_}, gpu{gpu_} {} | 248 | cpu_memory{cpu_memory_}, gpu{gpu_} {} |
| 249 | 249 | ||
| 250 | RendererVulkan::~RendererVulkan() { | 250 | RendererVulkan::~RendererVulkan() { |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h index 1044ca124..977b86003 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.h +++ b/src/video_core/renderer_vulkan/renderer_vulkan.h | |||
| @@ -45,9 +45,9 @@ struct VKScreenInfo { | |||
| 45 | class RendererVulkan final : public VideoCore::RendererBase { | 45 | class RendererVulkan final : public VideoCore::RendererBase { |
| 46 | public: | 46 | public: |
| 47 | explicit RendererVulkan(Core::TelemetrySession& telemtry_session, | 47 | explicit RendererVulkan(Core::TelemetrySession& telemtry_session, |
| 48 | Core::Frontend::EmuWindow& emu_window, Core::Memory::Memory& cpu_memory, | 48 | Core::Frontend::EmuWindow& emu_window, |
| 49 | Tegra::GPU& gpu, | 49 | Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, |
| 50 | std::unique_ptr<Core::Frontend::GraphicsContext> context); | 50 | std::unique_ptr<Core::Frontend::GraphicsContext> context_); |
| 51 | ~RendererVulkan() override; | 51 | ~RendererVulkan() override; |
| 52 | 52 | ||
| 53 | bool Init() override; | 53 | bool Init() override; |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 9637c6059..1ac7e2a30 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -461,15 +461,15 @@ VkDescriptorSet VKComputePass::CommitDescriptorSet( | |||
| 461 | return set; | 461 | return set; |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | QuadArrayPass::QuadArrayPass(const VKDevice& device, VKScheduler& scheduler, | 464 | QuadArrayPass::QuadArrayPass(const VKDevice& device_, VKScheduler& scheduler_, |
| 465 | VKDescriptorPool& descriptor_pool, | 465 | VKDescriptorPool& descriptor_pool_, |
| 466 | VKStagingBufferPool& staging_buffer_pool, | 466 | VKStagingBufferPool& staging_buffer_pool_, |
| 467 | VKUpdateDescriptorQueue& update_descriptor_queue) | 467 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| 468 | : VKComputePass(device, descriptor_pool, BuildQuadArrayPassDescriptorSetLayoutBinding(), | 468 | : VKComputePass(device_, descriptor_pool_, BuildQuadArrayPassDescriptorSetLayoutBinding(), |
| 469 | BuildQuadArrayPassDescriptorUpdateTemplateEntry(), | 469 | BuildQuadArrayPassDescriptorUpdateTemplateEntry(), |
| 470 | BuildComputePushConstantRange(sizeof(u32)), std::size(quad_array), quad_array), | 470 | BuildComputePushConstantRange(sizeof(u32)), std::size(quad_array), quad_array), |
| 471 | scheduler{scheduler}, staging_buffer_pool{staging_buffer_pool}, | 471 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 472 | update_descriptor_queue{update_descriptor_queue} {} | 472 | update_descriptor_queue{update_descriptor_queue_} {} |
| 473 | 473 | ||
| 474 | QuadArrayPass::~QuadArrayPass() = default; | 474 | QuadArrayPass::~QuadArrayPass() = default; |
| 475 | 475 | ||
| @@ -510,14 +510,14 @@ std::pair<VkBuffer, VkDeviceSize> QuadArrayPass::Assemble(u32 num_vertices, u32 | |||
| 510 | return {*buffer.handle, 0}; | 510 | return {*buffer.handle, 0}; |
| 511 | } | 511 | } |
| 512 | 512 | ||
| 513 | Uint8Pass::Uint8Pass(const VKDevice& device, VKScheduler& scheduler, | 513 | Uint8Pass::Uint8Pass(const VKDevice& device_, VKScheduler& scheduler_, |
| 514 | VKDescriptorPool& descriptor_pool, VKStagingBufferPool& staging_buffer_pool, | 514 | VKDescriptorPool& descriptor_pool_, VKStagingBufferPool& staging_buffer_pool_, |
| 515 | VKUpdateDescriptorQueue& update_descriptor_queue) | 515 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| 516 | : VKComputePass(device, descriptor_pool, BuildInputOutputDescriptorSetBindings(), | 516 | : VKComputePass(device_, descriptor_pool_, BuildInputOutputDescriptorSetBindings(), |
| 517 | BuildInputOutputDescriptorUpdateTemplate(), {}, std::size(uint8_pass), | 517 | BuildInputOutputDescriptorUpdateTemplate(), {}, std::size(uint8_pass), |
| 518 | uint8_pass), | 518 | uint8_pass), |
| 519 | scheduler{scheduler}, staging_buffer_pool{staging_buffer_pool}, | 519 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 520 | update_descriptor_queue{update_descriptor_queue} {} | 520 | update_descriptor_queue{update_descriptor_queue_} {} |
| 521 | 521 | ||
| 522 | Uint8Pass::~Uint8Pass() = default; | 522 | Uint8Pass::~Uint8Pass() = default; |
| 523 | 523 | ||
| @@ -555,16 +555,16 @@ std::pair<VkBuffer, u64> Uint8Pass::Assemble(u32 num_vertices, VkBuffer src_buff | |||
| 555 | return {*buffer.handle, 0}; | 555 | return {*buffer.handle, 0}; |
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | QuadIndexedPass::QuadIndexedPass(const VKDevice& device, VKScheduler& scheduler, | 558 | QuadIndexedPass::QuadIndexedPass(const VKDevice& device_, VKScheduler& scheduler_, |
| 559 | VKDescriptorPool& descriptor_pool, | 559 | VKDescriptorPool& descriptor_pool_, |
| 560 | VKStagingBufferPool& staging_buffer_pool, | 560 | VKStagingBufferPool& staging_buffer_pool_, |
| 561 | VKUpdateDescriptorQueue& update_descriptor_queue) | 561 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| 562 | : VKComputePass(device, descriptor_pool, BuildInputOutputDescriptorSetBindings(), | 562 | : VKComputePass(device_, descriptor_pool_, BuildInputOutputDescriptorSetBindings(), |
| 563 | BuildInputOutputDescriptorUpdateTemplate(), | 563 | BuildInputOutputDescriptorUpdateTemplate(), |
| 564 | BuildComputePushConstantRange(sizeof(u32) * 2), std::size(QUAD_INDEXED_SPV), | 564 | BuildComputePushConstantRange(sizeof(u32) * 2), std::size(QUAD_INDEXED_SPV), |
| 565 | QUAD_INDEXED_SPV), | 565 | QUAD_INDEXED_SPV), |
| 566 | scheduler{scheduler}, staging_buffer_pool{staging_buffer_pool}, | 566 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 567 | update_descriptor_queue{update_descriptor_queue} {} | 567 | update_descriptor_queue{update_descriptor_queue_} {} |
| 568 | 568 | ||
| 569 | QuadIndexedPass::~QuadIndexedPass() = default; | 569 | QuadIndexedPass::~QuadIndexedPass() = default; |
| 570 | 570 | ||
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index acc94f27e..2dc87902c 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h | |||
| @@ -43,10 +43,10 @@ private: | |||
| 43 | 43 | ||
| 44 | class QuadArrayPass final : public VKComputePass { | 44 | class QuadArrayPass final : public VKComputePass { |
| 45 | public: | 45 | public: |
| 46 | explicit QuadArrayPass(const VKDevice& device, VKScheduler& scheduler, | 46 | explicit QuadArrayPass(const VKDevice& device_, VKScheduler& scheduler_, |
| 47 | VKDescriptorPool& descriptor_pool, | 47 | VKDescriptorPool& descriptor_pool_, |
| 48 | VKStagingBufferPool& staging_buffer_pool, | 48 | VKStagingBufferPool& staging_buffer_pool_, |
| 49 | VKUpdateDescriptorQueue& update_descriptor_queue); | 49 | VKUpdateDescriptorQueue& update_descriptor_queue_); |
| 50 | ~QuadArrayPass(); | 50 | ~QuadArrayPass(); |
| 51 | 51 | ||
| 52 | std::pair<VkBuffer, VkDeviceSize> Assemble(u32 num_vertices, u32 first); | 52 | std::pair<VkBuffer, VkDeviceSize> Assemble(u32 num_vertices, u32 first); |
| @@ -59,9 +59,10 @@ private: | |||
| 59 | 59 | ||
| 60 | class Uint8Pass final : public VKComputePass { | 60 | class Uint8Pass final : public VKComputePass { |
| 61 | public: | 61 | public: |
| 62 | explicit Uint8Pass(const VKDevice& device, VKScheduler& scheduler, | 62 | explicit Uint8Pass(const VKDevice& device_, VKScheduler& scheduler_, |
| 63 | VKDescriptorPool& descriptor_pool, VKStagingBufferPool& staging_buffer_pool, | 63 | VKDescriptorPool& descriptor_pool_, |
| 64 | VKUpdateDescriptorQueue& update_descriptor_queue); | 64 | VKStagingBufferPool& staging_buffer_pool_, |
| 65 | VKUpdateDescriptorQueue& update_descriptor_queue_); | ||
| 65 | ~Uint8Pass(); | 66 | ~Uint8Pass(); |
| 66 | 67 | ||
| 67 | std::pair<VkBuffer, u64> Assemble(u32 num_vertices, VkBuffer src_buffer, u64 src_offset); | 68 | std::pair<VkBuffer, u64> Assemble(u32 num_vertices, VkBuffer src_buffer, u64 src_offset); |
| @@ -74,10 +75,10 @@ private: | |||
| 74 | 75 | ||
| 75 | class QuadIndexedPass final : public VKComputePass { | 76 | class QuadIndexedPass final : public VKComputePass { |
| 76 | public: | 77 | public: |
| 77 | explicit QuadIndexedPass(const VKDevice& device, VKScheduler& scheduler, | 78 | explicit QuadIndexedPass(const VKDevice& device_, VKScheduler& scheduler_, |
| 78 | VKDescriptorPool& descriptor_pool, | 79 | VKDescriptorPool& descriptor_pool_, |
| 79 | VKStagingBufferPool& staging_buffer_pool, | 80 | VKStagingBufferPool& staging_buffer_pool_, |
| 80 | VKUpdateDescriptorQueue& update_descriptor_queue); | 81 | VKUpdateDescriptorQueue& update_descriptor_queue_); |
| 81 | ~QuadIndexedPass(); | 82 | ~QuadIndexedPass(); |
| 82 | 83 | ||
| 83 | std::pair<VkBuffer, u64> Assemble(Tegra::Engines::Maxwell3D::Regs::IndexFormat index_format, | 84 | std::pair<VkBuffer, u64> Assemble(Tegra::Engines::Maxwell3D::Regs::IndexFormat index_format, |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 9be72dc9b..62f44d6da 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | |||
| @@ -15,16 +15,16 @@ | |||
| 15 | 15 | ||
| 16 | namespace Vulkan { | 16 | namespace Vulkan { |
| 17 | 17 | ||
| 18 | VKComputePipeline::VKComputePipeline(const VKDevice& device, VKScheduler& scheduler, | 18 | VKComputePipeline::VKComputePipeline(const VKDevice& device_, VKScheduler& scheduler_, |
| 19 | VKDescriptorPool& descriptor_pool, | 19 | VKDescriptorPool& descriptor_pool_, |
| 20 | VKUpdateDescriptorQueue& update_descriptor_queue, | 20 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 21 | const SPIRVShader& shader) | 21 | const SPIRVShader& shader_) |
| 22 | : device{device}, scheduler{scheduler}, entries{shader.entries}, | 22 | : device{device_}, scheduler{scheduler_}, entries{shader_.entries}, |
| 23 | descriptor_set_layout{CreateDescriptorSetLayout()}, | 23 | descriptor_set_layout{CreateDescriptorSetLayout()}, |
| 24 | descriptor_allocator{descriptor_pool, *descriptor_set_layout}, | 24 | descriptor_allocator{descriptor_pool_, *descriptor_set_layout}, |
| 25 | update_descriptor_queue{update_descriptor_queue}, layout{CreatePipelineLayout()}, | 25 | update_descriptor_queue{update_descriptor_queue_}, layout{CreatePipelineLayout()}, |
| 26 | descriptor_template{CreateDescriptorUpdateTemplate()}, | 26 | descriptor_template{CreateDescriptorUpdateTemplate()}, |
| 27 | shader_module{CreateShaderModule(shader.code)}, pipeline{CreatePipeline()} {} | 27 | shader_module{CreateShaderModule(shader_.code)}, pipeline{CreatePipeline()} {} |
| 28 | 28 | ||
| 29 | VKComputePipeline::~VKComputePipeline() = default; | 29 | VKComputePipeline::~VKComputePipeline() = default; |
| 30 | 30 | ||
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index 6e2f22a4a..49e2113a2 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h | |||
| @@ -17,10 +17,10 @@ class VKUpdateDescriptorQueue; | |||
| 17 | 17 | ||
| 18 | class VKComputePipeline final { | 18 | class VKComputePipeline final { |
| 19 | public: | 19 | public: |
| 20 | explicit VKComputePipeline(const VKDevice& device, VKScheduler& scheduler, | 20 | explicit VKComputePipeline(const VKDevice& device_, VKScheduler& scheduler_, |
| 21 | VKDescriptorPool& descriptor_pool, | 21 | VKDescriptorPool& descriptor_pool_, |
| 22 | VKUpdateDescriptorQueue& update_descriptor_queue, | 22 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 23 | const SPIRVShader& shader); | 23 | const SPIRVShader& shader_); |
| 24 | ~VKComputePipeline(); | 24 | ~VKComputePipeline(); |
| 25 | 25 | ||
| 26 | VkDescriptorSet CommitDescriptorSet(); | 26 | VkDescriptorSet CommitDescriptorSet(); |
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index f34ed6735..ce3846195 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp | |||
| @@ -491,8 +491,8 @@ bool VKDevice::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) | |||
| 491 | VK_FORMAT_FEATURE_BLIT_DST_BIT | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | | 491 | VK_FORMAT_FEATURE_BLIT_DST_BIT | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | |
| 492 | VK_FORMAT_FEATURE_TRANSFER_DST_BIT}; | 492 | VK_FORMAT_FEATURE_TRANSFER_DST_BIT}; |
| 493 | for (const auto format : astc_formats) { | 493 | for (const auto format : astc_formats) { |
| 494 | const auto format_properties{physical.GetFormatProperties(format)}; | 494 | const auto physical_format_properties{physical.GetFormatProperties(format)}; |
| 495 | if (!(format_properties.optimalTilingFeatures & format_feature_usage)) { | 495 | if ((physical_format_properties.optimalTilingFeatures & format_feature_usage) == 0) { |
| 496 | return false; | 496 | return false; |
| 497 | } | 497 | } |
| 498 | } | 498 | } |
| @@ -644,8 +644,8 @@ std::vector<const char*> VKDevice::LoadExtensions() { | |||
| 644 | VkPhysicalDeviceFeatures2KHR features; | 644 | VkPhysicalDeviceFeatures2KHR features; |
| 645 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; | 645 | features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR; |
| 646 | 646 | ||
| 647 | VkPhysicalDeviceProperties2KHR properties; | 647 | VkPhysicalDeviceProperties2KHR physical_properties; |
| 648 | properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; | 648 | physical_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR; |
| 649 | 649 | ||
| 650 | if (has_khr_shader_float16_int8) { | 650 | if (has_khr_shader_float16_int8) { |
| 651 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8_features; | 651 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8_features; |
| @@ -670,8 +670,8 @@ std::vector<const char*> VKDevice::LoadExtensions() { | |||
| 670 | subgroup_properties.sType = | 670 | subgroup_properties.sType = |
| 671 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT; | 671 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT; |
| 672 | subgroup_properties.pNext = nullptr; | 672 | subgroup_properties.pNext = nullptr; |
| 673 | properties.pNext = &subgroup_properties; | 673 | physical_properties.pNext = &subgroup_properties; |
| 674 | physical.GetProperties2KHR(properties); | 674 | physical.GetProperties2KHR(physical_properties); |
| 675 | 675 | ||
| 676 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; | 676 | is_warp_potentially_bigger = subgroup_properties.maxSubgroupSize > GuestWarpSize; |
| 677 | 677 | ||
| @@ -695,8 +695,8 @@ std::vector<const char*> VKDevice::LoadExtensions() { | |||
| 695 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; | 695 | VkPhysicalDeviceTransformFeedbackPropertiesEXT tfb_properties; |
| 696 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; | 696 | tfb_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT; |
| 697 | tfb_properties.pNext = nullptr; | 697 | tfb_properties.pNext = nullptr; |
| 698 | properties.pNext = &tfb_properties; | 698 | physical_properties.pNext = &tfb_properties; |
| 699 | physical.GetProperties2KHR(properties); | 699 | physical.GetProperties2KHR(physical_properties); |
| 700 | 700 | ||
| 701 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && | 701 | if (tfb_features.transformFeedback && tfb_features.geometryStreams && |
| 702 | tfb_properties.maxTransformFeedbackStreams >= 4 && | 702 | tfb_properties.maxTransformFeedbackStreams >= 4 && |
diff --git a/src/video_core/renderer_vulkan/vk_fence_manager.cpp b/src/video_core/renderer_vulkan/vk_fence_manager.cpp index 5babbdd0b..0bcaee714 100644 --- a/src/video_core/renderer_vulkan/vk_fence_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_fence_manager.cpp | |||
| @@ -14,12 +14,13 @@ | |||
| 14 | 14 | ||
| 15 | namespace Vulkan { | 15 | namespace Vulkan { |
| 16 | 16 | ||
| 17 | InnerFence::InnerFence(const VKDevice& device, VKScheduler& scheduler, u32 payload, bool is_stubbed) | 17 | InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, u32 payload_, |
| 18 | : VideoCommon::FenceBase(payload, is_stubbed), device{device}, scheduler{scheduler} {} | 18 | bool is_stubbed_) |
| 19 | : FenceBase{payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} | ||
| 19 | 20 | ||
| 20 | InnerFence::InnerFence(const VKDevice& device, VKScheduler& scheduler, GPUVAddr address, | 21 | InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, GPUVAddr address_, |
| 21 | u32 payload, bool is_stubbed) | 22 | u32 payload_, bool is_stubbed_) |
| 22 | : VideoCommon::FenceBase(address, payload, is_stubbed), device{device}, scheduler{scheduler} {} | 23 | : FenceBase{address_, payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} |
| 23 | 24 | ||
| 24 | InnerFence::~InnerFence() = default; | 25 | InnerFence::~InnerFence() = default; |
| 25 | 26 | ||
| @@ -71,11 +72,12 @@ bool InnerFence::IsEventSignalled() const { | |||
| 71 | } | 72 | } |
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | VKFenceManager::VKFenceManager(VideoCore::RasterizerInterface& rasterizer, Tegra::GPU& gpu, | 75 | VKFenceManager::VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, |
| 75 | Tegra::MemoryManager& memory_manager, VKTextureCache& texture_cache, | 76 | Tegra::MemoryManager& memory_manager_, |
| 76 | VKBufferCache& buffer_cache, VKQueryCache& query_cache, | 77 | VKTextureCache& texture_cache_, VKBufferCache& buffer_cache_, |
| 77 | const VKDevice& device_, VKScheduler& scheduler_) | 78 | VKQueryCache& query_cache_, const VKDevice& device_, |
| 78 | : GenericFenceManager(rasterizer, gpu, texture_cache, buffer_cache, query_cache), | 79 | VKScheduler& scheduler_) |
| 80 | : GenericFenceManager{rasterizer_, gpu_, texture_cache_, buffer_cache_, query_cache_}, | ||
| 79 | device{device_}, scheduler{scheduler_} {} | 81 | device{device_}, scheduler{scheduler_} {} |
| 80 | 82 | ||
| 81 | Fence VKFenceManager::CreateFence(u32 value, bool is_stubbed) { | 83 | Fence VKFenceManager::CreateFence(u32 value, bool is_stubbed) { |
diff --git a/src/video_core/renderer_vulkan/vk_fence_manager.h b/src/video_core/renderer_vulkan/vk_fence_manager.h index 1547d6d30..c8547cc24 100644 --- a/src/video_core/renderer_vulkan/vk_fence_manager.h +++ b/src/video_core/renderer_vulkan/vk_fence_manager.h | |||
| @@ -28,10 +28,10 @@ class VKTextureCache; | |||
| 28 | 28 | ||
| 29 | class InnerFence : public VideoCommon::FenceBase { | 29 | class InnerFence : public VideoCommon::FenceBase { |
| 30 | public: | 30 | public: |
| 31 | explicit InnerFence(const VKDevice& device, VKScheduler& scheduler, u32 payload, | 31 | explicit InnerFence(const VKDevice& device_, VKScheduler& scheduler_, u32 payload_, |
| 32 | bool is_stubbed); | 32 | bool is_stubbed_); |
| 33 | explicit InnerFence(const VKDevice& device, VKScheduler& scheduler, GPUVAddr address, | 33 | explicit InnerFence(const VKDevice& device_, VKScheduler& scheduler_, GPUVAddr address_, |
| 34 | u32 payload, bool is_stubbed); | 34 | u32 payload_, bool is_stubbed_); |
| 35 | ~InnerFence(); | 35 | ~InnerFence(); |
| 36 | 36 | ||
| 37 | void Queue(); | 37 | void Queue(); |
| @@ -55,10 +55,10 @@ using GenericFenceManager = | |||
| 55 | 55 | ||
| 56 | class VKFenceManager final : public GenericFenceManager { | 56 | class VKFenceManager final : public GenericFenceManager { |
| 57 | public: | 57 | public: |
| 58 | explicit VKFenceManager(VideoCore::RasterizerInterface& rasterizer, Tegra::GPU& gpu, | 58 | explicit VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, |
| 59 | Tegra::MemoryManager& memory_manager, VKTextureCache& texture_cache, | 59 | Tegra::MemoryManager& memory_manager_, VKTextureCache& texture_cache_, |
| 60 | VKBufferCache& buffer_cache, VKQueryCache& query_cache, | 60 | VKBufferCache& buffer_cache_, VKQueryCache& query_cache_, |
| 61 | const VKDevice& device, VKScheduler& scheduler); | 61 | const VKDevice& device_, VKScheduler& scheduler_); |
| 62 | 62 | ||
| 63 | protected: | 63 | protected: |
| 64 | Fence CreateFence(u32 value, bool is_stubbed) override; | 64 | Fence CreateFence(u32 value, bool is_stubbed) override; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 0e8f9c352..f8a1bcf34 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -71,21 +71,21 @@ VkViewportSwizzleNV UnpackViewportSwizzle(u16 swizzle) { | |||
| 71 | 71 | ||
| 72 | } // Anonymous namespace | 72 | } // Anonymous namespace |
| 73 | 73 | ||
| 74 | VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device, VKScheduler& scheduler, | 74 | VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device_, VKScheduler& scheduler_, |
| 75 | VKDescriptorPool& descriptor_pool, | 75 | VKDescriptorPool& descriptor_pool_, |
| 76 | VKUpdateDescriptorQueue& update_descriptor_queue, | 76 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 77 | VKRenderPassCache& renderpass_cache, | 77 | VKRenderPassCache& renderpass_cache_, |
| 78 | const GraphicsPipelineCacheKey& key, | 78 | const GraphicsPipelineCacheKey& key_, |
| 79 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 79 | vk::Span<VkDescriptorSetLayoutBinding> bindings_, |
| 80 | const SPIRVProgram& program) | 80 | const SPIRVProgram& program_) |
| 81 | : device{device}, scheduler{scheduler}, cache_key{key}, hash{cache_key.Hash()}, | 81 | : device{device_}, scheduler{scheduler_}, cache_key{key_}, hash{cache_key.Hash()}, |
| 82 | descriptor_set_layout{CreateDescriptorSetLayout(bindings)}, | 82 | descriptor_set_layout{CreateDescriptorSetLayout(bindings_)}, |
| 83 | descriptor_allocator{descriptor_pool, *descriptor_set_layout}, | 83 | descriptor_allocator{descriptor_pool_, *descriptor_set_layout}, |
| 84 | update_descriptor_queue{update_descriptor_queue}, layout{CreatePipelineLayout()}, | 84 | update_descriptor_queue{update_descriptor_queue_}, layout{CreatePipelineLayout()}, |
| 85 | descriptor_template{CreateDescriptorUpdateTemplate(program)}, modules{CreateShaderModules( | 85 | descriptor_template{CreateDescriptorUpdateTemplate(program_)}, modules{CreateShaderModules( |
| 86 | program)}, | 86 | program_)}, |
| 87 | renderpass{renderpass_cache.GetRenderPass(cache_key.renderpass_params)}, | 87 | renderpass{renderpass_cache_.GetRenderPass(cache_key.renderpass_params)}, |
| 88 | pipeline{CreatePipeline(cache_key.renderpass_params, program)} {} | 88 | pipeline{CreatePipeline(cache_key.renderpass_params, program_)} {} |
| 89 | 89 | ||
| 90 | VKGraphicsPipeline::~VKGraphicsPipeline() = default; | 90 | VKGraphicsPipeline::~VKGraphicsPipeline() = default; |
| 91 | 91 | ||
| @@ -162,8 +162,8 @@ std::vector<vk::ShaderModule> VKGraphicsPipeline::CreateShaderModules( | |||
| 162 | .codeSize = 0, | 162 | .codeSize = 0, |
| 163 | }; | 163 | }; |
| 164 | 164 | ||
| 165 | std::vector<vk::ShaderModule> modules; | 165 | std::vector<vk::ShaderModule> shader_modules; |
| 166 | modules.reserve(Maxwell::MaxShaderStage); | 166 | shader_modules.reserve(Maxwell::MaxShaderStage); |
| 167 | for (std::size_t i = 0; i < Maxwell::MaxShaderStage; ++i) { | 167 | for (std::size_t i = 0; i < Maxwell::MaxShaderStage; ++i) { |
| 168 | const auto& stage = program[i]; | 168 | const auto& stage = program[i]; |
| 169 | if (!stage) { | 169 | if (!stage) { |
| @@ -174,9 +174,9 @@ std::vector<vk::ShaderModule> VKGraphicsPipeline::CreateShaderModules( | |||
| 174 | 174 | ||
| 175 | ci.codeSize = stage->code.size() * sizeof(u32); | 175 | ci.codeSize = stage->code.size() * sizeof(u32); |
| 176 | ci.pCode = stage->code.data(); | 176 | ci.pCode = stage->code.data(); |
| 177 | modules.push_back(device.GetLogical().CreateShaderModule(ci)); | 177 | shader_modules.push_back(device.GetLogical().CreateShaderModule(ci)); |
| 178 | } | 178 | } |
| 179 | return modules; | 179 | return shader_modules; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpass_params, | 182 | vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpass_params, |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 58aa35efd..3fb31d55a 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -51,13 +51,13 @@ using SPIRVProgram = std::array<std::optional<SPIRVShader>, Maxwell::MaxShaderSt | |||
| 51 | 51 | ||
| 52 | class VKGraphicsPipeline final { | 52 | class VKGraphicsPipeline final { |
| 53 | public: | 53 | public: |
| 54 | explicit VKGraphicsPipeline(const VKDevice& device, VKScheduler& scheduler, | 54 | explicit VKGraphicsPipeline(const VKDevice& device_, VKScheduler& scheduler_, |
| 55 | VKDescriptorPool& descriptor_pool, | 55 | VKDescriptorPool& descriptor_pool_, |
| 56 | VKUpdateDescriptorQueue& update_descriptor_queue, | 56 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 57 | VKRenderPassCache& renderpass_cache, | 57 | VKRenderPassCache& renderpass_cache_, |
| 58 | const GraphicsPipelineCacheKey& key, | 58 | const GraphicsPipelineCacheKey& key_, |
| 59 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 59 | vk::Span<VkDescriptorSetLayoutBinding> bindings_, |
| 60 | const SPIRVProgram& program); | 60 | const SPIRVProgram& program_); |
| 61 | ~VKGraphicsPipeline(); | 61 | ~VKGraphicsPipeline(); |
| 62 | 62 | ||
| 63 | VkDescriptorSet CommitDescriptorSet(); | 63 | VkDescriptorSet CommitDescriptorSet(); |
diff --git a/src/video_core/renderer_vulkan/vk_image.cpp b/src/video_core/renderer_vulkan/vk_image.cpp index 1c418ea17..072d14e3b 100644 --- a/src/video_core/renderer_vulkan/vk_image.cpp +++ b/src/video_core/renderer_vulkan/vk_image.cpp | |||
| @@ -13,18 +13,18 @@ | |||
| 13 | 13 | ||
| 14 | namespace Vulkan { | 14 | namespace Vulkan { |
| 15 | 15 | ||
| 16 | VKImage::VKImage(const VKDevice& device, VKScheduler& scheduler, const VkImageCreateInfo& image_ci, | 16 | VKImage::VKImage(const VKDevice& device_, VKScheduler& scheduler_, |
| 17 | VkImageAspectFlags aspect_mask) | 17 | const VkImageCreateInfo& image_ci_, VkImageAspectFlags aspect_mask_) |
| 18 | : device{device}, scheduler{scheduler}, format{image_ci.format}, aspect_mask{aspect_mask}, | 18 | : device{device_}, scheduler{scheduler_}, format{image_ci_.format}, aspect_mask{aspect_mask_}, |
| 19 | image_num_layers{image_ci.arrayLayers}, image_num_levels{image_ci.mipLevels} { | 19 | image_num_layers{image_ci_.arrayLayers}, image_num_levels{image_ci_.mipLevels} { |
| 20 | UNIMPLEMENTED_IF_MSG(image_ci.queueFamilyIndexCount != 0, | 20 | UNIMPLEMENTED_IF_MSG(image_ci_.queueFamilyIndexCount != 0, |
| 21 | "Queue family tracking is not implemented"); | 21 | "Queue family tracking is not implemented"); |
| 22 | 22 | ||
| 23 | image = device.GetLogical().CreateImage(image_ci); | 23 | image = device_.GetLogical().CreateImage(image_ci_); |
| 24 | 24 | ||
| 25 | const u32 num_ranges = image_num_layers * image_num_levels; | 25 | const u32 num_ranges = image_num_layers * image_num_levels; |
| 26 | barriers.resize(num_ranges); | 26 | barriers.resize(num_ranges); |
| 27 | subrange_states.resize(num_ranges, {{}, image_ci.initialLayout}); | 27 | subrange_states.resize(num_ranges, {{}, image_ci_.initialLayout}); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | VKImage::~VKImage() = default; | 30 | VKImage::~VKImage() = default; |
diff --git a/src/video_core/renderer_vulkan/vk_image.h b/src/video_core/renderer_vulkan/vk_image.h index b4d7229e5..287ab90ca 100644 --- a/src/video_core/renderer_vulkan/vk_image.h +++ b/src/video_core/renderer_vulkan/vk_image.h | |||
| @@ -17,8 +17,8 @@ class VKScheduler; | |||
| 17 | 17 | ||
| 18 | class VKImage { | 18 | class VKImage { |
| 19 | public: | 19 | public: |
| 20 | explicit VKImage(const VKDevice& device, VKScheduler& scheduler, | 20 | explicit VKImage(const VKDevice& device_, VKScheduler& scheduler_, |
| 21 | const VkImageCreateInfo& image_ci, VkImageAspectFlags aspect_mask); | 21 | const VkImageCreateInfo& image_ci_, VkImageAspectFlags aspect_mask_); |
| 22 | ~VKImage(); | 22 | ~VKImage(); |
| 23 | 23 | ||
| 24 | /// Records in the passed command buffer an image transition and updates the state of the image. | 24 | /// Records in the passed command buffer an image transition and updates the state of the image. |
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.cpp b/src/video_core/renderer_vulkan/vk_memory_manager.cpp index 24c8960ac..be53d450f 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_memory_manager.cpp | |||
| @@ -29,10 +29,10 @@ u64 GetAllocationChunkSize(u64 required_size) { | |||
| 29 | 29 | ||
| 30 | class VKMemoryAllocation final { | 30 | class VKMemoryAllocation final { |
| 31 | public: | 31 | public: |
| 32 | explicit VKMemoryAllocation(const VKDevice& device, vk::DeviceMemory memory, | 32 | explicit VKMemoryAllocation(const VKDevice& device_, vk::DeviceMemory memory_, |
| 33 | VkMemoryPropertyFlags properties, u64 allocation_size, u32 type) | 33 | VkMemoryPropertyFlags properties_, u64 allocation_size_, u32 type_) |
| 34 | : device{device}, memory{std::move(memory)}, properties{properties}, | 34 | : device{device_}, memory{std::move(memory_)}, properties{properties_}, |
| 35 | allocation_size{allocation_size}, shifted_type{ShiftType(type)} {} | 35 | allocation_size{allocation_size_}, shifted_type{ShiftType(type_)} {} |
| 36 | 36 | ||
| 37 | VKMemoryCommit Commit(VkDeviceSize commit_size, VkDeviceSize alignment) { | 37 | VKMemoryCommit Commit(VkDeviceSize commit_size, VkDeviceSize alignment) { |
| 38 | auto found = TryFindFreeSection(free_iterator, allocation_size, | 38 | auto found = TryFindFreeSection(free_iterator, allocation_size, |
| @@ -117,8 +117,8 @@ private: | |||
| 117 | std::vector<const VKMemoryCommitImpl*> commits; | 117 | std::vector<const VKMemoryCommitImpl*> commits; |
| 118 | }; | 118 | }; |
| 119 | 119 | ||
| 120 | VKMemoryManager::VKMemoryManager(const VKDevice& device) | 120 | VKMemoryManager::VKMemoryManager(const VKDevice& device_) |
| 121 | : device{device}, properties{device.GetPhysical().GetMemoryProperties()} {} | 121 | : device{device_}, properties{device_.GetPhysical().GetMemoryProperties()} {} |
| 122 | 122 | ||
| 123 | VKMemoryManager::~VKMemoryManager() = default; | 123 | VKMemoryManager::~VKMemoryManager() = default; |
| 124 | 124 | ||
| @@ -207,9 +207,9 @@ VKMemoryCommit VKMemoryManager::TryAllocCommit(const VkMemoryRequirements& requi | |||
| 207 | return {}; | 207 | return {}; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | VKMemoryCommitImpl::VKMemoryCommitImpl(const VKDevice& device, VKMemoryAllocation* allocation, | 210 | VKMemoryCommitImpl::VKMemoryCommitImpl(const VKDevice& device_, VKMemoryAllocation* allocation_, |
| 211 | const vk::DeviceMemory& memory, u64 begin, u64 end) | 211 | const vk::DeviceMemory& memory_, u64 begin_, u64 end_) |
| 212 | : device{device}, memory{memory}, interval{begin, end}, allocation{allocation} {} | 212 | : device{device_}, memory{memory_}, interval{begin_, end_}, allocation{allocation_} {} |
| 213 | 213 | ||
| 214 | VKMemoryCommitImpl::~VKMemoryCommitImpl() { | 214 | VKMemoryCommitImpl::~VKMemoryCommitImpl() { |
| 215 | allocation->Free(this); | 215 | allocation->Free(this); |
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.h b/src/video_core/renderer_vulkan/vk_memory_manager.h index 1af88e3d4..39f903ec8 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.h +++ b/src/video_core/renderer_vulkan/vk_memory_manager.h | |||
| @@ -21,7 +21,7 @@ using VKMemoryCommit = std::unique_ptr<VKMemoryCommitImpl>; | |||
| 21 | 21 | ||
| 22 | class VKMemoryManager final { | 22 | class VKMemoryManager final { |
| 23 | public: | 23 | public: |
| 24 | explicit VKMemoryManager(const VKDevice& device); | 24 | explicit VKMemoryManager(const VKDevice& device_); |
| 25 | VKMemoryManager(const VKMemoryManager&) = delete; | 25 | VKMemoryManager(const VKMemoryManager&) = delete; |
| 26 | ~VKMemoryManager(); | 26 | ~VKMemoryManager(); |
| 27 | 27 | ||
| @@ -58,8 +58,8 @@ class VKMemoryCommitImpl final { | |||
| 58 | friend MemoryMap; | 58 | friend MemoryMap; |
| 59 | 59 | ||
| 60 | public: | 60 | public: |
| 61 | explicit VKMemoryCommitImpl(const VKDevice& device, VKMemoryAllocation* allocation, | 61 | explicit VKMemoryCommitImpl(const VKDevice& device_, VKMemoryAllocation* allocation_, |
| 62 | const vk::DeviceMemory& memory, u64 begin, u64 end); | 62 | const vk::DeviceMemory& memory_, u64 begin_, u64 end_); |
| 63 | ~VKMemoryCommitImpl(); | 63 | ~VKMemoryCommitImpl(); |
| 64 | 64 | ||
| 65 | /// Maps a memory region and returns a pointer to it. | 65 | /// Maps a memory region and returns a pointer to it. |
| @@ -93,8 +93,8 @@ private: | |||
| 93 | /// Holds ownership of a memory map. | 93 | /// Holds ownership of a memory map. |
| 94 | class MemoryMap final { | 94 | class MemoryMap final { |
| 95 | public: | 95 | public: |
| 96 | explicit MemoryMap(const VKMemoryCommitImpl* commit, u8* address) | 96 | explicit MemoryMap(const VKMemoryCommitImpl* commit_, u8* address_) |
| 97 | : commit{commit}, address{address} {} | 97 | : commit{commit_}, address{address_} {} |
| 98 | 98 | ||
| 99 | ~MemoryMap() { | 99 | ~MemoryMap() { |
| 100 | if (commit) { | 100 | if (commit) { |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index ee2d871e3..6fa071737 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -66,15 +66,15 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) { | |||
| 66 | usage[pool_index * GROW_STEP + static_cast<std::ptrdiff_t>(query.second)] = false; | 66 | usage[pool_index * GROW_STEP + static_cast<std::ptrdiff_t>(query.second)] = false; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer, | 69 | VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer_, |
| 70 | Tegra::Engines::Maxwell3D& maxwell3d, Tegra::MemoryManager& gpu_memory, | 70 | Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, |
| 71 | const VKDevice& device, VKScheduler& scheduler) | 71 | const VKDevice& device_, VKScheduler& scheduler_) |
| 72 | : VideoCommon::QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, | 72 | : QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, HostCounter>{rasterizer_, maxwell3d_, |
| 73 | HostCounter>{rasterizer, maxwell3d, gpu_memory}, | 73 | gpu_memory_}, |
| 74 | device{device}, scheduler{scheduler}, query_pools{ | 74 | device{device_}, scheduler{scheduler_}, query_pools{ |
| 75 | QueryPool{device, scheduler, | 75 | QueryPool{device_, scheduler_, |
| 76 | QueryType::SamplesPassed}, | 76 | QueryType::SamplesPassed}, |
| 77 | } {} | 77 | } {} |
| 78 | 78 | ||
| 79 | VKQueryCache::~VKQueryCache() { | 79 | VKQueryCache::~VKQueryCache() { |
| 80 | // TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class | 80 | // TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class |
| @@ -95,12 +95,12 @@ void VKQueryCache::Reserve(QueryType type, std::pair<VkQueryPool, u32> query) { | |||
| 95 | query_pools[static_cast<std::size_t>(type)].Reserve(query); | 95 | query_pools[static_cast<std::size_t>(type)].Reserve(query); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | HostCounter::HostCounter(VKQueryCache& cache, std::shared_ptr<HostCounter> dependency, | 98 | HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, |
| 99 | QueryType type) | 99 | QueryType type_) |
| 100 | : VideoCommon::HostCounterBase<VKQueryCache, HostCounter>{std::move(dependency)}, cache{cache}, | 100 | : HostCounterBase<VKQueryCache, HostCounter>{std::move(dependency_)}, cache{cache_}, |
| 101 | type{type}, query{cache.AllocateQuery(type)}, tick{cache.Scheduler().CurrentTick()} { | 101 | type{type_}, query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} { |
| 102 | const vk::Device* logical = &cache.Device().GetLogical(); | 102 | const vk::Device* logical = &cache_.Device().GetLogical(); |
| 103 | cache.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { | 103 | cache_.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { |
| 104 | logical->ResetQueryPoolEXT(query.first, query.second, 1); | 104 | logical->ResetQueryPoolEXT(query.first, query.second, 1); |
| 105 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); | 105 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); |
| 106 | }); | 106 | }); |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.h b/src/video_core/renderer_vulkan/vk_query_cache.h index 2e57fb75d..201fca888 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.h +++ b/src/video_core/renderer_vulkan/vk_query_cache.h | |||
| @@ -53,9 +53,9 @@ private: | |||
| 53 | class VKQueryCache final | 53 | class VKQueryCache final |
| 54 | : public VideoCommon::QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, HostCounter> { | 54 | : public VideoCommon::QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, HostCounter> { |
| 55 | public: | 55 | public: |
| 56 | explicit VKQueryCache(VideoCore::RasterizerInterface& rasterizer, | 56 | explicit VKQueryCache(VideoCore::RasterizerInterface& rasterizer_, |
| 57 | Tegra::Engines::Maxwell3D& maxwell3d, Tegra::MemoryManager& gpu_memory, | 57 | Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, |
| 58 | const VKDevice& device, VKScheduler& scheduler); | 58 | const VKDevice& device_, VKScheduler& scheduler_); |
| 59 | ~VKQueryCache(); | 59 | ~VKQueryCache(); |
| 60 | 60 | ||
| 61 | std::pair<VkQueryPool, u32> AllocateQuery(VideoCore::QueryType type); | 61 | std::pair<VkQueryPool, u32> AllocateQuery(VideoCore::QueryType type); |
| @@ -78,8 +78,8 @@ private: | |||
| 78 | 78 | ||
| 79 | class HostCounter final : public VideoCommon::HostCounterBase<VKQueryCache, HostCounter> { | 79 | class HostCounter final : public VideoCommon::HostCounterBase<VKQueryCache, HostCounter> { |
| 80 | public: | 80 | public: |
| 81 | explicit HostCounter(VKQueryCache& cache, std::shared_ptr<HostCounter> dependency, | 81 | explicit HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, |
| 82 | VideoCore::QueryType type); | 82 | VideoCore::QueryType type_); |
| 83 | ~HostCounter(); | 83 | ~HostCounter(); |
| 84 | 84 | ||
| 85 | void EndQuery(); | 85 | void EndQuery(); |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index e0fb8693f..560386081 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -904,15 +904,14 @@ void RasterizerVulkan::SetupShaderDescriptors( | |||
| 904 | texture_cache.GuardSamplers(false); | 904 | texture_cache.GuardSamplers(false); |
| 905 | } | 905 | } |
| 906 | 906 | ||
| 907 | void RasterizerVulkan::SetupImageTransitions( | 907 | void RasterizerVulkan::SetupImageTransitions(Texceptions texceptions, const ColorAttachments& color, |
| 908 | Texceptions texceptions, const std::array<View, Maxwell::NumRenderTargets>& color_attachments, | 908 | const ZetaAttachment& zeta) { |
| 909 | const View& zeta_attachment) { | ||
| 910 | TransitionImages(sampled_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_ACCESS_SHADER_READ_BIT); | 909 | TransitionImages(sampled_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_ACCESS_SHADER_READ_BIT); |
| 911 | TransitionImages(image_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, | 910 | TransitionImages(image_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, |
| 912 | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT); | 911 | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT); |
| 913 | 912 | ||
| 914 | for (std::size_t rt = 0; rt < std::size(color_attachments); ++rt) { | 913 | for (std::size_t rt = 0; rt < color.size(); ++rt) { |
| 915 | const auto color_attachment = color_attachments[rt]; | 914 | const auto color_attachment = color[rt]; |
| 916 | if (color_attachment == nullptr) { | 915 | if (color_attachment == nullptr) { |
| 917 | continue; | 916 | continue; |
| 918 | } | 917 | } |
| @@ -923,13 +922,13 @@ void RasterizerVulkan::SetupImageTransitions( | |||
| 923 | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); | 922 | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); |
| 924 | } | 923 | } |
| 925 | 924 | ||
| 926 | if (zeta_attachment != nullptr) { | 925 | if (zeta != nullptr) { |
| 927 | const auto image_layout = texceptions[ZETA_TEXCEPTION_INDEX] | 926 | const auto image_layout = texceptions[ZETA_TEXCEPTION_INDEX] |
| 928 | ? VK_IMAGE_LAYOUT_GENERAL | 927 | ? VK_IMAGE_LAYOUT_GENERAL |
| 929 | : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; | 928 | : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; |
| 930 | zeta_attachment->Transition(image_layout, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, | 929 | zeta->Transition(image_layout, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, |
| 931 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | | 930 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | |
| 932 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); | 931 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); |
| 933 | } | 932 | } |
| 934 | } | 933 | } |
| 935 | 934 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 237e51fa4..1789fb285 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -160,6 +160,9 @@ private: | |||
| 160 | bool is_indexed = 0; | 160 | bool is_indexed = 0; |
| 161 | }; | 161 | }; |
| 162 | 162 | ||
| 163 | using ColorAttachments = std::array<View, Maxwell::NumRenderTargets>; | ||
| 164 | using ZetaAttachment = View; | ||
| 165 | |||
| 163 | using Texceptions = std::bitset<Maxwell::NumRenderTargets + 1>; | 166 | using Texceptions = std::bitset<Maxwell::NumRenderTargets + 1>; |
| 164 | 167 | ||
| 165 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; | 168 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; |
| @@ -181,9 +184,8 @@ private: | |||
| 181 | /// Setup descriptors in the graphics pipeline. | 184 | /// Setup descriptors in the graphics pipeline. |
| 182 | void SetupShaderDescriptors(const std::array<Shader*, Maxwell::MaxShaderProgram>& shaders); | 185 | void SetupShaderDescriptors(const std::array<Shader*, Maxwell::MaxShaderProgram>& shaders); |
| 183 | 186 | ||
| 184 | void SetupImageTransitions(Texceptions texceptions, | 187 | void SetupImageTransitions(Texceptions texceptions, const ColorAttachments& color, |
| 185 | const std::array<View, Maxwell::NumRenderTargets>& color_attachments, | 188 | const ZetaAttachment& zeta); |
| 186 | const View& zeta_attachment); | ||
| 187 | 189 | ||
| 188 | void UpdateDynamicStates(); | 190 | void UpdateDynamicStates(); |
| 189 | 191 | ||
| @@ -308,8 +310,8 @@ private: | |||
| 308 | vk::Event wfi_event; | 310 | vk::Event wfi_event; |
| 309 | VideoCommon::Shader::AsyncShaders async_shaders; | 311 | VideoCommon::Shader::AsyncShaders async_shaders; |
| 310 | 312 | ||
| 311 | std::array<View, Maxwell::NumRenderTargets> color_attachments; | 313 | ColorAttachments color_attachments; |
| 312 | View zeta_attachment; | 314 | ZetaAttachment zeta_attachment; |
| 313 | 315 | ||
| 314 | std::vector<ImageView> sampled_views; | 316 | std::vector<ImageView> sampled_views; |
| 315 | std::vector<ImageView> image_views; | 317 | std::vector<ImageView> image_views; |
diff --git a/src/video_core/renderer_vulkan/vk_renderpass_cache.cpp b/src/video_core/renderer_vulkan/vk_renderpass_cache.cpp index 80284cf92..e812c7dd6 100644 --- a/src/video_core/renderer_vulkan/vk_renderpass_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_renderpass_cache.cpp | |||
| @@ -24,7 +24,7 @@ bool RenderPassParams::operator==(const RenderPassParams& rhs) const noexcept { | |||
| 24 | return std::memcmp(&rhs, this, sizeof *this) == 0; | 24 | return std::memcmp(&rhs, this, sizeof *this) == 0; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | VKRenderPassCache::VKRenderPassCache(const VKDevice& device) : device{device} {} | 27 | VKRenderPassCache::VKRenderPassCache(const VKDevice& device_) : device{device_} {} |
| 28 | 28 | ||
| 29 | VKRenderPassCache::~VKRenderPassCache() = default; | 29 | VKRenderPassCache::~VKRenderPassCache() = default; |
| 30 | 30 | ||
diff --git a/src/video_core/renderer_vulkan/vk_renderpass_cache.h b/src/video_core/renderer_vulkan/vk_renderpass_cache.h index 8b0fec720..652ecef7b 100644 --- a/src/video_core/renderer_vulkan/vk_renderpass_cache.h +++ b/src/video_core/renderer_vulkan/vk_renderpass_cache.h | |||
| @@ -55,7 +55,7 @@ namespace Vulkan { | |||
| 55 | 55 | ||
| 56 | class VKRenderPassCache final { | 56 | class VKRenderPassCache final { |
| 57 | public: | 57 | public: |
| 58 | explicit VKRenderPassCache(const VKDevice& device); | 58 | explicit VKRenderPassCache(const VKDevice& device_); |
| 59 | ~VKRenderPassCache(); | 59 | ~VKRenderPassCache(); |
| 60 | 60 | ||
| 61 | VkRenderPass GetRenderPass(const RenderPassParams& params); | 61 | VkRenderPass GetRenderPass(const RenderPassParams& params); |
diff --git a/src/video_core/renderer_vulkan/vk_sampler_cache.cpp b/src/video_core/renderer_vulkan/vk_sampler_cache.cpp index b068888f9..b859691fa 100644 --- a/src/video_core/renderer_vulkan/vk_sampler_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_sampler_cache.cpp | |||
| @@ -36,7 +36,7 @@ VkBorderColor ConvertBorderColor(std::array<float, 4> color) { | |||
| 36 | 36 | ||
| 37 | } // Anonymous namespace | 37 | } // Anonymous namespace |
| 38 | 38 | ||
| 39 | VKSamplerCache::VKSamplerCache(const VKDevice& device) : device{device} {} | 39 | VKSamplerCache::VKSamplerCache(const VKDevice& device_) : device{device_} {} |
| 40 | 40 | ||
| 41 | VKSamplerCache::~VKSamplerCache() = default; | 41 | VKSamplerCache::~VKSamplerCache() = default; |
| 42 | 42 | ||
diff --git a/src/video_core/renderer_vulkan/vk_sampler_cache.h b/src/video_core/renderer_vulkan/vk_sampler_cache.h index a33d1c0ee..3f22c4610 100644 --- a/src/video_core/renderer_vulkan/vk_sampler_cache.h +++ b/src/video_core/renderer_vulkan/vk_sampler_cache.h | |||
| @@ -14,7 +14,7 @@ class VKDevice; | |||
| 14 | 14 | ||
| 15 | class VKSamplerCache final : public VideoCommon::SamplerCache<VkSampler, vk::Sampler> { | 15 | class VKSamplerCache final : public VideoCommon::SamplerCache<VkSampler, vk::Sampler> { |
| 16 | public: | 16 | public: |
| 17 | explicit VKSamplerCache(const VKDevice& device); | 17 | explicit VKSamplerCache(const VKDevice& device_); |
| 18 | ~VKSamplerCache(); | 18 | ~VKSamplerCache(); |
| 19 | 19 | ||
| 20 | protected: | 20 | protected: |
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 7be8a19f0..6d3a5da0b 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h | |||
| @@ -104,7 +104,7 @@ private: | |||
| 104 | template <typename T> | 104 | template <typename T> |
| 105 | class TypedCommand final : public Command { | 105 | class TypedCommand final : public Command { |
| 106 | public: | 106 | public: |
| 107 | explicit TypedCommand(T&& command) : command{std::move(command)} {} | 107 | explicit TypedCommand(T&& command_) : command{std::move(command_)} {} |
| 108 | ~TypedCommand() override = default; | 108 | ~TypedCommand() override = default; |
| 109 | 109 | ||
| 110 | TypedCommand(TypedCommand&&) = delete; | 110 | TypedCommand(TypedCommand&&) = delete; |
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index fed9ebecd..7b0169acd 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -55,8 +55,8 @@ enum class Type { Void, Bool, Bool2, Float, Int, Uint, HalfFloat }; | |||
| 55 | 55 | ||
| 56 | class Expression final { | 56 | class Expression final { |
| 57 | public: | 57 | public: |
| 58 | Expression(Id id, Type type) : id{id}, type{type} { | 58 | Expression(Id id_, Type type_) : id{id_}, type{type_} { |
| 59 | ASSERT(type != Type::Void); | 59 | ASSERT(type_ != Type::Void); |
| 60 | } | 60 | } |
| 61 | Expression() : type{Type::Void} {} | 61 | Expression() : type{Type::Void} {} |
| 62 | 62 | ||
| @@ -281,12 +281,12 @@ u32 ShaderVersion(const VKDevice& device) { | |||
| 281 | 281 | ||
| 282 | class SPIRVDecompiler final : public Sirit::Module { | 282 | class SPIRVDecompiler final : public Sirit::Module { |
| 283 | public: | 283 | public: |
| 284 | explicit SPIRVDecompiler(const VKDevice& device, const ShaderIR& ir, ShaderType stage, | 284 | explicit SPIRVDecompiler(const VKDevice& device_, const ShaderIR& ir_, ShaderType stage_, |
| 285 | const Registry& registry, const Specialization& specialization) | 285 | const Registry& registry_, const Specialization& specialization_) |
| 286 | : Module(ShaderVersion(device)), device{device}, ir{ir}, stage{stage}, | 286 | : Module(ShaderVersion(device_)), device{device_}, ir{ir_}, stage{stage_}, |
| 287 | header{ir.GetHeader()}, registry{registry}, specialization{specialization} { | 287 | header{ir_.GetHeader()}, registry{registry_}, specialization{specialization_} { |
| 288 | if (stage != ShaderType::Compute) { | 288 | if (stage_ != ShaderType::Compute) { |
| 289 | transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); | 289 | transform_feedback = BuildTransformFeedback(registry_.GetGraphicsInfo()); |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | AddCapability(spv::Capability::Shader); | 292 | AddCapability(spv::Capability::Shader); |
| @@ -330,7 +330,7 @@ public: | |||
| 330 | if (device.IsFloat16Supported()) { | 330 | if (device.IsFloat16Supported()) { |
| 331 | AddCapability(spv::Capability::Float16); | 331 | AddCapability(spv::Capability::Float16); |
| 332 | } | 332 | } |
| 333 | t_scalar_half = Name(TypeFloat(device.IsFloat16Supported() ? 16 : 32), "scalar_half"); | 333 | t_scalar_half = Name(TypeFloat(device_.IsFloat16Supported() ? 16 : 32), "scalar_half"); |
| 334 | t_half = Name(TypeVector(t_scalar_half, 2), "half"); | 334 | t_half = Name(TypeVector(t_scalar_half, 2), "half"); |
| 335 | 335 | ||
| 336 | const Id main = Decompile(); | 336 | const Id main = Decompile(); |
| @@ -1088,9 +1088,9 @@ private: | |||
| 1088 | indices.point_size = AddBuiltIn(t_float, spv::BuiltIn::PointSize, "point_size"); | 1088 | indices.point_size = AddBuiltIn(t_float, spv::BuiltIn::PointSize, "point_size"); |
| 1089 | } | 1089 | } |
| 1090 | 1090 | ||
| 1091 | const auto& output_attributes = ir.GetOutputAttributes(); | 1091 | const auto& ir_output_attributes = ir.GetOutputAttributes(); |
| 1092 | const bool declare_clip_distances = | 1092 | const bool declare_clip_distances = std::any_of( |
| 1093 | std::any_of(output_attributes.begin(), output_attributes.end(), [](const auto& index) { | 1093 | ir_output_attributes.begin(), ir_output_attributes.end(), [](const auto& index) { |
| 1094 | return index == Attribute::Index::ClipDistances0123 || | 1094 | return index == Attribute::Index::ClipDistances0123 || |
| 1095 | index == Attribute::Index::ClipDistances4567; | 1095 | index == Attribute::Index::ClipDistances4567; |
| 1096 | }); | 1096 | }); |
| @@ -2891,7 +2891,7 @@ private: | |||
| 2891 | 2891 | ||
| 2892 | class ExprDecompiler { | 2892 | class ExprDecompiler { |
| 2893 | public: | 2893 | public: |
| 2894 | explicit ExprDecompiler(SPIRVDecompiler& decomp) : decomp{decomp} {} | 2894 | explicit ExprDecompiler(SPIRVDecompiler& decomp_) : decomp{decomp_} {} |
| 2895 | 2895 | ||
| 2896 | Id operator()(const ExprAnd& expr) { | 2896 | Id operator()(const ExprAnd& expr) { |
| 2897 | const Id type_def = decomp.GetTypeDefinition(Type::Bool); | 2897 | const Id type_def = decomp.GetTypeDefinition(Type::Bool); |
| @@ -2947,7 +2947,7 @@ private: | |||
| 2947 | 2947 | ||
| 2948 | class ASTDecompiler { | 2948 | class ASTDecompiler { |
| 2949 | public: | 2949 | public: |
| 2950 | explicit ASTDecompiler(SPIRVDecompiler& decomp) : decomp{decomp} {} | 2950 | explicit ASTDecompiler(SPIRVDecompiler& decomp_) : decomp{decomp_} {} |
| 2951 | 2951 | ||
| 2952 | void operator()(const ASTProgram& ast) { | 2952 | void operator()(const ASTProgram& ast) { |
| 2953 | ASTNode current = ast.nodes.GetFirst(); | 2953 | ASTNode current = ast.nodes.GetFirst(); |
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.h b/src/video_core/renderer_vulkan/vk_shader_decompiler.h index 110848922..df1812514 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.h +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.h | |||
| @@ -30,8 +30,8 @@ constexpr u32 DESCRIPTOR_SET = 0; | |||
| 30 | 30 | ||
| 31 | class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer { | 31 | class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer { |
| 32 | public: | 32 | public: |
| 33 | explicit constexpr ConstBufferEntry(const VideoCommon::Shader::ConstBuffer& entry, u32 index) | 33 | explicit constexpr ConstBufferEntry(const ConstBuffer& entry_, u32 index_) |
| 34 | : VideoCommon::Shader::ConstBuffer{entry}, index{index} {} | 34 | : ConstBuffer{entry_}, index{index_} {} |
| 35 | 35 | ||
| 36 | constexpr u32 GetIndex() const { | 36 | constexpr u32 GetIndex() const { |
| 37 | return index; | 37 | return index; |
| @@ -43,8 +43,8 @@ private: | |||
| 43 | 43 | ||
| 44 | class GlobalBufferEntry { | 44 | class GlobalBufferEntry { |
| 45 | public: | 45 | public: |
| 46 | constexpr explicit GlobalBufferEntry(u32 cbuf_index, u32 cbuf_offset, bool is_written) | 46 | constexpr explicit GlobalBufferEntry(u32 cbuf_index_, u32 cbuf_offset_, bool is_written_) |
| 47 | : cbuf_index{cbuf_index}, cbuf_offset{cbuf_offset}, is_written{is_written} {} | 47 | : cbuf_index{cbuf_index_}, cbuf_offset{cbuf_offset_}, is_written{is_written_} {} |
| 48 | 48 | ||
| 49 | constexpr u32 GetCbufIndex() const { | 49 | constexpr u32 GetCbufIndex() const { |
| 50 | return cbuf_index; | 50 | return cbuf_index; |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index f2c8f2ae1..64649699f 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -180,19 +180,19 @@ VkImageCreateInfo GenerateImageCreateInfo(const VKDevice& device, const SurfaceP | |||
| 180 | return ci; | 180 | return ci; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | u32 EncodeSwizzle(Tegra::Texture::SwizzleSource x_source, Tegra::Texture::SwizzleSource y_source, | 183 | u32 EncodeSwizzle(SwizzleSource x_source, SwizzleSource y_source, SwizzleSource z_source, |
| 184 | Tegra::Texture::SwizzleSource z_source, Tegra::Texture::SwizzleSource w_source) { | 184 | SwizzleSource w_source) { |
| 185 | return (static_cast<u32>(x_source) << 24) | (static_cast<u32>(y_source) << 16) | | 185 | return (static_cast<u32>(x_source) << 24) | (static_cast<u32>(y_source) << 16) | |
| 186 | (static_cast<u32>(z_source) << 8) | static_cast<u32>(w_source); | 186 | (static_cast<u32>(z_source) << 8) | static_cast<u32>(w_source); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | } // Anonymous namespace | 189 | } // Anonymous namespace |
| 190 | 190 | ||
| 191 | CachedSurface::CachedSurface(const VKDevice& device, VKMemoryManager& memory_manager, | 191 | CachedSurface::CachedSurface(const VKDevice& device_, VKMemoryManager& memory_manager_, |
| 192 | VKScheduler& scheduler, VKStagingBufferPool& staging_pool, | 192 | VKScheduler& scheduler_, VKStagingBufferPool& staging_pool_, |
| 193 | GPUVAddr gpu_addr, const SurfaceParams& params) | 193 | GPUVAddr gpu_addr_, const SurfaceParams& params_) |
| 194 | : SurfaceBase<View>{gpu_addr, params, device.IsOptimalAstcSupported()}, device{device}, | 194 | : SurfaceBase<View>{gpu_addr_, params_, device_.IsOptimalAstcSupported()}, device{device_}, |
| 195 | memory_manager{memory_manager}, scheduler{scheduler}, staging_pool{staging_pool} { | 195 | memory_manager{memory_manager_}, scheduler{scheduler_}, staging_pool{staging_pool_} { |
| 196 | if (params.IsBuffer()) { | 196 | if (params.IsBuffer()) { |
| 197 | buffer = CreateBuffer(device, params, host_memory_size); | 197 | buffer = CreateBuffer(device, params, host_memory_size); |
| 198 | commit = memory_manager.Commit(buffer, false); | 198 | commit = memory_manager.Commit(buffer, false); |
| @@ -234,7 +234,7 @@ void CachedSurface::UploadTexture(const std::vector<u8>& staging_buffer) { | |||
| 234 | void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { | 234 | void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { |
| 235 | UNIMPLEMENTED_IF(params.IsBuffer()); | 235 | UNIMPLEMENTED_IF(params.IsBuffer()); |
| 236 | 236 | ||
| 237 | if (params.pixel_format == VideoCore::Surface::PixelFormat::A1B5G5R5_UNORM) { | 237 | if (params.pixel_format == PixelFormat::A1B5G5R5_UNORM) { |
| 238 | LOG_WARNING(Render_Vulkan, "A1B5G5R5 flushing is stubbed"); | 238 | LOG_WARNING(Render_Vulkan, "A1B5G5R5 flushing is stubbed"); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| @@ -244,10 +244,10 @@ void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { | |||
| 244 | FullTransition(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT, | 244 | FullTransition(VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT, |
| 245 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); | 245 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); |
| 246 | 246 | ||
| 247 | const auto& buffer = staging_pool.GetUnusedBuffer(host_memory_size, true); | 247 | const auto& unused_buffer = staging_pool.GetUnusedBuffer(host_memory_size, true); |
| 248 | // TODO(Rodrigo): Do this in a single copy | 248 | // TODO(Rodrigo): Do this in a single copy |
| 249 | for (u32 level = 0; level < params.num_levels; ++level) { | 249 | for (u32 level = 0; level < params.num_levels; ++level) { |
| 250 | scheduler.Record([image = *image->GetHandle(), buffer = *buffer.handle, | 250 | scheduler.Record([image = *image->GetHandle(), buffer = *unused_buffer.handle, |
| 251 | copy = GetBufferImageCopy(level)](vk::CommandBuffer cmdbuf) { | 251 | copy = GetBufferImageCopy(level)](vk::CommandBuffer cmdbuf) { |
| 252 | cmdbuf.CopyImageToBuffer(image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, buffer, copy); | 252 | cmdbuf.CopyImageToBuffer(image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, buffer, copy); |
| 253 | }); | 253 | }); |
| @@ -255,16 +255,17 @@ void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { | |||
| 255 | scheduler.Finish(); | 255 | scheduler.Finish(); |
| 256 | 256 | ||
| 257 | // TODO(Rodrigo): Use an intern buffer for staging buffers and avoid this unnecessary memcpy. | 257 | // TODO(Rodrigo): Use an intern buffer for staging buffers and avoid this unnecessary memcpy. |
| 258 | std::memcpy(staging_buffer.data(), buffer.commit->Map(host_memory_size), host_memory_size); | 258 | std::memcpy(staging_buffer.data(), unused_buffer.commit->Map(host_memory_size), |
| 259 | host_memory_size); | ||
| 259 | } | 260 | } |
| 260 | 261 | ||
| 261 | void CachedSurface::DecorateSurfaceName() { | 262 | void CachedSurface::DecorateSurfaceName() { |
| 262 | // TODO(Rodrigo): Add name decorations | 263 | // TODO(Rodrigo): Add name decorations |
| 263 | } | 264 | } |
| 264 | 265 | ||
| 265 | View CachedSurface::CreateView(const ViewParams& params) { | 266 | View CachedSurface::CreateView(const ViewParams& view_params) { |
| 266 | // TODO(Rodrigo): Add name decorations | 267 | // TODO(Rodrigo): Add name decorations |
| 267 | return views[params] = std::make_shared<CachedSurfaceView>(device, *this, params); | 268 | return views[view_params] = std::make_shared<CachedSurfaceView>(device, *this, view_params); |
| 268 | } | 269 | } |
| 269 | 270 | ||
| 270 | void CachedSurface::UploadBuffer(const std::vector<u8>& staging_buffer) { | 271 | void CachedSurface::UploadBuffer(const std::vector<u8>& staging_buffer) { |
| @@ -348,21 +349,21 @@ VkImageSubresourceRange CachedSurface::GetImageSubresourceRange() const { | |||
| 348 | static_cast<u32>(params.GetNumLayers())}; | 349 | static_cast<u32>(params.GetNumLayers())}; |
| 349 | } | 350 | } |
| 350 | 351 | ||
| 351 | CachedSurfaceView::CachedSurfaceView(const VKDevice& device, CachedSurface& surface, | 352 | CachedSurfaceView::CachedSurfaceView(const VKDevice& device_, CachedSurface& surface_, |
| 352 | const ViewParams& params) | 353 | const ViewParams& view_params_) |
| 353 | : VideoCommon::ViewBase{params}, params{surface.GetSurfaceParams()}, | 354 | : ViewBase{view_params_}, surface_params{surface_.GetSurfaceParams()}, |
| 354 | image{surface.GetImageHandle()}, buffer_view{surface.GetBufferViewHandle()}, | 355 | image{surface_.GetImageHandle()}, buffer_view{surface_.GetBufferViewHandle()}, |
| 355 | aspect_mask{surface.GetAspectMask()}, device{device}, surface{surface}, | 356 | aspect_mask{surface_.GetAspectMask()}, device{device_}, surface{surface_}, |
| 356 | base_level{params.base_level}, num_levels{params.num_levels}, | 357 | base_level{view_params_.base_level}, num_levels{view_params_.num_levels}, |
| 357 | image_view_type{image ? GetImageViewType(params.target) : VK_IMAGE_VIEW_TYPE_1D} { | 358 | image_view_type{image ? GetImageViewType(view_params_.target) : VK_IMAGE_VIEW_TYPE_1D} { |
| 358 | if (image_view_type == VK_IMAGE_VIEW_TYPE_3D) { | 359 | if (image_view_type == VK_IMAGE_VIEW_TYPE_3D) { |
| 359 | base_layer = 0; | 360 | base_layer = 0; |
| 360 | num_layers = 1; | 361 | num_layers = 1; |
| 361 | base_slice = params.base_layer; | 362 | base_slice = view_params_.base_layer; |
| 362 | num_slices = params.num_layers; | 363 | num_slices = view_params_.num_layers; |
| 363 | } else { | 364 | } else { |
| 364 | base_layer = params.base_layer; | 365 | base_layer = view_params_.base_layer; |
| 365 | num_layers = params.num_layers; | 366 | num_layers = view_params_.num_layers; |
| 366 | } | 367 | } |
| 367 | } | 368 | } |
| 368 | 369 | ||
| @@ -384,7 +385,7 @@ VkImageView CachedSurfaceView::GetImageView(SwizzleSource x_source, SwizzleSourc | |||
| 384 | 385 | ||
| 385 | std::array swizzle{MaxwellToVK::SwizzleSource(x_source), MaxwellToVK::SwizzleSource(y_source), | 386 | std::array swizzle{MaxwellToVK::SwizzleSource(x_source), MaxwellToVK::SwizzleSource(y_source), |
| 386 | MaxwellToVK::SwizzleSource(z_source), MaxwellToVK::SwizzleSource(w_source)}; | 387 | MaxwellToVK::SwizzleSource(z_source), MaxwellToVK::SwizzleSource(w_source)}; |
| 387 | if (params.pixel_format == VideoCore::Surface::PixelFormat::A1B5G5R5_UNORM) { | 388 | if (surface_params.pixel_format == PixelFormat::A1B5G5R5_UNORM) { |
| 388 | // A1B5G5R5 is implemented as A1R5G5B5, we have to change the swizzle here. | 389 | // A1B5G5R5 is implemented as A1R5G5B5, we have to change the swizzle here. |
| 389 | std::swap(swizzle[0], swizzle[2]); | 390 | std::swap(swizzle[0], swizzle[2]); |
| 390 | } | 391 | } |
| @@ -395,12 +396,12 @@ VkImageView CachedSurfaceView::GetImageView(SwizzleSource x_source, SwizzleSourc | |||
| 395 | if (aspect == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { | 396 | if (aspect == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { |
| 396 | UNIMPLEMENTED_IF(x_source != SwizzleSource::R && x_source != SwizzleSource::G); | 397 | UNIMPLEMENTED_IF(x_source != SwizzleSource::R && x_source != SwizzleSource::G); |
| 397 | const bool is_first = x_source == SwizzleSource::R; | 398 | const bool is_first = x_source == SwizzleSource::R; |
| 398 | switch (params.pixel_format) { | 399 | switch (surface_params.pixel_format) { |
| 399 | case VideoCore::Surface::PixelFormat::D24_UNORM_S8_UINT: | 400 | case PixelFormat::D24_UNORM_S8_UINT: |
| 400 | case VideoCore::Surface::PixelFormat::D32_FLOAT_S8_UINT: | 401 | case PixelFormat::D32_FLOAT_S8_UINT: |
| 401 | aspect = is_first ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_STENCIL_BIT; | 402 | aspect = is_first ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_STENCIL_BIT; |
| 402 | break; | 403 | break; |
| 403 | case VideoCore::Surface::PixelFormat::S8_UINT_D24_UNORM: | 404 | case PixelFormat::S8_UINT_D24_UNORM: |
| 404 | aspect = is_first ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; | 405 | aspect = is_first ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; |
| 405 | break; | 406 | break; |
| 406 | default: | 407 | default: |
| @@ -417,7 +418,7 @@ VkImageView CachedSurfaceView::GetImageView(SwizzleSource x_source, SwizzleSourc | |||
| 417 | 418 | ||
| 418 | if (image_view_type == VK_IMAGE_VIEW_TYPE_3D) { | 419 | if (image_view_type == VK_IMAGE_VIEW_TYPE_3D) { |
| 419 | ASSERT(base_slice == 0); | 420 | ASSERT(base_slice == 0); |
| 420 | ASSERT(num_slices == params.depth); | 421 | ASSERT(num_slices == surface_params.depth); |
| 421 | } | 422 | } |
| 422 | 423 | ||
| 423 | image_view = device.GetLogical().CreateImageView({ | 424 | image_view = device.GetLogical().CreateImageView({ |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 39202feba..06880f228 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h | |||
| @@ -40,9 +40,9 @@ class CachedSurface final : public VideoCommon::SurfaceBase<View> { | |||
| 40 | friend CachedSurfaceView; | 40 | friend CachedSurfaceView; |
| 41 | 41 | ||
| 42 | public: | 42 | public: |
| 43 | explicit CachedSurface(const VKDevice& device, VKMemoryManager& memory_manager, | 43 | explicit CachedSurface(const VKDevice& device_, VKMemoryManager& memory_manager_, |
| 44 | VKScheduler& scheduler, VKStagingBufferPool& staging_pool, | 44 | VKScheduler& scheduler_, VKStagingBufferPool& staging_pool_, |
| 45 | GPUVAddr gpu_addr, const SurfaceParams& params); | 45 | GPUVAddr gpu_addr_, const SurfaceParams& params_); |
| 46 | ~CachedSurface(); | 46 | ~CachedSurface(); |
| 47 | 47 | ||
| 48 | void UploadTexture(const std::vector<u8>& staging_buffer) override; | 48 | void UploadTexture(const std::vector<u8>& staging_buffer) override; |
| @@ -84,7 +84,7 @@ public: | |||
| 84 | protected: | 84 | protected: |
| 85 | void DecorateSurfaceName(); | 85 | void DecorateSurfaceName(); |
| 86 | 86 | ||
| 87 | View CreateView(const ViewParams& params) override; | 87 | View CreateView(const ViewParams& view_params) override; |
| 88 | 88 | ||
| 89 | private: | 89 | private: |
| 90 | void UploadBuffer(const std::vector<u8>& staging_buffer); | 90 | void UploadBuffer(const std::vector<u8>& staging_buffer); |
| @@ -110,8 +110,8 @@ private: | |||
| 110 | 110 | ||
| 111 | class CachedSurfaceView final : public VideoCommon::ViewBase { | 111 | class CachedSurfaceView final : public VideoCommon::ViewBase { |
| 112 | public: | 112 | public: |
| 113 | explicit CachedSurfaceView(const VKDevice& device, CachedSurface& surface, | 113 | explicit CachedSurfaceView(const VKDevice& device_, CachedSurface& surface_, |
| 114 | const ViewParams& params); | 114 | const ViewParams& view_params_); |
| 115 | ~CachedSurfaceView(); | 115 | ~CachedSurfaceView(); |
| 116 | 116 | ||
| 117 | VkImageView GetImageView(Tegra::Texture::SwizzleSource x_source, | 117 | VkImageView GetImageView(Tegra::Texture::SwizzleSource x_source, |
| @@ -126,11 +126,11 @@ public: | |||
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | u32 GetWidth() const { | 128 | u32 GetWidth() const { |
| 129 | return params.GetMipWidth(base_level); | 129 | return surface_params.GetMipWidth(base_level); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | u32 GetHeight() const { | 132 | u32 GetHeight() const { |
| 133 | return params.GetMipHeight(base_level); | 133 | return surface_params.GetMipHeight(base_level); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | u32 GetNumLayers() const { | 136 | u32 GetNumLayers() const { |
| @@ -169,7 +169,7 @@ public: | |||
| 169 | 169 | ||
| 170 | private: | 170 | private: |
| 171 | // Store a copy of these values to avoid double dereference when reading them | 171 | // Store a copy of these values to avoid double dereference when reading them |
| 172 | const SurfaceParams params; | 172 | const SurfaceParams surface_params; |
| 173 | const VkImage image; | 173 | const VkImage image; |
| 174 | const VkBufferView buffer_view; | 174 | const VkBufferView buffer_view; |
| 175 | const VkImageAspectFlags aspect_mask; | 175 | const VkImageAspectFlags aspect_mask; |
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.cpp b/src/video_core/renderer_vulkan/vk_update_descriptor.cpp index 351c048d2..8826da325 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.cpp +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.cpp | |||
| @@ -14,8 +14,8 @@ | |||
| 14 | 14 | ||
| 15 | namespace Vulkan { | 15 | namespace Vulkan { |
| 16 | 16 | ||
| 17 | VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const VKDevice& device, VKScheduler& scheduler) | 17 | VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const VKDevice& device_, VKScheduler& scheduler_) |
| 18 | : device{device}, scheduler{scheduler} {} | 18 | : device{device_}, scheduler{scheduler_} {} |
| 19 | 19 | ||
| 20 | VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; | 20 | VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; |
| 21 | 21 | ||
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h index 945320c72..f7e3c9821 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.h +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h | |||
| @@ -31,7 +31,7 @@ struct DescriptorUpdateEntry { | |||
| 31 | 31 | ||
| 32 | class VKUpdateDescriptorQueue final { | 32 | class VKUpdateDescriptorQueue final { |
| 33 | public: | 33 | public: |
| 34 | explicit VKUpdateDescriptorQueue(const VKDevice& device, VKScheduler& scheduler); | 34 | explicit VKUpdateDescriptorQueue(const VKDevice& device_, VKScheduler& scheduler_); |
| 35 | ~VKUpdateDescriptorQueue(); | 35 | ~VKUpdateDescriptorQueue(); |
| 36 | 36 | ||
| 37 | void TickFrame(); | 37 | void TickFrame(); |
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index 4e83303d8..1eced809e 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp | |||
| @@ -417,7 +417,7 @@ VkResult Free(VkDevice device, VkCommandPool handle, Span<VkCommandBuffer> buffe | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions, | 419 | Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions, |
| 420 | InstanceDispatch& dld) noexcept { | 420 | InstanceDispatch& dispatch) noexcept { |
| 421 | const VkApplicationInfo application_info{ | 421 | const VkApplicationInfo application_info{ |
| 422 | .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, | 422 | .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, |
| 423 | .pNext = nullptr, | 423 | .pNext = nullptr, |
| @@ -439,17 +439,17 @@ Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char | |||
| 439 | }; | 439 | }; |
| 440 | 440 | ||
| 441 | VkInstance instance; | 441 | VkInstance instance; |
| 442 | if (dld.vkCreateInstance(&ci, nullptr, &instance) != VK_SUCCESS) { | 442 | if (dispatch.vkCreateInstance(&ci, nullptr, &instance) != VK_SUCCESS) { |
| 443 | // Failed to create the instance. | 443 | // Failed to create the instance. |
| 444 | return {}; | 444 | return {}; |
| 445 | } | 445 | } |
| 446 | if (!Proc(dld.vkDestroyInstance, dld, "vkDestroyInstance", instance)) { | 446 | if (!Proc(dispatch.vkDestroyInstance, dispatch, "vkDestroyInstance", instance)) { |
| 447 | // We successfully created an instance but the destroy function couldn't be loaded. | 447 | // We successfully created an instance but the destroy function couldn't be loaded. |
| 448 | // This is a good moment to panic. | 448 | // This is a good moment to panic. |
| 449 | return {}; | 449 | return {}; |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | return Instance(instance, dld); | 452 | return Instance(instance, dispatch); |
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | std::optional<std::vector<VkPhysicalDevice>> Instance::EnumeratePhysicalDevices() { | 455 | std::optional<std::vector<VkPhysicalDevice>> Instance::EnumeratePhysicalDevices() { |
| @@ -540,7 +540,7 @@ std::vector<VkImage> SwapchainKHR::GetImages() const { | |||
| 540 | 540 | ||
| 541 | Device Device::Create(VkPhysicalDevice physical_device, Span<VkDeviceQueueCreateInfo> queues_ci, | 541 | Device Device::Create(VkPhysicalDevice physical_device, Span<VkDeviceQueueCreateInfo> queues_ci, |
| 542 | Span<const char*> enabled_extensions, const void* next, | 542 | Span<const char*> enabled_extensions, const void* next, |
| 543 | DeviceDispatch& dld) noexcept { | 543 | DeviceDispatch& dispatch) noexcept { |
| 544 | const VkDeviceCreateInfo ci{ | 544 | const VkDeviceCreateInfo ci{ |
| 545 | .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, | 545 | .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, |
| 546 | .pNext = next, | 546 | .pNext = next, |
| @@ -555,11 +555,11 @@ Device Device::Create(VkPhysicalDevice physical_device, Span<VkDeviceQueueCreate | |||
| 555 | }; | 555 | }; |
| 556 | 556 | ||
| 557 | VkDevice device; | 557 | VkDevice device; |
| 558 | if (dld.vkCreateDevice(physical_device, &ci, nullptr, &device) != VK_SUCCESS) { | 558 | if (dispatch.vkCreateDevice(physical_device, &ci, nullptr, &device) != VK_SUCCESS) { |
| 559 | return {}; | 559 | return {}; |
| 560 | } | 560 | } |
| 561 | Load(device, dld); | 561 | Load(device, dispatch); |
| 562 | return Device(device, dld); | 562 | return Device(device, dispatch); |
| 563 | } | 563 | } |
| 564 | 564 | ||
| 565 | Queue Device::GetQueue(u32 family_index) const noexcept { | 565 | Queue Device::GetQueue(u32 family_index) const noexcept { |
diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h index f64919623..76f790eab 100644 --- a/src/video_core/renderer_vulkan/wrapper.h +++ b/src/video_core/renderer_vulkan/wrapper.h | |||
| @@ -52,7 +52,7 @@ public: | |||
| 52 | 52 | ||
| 53 | /// Construct a span from a pointer and a size. | 53 | /// Construct a span from a pointer and a size. |
| 54 | /// This is inteded for subranges. | 54 | /// This is inteded for subranges. |
| 55 | constexpr Span(const T* ptr, std::size_t num) noexcept : ptr{ptr}, num{num} {} | 55 | constexpr Span(const T* ptr_, std::size_t num_) noexcept : ptr{ptr_}, num{num_} {} |
| 56 | 56 | ||
| 57 | /// Returns the data pointer by the span. | 57 | /// Returns the data pointer by the span. |
| 58 | constexpr const T* data() const noexcept { | 58 | constexpr const T* data() const noexcept { |
| @@ -469,9 +469,10 @@ public: | |||
| 469 | PoolAllocations() = default; | 469 | PoolAllocations() = default; |
| 470 | 470 | ||
| 471 | /// Construct an allocation. Errors are reported through IsOutOfPoolMemory(). | 471 | /// Construct an allocation. Errors are reported through IsOutOfPoolMemory(). |
| 472 | explicit PoolAllocations(std::unique_ptr<AllocationType[]> allocations, std::size_t num, | 472 | explicit PoolAllocations(std::unique_ptr<AllocationType[]> allocations_, std::size_t num_, |
| 473 | VkDevice device, PoolType pool, const DeviceDispatch& dld) noexcept | 473 | VkDevice device_, PoolType pool_, const DeviceDispatch& dld_) noexcept |
| 474 | : allocations{std::move(allocations)}, num{num}, device{device}, pool{pool}, dld{&dld} {} | 474 | : allocations{std::move(allocations_)}, num{num_}, device{device_}, pool{pool_}, |
| 475 | dld{&dld_} {} | ||
| 475 | 476 | ||
| 476 | /// Copying Vulkan allocations is not supported and will never be. | 477 | /// Copying Vulkan allocations is not supported and will never be. |
| 477 | PoolAllocations(const PoolAllocations&) = delete; | 478 | PoolAllocations(const PoolAllocations&) = delete; |
| @@ -565,7 +566,7 @@ class Instance : public Handle<VkInstance, NoOwner, InstanceDispatch> { | |||
| 565 | public: | 566 | public: |
| 566 | /// Creates a Vulkan instance. Use "operator bool" for error handling. | 567 | /// Creates a Vulkan instance. Use "operator bool" for error handling. |
| 567 | static Instance Create(u32 version, Span<const char*> layers, Span<const char*> extensions, | 568 | static Instance Create(u32 version, Span<const char*> layers, Span<const char*> extensions, |
| 568 | InstanceDispatch& dld) noexcept; | 569 | InstanceDispatch& dispatch) noexcept; |
| 569 | 570 | ||
| 570 | /// Enumerates physical devices. | 571 | /// Enumerates physical devices. |
| 571 | /// @return Physical devices and an empty handle on failure. | 572 | /// @return Physical devices and an empty handle on failure. |
| @@ -581,7 +582,8 @@ public: | |||
| 581 | constexpr Queue() noexcept = default; | 582 | constexpr Queue() noexcept = default; |
| 582 | 583 | ||
| 583 | /// Construct a queue handle. | 584 | /// Construct a queue handle. |
| 584 | constexpr Queue(VkQueue queue, const DeviceDispatch& dld) noexcept : queue{queue}, dld{&dld} {} | 585 | constexpr Queue(VkQueue queue_, const DeviceDispatch& dld_) noexcept |
| 586 | : queue{queue_}, dld{&dld_} {} | ||
| 585 | 587 | ||
| 586 | VkResult Submit(Span<VkSubmitInfo> submit_infos, | 588 | VkResult Submit(Span<VkSubmitInfo> submit_infos, |
| 587 | VkFence fence = VK_NULL_HANDLE) const noexcept { | 589 | VkFence fence = VK_NULL_HANDLE) const noexcept { |
| @@ -720,7 +722,7 @@ class Device : public Handle<VkDevice, NoOwner, DeviceDispatch> { | |||
| 720 | public: | 722 | public: |
| 721 | static Device Create(VkPhysicalDevice physical_device, Span<VkDeviceQueueCreateInfo> queues_ci, | 723 | static Device Create(VkPhysicalDevice physical_device, Span<VkDeviceQueueCreateInfo> queues_ci, |
| 722 | Span<const char*> enabled_extensions, const void* next, | 724 | Span<const char*> enabled_extensions, const void* next, |
| 723 | DeviceDispatch& dld) noexcept; | 725 | DeviceDispatch& dispatch) noexcept; |
| 724 | 726 | ||
| 725 | Queue GetQueue(u32 family_index) const noexcept; | 727 | Queue GetQueue(u32 family_index) const noexcept; |
| 726 | 728 | ||
| @@ -809,8 +811,9 @@ class PhysicalDevice { | |||
| 809 | public: | 811 | public: |
| 810 | constexpr PhysicalDevice() noexcept = default; | 812 | constexpr PhysicalDevice() noexcept = default; |
| 811 | 813 | ||
| 812 | constexpr PhysicalDevice(VkPhysicalDevice physical_device, const InstanceDispatch& dld) noexcept | 814 | constexpr PhysicalDevice(VkPhysicalDevice physical_device_, |
| 813 | : physical_device{physical_device}, dld{&dld} {} | 815 | const InstanceDispatch& dld_) noexcept |
| 816 | : physical_device{physical_device_}, dld{&dld_} {} | ||
| 814 | 817 | ||
| 815 | constexpr operator VkPhysicalDevice() const noexcept { | 818 | constexpr operator VkPhysicalDevice() const noexcept { |
| 816 | return physical_device; | 819 | return physical_device; |
| @@ -849,8 +852,8 @@ class CommandBuffer { | |||
| 849 | public: | 852 | public: |
| 850 | CommandBuffer() noexcept = default; | 853 | CommandBuffer() noexcept = default; |
| 851 | 854 | ||
| 852 | explicit CommandBuffer(VkCommandBuffer handle, const DeviceDispatch& dld) noexcept | 855 | explicit CommandBuffer(VkCommandBuffer handle_, const DeviceDispatch& dld_) noexcept |
| 853 | : handle{handle}, dld{&dld} {} | 856 | : handle{handle_}, dld{&dld_} {} |
| 854 | 857 | ||
| 855 | const VkCommandBuffer* address() const noexcept { | 858 | const VkCommandBuffer* address() const noexcept { |
| 856 | return &handle; | 859 | return &handle; |
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index 4c8971615..d656e0668 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp | |||
| @@ -241,10 +241,10 @@ std::pair<ParseResult, ParseInfo> ParseCode(CFGRebuildState& state, u32 address) | |||
| 241 | ParseInfo parse_info{}; | 241 | ParseInfo parse_info{}; |
| 242 | SingleBranch single_branch{}; | 242 | SingleBranch single_branch{}; |
| 243 | 243 | ||
| 244 | const auto insert_label = [](CFGRebuildState& state, u32 address) { | 244 | const auto insert_label = [](CFGRebuildState& rebuild_state, u32 label_address) { |
| 245 | const auto pair = state.labels.emplace(address); | 245 | const auto pair = rebuild_state.labels.emplace(label_address); |
| 246 | if (pair.second) { | 246 | if (pair.second) { |
| 247 | state.inspect_queries.push_back(address); | 247 | rebuild_state.inspect_queries.push_back(label_address); |
| 248 | } | 248 | } |
| 249 | }; | 249 | }; |
| 250 | 250 | ||
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp index 1ed4212ee..532f66d27 100644 --- a/src/video_core/shader/decode/image.cpp +++ b/src/video_core/shader/decode/image.cpp | |||
| @@ -358,9 +358,9 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) { | |||
| 358 | instr.suldst.GetStoreDataLayout() != StoreType::Bits64); | 358 | instr.suldst.GetStoreDataLayout() != StoreType::Bits64); |
| 359 | 359 | ||
| 360 | auto descriptor = [this, instr] { | 360 | auto descriptor = [this, instr] { |
| 361 | std::optional<Tegra::Engines::SamplerDescriptor> descriptor; | 361 | std::optional<Tegra::Engines::SamplerDescriptor> sampler_descriptor; |
| 362 | if (instr.suldst.is_immediate) { | 362 | if (instr.suldst.is_immediate) { |
| 363 | descriptor = | 363 | sampler_descriptor = |
| 364 | registry.ObtainBoundSampler(static_cast<u32>(instr.image.index.Value())); | 364 | registry.ObtainBoundSampler(static_cast<u32>(instr.image.index.Value())); |
| 365 | } else { | 365 | } else { |
| 366 | const Node image_register = GetRegister(instr.gpr39); | 366 | const Node image_register = GetRegister(instr.gpr39); |
| @@ -368,12 +368,12 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) { | |||
| 368 | static_cast<s64>(global_code.size())); | 368 | static_cast<s64>(global_code.size())); |
| 369 | const auto buffer = std::get<1>(result); | 369 | const auto buffer = std::get<1>(result); |
| 370 | const auto offset = std::get<2>(result); | 370 | const auto offset = std::get<2>(result); |
| 371 | descriptor = registry.ObtainBindlessSampler(buffer, offset); | 371 | sampler_descriptor = registry.ObtainBindlessSampler(buffer, offset); |
| 372 | } | 372 | } |
| 373 | if (!descriptor) { | 373 | if (!sampler_descriptor) { |
| 374 | UNREACHABLE_MSG("Failed to obtain image descriptor"); | 374 | UNREACHABLE_MSG("Failed to obtain image descriptor"); |
| 375 | } | 375 | } |
| 376 | return *descriptor; | 376 | return *sampler_descriptor; |
| 377 | }(); | 377 | }(); |
| 378 | 378 | ||
| 379 | const auto comp_mask = GetImageComponentMask(descriptor.format); | 379 | const auto comp_mask = GetImageComponentMask(descriptor.format); |
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index 29a7cfbfe..1db500bc4 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp | |||
| @@ -90,11 +90,11 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { | |||
| 90 | UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented"); | 90 | UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented"); |
| 91 | return Immediate(0U); | 91 | return Immediate(0U); |
| 92 | case SystemVariable::Tid: { | 92 | case SystemVariable::Tid: { |
| 93 | Node value = Immediate(0); | 93 | Node val = Immediate(0); |
| 94 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdX), 0, 9); | 94 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdX), 0, 9); |
| 95 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdY), 16, 9); | 95 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdY), 16, 9); |
| 96 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdZ), 26, 5); | 96 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdZ), 26, 5); |
| 97 | return value; | 97 | return val; |
| 98 | } | 98 | } |
| 99 | case SystemVariable::TidX: | 99 | case SystemVariable::TidX: |
| 100 | return Operation(OperationCode::LocalInvocationIdX); | 100 | return Operation(OperationCode::LocalInvocationIdX); |
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp index b44c09d71..42a1c0c6f 100644 --- a/src/video_core/texture_cache/surface_base.cpp +++ b/src/video_core/texture_cache/surface_base.cpp | |||
| @@ -167,27 +167,28 @@ std::vector<CopyParams> SurfaceBaseImpl::BreakDownNonLayered(const SurfaceParams | |||
| 167 | return result; | 167 | return result; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | void SurfaceBaseImpl::SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& params, | 170 | void SurfaceBaseImpl::SwizzleFunc(MortonSwizzleMode mode, u8* memory, |
| 171 | u8* buffer, u32 level) { | 171 | const SurfaceParams& surface_params, u8* buffer, u32 level) { |
| 172 | const u32 width{params.GetMipWidth(level)}; | 172 | const u32 width{surface_params.GetMipWidth(level)}; |
| 173 | const u32 height{params.GetMipHeight(level)}; | 173 | const u32 height{surface_params.GetMipHeight(level)}; |
| 174 | const u32 block_height{params.GetMipBlockHeight(level)}; | 174 | const u32 block_height{surface_params.GetMipBlockHeight(level)}; |
| 175 | const u32 block_depth{params.GetMipBlockDepth(level)}; | 175 | const u32 block_depth{surface_params.GetMipBlockDepth(level)}; |
| 176 | 176 | ||
| 177 | std::size_t guest_offset{mipmap_offsets[level]}; | 177 | std::size_t guest_offset{mipmap_offsets[level]}; |
| 178 | if (params.is_layered) { | 178 | if (surface_params.is_layered) { |
| 179 | std::size_t host_offset = 0; | 179 | std::size_t host_offset = 0; |
| 180 | const std::size_t guest_stride = layer_size; | 180 | const std::size_t guest_stride = layer_size; |
| 181 | const std::size_t host_stride = params.GetHostLayerSize(level); | 181 | const std::size_t host_stride = surface_params.GetHostLayerSize(level); |
| 182 | for (u32 layer = 0; layer < params.depth; ++layer) { | 182 | for (u32 layer = 0; layer < surface_params.depth; ++layer) { |
| 183 | MortonSwizzle(mode, params.pixel_format, width, block_height, height, block_depth, 1, | 183 | MortonSwizzle(mode, surface_params.pixel_format, width, block_height, height, |
| 184 | params.tile_width_spacing, buffer + host_offset, memory + guest_offset); | 184 | block_depth, 1, surface_params.tile_width_spacing, buffer + host_offset, |
| 185 | memory + guest_offset); | ||
| 185 | guest_offset += guest_stride; | 186 | guest_offset += guest_stride; |
| 186 | host_offset += host_stride; | 187 | host_offset += host_stride; |
| 187 | } | 188 | } |
| 188 | } else { | 189 | } else { |
| 189 | MortonSwizzle(mode, params.pixel_format, width, block_height, height, block_depth, | 190 | MortonSwizzle(mode, surface_params.pixel_format, width, block_height, height, block_depth, |
| 190 | params.GetMipDepth(level), params.tile_width_spacing, buffer, | 191 | surface_params.GetMipDepth(level), surface_params.tile_width_spacing, buffer, |
| 191 | memory + guest_offset); | 192 | memory + guest_offset); |
| 192 | } | 193 | } |
| 193 | } | 194 | } |
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h index 173f2edba..cfcfa5b3a 100644 --- a/src/video_core/texture_cache/surface_base.h +++ b/src/video_core/texture_cache/surface_base.h | |||
| @@ -167,8 +167,8 @@ protected: | |||
| 167 | std::vector<std::size_t> mipmap_offsets; | 167 | std::vector<std::size_t> mipmap_offsets; |
| 168 | 168 | ||
| 169 | private: | 169 | private: |
| 170 | void SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& params, u8* buffer, | 170 | void SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& surface_params, |
| 171 | u32 level); | 171 | u8* buffer, u32 level); |
| 172 | 172 | ||
| 173 | std::vector<CopyParams> BreakDownLayered(const SurfaceParams& in_params) const; | 173 | std::vector<CopyParams> BreakDownLayered(const SurfaceParams& in_params) const; |
| 174 | 174 | ||
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp index 13dd16356..305297719 100644 --- a/src/video_core/texture_cache/surface_params.cpp +++ b/src/video_core/texture_cache/surface_params.cpp | |||
| @@ -356,18 +356,18 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co | |||
| 356 | 356 | ||
| 357 | std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size, | 357 | std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size, |
| 358 | bool uncompressed) const { | 358 | bool uncompressed) const { |
| 359 | const u32 width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())}; | 359 | const u32 mip_width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())}; |
| 360 | const u32 height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())}; | 360 | const u32 mip_height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())}; |
| 361 | const u32 depth{is_layered ? 1U : GetMipDepth(level)}; | 361 | const u32 mip_depth{is_layered ? 1U : GetMipDepth(level)}; |
| 362 | if (is_tiled) { | 362 | if (is_tiled) { |
| 363 | return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), width, height, | 363 | return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), mip_width, |
| 364 | depth, GetMipBlockHeight(level), | 364 | mip_height, mip_depth, GetMipBlockHeight(level), |
| 365 | GetMipBlockDepth(level)); | 365 | GetMipBlockDepth(level)); |
| 366 | } else if (as_host_size || IsBuffer()) { | 366 | } else if (as_host_size || IsBuffer()) { |
| 367 | return GetBytesPerPixel() * width * height * depth; | 367 | return GetBytesPerPixel() * mip_width * mip_height * mip_depth; |
| 368 | } else { | 368 | } else { |
| 369 | // Linear Texture Case | 369 | // Linear Texture Case |
| 370 | return pitch * height * depth; | 370 | return pitch * mip_height * mip_depth; |
| 371 | } | 371 | } |
| 372 | } | 372 | } |
| 373 | 373 | ||