diff options
Diffstat (limited to 'src')
52 files changed, 166 insertions, 169 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 504492cac..b412cdb7f 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp | |||
| @@ -225,7 +225,7 @@ constexpr std::array<VkPipelineShaderStageCreateInfo, 2> MakeStages( | |||
| 225 | }; | 225 | }; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | void UpdateOneTextureDescriptorSet(const VKDevice& device, VkDescriptorSet descriptor_set, | 228 | void UpdateOneTextureDescriptorSet(const Device& device, VkDescriptorSet descriptor_set, |
| 229 | VkSampler sampler, VkImageView image_view) { | 229 | VkSampler sampler, VkImageView image_view) { |
| 230 | const VkDescriptorImageInfo image_info{ | 230 | const VkDescriptorImageInfo image_info{ |
| 231 | .sampler = sampler, | 231 | .sampler = sampler, |
| @@ -247,7 +247,7 @@ void UpdateOneTextureDescriptorSet(const VKDevice& device, VkDescriptorSet descr | |||
| 247 | device.GetLogical().UpdateDescriptorSets(write_descriptor_set, nullptr); | 247 | device.GetLogical().UpdateDescriptorSets(write_descriptor_set, nullptr); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | void UpdateTwoTexturesDescriptorSet(const VKDevice& device, VkDescriptorSet descriptor_set, | 250 | void UpdateTwoTexturesDescriptorSet(const Device& device, VkDescriptorSet descriptor_set, |
| 251 | VkSampler sampler, VkImageView image_view_0, | 251 | VkSampler sampler, VkImageView image_view_0, |
| 252 | VkImageView image_view_1) { | 252 | VkImageView image_view_1) { |
| 253 | const VkDescriptorImageInfo image_info_0{ | 253 | const VkDescriptorImageInfo image_info_0{ |
| @@ -326,7 +326,7 @@ void BindBlitState(vk::CommandBuffer cmdbuf, VkPipelineLayout layout, | |||
| 326 | 326 | ||
| 327 | } // Anonymous namespace | 327 | } // Anonymous namespace |
| 328 | 328 | ||
| 329 | BlitImageHelper::BlitImageHelper(const VKDevice& device_, VKScheduler& scheduler_, | 329 | BlitImageHelper::BlitImageHelper(const Device& device_, VKScheduler& scheduler_, |
| 330 | StateTracker& state_tracker_, VKDescriptorPool& descriptor_pool) | 330 | StateTracker& state_tracker_, VKDescriptorPool& descriptor_pool) |
| 331 | : device{device_}, scheduler{scheduler_}, state_tracker{state_tracker_}, | 331 | : device{device_}, scheduler{scheduler_}, state_tracker{state_tracker_}, |
| 332 | one_texture_set_layout(device.GetLogical().CreateDescriptorSetLayout( | 332 | one_texture_set_layout(device.GetLogical().CreateDescriptorSetLayout( |
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index 1a4f66336..43fd3d737 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h | |||
| @@ -15,12 +15,11 @@ namespace Vulkan { | |||
| 15 | 15 | ||
| 16 | using VideoCommon::Offset2D; | 16 | using VideoCommon::Offset2D; |
| 17 | 17 | ||
| 18 | class VKDevice; | 18 | class Device; |
| 19 | class VKScheduler; | ||
| 20 | class StateTracker; | ||
| 21 | |||
| 22 | class Framebuffer; | 19 | class Framebuffer; |
| 23 | class ImageView; | 20 | class ImageView; |
| 21 | class StateTracker; | ||
| 22 | class VKScheduler; | ||
| 24 | 23 | ||
| 25 | struct BlitImagePipelineKey { | 24 | struct BlitImagePipelineKey { |
| 26 | constexpr auto operator<=>(const BlitImagePipelineKey&) const noexcept = default; | 25 | constexpr auto operator<=>(const BlitImagePipelineKey&) const noexcept = default; |
| @@ -31,7 +30,7 @@ struct BlitImagePipelineKey { | |||
| 31 | 30 | ||
| 32 | class BlitImageHelper { | 31 | class BlitImageHelper { |
| 33 | public: | 32 | public: |
| 34 | explicit BlitImageHelper(const VKDevice& device, VKScheduler& scheduler, | 33 | explicit BlitImageHelper(const Device& device, VKScheduler& scheduler, |
| 35 | StateTracker& state_tracker, VKDescriptorPool& descriptor_pool); | 34 | StateTracker& state_tracker, VKDescriptorPool& descriptor_pool); |
| 36 | ~BlitImageHelper(); | 35 | ~BlitImageHelper(); |
| 37 | 36 | ||
| @@ -67,7 +66,7 @@ private: | |||
| 67 | 66 | ||
| 68 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); | 67 | void ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRenderPass renderpass); |
| 69 | 68 | ||
| 70 | const VKDevice& device; | 69 | const Device& device; |
| 71 | VKScheduler& scheduler; | 70 | VKScheduler& scheduler; |
| 72 | StateTracker& state_tracker; | 71 | StateTracker& state_tracker; |
| 73 | 72 | ||
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index ed4fce714..9c0fcfbce 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -47,7 +47,7 @@ VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter | |||
| 47 | return {}; | 47 | return {}; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode wrap_mode, | 50 | VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wrap_mode, |
| 51 | Tegra::Texture::TextureFilter filter) { | 51 | Tegra::Texture::TextureFilter filter) { |
| 52 | switch (wrap_mode) { | 52 | switch (wrap_mode) { |
| 53 | case Tegra::Texture::WrapMode::Wrap: | 53 | case Tegra::Texture::WrapMode::Wrap: |
| @@ -222,7 +222,7 @@ constexpr bool IsZetaFormat(PixelFormat pixel_format) { | |||
| 222 | 222 | ||
| 223 | } // Anonymous namespace | 223 | } // Anonymous namespace |
| 224 | 224 | ||
| 225 | FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFormat pixel_format) { | 225 | FormatInfo SurfaceFormat(const Device& device, FormatType format_type, PixelFormat pixel_format) { |
| 226 | ASSERT(static_cast<std::size_t>(pixel_format) < std::size(tex_format_tuples)); | 226 | ASSERT(static_cast<std::size_t>(pixel_format) < std::size(tex_format_tuples)); |
| 227 | 227 | ||
| 228 | auto tuple = tex_format_tuples[static_cast<std::size_t>(pixel_format)]; | 228 | auto tuple = tex_format_tuples[static_cast<std::size_t>(pixel_format)]; |
| @@ -280,7 +280,7 @@ VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage) { | |||
| 280 | return {}; | 280 | return {}; |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const VKDevice& device, | 283 | VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const Device& device, |
| 284 | Maxwell::PrimitiveTopology topology) { | 284 | Maxwell::PrimitiveTopology topology) { |
| 285 | switch (topology) { | 285 | switch (topology) { |
| 286 | case Maxwell::PrimitiveTopology::Points: | 286 | case Maxwell::PrimitiveTopology::Points: |
| @@ -526,7 +526,7 @@ VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison) { | |||
| 526 | return {}; | 526 | return {}; |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format) { | 529 | VkIndexType IndexFormat(const Device& device, Maxwell::IndexFormat index_format) { |
| 530 | switch (index_format) { | 530 | switch (index_format) { |
| 531 | case Maxwell::IndexFormat::UnsignedByte: | 531 | case Maxwell::IndexFormat::UnsignedByte: |
| 532 | if (!device.IsExtIndexTypeUint8Supported()) { | 532 | if (!device.IsExtIndexTypeUint8Supported()) { |
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.h b/src/video_core/renderer_vulkan/maxwell_to_vk.h index 8cf5aa711..8fa63c1c9 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.h +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.h | |||
| @@ -22,7 +22,7 @@ VkFilter Filter(Tegra::Texture::TextureFilter filter); | |||
| 22 | 22 | ||
| 23 | VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter); | 23 | VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter); |
| 24 | 24 | ||
| 25 | VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode wrap_mode, | 25 | VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wrap_mode, |
| 26 | Tegra::Texture::TextureFilter filter); | 26 | Tegra::Texture::TextureFilter filter); |
| 27 | 27 | ||
| 28 | VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func); | 28 | VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func); |
| @@ -35,17 +35,17 @@ struct FormatInfo { | |||
| 35 | bool storage; | 35 | bool storage; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFormat pixel_format); | 38 | FormatInfo SurfaceFormat(const Device& device, FormatType format_type, PixelFormat pixel_format); |
| 39 | 39 | ||
| 40 | VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage); | 40 | VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage); |
| 41 | 41 | ||
| 42 | VkPrimitiveTopology PrimitiveTopology(const VKDevice& device, Maxwell::PrimitiveTopology topology); | 42 | VkPrimitiveTopology PrimitiveTopology(const Device& device, Maxwell::PrimitiveTopology topology); |
| 43 | 43 | ||
| 44 | VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size); | 44 | VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size); |
| 45 | 45 | ||
| 46 | VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison); | 46 | VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison); |
| 47 | 47 | ||
| 48 | VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format); | 48 | VkIndexType IndexFormat(const Device& device, Maxwell::IndexFormat index_format); |
| 49 | 49 | ||
| 50 | VkStencilOp StencilOp(Maxwell::StencilOp stencil_op); | 50 | VkStencilOp StencilOp(Maxwell::StencilOp stencil_op); |
| 51 | 51 | ||
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 5b35cb407..0224fc445 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -42,7 +42,7 @@ std::string GetReadableVersion(u32 version) { | |||
| 42 | VK_VERSION_PATCH(version)); | 42 | VK_VERSION_PATCH(version)); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | std::string GetDriverVersion(const VKDevice& device) { | 45 | std::string GetDriverVersion(const Device& device) { |
| 46 | // Extracted from | 46 | // Extracted from |
| 47 | // https://github.com/SaschaWillems/vulkan.gpuinfo.org/blob/5dddea46ea1120b0df14eef8f15ff8e318e35462/functions.php#L308-L314 | 47 | // https://github.com/SaschaWillems/vulkan.gpuinfo.org/blob/5dddea46ea1120b0df14eef8f15ff8e318e35462/functions.php#L308-L314 |
| 48 | const u32 version = device.GetDriverVersion(); | 48 | const u32 version = device.GetDriverVersion(); |
| @@ -184,7 +184,7 @@ void RendererVulkan::InitializeDevice() { | |||
| 184 | throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED); | 184 | throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED); |
| 185 | } | 185 | } |
| 186 | const vk::PhysicalDevice physical_device(devices[static_cast<size_t>(device_index)], dld); | 186 | const vk::PhysicalDevice physical_device(devices[static_cast<size_t>(device_index)], dld); |
| 187 | device = std::make_unique<VKDevice>(*instance, physical_device, *surface, dld); | 187 | device = std::make_unique<Device>(*instance, physical_device, *surface, dld); |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | void RendererVulkan::Report() const { | 190 | void RendererVulkan::Report() const { |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h index f22f50709..5575ffc54 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.h +++ b/src/video_core/renderer_vulkan/renderer_vulkan.h | |||
| @@ -27,9 +27,9 @@ class GPU; | |||
| 27 | 27 | ||
| 28 | namespace Vulkan { | 28 | namespace Vulkan { |
| 29 | 29 | ||
| 30 | class Device; | ||
| 30 | class StateTracker; | 31 | class StateTracker; |
| 31 | class VKBlitScreen; | 32 | class VKBlitScreen; |
| 32 | class VKDevice; | ||
| 33 | class VKMemoryManager; | 33 | class VKMemoryManager; |
| 34 | class VKSwapchain; | 34 | class VKSwapchain; |
| 35 | class VKScheduler; | 35 | class VKScheduler; |
| @@ -74,7 +74,7 @@ private: | |||
| 74 | VKScreenInfo screen_info; | 74 | VKScreenInfo screen_info; |
| 75 | 75 | ||
| 76 | vk::DebugUtilsMessenger debug_callback; | 76 | vk::DebugUtilsMessenger debug_callback; |
| 77 | std::unique_ptr<VKDevice> device; | 77 | std::unique_ptr<Device> device; |
| 78 | std::unique_ptr<VKMemoryManager> memory_manager; | 78 | std::unique_ptr<VKMemoryManager> memory_manager; |
| 79 | std::unique_ptr<StateTracker> state_tracker; | 79 | std::unique_ptr<StateTracker> state_tracker; |
| 80 | std::unique_ptr<VKScheduler> scheduler; | 80 | std::unique_ptr<VKScheduler> scheduler; |
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index a205cd151..a0f2825e2 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp | |||
| @@ -114,7 +114,7 @@ struct VKBlitScreen::BufferData { | |||
| 114 | 114 | ||
| 115 | VKBlitScreen::VKBlitScreen(Core::Memory::Memory& cpu_memory_, | 115 | VKBlitScreen::VKBlitScreen(Core::Memory::Memory& cpu_memory_, |
| 116 | Core::Frontend::EmuWindow& render_window_, | 116 | Core::Frontend::EmuWindow& render_window_, |
| 117 | VideoCore::RasterizerInterface& rasterizer_, const VKDevice& device_, | 117 | VideoCore::RasterizerInterface& rasterizer_, const Device& device_, |
| 118 | VKMemoryManager& memory_manager_, VKSwapchain& swapchain_, | 118 | VKMemoryManager& memory_manager_, VKSwapchain& swapchain_, |
| 119 | VKScheduler& scheduler_, const VKScreenInfo& screen_info_) | 119 | VKScheduler& scheduler_, const VKScreenInfo& screen_info_) |
| 120 | : cpu_memory{cpu_memory_}, render_window{render_window_}, rasterizer{rasterizer_}, | 120 | : cpu_memory{cpu_memory_}, render_window{render_window_}, rasterizer{rasterizer_}, |
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h index cc56c4560..69ed61770 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.h +++ b/src/video_core/renderer_vulkan/vk_blit_screen.h | |||
| @@ -33,8 +33,8 @@ namespace Vulkan { | |||
| 33 | 33 | ||
| 34 | struct ScreenInfo; | 34 | struct ScreenInfo; |
| 35 | 35 | ||
| 36 | class Device; | ||
| 36 | class RasterizerVulkan; | 37 | class RasterizerVulkan; |
| 37 | class VKDevice; | ||
| 38 | class VKScheduler; | 38 | class VKScheduler; |
| 39 | class VKSwapchain; | 39 | class VKSwapchain; |
| 40 | 40 | ||
| @@ -42,7 +42,7 @@ class VKBlitScreen final { | |||
| 42 | public: | 42 | public: |
| 43 | explicit VKBlitScreen(Core::Memory::Memory& cpu_memory, | 43 | explicit VKBlitScreen(Core::Memory::Memory& cpu_memory, |
| 44 | Core::Frontend::EmuWindow& render_window, | 44 | Core::Frontend::EmuWindow& render_window, |
| 45 | VideoCore::RasterizerInterface& rasterizer, const VKDevice& device, | 45 | VideoCore::RasterizerInterface& rasterizer, const Device& device, |
| 46 | VKMemoryManager& memory_manager, VKSwapchain& swapchain, | 46 | VKMemoryManager& memory_manager, VKSwapchain& swapchain, |
| 47 | VKScheduler& scheduler, const VKScreenInfo& screen_info); | 47 | VKScheduler& scheduler, const VKScreenInfo& screen_info); |
| 48 | ~VKBlitScreen(); | 48 | ~VKBlitScreen(); |
| @@ -85,7 +85,7 @@ private: | |||
| 85 | Core::Memory::Memory& cpu_memory; | 85 | Core::Memory::Memory& cpu_memory; |
| 86 | Core::Frontend::EmuWindow& render_window; | 86 | Core::Frontend::EmuWindow& render_window; |
| 87 | VideoCore::RasterizerInterface& rasterizer; | 87 | VideoCore::RasterizerInterface& rasterizer; |
| 88 | const VKDevice& device; | 88 | const Device& device; |
| 89 | VKMemoryManager& memory_manager; | 89 | VKMemoryManager& memory_manager; |
| 90 | VKSwapchain& swapchain; | 90 | VKSwapchain& swapchain; |
| 91 | VKScheduler& scheduler; | 91 | VKScheduler& scheduler; |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 79131f819..f87779c4b 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -34,13 +34,13 @@ constexpr VkAccessFlags UPLOAD_ACCESS_BARRIERS = | |||
| 34 | constexpr VkAccessFlags TRANSFORM_FEEDBACK_WRITE_ACCESS = | 34 | constexpr VkAccessFlags TRANSFORM_FEEDBACK_WRITE_ACCESS = |
| 35 | VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT; | 35 | VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT; |
| 36 | 36 | ||
| 37 | std::unique_ptr<VKStreamBuffer> CreateStreamBuffer(const VKDevice& device, VKScheduler& scheduler) { | 37 | std::unique_ptr<VKStreamBuffer> CreateStreamBuffer(const Device& device, VKScheduler& scheduler) { |
| 38 | return std::make_unique<VKStreamBuffer>(device, scheduler); | 38 | return std::make_unique<VKStreamBuffer>(device, scheduler); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | } // Anonymous namespace | 41 | } // Anonymous namespace |
| 42 | 42 | ||
| 43 | Buffer::Buffer(const VKDevice& device_, VKMemoryManager& memory_manager, VKScheduler& scheduler_, | 43 | Buffer::Buffer(const Device& device_, VKMemoryManager& memory_manager, VKScheduler& scheduler_, |
| 44 | VKStagingBufferPool& staging_pool_, VAddr cpu_addr_, std::size_t size_) | 44 | VKStagingBufferPool& staging_pool_, VAddr cpu_addr_, std::size_t size_) |
| 45 | : BufferBlock{cpu_addr_, size_}, device{device_}, scheduler{scheduler_}, staging_pool{ | 45 | : BufferBlock{cpu_addr_, size_}, device{device_}, scheduler{scheduler_}, staging_pool{ |
| 46 | staging_pool_} { | 46 | staging_pool_} { |
| @@ -168,7 +168,7 @@ void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst | |||
| 168 | 168 | ||
| 169 | VKBufferCache::VKBufferCache(VideoCore::RasterizerInterface& rasterizer_, | 169 | VKBufferCache::VKBufferCache(VideoCore::RasterizerInterface& rasterizer_, |
| 170 | Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_, | 170 | Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_, |
| 171 | const VKDevice& device_, VKMemoryManager& memory_manager_, | 171 | const Device& device_, VKMemoryManager& memory_manager_, |
| 172 | VKScheduler& scheduler_, VKStreamBuffer& stream_buffer_, | 172 | VKScheduler& scheduler_, VKStreamBuffer& stream_buffer_, |
| 173 | VKStagingBufferPool& staging_pool_) | 173 | VKStagingBufferPool& staging_pool_) |
| 174 | : VideoCommon::BufferCache<Buffer, VkBuffer, VKStreamBuffer>{rasterizer_, gpu_memory_, | 174 | : VideoCommon::BufferCache<Buffer, VkBuffer, VKStreamBuffer>{rasterizer_, gpu_memory_, |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 3ab77a00b..1c39aed34 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h | |||
| @@ -15,13 +15,13 @@ | |||
| 15 | 15 | ||
| 16 | namespace Vulkan { | 16 | namespace Vulkan { |
| 17 | 17 | ||
| 18 | class VKDevice; | 18 | class Device; |
| 19 | class VKMemoryManager; | 19 | class VKMemoryManager; |
| 20 | class VKScheduler; | 20 | class VKScheduler; |
| 21 | 21 | ||
| 22 | class Buffer final : public VideoCommon::BufferBlock { | 22 | class Buffer final : public VideoCommon::BufferBlock { |
| 23 | public: | 23 | public: |
| 24 | explicit Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKScheduler& scheduler, | 24 | explicit Buffer(const Device& device, VKMemoryManager& memory_manager, VKScheduler& scheduler, |
| 25 | VKStagingBufferPool& staging_pool, VAddr cpu_addr_, std::size_t size_); | 25 | VKStagingBufferPool& staging_pool, VAddr cpu_addr_, std::size_t size_); |
| 26 | ~Buffer(); | 26 | ~Buffer(); |
| 27 | 27 | ||
| @@ -41,7 +41,7 @@ public: | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | private: | 43 | private: |
| 44 | const VKDevice& device; | 44 | const Device& device; |
| 45 | VKScheduler& scheduler; | 45 | VKScheduler& scheduler; |
| 46 | VKStagingBufferPool& staging_pool; | 46 | VKStagingBufferPool& staging_pool; |
| 47 | 47 | ||
| @@ -52,7 +52,7 @@ class VKBufferCache final : public VideoCommon::BufferCache<Buffer, VkBuffer, VK | |||
| 52 | public: | 52 | public: |
| 53 | explicit VKBufferCache(VideoCore::RasterizerInterface& rasterizer, | 53 | explicit VKBufferCache(VideoCore::RasterizerInterface& rasterizer, |
| 54 | Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, | 54 | Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, |
| 55 | const VKDevice& device, VKMemoryManager& memory_manager, | 55 | const Device& device, VKMemoryManager& memory_manager, |
| 56 | VKScheduler& scheduler, VKStreamBuffer& stream_buffer, | 56 | VKScheduler& scheduler, VKStreamBuffer& stream_buffer, |
| 57 | VKStagingBufferPool& staging_pool); | 57 | VKStagingBufferPool& staging_pool); |
| 58 | ~VKBufferCache(); | 58 | ~VKBufferCache(); |
| @@ -63,7 +63,7 @@ protected: | |||
| 63 | std::shared_ptr<Buffer> CreateBlock(VAddr cpu_addr, std::size_t size) override; | 63 | std::shared_ptr<Buffer> CreateBlock(VAddr cpu_addr, std::size_t size) override; |
| 64 | 64 | ||
| 65 | private: | 65 | private: |
| 66 | const VKDevice& device; | 66 | const Device& device; |
| 67 | VKMemoryManager& memory_manager; | 67 | VKMemoryManager& memory_manager; |
| 68 | VKScheduler& scheduler; | 68 | VKScheduler& scheduler; |
| 69 | VKStagingBufferPool& staging_pool; | 69 | VKStagingBufferPool& staging_pool; |
diff --git a/src/video_core/renderer_vulkan/vk_command_pool.cpp b/src/video_core/renderer_vulkan/vk_command_pool.cpp index ccae04929..ca512d667 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_command_pool.cpp | |||
| @@ -17,7 +17,7 @@ struct CommandPool::Pool { | |||
| 17 | vk::CommandBuffers cmdbufs; | 17 | vk::CommandBuffers cmdbufs; |
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | CommandPool::CommandPool(MasterSemaphore& master_semaphore_, const VKDevice& device_) | 20 | CommandPool::CommandPool(MasterSemaphore& master_semaphore_, const Device& device_) |
| 21 | : ResourcePool(master_semaphore_, COMMAND_BUFFER_POOL_SIZE), device{device_} {} | 21 | : ResourcePool(master_semaphore_, COMMAND_BUFFER_POOL_SIZE), device{device_} {} |
| 22 | 22 | ||
| 23 | CommandPool::~CommandPool() = default; | 23 | CommandPool::~CommandPool() = default; |
diff --git a/src/video_core/renderer_vulkan/vk_command_pool.h b/src/video_core/renderer_vulkan/vk_command_pool.h index ce0e34515..61c26a22a 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.h +++ b/src/video_core/renderer_vulkan/vk_command_pool.h | |||
| @@ -12,12 +12,12 @@ | |||
| 12 | 12 | ||
| 13 | namespace Vulkan { | 13 | namespace Vulkan { |
| 14 | 14 | ||
| 15 | class Device; | ||
| 15 | class MasterSemaphore; | 16 | class MasterSemaphore; |
| 16 | class VKDevice; | ||
| 17 | 17 | ||
| 18 | class CommandPool final : public ResourcePool { | 18 | class CommandPool final : public ResourcePool { |
| 19 | public: | 19 | public: |
| 20 | explicit CommandPool(MasterSemaphore& master_semaphore_, const VKDevice& device_); | 20 | explicit CommandPool(MasterSemaphore& master_semaphore_, const Device& device_); |
| 21 | ~CommandPool() override; | 21 | ~CommandPool() override; |
| 22 | 22 | ||
| 23 | void Allocate(size_t begin, size_t end) override; | 23 | void Allocate(size_t begin, size_t end) override; |
| @@ -27,7 +27,7 @@ public: | |||
| 27 | private: | 27 | private: |
| 28 | struct Pool; | 28 | struct Pool; |
| 29 | 29 | ||
| 30 | const VKDevice& device; | 30 | const Device& device; |
| 31 | std::vector<Pool> pools; | 31 | std::vector<Pool> pools; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 5d4543bae..b13ed219a 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -86,7 +86,7 @@ VkDescriptorUpdateTemplateEntryKHR BuildInputOutputDescriptorUpdateTemplate() { | |||
| 86 | 86 | ||
| 87 | } // Anonymous namespace | 87 | } // Anonymous namespace |
| 88 | 88 | ||
| 89 | VKComputePass::VKComputePass(const VKDevice& device, VKDescriptorPool& descriptor_pool, | 89 | VKComputePass::VKComputePass(const Device& device, VKDescriptorPool& descriptor_pool, |
| 90 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 90 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 91 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 91 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, |
| 92 | vk::Span<VkPushConstantRange> push_constants, | 92 | vk::Span<VkPushConstantRange> push_constants, |
| @@ -162,7 +162,7 @@ VkDescriptorSet VKComputePass::CommitDescriptorSet( | |||
| 162 | return set; | 162 | return set; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | QuadArrayPass::QuadArrayPass(const VKDevice& device_, VKScheduler& scheduler_, | 165 | QuadArrayPass::QuadArrayPass(const Device& device_, VKScheduler& scheduler_, |
| 166 | VKDescriptorPool& descriptor_pool_, | 166 | VKDescriptorPool& descriptor_pool_, |
| 167 | VKStagingBufferPool& staging_buffer_pool_, | 167 | VKStagingBufferPool& staging_buffer_pool_, |
| 168 | VKUpdateDescriptorQueue& update_descriptor_queue_) | 168 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| @@ -211,7 +211,7 @@ std::pair<VkBuffer, VkDeviceSize> QuadArrayPass::Assemble(u32 num_vertices, u32 | |||
| 211 | return {*buffer.handle, 0}; | 211 | return {*buffer.handle, 0}; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | Uint8Pass::Uint8Pass(const VKDevice& device, VKScheduler& scheduler_, | 214 | Uint8Pass::Uint8Pass(const Device& device, VKScheduler& scheduler_, |
| 215 | VKDescriptorPool& descriptor_pool, VKStagingBufferPool& staging_buffer_pool_, | 215 | VKDescriptorPool& descriptor_pool, VKStagingBufferPool& staging_buffer_pool_, |
| 216 | VKUpdateDescriptorQueue& update_descriptor_queue_) | 216 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| 217 | : VKComputePass(device, descriptor_pool, BuildInputOutputDescriptorSetBindings(), | 217 | : VKComputePass(device, descriptor_pool, BuildInputOutputDescriptorSetBindings(), |
| @@ -255,7 +255,7 @@ std::pair<VkBuffer, u64> Uint8Pass::Assemble(u32 num_vertices, VkBuffer src_buff | |||
| 255 | return {*buffer.handle, 0}; | 255 | return {*buffer.handle, 0}; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | QuadIndexedPass::QuadIndexedPass(const VKDevice& device_, VKScheduler& scheduler_, | 258 | QuadIndexedPass::QuadIndexedPass(const Device& device_, VKScheduler& scheduler_, |
| 259 | VKDescriptorPool& descriptor_pool_, | 259 | VKDescriptorPool& descriptor_pool_, |
| 260 | VKStagingBufferPool& staging_buffer_pool_, | 260 | VKStagingBufferPool& staging_buffer_pool_, |
| 261 | VKUpdateDescriptorQueue& update_descriptor_queue_) | 261 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index 1b7502a4f..7ddb09afb 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h | |||
| @@ -15,14 +15,14 @@ | |||
| 15 | 15 | ||
| 16 | namespace Vulkan { | 16 | namespace Vulkan { |
| 17 | 17 | ||
| 18 | class VKDevice; | 18 | class Device; |
| 19 | class VKScheduler; | 19 | class VKScheduler; |
| 20 | class VKStagingBufferPool; | 20 | class VKStagingBufferPool; |
| 21 | class VKUpdateDescriptorQueue; | 21 | class VKUpdateDescriptorQueue; |
| 22 | 22 | ||
| 23 | class VKComputePass { | 23 | class VKComputePass { |
| 24 | public: | 24 | public: |
| 25 | explicit VKComputePass(const VKDevice& device, VKDescriptorPool& descriptor_pool, | 25 | explicit VKComputePass(const Device& device, VKDescriptorPool& descriptor_pool, |
| 26 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 26 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 27 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 27 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, |
| 28 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); | 28 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); |
| @@ -43,7 +43,7 @@ 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 Device& 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_); |
| @@ -59,7 +59,7 @@ 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 Device& device_, VKScheduler& scheduler_, |
| 63 | VKDescriptorPool& descriptor_pool_, | 63 | VKDescriptorPool& descriptor_pool_, |
| 64 | VKStagingBufferPool& staging_buffer_pool_, | 64 | VKStagingBufferPool& staging_buffer_pool_, |
| 65 | VKUpdateDescriptorQueue& update_descriptor_queue_); | 65 | VKUpdateDescriptorQueue& update_descriptor_queue_); |
| @@ -75,7 +75,7 @@ private: | |||
| 75 | 75 | ||
| 76 | class QuadIndexedPass final : public VKComputePass { | 76 | class QuadIndexedPass final : public VKComputePass { |
| 77 | public: | 77 | public: |
| 78 | explicit QuadIndexedPass(const VKDevice& device_, VKScheduler& scheduler_, | 78 | explicit QuadIndexedPass(const Device& device_, VKScheduler& scheduler_, |
| 79 | VKDescriptorPool& descriptor_pool_, | 79 | VKDescriptorPool& descriptor_pool_, |
| 80 | VKStagingBufferPool& staging_buffer_pool_, | 80 | VKStagingBufferPool& staging_buffer_pool_, |
| 81 | VKUpdateDescriptorQueue& update_descriptor_queue_); | 81 | VKUpdateDescriptorQueue& update_descriptor_queue_); |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 9966dd14a..cd92d5dbe 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | namespace Vulkan { | 16 | namespace Vulkan { |
| 17 | 17 | ||
| 18 | VKComputePipeline::VKComputePipeline(const VKDevice& device_, VKScheduler& scheduler_, | 18 | VKComputePipeline::VKComputePipeline(const Device& 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_) |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index a7197536c..7e16575ac 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h | |||
| @@ -11,13 +11,13 @@ | |||
| 11 | 11 | ||
| 12 | namespace Vulkan { | 12 | namespace Vulkan { |
| 13 | 13 | ||
| 14 | class VKDevice; | 14 | class Device; |
| 15 | class VKScheduler; | 15 | class VKScheduler; |
| 16 | class VKUpdateDescriptorQueue; | 16 | 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 Device& 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_); |
| @@ -48,7 +48,7 @@ private: | |||
| 48 | 48 | ||
| 49 | vk::Pipeline CreatePipeline() const; | 49 | vk::Pipeline CreatePipeline() const; |
| 50 | 50 | ||
| 51 | const VKDevice& device; | 51 | const Device& device; |
| 52 | VKScheduler& scheduler; | 52 | VKScheduler& scheduler; |
| 53 | ShaderEntries entries; | 53 | ShaderEntries entries; |
| 54 | 54 | ||
diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp index 4dea03239..f5ea1ff62 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp | |||
| @@ -32,7 +32,7 @@ void DescriptorAllocator::Allocate(std::size_t begin, std::size_t end) { | |||
| 32 | descriptors_allocations.push_back(descriptor_pool.AllocateDescriptors(layout, end - begin)); | 32 | descriptors_allocations.push_back(descriptor_pool.AllocateDescriptors(layout, end - begin)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | VKDescriptorPool::VKDescriptorPool(const VKDevice& device_, VKScheduler& scheduler) | 35 | VKDescriptorPool::VKDescriptorPool(const Device& device_, VKScheduler& scheduler) |
| 36 | : device{device_}, master_semaphore{scheduler.GetMasterSemaphore()}, active_pool{ | 36 | : device{device_}, master_semaphore{scheduler.GetMasterSemaphore()}, active_pool{ |
| 37 | AllocateNewPool()} {} | 37 | AllocateNewPool()} {} |
| 38 | 38 | ||
diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.h b/src/video_core/renderer_vulkan/vk_descriptor_pool.h index 2abcaeddd..f892be7be 100644 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.h +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | namespace Vulkan { | 12 | namespace Vulkan { |
| 13 | 13 | ||
| 14 | class VKDevice; | 14 | class Device; |
| 15 | class VKDescriptorPool; | 15 | class VKDescriptorPool; |
| 16 | class VKScheduler; | 16 | class VKScheduler; |
| 17 | 17 | ||
| @@ -39,7 +39,7 @@ class VKDescriptorPool final { | |||
| 39 | friend DescriptorAllocator; | 39 | friend DescriptorAllocator; |
| 40 | 40 | ||
| 41 | public: | 41 | public: |
| 42 | explicit VKDescriptorPool(const VKDevice& device, VKScheduler& scheduler); | 42 | explicit VKDescriptorPool(const Device& device, VKScheduler& scheduler); |
| 43 | ~VKDescriptorPool(); | 43 | ~VKDescriptorPool(); |
| 44 | 44 | ||
| 45 | VKDescriptorPool(const VKDescriptorPool&) = delete; | 45 | VKDescriptorPool(const VKDescriptorPool&) = delete; |
| @@ -50,7 +50,7 @@ private: | |||
| 50 | 50 | ||
| 51 | vk::DescriptorSets AllocateDescriptors(VkDescriptorSetLayout layout, std::size_t count); | 51 | vk::DescriptorSets AllocateDescriptors(VkDescriptorSetLayout layout, std::size_t count); |
| 52 | 52 | ||
| 53 | const VKDevice& device; | 53 | const Device& device; |
| 54 | MasterSemaphore& master_semaphore; | 54 | MasterSemaphore& master_semaphore; |
| 55 | 55 | ||
| 56 | std::vector<vk::DescriptorPool> pools; | 56 | std::vector<vk::DescriptorPool> pools; |
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 9008530d5..7a8b3fea0 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp | |||
| @@ -206,8 +206,8 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties( | |||
| 206 | 206 | ||
| 207 | } // Anonymous namespace | 207 | } // Anonymous namespace |
| 208 | 208 | ||
| 209 | VKDevice::VKDevice(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR surface, | 209 | Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR surface, |
| 210 | const vk::InstanceDispatch& dld_) | 210 | const vk::InstanceDispatch& dld_) |
| 211 | : instance{instance_}, dld{dld_}, physical{physical_}, properties{physical.GetProperties()}, | 211 | : instance{instance_}, dld{dld_}, physical{physical_}, properties{physical.GetProperties()}, |
| 212 | format_properties{GetFormatProperties(physical, dld)} { | 212 | format_properties{GetFormatProperties(physical, dld)} { |
| 213 | CheckSuitability(); | 213 | CheckSuitability(); |
| @@ -449,10 +449,10 @@ VKDevice::VKDevice(VkInstance instance_, vk::PhysicalDevice physical_, VkSurface | |||
| 449 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue(); | 449 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue(); |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | VKDevice::~VKDevice() = default; | 452 | Device::~Device() = default; |
| 453 | 453 | ||
| 454 | VkFormat VKDevice::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, | 454 | VkFormat Device::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, |
| 455 | FormatType format_type) const { | 455 | FormatType format_type) const { |
| 456 | if (IsFormatSupported(wanted_format, wanted_usage, format_type)) { | 456 | if (IsFormatSupported(wanted_format, wanted_usage, format_type)) { |
| 457 | return wanted_format; | 457 | return wanted_format; |
| 458 | } | 458 | } |
| @@ -483,18 +483,18 @@ VkFormat VKDevice::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFla | |||
| 483 | return wanted_format; | 483 | return wanted_format; |
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | void VKDevice::ReportLoss() const { | 486 | void Device::ReportLoss() const { |
| 487 | LOG_CRITICAL(Render_Vulkan, "Device loss occurred!"); | 487 | LOG_CRITICAL(Render_Vulkan, "Device loss occured!"); |
| 488 | 488 | ||
| 489 | // Wait for the log to flush and for Nsight Aftermath to dump the results | 489 | // Wait for the log to flush and for Nsight Aftermath to dump the results |
| 490 | std::this_thread::sleep_for(std::chrono::seconds{15}); | 490 | std::this_thread::sleep_for(std::chrono::seconds{15}); |
| 491 | } | 491 | } |
| 492 | 492 | ||
| 493 | void VKDevice::SaveShader(const std::vector<u32>& spirv) const { | 493 | void Device::SaveShader(const std::vector<u32>& spirv) const { |
| 494 | nsight_aftermath_tracker.SaveShader(spirv); | 494 | nsight_aftermath_tracker.SaveShader(spirv); |
| 495 | } | 495 | } |
| 496 | 496 | ||
| 497 | bool VKDevice::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) const { | 497 | bool Device::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) const { |
| 498 | // Disable for now to avoid converting ASTC twice. | 498 | // Disable for now to avoid converting ASTC twice. |
| 499 | static constexpr std::array astc_formats = { | 499 | static constexpr std::array astc_formats = { |
| 500 | VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, | 500 | VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, |
| @@ -528,7 +528,7 @@ bool VKDevice::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) | |||
| 528 | return true; | 528 | return true; |
| 529 | } | 529 | } |
| 530 | 530 | ||
| 531 | bool VKDevice::TestDepthStencilBlits() const { | 531 | bool Device::TestDepthStencilBlits() const { |
| 532 | static constexpr VkFormatFeatureFlags required_features = | 532 | static constexpr VkFormatFeatureFlags required_features = |
| 533 | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT; | 533 | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT; |
| 534 | const auto test_features = [](VkFormatProperties props) { | 534 | const auto test_features = [](VkFormatProperties props) { |
| @@ -538,8 +538,8 @@ bool VKDevice::TestDepthStencilBlits() const { | |||
| 538 | test_features(format_properties.at(VK_FORMAT_D24_UNORM_S8_UINT)); | 538 | test_features(format_properties.at(VK_FORMAT_D24_UNORM_S8_UINT)); |
| 539 | } | 539 | } |
| 540 | 540 | ||
| 541 | bool VKDevice::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, | 541 | bool Device::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, |
| 542 | FormatType format_type) const { | 542 | FormatType format_type) const { |
| 543 | const auto it = format_properties.find(wanted_format); | 543 | const auto it = format_properties.find(wanted_format); |
| 544 | if (it == format_properties.end()) { | 544 | if (it == format_properties.end()) { |
| 545 | UNIMPLEMENTED_MSG("Unimplemented format query={}", wanted_format); | 545 | UNIMPLEMENTED_MSG("Unimplemented format query={}", wanted_format); |
| @@ -549,7 +549,7 @@ bool VKDevice::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wa | |||
| 549 | return (supported_usage & wanted_usage) == wanted_usage; | 549 | return (supported_usage & wanted_usage) == wanted_usage; |
| 550 | } | 550 | } |
| 551 | 551 | ||
| 552 | void VKDevice::CheckSuitability() const { | 552 | void Device::CheckSuitability() const { |
| 553 | std::bitset<REQUIRED_EXTENSIONS.size()> available_extensions; | 553 | std::bitset<REQUIRED_EXTENSIONS.size()> available_extensions; |
| 554 | for (const VkExtensionProperties& property : physical.EnumerateDeviceExtensionProperties()) { | 554 | for (const VkExtensionProperties& property : physical.EnumerateDeviceExtensionProperties()) { |
| 555 | for (std::size_t i = 0; i < REQUIRED_EXTENSIONS.size(); ++i) { | 555 | for (std::size_t i = 0; i < REQUIRED_EXTENSIONS.size(); ++i) { |
| @@ -614,7 +614,7 @@ void VKDevice::CheckSuitability() const { | |||
| 614 | } | 614 | } |
| 615 | } | 615 | } |
| 616 | 616 | ||
| 617 | std::vector<const char*> VKDevice::LoadExtensions() { | 617 | std::vector<const char*> Device::LoadExtensions() { |
| 618 | std::vector<const char*> extensions; | 618 | std::vector<const char*> extensions; |
| 619 | extensions.reserve(7 + REQUIRED_EXTENSIONS.size()); | 619 | extensions.reserve(7 + REQUIRED_EXTENSIONS.size()); |
| 620 | extensions.insert(extensions.begin(), REQUIRED_EXTENSIONS.begin(), REQUIRED_EXTENSIONS.end()); | 620 | extensions.insert(extensions.begin(), REQUIRED_EXTENSIONS.begin(), REQUIRED_EXTENSIONS.end()); |
| @@ -767,7 +767,7 @@ std::vector<const char*> VKDevice::LoadExtensions() { | |||
| 767 | return extensions; | 767 | return extensions; |
| 768 | } | 768 | } |
| 769 | 769 | ||
| 770 | void VKDevice::SetupFamilies(VkSurfaceKHR surface) { | 770 | void Device::SetupFamilies(VkSurfaceKHR surface) { |
| 771 | const std::vector queue_family_properties = physical.GetQueueFamilyProperties(); | 771 | const std::vector queue_family_properties = physical.GetQueueFamilyProperties(); |
| 772 | std::optional<u32> graphics; | 772 | std::optional<u32> graphics; |
| 773 | std::optional<u32> present; | 773 | std::optional<u32> present; |
| @@ -798,14 +798,14 @@ void VKDevice::SetupFamilies(VkSurfaceKHR surface) { | |||
| 798 | present_family = *present; | 798 | present_family = *present; |
| 799 | } | 799 | } |
| 800 | 800 | ||
| 801 | void VKDevice::SetupFeatures() { | 801 | void Device::SetupFeatures() { |
| 802 | const auto supported_features{physical.GetFeatures()}; | 802 | const auto supported_features{physical.GetFeatures()}; |
| 803 | is_formatless_image_load_supported = supported_features.shaderStorageImageReadWithoutFormat; | 803 | is_formatless_image_load_supported = supported_features.shaderStorageImageReadWithoutFormat; |
| 804 | is_blit_depth_stencil_supported = TestDepthStencilBlits(); | 804 | is_blit_depth_stencil_supported = TestDepthStencilBlits(); |
| 805 | is_optimal_astc_supported = IsOptimalAstcSupported(supported_features); | 805 | is_optimal_astc_supported = IsOptimalAstcSupported(supported_features); |
| 806 | } | 806 | } |
| 807 | 807 | ||
| 808 | void VKDevice::CollectTelemetryParameters() { | 808 | void Device::CollectTelemetryParameters() { |
| 809 | VkPhysicalDeviceDriverPropertiesKHR driver{ | 809 | VkPhysicalDeviceDriverPropertiesKHR driver{ |
| 810 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR, | 810 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR, |
| 811 | .pNext = nullptr, | 811 | .pNext = nullptr, |
| @@ -832,7 +832,7 @@ void VKDevice::CollectTelemetryParameters() { | |||
| 832 | } | 832 | } |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | void VKDevice::CollectToolingInfo() { | 835 | void Device::CollectToolingInfo() { |
| 836 | if (!ext_tooling_info) { | 836 | if (!ext_tooling_info) { |
| 837 | return; | 837 | return; |
| 838 | } | 838 | } |
| @@ -858,7 +858,7 @@ void VKDevice::CollectToolingInfo() { | |||
| 858 | } | 858 | } |
| 859 | } | 859 | } |
| 860 | 860 | ||
| 861 | std::vector<VkDeviceQueueCreateInfo> VKDevice::GetDeviceQueueCreateInfos() const { | 861 | std::vector<VkDeviceQueueCreateInfo> Device::GetDeviceQueueCreateInfos() const { |
| 862 | static constexpr float QUEUE_PRIORITY = 1.0f; | 862 | static constexpr float QUEUE_PRIORITY = 1.0f; |
| 863 | 863 | ||
| 864 | std::unordered_set<u32> unique_queue_families{graphics_family, present_family}; | 864 | std::unordered_set<u32> unique_queue_families{graphics_family, present_family}; |
diff --git a/src/video_core/renderer_vulkan/vk_device.h b/src/video_core/renderer_vulkan/vk_device.h index 146acbe24..b2651e049 100644 --- a/src/video_core/renderer_vulkan/vk_device.h +++ b/src/video_core/renderer_vulkan/vk_device.h | |||
| @@ -22,11 +22,11 @@ enum class FormatType { Linear, Optimal, Buffer }; | |||
| 22 | const u32 GuestWarpSize = 32; | 22 | const u32 GuestWarpSize = 32; |
| 23 | 23 | ||
| 24 | /// Handles data specific to a physical device. | 24 | /// Handles data specific to a physical device. |
| 25 | class VKDevice final { | 25 | class Device final { |
| 26 | public: | 26 | public: |
| 27 | explicit VKDevice(VkInstance instance, vk::PhysicalDevice physical, VkSurfaceKHR surface, | 27 | explicit Device(VkInstance instance, vk::PhysicalDevice physical, VkSurfaceKHR surface, |
| 28 | const vk::InstanceDispatch& dld); | 28 | const vk::InstanceDispatch& dld); |
| 29 | ~VKDevice(); | 29 | ~Device(); |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * Returns a format supported by the device for the passed requeriments. | 32 | * Returns a format supported by the device for the passed requeriments. |
diff --git a/src/video_core/renderer_vulkan/vk_fence_manager.cpp b/src/video_core/renderer_vulkan/vk_fence_manager.cpp index cd044c187..3ec1769ed 100644 --- a/src/video_core/renderer_vulkan/vk_fence_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_fence_manager.cpp | |||
| @@ -14,11 +14,11 @@ | |||
| 14 | 14 | ||
| 15 | namespace Vulkan { | 15 | namespace Vulkan { |
| 16 | 16 | ||
| 17 | InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, u32 payload_, | 17 | InnerFence::InnerFence(const Device& device_, VKScheduler& scheduler_, u32 payload_, |
| 18 | bool is_stubbed_) | 18 | bool is_stubbed_) |
| 19 | : FenceBase{payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} | 19 | : FenceBase{payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} |
| 20 | 20 | ||
| 21 | InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, GPUVAddr address_, | 21 | InnerFence::InnerFence(const Device& device_, VKScheduler& scheduler_, GPUVAddr address_, |
| 22 | u32 payload_, bool is_stubbed_) | 22 | u32 payload_, bool is_stubbed_) |
| 23 | : FenceBase{address_, payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} | 23 | : FenceBase{address_, payload_, is_stubbed_}, device{device_}, scheduler{scheduler_} {} |
| 24 | 24 | ||
| @@ -75,7 +75,7 @@ bool InnerFence::IsEventSignalled() const { | |||
| 75 | VKFenceManager::VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, | 75 | VKFenceManager::VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, |
| 76 | Tegra::MemoryManager& memory_manager_, TextureCache& texture_cache_, | 76 | Tegra::MemoryManager& memory_manager_, TextureCache& texture_cache_, |
| 77 | VKBufferCache& buffer_cache_, VKQueryCache& query_cache_, | 77 | VKBufferCache& buffer_cache_, VKQueryCache& query_cache_, |
| 78 | const VKDevice& device_, VKScheduler& scheduler_) | 78 | const Device& device_, VKScheduler& scheduler_) |
| 79 | : GenericFenceManager{rasterizer_, gpu_, texture_cache_, buffer_cache_, query_cache_}, | 79 | : GenericFenceManager{rasterizer_, gpu_, texture_cache_, buffer_cache_, query_cache_}, |
| 80 | device{device_}, scheduler{scheduler_} {} | 80 | device{device_}, scheduler{scheduler_} {} |
| 81 | 81 | ||
diff --git a/src/video_core/renderer_vulkan/vk_fence_manager.h b/src/video_core/renderer_vulkan/vk_fence_manager.h index 272ae6d29..6b51e4587 100644 --- a/src/video_core/renderer_vulkan/vk_fence_manager.h +++ b/src/video_core/renderer_vulkan/vk_fence_manager.h | |||
| @@ -21,16 +21,16 @@ class RasterizerInterface; | |||
| 21 | 21 | ||
| 22 | namespace Vulkan { | 22 | namespace Vulkan { |
| 23 | 23 | ||
| 24 | class Device; | ||
| 24 | class VKBufferCache; | 25 | class VKBufferCache; |
| 25 | class VKDevice; | ||
| 26 | class VKQueryCache; | 26 | class VKQueryCache; |
| 27 | class VKScheduler; | 27 | class VKScheduler; |
| 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 Device& 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 Device& device_, VKScheduler& scheduler_, GPUVAddr address_, |
| 34 | u32 payload_, bool is_stubbed_); | 34 | u32 payload_, bool is_stubbed_); |
| 35 | ~InnerFence(); | 35 | ~InnerFence(); |
| 36 | 36 | ||
| @@ -43,7 +43,7 @@ public: | |||
| 43 | private: | 43 | private: |
| 44 | bool IsEventSignalled() const; | 44 | bool IsEventSignalled() const; |
| 45 | 45 | ||
| 46 | const VKDevice& device; | 46 | const Device& device; |
| 47 | VKScheduler& scheduler; | 47 | VKScheduler& scheduler; |
| 48 | vk::Event event; | 48 | vk::Event event; |
| 49 | u64 ticks = 0; | 49 | u64 ticks = 0; |
| @@ -58,7 +58,7 @@ public: | |||
| 58 | explicit VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, | 58 | explicit VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, |
| 59 | Tegra::MemoryManager& memory_manager_, TextureCache& texture_cache_, | 59 | Tegra::MemoryManager& memory_manager_, TextureCache& texture_cache_, |
| 60 | VKBufferCache& buffer_cache_, VKQueryCache& query_cache_, | 60 | VKBufferCache& buffer_cache_, VKQueryCache& query_cache_, |
| 61 | const VKDevice& device_, VKScheduler& scheduler_); | 61 | const Device& 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; |
| @@ -68,7 +68,7 @@ protected: | |||
| 68 | void WaitFence(Fence& fence) override; | 68 | void WaitFence(Fence& fence) override; |
| 69 | 69 | ||
| 70 | private: | 70 | private: |
| 71 | const VKDevice& device; | 71 | const Device& device; |
| 72 | VKScheduler& scheduler; | 72 | VKScheduler& scheduler; |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index d9c1ed553..360ab86eb 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -94,7 +94,7 @@ VkSampleCountFlagBits ConvertMsaaMode(Tegra::Texture::MsaaMode msaa_mode) { | |||
| 94 | 94 | ||
| 95 | } // Anonymous namespace | 95 | } // Anonymous namespace |
| 96 | 96 | ||
| 97 | VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device_, VKScheduler& scheduler_, | 97 | VKGraphicsPipeline::VKGraphicsPipeline(const Device& device_, VKScheduler& scheduler_, |
| 98 | VKDescriptorPool& descriptor_pool_, | 98 | VKDescriptorPool& descriptor_pool_, |
| 99 | VKUpdateDescriptorQueue& update_descriptor_queue_, | 99 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 100 | const GraphicsPipelineCacheKey& key, | 100 | const GraphicsPipelineCacheKey& key, |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 3bc93bc2a..8b6a98fe0 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -40,8 +40,8 @@ static_assert(std::has_unique_object_representations_v<GraphicsPipelineCacheKey> | |||
| 40 | static_assert(std::is_trivially_copyable_v<GraphicsPipelineCacheKey>); | 40 | static_assert(std::is_trivially_copyable_v<GraphicsPipelineCacheKey>); |
| 41 | static_assert(std::is_trivially_constructible_v<GraphicsPipelineCacheKey>); | 41 | static_assert(std::is_trivially_constructible_v<GraphicsPipelineCacheKey>); |
| 42 | 42 | ||
| 43 | class Device; | ||
| 43 | class VKDescriptorPool; | 44 | class VKDescriptorPool; |
| 44 | class VKDevice; | ||
| 45 | class VKScheduler; | 45 | class VKScheduler; |
| 46 | class VKUpdateDescriptorQueue; | 46 | class VKUpdateDescriptorQueue; |
| 47 | 47 | ||
| @@ -49,7 +49,7 @@ using SPIRVProgram = std::array<std::optional<SPIRVShader>, Maxwell::MaxShaderSt | |||
| 49 | 49 | ||
| 50 | class VKGraphicsPipeline final { | 50 | class VKGraphicsPipeline final { |
| 51 | public: | 51 | public: |
| 52 | explicit VKGraphicsPipeline(const VKDevice& device_, VKScheduler& scheduler_, | 52 | explicit VKGraphicsPipeline(const Device& device_, VKScheduler& scheduler_, |
| 53 | VKDescriptorPool& descriptor_pool, | 53 | VKDescriptorPool& descriptor_pool, |
| 54 | VKUpdateDescriptorQueue& update_descriptor_queue_, | 54 | VKUpdateDescriptorQueue& update_descriptor_queue_, |
| 55 | const GraphicsPipelineCacheKey& key, | 55 | const GraphicsPipelineCacheKey& key, |
| @@ -85,7 +85,7 @@ private: | |||
| 85 | vk::Pipeline CreatePipeline(const SPIRVProgram& program, VkRenderPass renderpass, | 85 | vk::Pipeline CreatePipeline(const SPIRVProgram& program, VkRenderPass renderpass, |
| 86 | u32 num_color_buffers) const; | 86 | u32 num_color_buffers) const; |
| 87 | 87 | ||
| 88 | const VKDevice& device; | 88 | const Device& device; |
| 89 | VKScheduler& scheduler; | 89 | VKScheduler& scheduler; |
| 90 | const GraphicsPipelineCacheKey cache_key; | 90 | const GraphicsPipelineCacheKey cache_key; |
| 91 | const u64 hash; | 91 | const u64 hash; |
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index ed6ea0805..16e764cb8 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp | |||
| @@ -14,7 +14,7 @@ namespace Vulkan { | |||
| 14 | 14 | ||
| 15 | using namespace std::chrono_literals; | 15 | using namespace std::chrono_literals; |
| 16 | 16 | ||
| 17 | MasterSemaphore::MasterSemaphore(const VKDevice& device) { | 17 | MasterSemaphore::MasterSemaphore(const Device& device) { |
| 18 | static constexpr VkSemaphoreTypeCreateInfoKHR semaphore_type_ci{ | 18 | static constexpr VkSemaphoreTypeCreateInfoKHR semaphore_type_ci{ |
| 19 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR, | 19 | .sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR, |
| 20 | .pNext = nullptr, | 20 | .pNext = nullptr, |
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 747d2f3bc..f336f1862 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h | |||
| @@ -12,11 +12,11 @@ | |||
| 12 | 12 | ||
| 13 | namespace Vulkan { | 13 | namespace Vulkan { |
| 14 | 14 | ||
| 15 | class VKDevice; | 15 | class Device; |
| 16 | 16 | ||
| 17 | class MasterSemaphore { | 17 | class MasterSemaphore { |
| 18 | public: | 18 | public: |
| 19 | explicit MasterSemaphore(const VKDevice& device); | 19 | explicit MasterSemaphore(const Device& device); |
| 20 | ~MasterSemaphore(); | 20 | ~MasterSemaphore(); |
| 21 | 21 | ||
| 22 | /// Returns the current logical tick. | 22 | /// Returns the current logical tick. |
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.cpp b/src/video_core/renderer_vulkan/vk_memory_manager.cpp index 35f859f77..875bc65db 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_memory_manager.cpp | |||
| @@ -29,7 +29,7 @@ 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 Device& 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_)} {} |
| @@ -104,7 +104,7 @@ private: | |||
| 104 | return std::nullopt; | 104 | return std::nullopt; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | const VKDevice& device; ///< Vulkan device. | 107 | const Device& device; ///< Vulkan device. |
| 108 | const vk::DeviceMemory memory; ///< Vulkan memory allocation handler. | 108 | const vk::DeviceMemory memory; ///< Vulkan memory allocation handler. |
| 109 | const VkMemoryPropertyFlags properties; ///< Vulkan properties. | 109 | const VkMemoryPropertyFlags properties; ///< Vulkan properties. |
| 110 | const u64 allocation_size; ///< Size of this allocation. | 110 | const u64 allocation_size; ///< Size of this allocation. |
| @@ -117,7 +117,7 @@ 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 Device& 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; |
| @@ -207,7 +207,7 @@ 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 Device& 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 | ||
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.h b/src/video_core/renderer_vulkan/vk_memory_manager.h index 20463ecad..2452bca4e 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.h +++ b/src/video_core/renderer_vulkan/vk_memory_manager.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | namespace Vulkan { | 14 | namespace Vulkan { |
| 15 | 15 | ||
| 16 | class Device; | ||
| 16 | class MemoryMap; | 17 | class MemoryMap; |
| 17 | class VKDevice; | ||
| 18 | class VKMemoryAllocation; | 18 | class VKMemoryAllocation; |
| 19 | class VKMemoryCommitImpl; | 19 | class VKMemoryCommitImpl; |
| 20 | 20 | ||
| @@ -22,7 +22,7 @@ using VKMemoryCommit = std::unique_ptr<VKMemoryCommitImpl>; | |||
| 22 | 22 | ||
| 23 | class VKMemoryManager final { | 23 | class VKMemoryManager final { |
| 24 | public: | 24 | public: |
| 25 | explicit VKMemoryManager(const VKDevice& device_); | 25 | explicit VKMemoryManager(const Device& device_); |
| 26 | VKMemoryManager(const VKMemoryManager&) = delete; | 26 | VKMemoryManager(const VKMemoryManager&) = delete; |
| 27 | ~VKMemoryManager(); | 27 | ~VKMemoryManager(); |
| 28 | 28 | ||
| @@ -49,7 +49,7 @@ private: | |||
| 49 | VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements, | 49 | VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements, |
| 50 | VkMemoryPropertyFlags wanted_properties); | 50 | VkMemoryPropertyFlags wanted_properties); |
| 51 | 51 | ||
| 52 | const VKDevice& device; ///< Device handler. | 52 | const Device& device; ///< Device handler. |
| 53 | const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties. | 53 | const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties. |
| 54 | std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations. | 54 | std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations. |
| 55 | }; | 55 | }; |
| @@ -59,7 +59,7 @@ class VKMemoryCommitImpl final { | |||
| 59 | friend MemoryMap; | 59 | friend MemoryMap; |
| 60 | 60 | ||
| 61 | public: | 61 | public: |
| 62 | explicit VKMemoryCommitImpl(const VKDevice& device_, VKMemoryAllocation* allocation_, | 62 | explicit VKMemoryCommitImpl(const Device& device_, VKMemoryAllocation* allocation_, |
| 63 | const vk::DeviceMemory& memory_, u64 begin_, u64 end_); | 63 | const vk::DeviceMemory& memory_, u64 begin_, u64 end_); |
| 64 | ~VKMemoryCommitImpl(); | 64 | ~VKMemoryCommitImpl(); |
| 65 | 65 | ||
| @@ -85,7 +85,7 @@ private: | |||
| 85 | /// Unmaps memory. | 85 | /// Unmaps memory. |
| 86 | void Unmap() const; | 86 | void Unmap() const; |
| 87 | 87 | ||
| 88 | const VKDevice& device; ///< Vulkan device. | 88 | const Device& device; ///< Vulkan device. |
| 89 | const vk::DeviceMemory& memory; ///< Vulkan device memory handler. | 89 | const vk::DeviceMemory& memory; ///< Vulkan device memory handler. |
| 90 | std::pair<u64, u64> interval{}; ///< Interval where the commit exists. | 90 | std::pair<u64, u64> interval{}; ///< Interval where the commit exists. |
| 91 | VKMemoryAllocation* allocation{}; ///< Pointer to the large memory allocation. | 91 | VKMemoryAllocation* allocation{}; ///< Pointer to the large memory allocation. |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index b44fd6159..e3e0ecf15 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -149,7 +149,7 @@ Shader::~Shader() = default; | |||
| 149 | VKPipelineCache::VKPipelineCache(RasterizerVulkan& rasterizer_, Tegra::GPU& gpu_, | 149 | VKPipelineCache::VKPipelineCache(RasterizerVulkan& rasterizer_, Tegra::GPU& gpu_, |
| 150 | Tegra::Engines::Maxwell3D& maxwell3d_, | 150 | Tegra::Engines::Maxwell3D& maxwell3d_, |
| 151 | Tegra::Engines::KeplerCompute& kepler_compute_, | 151 | Tegra::Engines::KeplerCompute& kepler_compute_, |
| 152 | Tegra::MemoryManager& gpu_memory_, const VKDevice& device_, | 152 | Tegra::MemoryManager& gpu_memory_, const Device& device_, |
| 153 | VKScheduler& scheduler_, VKDescriptorPool& descriptor_pool_, | 153 | VKScheduler& scheduler_, VKDescriptorPool& descriptor_pool_, |
| 154 | VKUpdateDescriptorQueue& update_descriptor_queue_) | 154 | VKUpdateDescriptorQueue& update_descriptor_queue_) |
| 155 | : VideoCommon::ShaderCache<Shader>{rasterizer_}, gpu{gpu_}, maxwell3d{maxwell3d_}, | 155 | : VideoCommon::ShaderCache<Shader>{rasterizer_}, gpu{gpu_}, maxwell3d{maxwell3d_}, |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 5ce1b17f3..89d635a3d 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h | |||
| @@ -33,10 +33,10 @@ class System; | |||
| 33 | 33 | ||
| 34 | namespace Vulkan { | 34 | namespace Vulkan { |
| 35 | 35 | ||
| 36 | class Device; | ||
| 36 | class RasterizerVulkan; | 37 | class RasterizerVulkan; |
| 37 | class VKComputePipeline; | 38 | class VKComputePipeline; |
| 38 | class VKDescriptorPool; | 39 | class VKDescriptorPool; |
| 39 | class VKDevice; | ||
| 40 | class VKScheduler; | 40 | class VKScheduler; |
| 41 | class VKUpdateDescriptorQueue; | 41 | class VKUpdateDescriptorQueue; |
| 42 | 42 | ||
| @@ -121,7 +121,7 @@ public: | |||
| 121 | explicit VKPipelineCache(RasterizerVulkan& rasterizer, Tegra::GPU& gpu, | 121 | explicit VKPipelineCache(RasterizerVulkan& rasterizer, Tegra::GPU& gpu, |
| 122 | Tegra::Engines::Maxwell3D& maxwell3d, | 122 | Tegra::Engines::Maxwell3D& maxwell3d, |
| 123 | Tegra::Engines::KeplerCompute& kepler_compute, | 123 | Tegra::Engines::KeplerCompute& kepler_compute, |
| 124 | Tegra::MemoryManager& gpu_memory, const VKDevice& device, | 124 | Tegra::MemoryManager& gpu_memory, const Device& device, |
| 125 | VKScheduler& scheduler, VKDescriptorPool& descriptor_pool, | 125 | VKScheduler& scheduler, VKDescriptorPool& descriptor_pool, |
| 126 | VKUpdateDescriptorQueue& update_descriptor_queue); | 126 | VKUpdateDescriptorQueue& update_descriptor_queue); |
| 127 | ~VKPipelineCache() override; | 127 | ~VKPipelineCache() override; |
| @@ -148,7 +148,7 @@ private: | |||
| 148 | Tegra::Engines::KeplerCompute& kepler_compute; | 148 | Tegra::Engines::KeplerCompute& kepler_compute; |
| 149 | Tegra::MemoryManager& gpu_memory; | 149 | Tegra::MemoryManager& gpu_memory; |
| 150 | 150 | ||
| 151 | const VKDevice& device; | 151 | const Device& device; |
| 152 | VKScheduler& scheduler; | 152 | VKScheduler& scheduler; |
| 153 | VKDescriptorPool& descriptor_pool; | 153 | VKDescriptorPool& descriptor_pool; |
| 154 | VKUpdateDescriptorQueue& update_descriptor_queue; | 154 | VKUpdateDescriptorQueue& update_descriptor_queue; |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 7852178b6..1288d58ec 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -27,7 +27,7 @@ constexpr VkQueryType GetTarget(QueryType type) { | |||
| 27 | 27 | ||
| 28 | } // Anonymous namespace | 28 | } // Anonymous namespace |
| 29 | 29 | ||
| 30 | QueryPool::QueryPool(const VKDevice& device_, VKScheduler& scheduler, QueryType type_) | 30 | QueryPool::QueryPool(const Device& device_, VKScheduler& scheduler, QueryType type_) |
| 31 | : ResourcePool{scheduler.GetMasterSemaphore(), GROW_STEP}, device{device_}, type{type_} {} | 31 | : ResourcePool{scheduler.GetMasterSemaphore(), GROW_STEP}, device{device_}, type{type_} {} |
| 32 | 32 | ||
| 33 | QueryPool::~QueryPool() = default; | 33 | QueryPool::~QueryPool() = default; |
| @@ -68,7 +68,7 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) { | |||
| 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 Device& device_, VKScheduler& scheduler_) |
| 72 | : QueryCacheBase{rasterizer_, maxwell3d_, gpu_memory_}, device{device_}, scheduler{scheduler_}, | 72 | : QueryCacheBase{rasterizer_, maxwell3d_, gpu_memory_}, device{device_}, scheduler{scheduler_}, |
| 73 | query_pools{ | 73 | query_pools{ |
| 74 | QueryPool{device_, scheduler_, QueryType::SamplesPassed}, | 74 | QueryPool{device_, scheduler_, QueryType::SamplesPassed}, |
| @@ -96,9 +96,9 @@ void VKQueryCache::Reserve(QueryType type, std::pair<VkQueryPool, u32> query) { | |||
| 96 | HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, | 96 | HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, |
| 97 | QueryType type_) | 97 | QueryType type_) |
| 98 | : HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_}, | 98 | : HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_}, |
| 99 | query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} { | 99 | query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} { |
| 100 | const vk::Device* logical = &cache_.Device().GetLogical(); | 100 | const vk::Device* logical = &cache.GetDevice().GetLogical(); |
| 101 | cache_.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { | 101 | cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { |
| 102 | logical->ResetQueryPoolEXT(query.first, query.second, 1); | 102 | logical->ResetQueryPoolEXT(query.first, query.second, 1); |
| 103 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); | 103 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); |
| 104 | }); | 104 | }); |
| @@ -109,17 +109,17 @@ HostCounter::~HostCounter() { | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | void HostCounter::EndQuery() { | 111 | void HostCounter::EndQuery() { |
| 112 | cache.Scheduler().Record( | 112 | cache.GetScheduler().Record( |
| 113 | [query = query](vk::CommandBuffer cmdbuf) { cmdbuf.EndQuery(query.first, query.second); }); | 113 | [query = query](vk::CommandBuffer cmdbuf) { cmdbuf.EndQuery(query.first, query.second); }); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | u64 HostCounter::BlockingQuery() const { | 116 | u64 HostCounter::BlockingQuery() const { |
| 117 | if (tick >= cache.Scheduler().CurrentTick()) { | 117 | if (tick >= cache.GetScheduler().CurrentTick()) { |
| 118 | cache.Scheduler().Flush(); | 118 | cache.GetScheduler().Flush(); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | u64 data; | 121 | u64 data; |
| 122 | const VkResult query_result = cache.Device().GetLogical().GetQueryResults( | 122 | const VkResult query_result = cache.GetDevice().GetLogical().GetQueryResults( |
| 123 | query.first, query.second, 1, sizeof(data), &data, sizeof(data), | 123 | query.first, query.second, 1, sizeof(data), &data, sizeof(data), |
| 124 | VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); | 124 | VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); |
| 125 | 125 | ||
| @@ -127,7 +127,7 @@ u64 HostCounter::BlockingQuery() const { | |||
| 127 | case VK_SUCCESS: | 127 | case VK_SUCCESS: |
| 128 | return data; | 128 | return data; |
| 129 | case VK_ERROR_DEVICE_LOST: | 129 | case VK_ERROR_DEVICE_LOST: |
| 130 | cache.Device().ReportLoss(); | 130 | cache.GetDevice().ReportLoss(); |
| 131 | [[fallthrough]]; | 131 | [[fallthrough]]; |
| 132 | default: | 132 | default: |
| 133 | throw vk::Exception(query_result); | 133 | throw vk::Exception(query_result); |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.h b/src/video_core/renderer_vulkan/vk_query_cache.h index b4fb6b3b0..7190946b9 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.h +++ b/src/video_core/renderer_vulkan/vk_query_cache.h | |||
| @@ -21,8 +21,8 @@ class RasterizerInterface; | |||
| 21 | namespace Vulkan { | 21 | namespace Vulkan { |
| 22 | 22 | ||
| 23 | class CachedQuery; | 23 | class CachedQuery; |
| 24 | class Device; | ||
| 24 | class HostCounter; | 25 | class HostCounter; |
| 25 | class VKDevice; | ||
| 26 | class VKQueryCache; | 26 | class VKQueryCache; |
| 27 | class VKScheduler; | 27 | class VKScheduler; |
| 28 | 28 | ||
| @@ -30,7 +30,7 @@ using CounterStream = VideoCommon::CounterStreamBase<VKQueryCache, HostCounter>; | |||
| 30 | 30 | ||
| 31 | class QueryPool final : public ResourcePool { | 31 | class QueryPool final : public ResourcePool { |
| 32 | public: | 32 | public: |
| 33 | explicit QueryPool(const VKDevice& device, VKScheduler& scheduler, VideoCore::QueryType type); | 33 | explicit QueryPool(const Device& device, VKScheduler& scheduler, VideoCore::QueryType type); |
| 34 | ~QueryPool() override; | 34 | ~QueryPool() override; |
| 35 | 35 | ||
| 36 | std::pair<VkQueryPool, u32> Commit(); | 36 | std::pair<VkQueryPool, u32> Commit(); |
| @@ -43,7 +43,7 @@ protected: | |||
| 43 | private: | 43 | private: |
| 44 | static constexpr std::size_t GROW_STEP = 512; | 44 | static constexpr std::size_t GROW_STEP = 512; |
| 45 | 45 | ||
| 46 | const VKDevice& device; | 46 | const Device& device; |
| 47 | const VideoCore::QueryType type; | 47 | const VideoCore::QueryType type; |
| 48 | 48 | ||
| 49 | std::vector<vk::QueryPool> pools; | 49 | std::vector<vk::QueryPool> pools; |
| @@ -55,23 +55,23 @@ class VKQueryCache final | |||
| 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 Device& 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); |
| 62 | 62 | ||
| 63 | void Reserve(VideoCore::QueryType type, std::pair<VkQueryPool, u32> query); | 63 | void Reserve(VideoCore::QueryType type, std::pair<VkQueryPool, u32> query); |
| 64 | 64 | ||
| 65 | const VKDevice& Device() const noexcept { | 65 | const Device& GetDevice() const noexcept { |
| 66 | return device; | 66 | return device; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | VKScheduler& Scheduler() const noexcept { | 69 | VKScheduler& GetScheduler() const noexcept { |
| 70 | return scheduler; | 70 | return scheduler; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | private: | 73 | private: |
| 74 | const VKDevice& device; | 74 | const Device& device; |
| 75 | VKScheduler& scheduler; | 75 | VKScheduler& scheduler; |
| 76 | std::array<QueryPool, VideoCore::NumQueryTypes> query_pools; | 76 | std::array<QueryPool, VideoCore::NumQueryTypes> query_pools; |
| 77 | }; | 77 | }; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 1c174e7ec..85bd9c1c0 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -62,7 +62,7 @@ namespace { | |||
| 62 | 62 | ||
| 63 | constexpr auto COMPUTE_SHADER_INDEX = static_cast<size_t>(Tegra::Engines::ShaderType::Compute); | 63 | constexpr auto COMPUTE_SHADER_INDEX = static_cast<size_t>(Tegra::Engines::ShaderType::Compute); |
| 64 | 64 | ||
| 65 | VkViewport GetViewportState(const VKDevice& device, const Maxwell& regs, size_t index) { | 65 | VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index) { |
| 66 | const auto& src = regs.viewport_transform[index]; | 66 | const auto& src = regs.viewport_transform[index]; |
| 67 | const float width = src.scale_x * 2.0f; | 67 | const float width = src.scale_x * 2.0f; |
| 68 | const float height = src.scale_y * 2.0f; | 68 | const float height = src.scale_y * 2.0f; |
| @@ -239,7 +239,7 @@ public: | |||
| 239 | index.type = type; | 239 | index.type = type; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | void Bind(const VKDevice& device, VKScheduler& scheduler) const { | 242 | void Bind(const Device& device, VKScheduler& scheduler) const { |
| 243 | // Use this large switch case to avoid dispatching more memory in the record lambda than | 243 | // Use this large switch case to avoid dispatching more memory in the record lambda than |
| 244 | // what we need. It looks horrible, but it's the best we can do on standard C++. | 244 | // what we need. It looks horrible, but it's the best we can do on standard C++. |
| 245 | switch (vertex.num_buffers) { | 245 | switch (vertex.num_buffers) { |
| @@ -330,7 +330,7 @@ private: | |||
| 330 | } index; | 330 | } index; |
| 331 | 331 | ||
| 332 | template <size_t N> | 332 | template <size_t N> |
| 333 | void BindStatic(const VKDevice& device, VKScheduler& scheduler) const { | 333 | void BindStatic(const Device& device, VKScheduler& scheduler) const { |
| 334 | if (device.IsExtExtendedDynamicStateSupported()) { | 334 | if (device.IsExtExtendedDynamicStateSupported()) { |
| 335 | if (index.buffer) { | 335 | if (index.buffer) { |
| 336 | BindStatic<N, true, true>(scheduler); | 336 | BindStatic<N, true, true>(scheduler); |
| @@ -409,7 +409,7 @@ void RasterizerVulkan::DrawParameters::Draw(vk::CommandBuffer cmdbuf) const { | |||
| 409 | RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, | 409 | RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, |
| 410 | Tegra::MemoryManager& gpu_memory_, | 410 | Tegra::MemoryManager& gpu_memory_, |
| 411 | Core::Memory::Memory& cpu_memory_, VKScreenInfo& screen_info_, | 411 | Core::Memory::Memory& cpu_memory_, VKScreenInfo& screen_info_, |
| 412 | const VKDevice& device_, VKMemoryManager& memory_manager_, | 412 | const Device& device_, VKMemoryManager& memory_manager_, |
| 413 | StateTracker& state_tracker_, VKScheduler& scheduler_) | 413 | StateTracker& state_tracker_, VKScheduler& scheduler_) |
| 414 | : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, | 414 | : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, |
| 415 | gpu_memory{gpu_memory_}, maxwell3d{gpu.Maxwell3D()}, kepler_compute{gpu.KeplerCompute()}, | 415 | gpu_memory{gpu_memory_}, maxwell3d{gpu.Maxwell3D()}, kepler_compute{gpu.KeplerCompute()}, |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 7b9ec3bb8..4695718e9 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -55,7 +55,7 @@ class RasterizerVulkan final : public VideoCore::RasterizerAccelerated { | |||
| 55 | public: | 55 | public: |
| 56 | explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, | 56 | explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, |
| 57 | Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_, | 57 | Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_, |
| 58 | VKScreenInfo& screen_info_, const VKDevice& device_, | 58 | VKScreenInfo& screen_info_, const Device& device_, |
| 59 | VKMemoryManager& memory_manager_, StateTracker& state_tracker_, | 59 | VKMemoryManager& memory_manager_, StateTracker& state_tracker_, |
| 60 | VKScheduler& scheduler_); | 60 | VKScheduler& scheduler_); |
| 61 | ~RasterizerVulkan() override; | 61 | ~RasterizerVulkan() override; |
| @@ -212,7 +212,7 @@ private: | |||
| 212 | Tegra::Engines::KeplerCompute& kepler_compute; | 212 | Tegra::Engines::KeplerCompute& kepler_compute; |
| 213 | 213 | ||
| 214 | VKScreenInfo& screen_info; | 214 | VKScreenInfo& screen_info; |
| 215 | const VKDevice& device; | 215 | const Device& device; |
| 216 | VKMemoryManager& memory_manager; | 216 | VKMemoryManager& memory_manager; |
| 217 | StateTracker& state_tracker; | 217 | StateTracker& state_tracker; |
| 218 | VKScheduler& scheduler; | 218 | VKScheduler& scheduler; |
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index f7b79e74c..86ac1100f 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp | |||
| @@ -37,7 +37,7 @@ void VKScheduler::CommandChunk::ExecuteAll(vk::CommandBuffer cmdbuf) { | |||
| 37 | last = nullptr; | 37 | last = nullptr; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | VKScheduler::VKScheduler(const VKDevice& device_, StateTracker& state_tracker_) | 40 | VKScheduler::VKScheduler(const Device& device_, StateTracker& state_tracker_) |
| 41 | : device{device_}, state_tracker{state_tracker_}, | 41 | : device{device_}, state_tracker{state_tracker_}, |
| 42 | master_semaphore{std::make_unique<MasterSemaphore>(device)}, | 42 | master_semaphore{std::make_unique<MasterSemaphore>(device)}, |
| 43 | command_pool{std::make_unique<CommandPool>(*master_semaphore, device)} { | 43 | command_pool{std::make_unique<CommandPool>(*master_semaphore, device)} { |
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 1172ec622..4cd43e425 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h | |||
| @@ -17,17 +17,17 @@ | |||
| 17 | namespace Vulkan { | 17 | namespace Vulkan { |
| 18 | 18 | ||
| 19 | class CommandPool; | 19 | class CommandPool; |
| 20 | class Device; | ||
| 20 | class Framebuffer; | 21 | class Framebuffer; |
| 21 | class MasterSemaphore; | 22 | class MasterSemaphore; |
| 22 | class StateTracker; | 23 | class StateTracker; |
| 23 | class VKDevice; | ||
| 24 | class VKQueryCache; | 24 | class VKQueryCache; |
| 25 | 25 | ||
| 26 | /// The scheduler abstracts command buffer and fence management with an interface that's able to do | 26 | /// The scheduler abstracts command buffer and fence management with an interface that's able to do |
| 27 | /// OpenGL-like operations on Vulkan command buffers. | 27 | /// OpenGL-like operations on Vulkan command buffers. |
| 28 | class VKScheduler { | 28 | class VKScheduler { |
| 29 | public: | 29 | public: |
| 30 | explicit VKScheduler(const VKDevice& device, StateTracker& state_tracker); | 30 | explicit VKScheduler(const Device& device, StateTracker& state_tracker); |
| 31 | ~VKScheduler(); | 31 | ~VKScheduler(); |
| 32 | 32 | ||
| 33 | /// Returns the current command buffer tick. | 33 | /// Returns the current command buffer tick. |
| @@ -179,7 +179,7 @@ private: | |||
| 179 | 179 | ||
| 180 | void AcquireNewChunk(); | 180 | void AcquireNewChunk(); |
| 181 | 181 | ||
| 182 | const VKDevice& device; | 182 | const Device& device; |
| 183 | StateTracker& state_tracker; | 183 | StateTracker& state_tracker; |
| 184 | 184 | ||
| 185 | std::unique_ptr<MasterSemaphore> master_semaphore; | 185 | std::unique_ptr<MasterSemaphore> master_semaphore; |
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 571460c2f..f80cc1955 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -274,7 +274,7 @@ bool IsPrecise(Operation operand) { | |||
| 274 | 274 | ||
| 275 | class SPIRVDecompiler final : public Sirit::Module { | 275 | class SPIRVDecompiler final : public Sirit::Module { |
| 276 | public: | 276 | public: |
| 277 | explicit SPIRVDecompiler(const VKDevice& device_, const ShaderIR& ir_, ShaderType stage_, | 277 | explicit SPIRVDecompiler(const Device& device_, const ShaderIR& ir_, ShaderType stage_, |
| 278 | const Registry& registry_, const Specialization& specialization_) | 278 | const Registry& registry_, const Specialization& specialization_) |
| 279 | : Module(0x00010300), device{device_}, ir{ir_}, stage{stage_}, header{ir_.GetHeader()}, | 279 | : Module(0x00010300), device{device_}, ir{ir_}, stage{stage_}, header{ir_.GetHeader()}, |
| 280 | registry{registry_}, specialization{specialization_} { | 280 | registry{registry_}, specialization{specialization_} { |
| @@ -2742,7 +2742,7 @@ private: | |||
| 2742 | }; | 2742 | }; |
| 2743 | static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount)); | 2743 | static_assert(operation_decompilers.size() == static_cast<std::size_t>(OperationCode::Amount)); |
| 2744 | 2744 | ||
| 2745 | const VKDevice& device; | 2745 | const Device& device; |
| 2746 | const ShaderIR& ir; | 2746 | const ShaderIR& ir; |
| 2747 | const ShaderType stage; | 2747 | const ShaderType stage; |
| 2748 | const Tegra::Shader::Header header; | 2748 | const Tegra::Shader::Header header; |
| @@ -3130,7 +3130,7 @@ ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir) { | |||
| 3130 | return entries; | 3130 | return entries; |
| 3131 | } | 3131 | } |
| 3132 | 3132 | ||
| 3133 | std::vector<u32> Decompile(const VKDevice& device, const VideoCommon::Shader::ShaderIR& ir, | 3133 | std::vector<u32> Decompile(const Device& device, const VideoCommon::Shader::ShaderIR& ir, |
| 3134 | ShaderType stage, const VideoCommon::Shader::Registry& registry, | 3134 | ShaderType stage, const VideoCommon::Shader::Registry& registry, |
| 3135 | const Specialization& specialization) { | 3135 | const Specialization& specialization) { |
| 3136 | return SPIRVDecompiler(device, ir, stage, registry, specialization).Assemble(); | 3136 | return SPIRVDecompiler(device, ir, stage, registry, specialization).Assemble(); |
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.h b/src/video_core/renderer_vulkan/vk_shader_decompiler.h index ad91ad5de..26381e444 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.h +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.h | |||
| @@ -15,10 +15,8 @@ | |||
| 15 | #include "video_core/shader/shader_ir.h" | 15 | #include "video_core/shader/shader_ir.h" |
| 16 | 16 | ||
| 17 | namespace Vulkan { | 17 | namespace Vulkan { |
| 18 | class VKDevice; | ||
| 19 | } | ||
| 20 | 18 | ||
| 21 | namespace Vulkan { | 19 | class Device; |
| 22 | 20 | ||
| 23 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; | 21 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; |
| 24 | using UniformTexelEntry = VideoCommon::Shader::SamplerEntry; | 22 | using UniformTexelEntry = VideoCommon::Shader::SamplerEntry; |
| @@ -109,7 +107,7 @@ struct SPIRVShader { | |||
| 109 | 107 | ||
| 110 | ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir); | 108 | ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir); |
| 111 | 109 | ||
| 112 | std::vector<u32> Decompile(const VKDevice& device, const VideoCommon::Shader::ShaderIR& ir, | 110 | std::vector<u32> Decompile(const Device& device, const VideoCommon::Shader::ShaderIR& ir, |
| 113 | Tegra::Engines::ShaderType stage, | 111 | Tegra::Engines::ShaderType stage, |
| 114 | const VideoCommon::Shader::Registry& registry, | 112 | const VideoCommon::Shader::Registry& registry, |
| 115 | const Specialization& specialization); | 113 | const Specialization& specialization); |
diff --git a/src/video_core/renderer_vulkan/vk_shader_util.cpp b/src/video_core/renderer_vulkan/vk_shader_util.cpp index 630306077..a5f554a6d 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_util.cpp | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | namespace Vulkan { | 14 | namespace Vulkan { |
| 15 | 15 | ||
| 16 | vk::ShaderModule BuildShader(const VKDevice& device, std::span<const u32> code) { | 16 | vk::ShaderModule BuildShader(const Device& device, std::span<const u32> code) { |
| 17 | return device.GetLogical().CreateShaderModule({ | 17 | return device.GetLogical().CreateShaderModule({ |
| 18 | .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, | 18 | .sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, |
| 19 | .pNext = nullptr, | 19 | .pNext = nullptr, |
diff --git a/src/video_core/renderer_vulkan/vk_shader_util.h b/src/video_core/renderer_vulkan/vk_shader_util.h index 98ee5e668..9517cbe84 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.h +++ b/src/video_core/renderer_vulkan/vk_shader_util.h | |||
| @@ -11,8 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | namespace Vulkan { | 12 | namespace Vulkan { |
| 13 | 13 | ||
| 14 | class VKDevice; | 14 | class Device; |
| 15 | 15 | ||
| 16 | vk::ShaderModule BuildShader(const VKDevice& device, std::span<const u32> code); | 16 | vk::ShaderModule BuildShader(const Device& device, std::span<const u32> code); |
| 17 | 17 | ||
| 18 | } // namespace Vulkan | 18 | } // namespace Vulkan |
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index e5155e886..34038f3d0 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | |||
| @@ -19,7 +19,7 @@ namespace Vulkan { | |||
| 19 | VKStagingBufferPool::StagingBuffer::StagingBuffer(std::unique_ptr<VKBuffer> buffer_) | 19 | VKStagingBufferPool::StagingBuffer::StagingBuffer(std::unique_ptr<VKBuffer> buffer_) |
| 20 | : buffer{std::move(buffer_)} {} | 20 | : buffer{std::move(buffer_)} {} |
| 21 | 21 | ||
| 22 | VKStagingBufferPool::VKStagingBufferPool(const VKDevice& device_, VKMemoryManager& memory_manager_, | 22 | VKStagingBufferPool::VKStagingBufferPool(const Device& device_, VKMemoryManager& memory_manager_, |
| 23 | VKScheduler& scheduler_) | 23 | VKScheduler& scheduler_) |
| 24 | : device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_} {} | 24 | : device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_} {} |
| 25 | 25 | ||
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h index 97ed1118a..90dadcbbe 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | namespace Vulkan { | 15 | namespace Vulkan { |
| 16 | 16 | ||
| 17 | class VKDevice; | 17 | class Device; |
| 18 | class VKScheduler; | 18 | class VKScheduler; |
| 19 | 19 | ||
| 20 | struct VKBuffer final { | 20 | struct VKBuffer final { |
| @@ -24,7 +24,7 @@ struct VKBuffer final { | |||
| 24 | 24 | ||
| 25 | class VKStagingBufferPool final { | 25 | class VKStagingBufferPool final { |
| 26 | public: | 26 | public: |
| 27 | explicit VKStagingBufferPool(const VKDevice& device, VKMemoryManager& memory_manager, | 27 | explicit VKStagingBufferPool(const Device& device, VKMemoryManager& memory_manager, |
| 28 | VKScheduler& scheduler); | 28 | VKScheduler& scheduler); |
| 29 | ~VKStagingBufferPool(); | 29 | ~VKStagingBufferPool(); |
| 30 | 30 | ||
| @@ -58,7 +58,7 @@ private: | |||
| 58 | 58 | ||
| 59 | u64 ReleaseLevel(StagingBuffersCache& cache, std::size_t log2); | 59 | u64 ReleaseLevel(StagingBuffersCache& cache, std::size_t log2); |
| 60 | 60 | ||
| 61 | const VKDevice& device; | 61 | const Device& device; |
| 62 | VKMemoryManager& memory_manager; | 62 | VKMemoryManager& memory_manager; |
| 63 | VKScheduler& scheduler; | 63 | VKScheduler& scheduler; |
| 64 | 64 | ||
diff --git a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp index aae50bf25..d72acb467 100644 --- a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp +++ b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp | |||
| @@ -60,7 +60,7 @@ u32 GetMemoryType(const VkPhysicalDeviceMemoryProperties& properties, | |||
| 60 | 60 | ||
| 61 | } // Anonymous namespace | 61 | } // Anonymous namespace |
| 62 | 62 | ||
| 63 | VKStreamBuffer::VKStreamBuffer(const VKDevice& device_, VKScheduler& scheduler_) | 63 | VKStreamBuffer::VKStreamBuffer(const Device& device_, VKScheduler& scheduler_) |
| 64 | : device{device_}, scheduler{scheduler_} { | 64 | : device{device_}, scheduler{scheduler_} { |
| 65 | CreateBuffers(); | 65 | CreateBuffers(); |
| 66 | ReserveWatches(current_watches, WATCHES_INITIAL_RESERVE); | 66 | ReserveWatches(current_watches, WATCHES_INITIAL_RESERVE); |
diff --git a/src/video_core/renderer_vulkan/vk_stream_buffer.h b/src/video_core/renderer_vulkan/vk_stream_buffer.h index aebd68728..2e9c8cb46 100644 --- a/src/video_core/renderer_vulkan/vk_stream_buffer.h +++ b/src/video_core/renderer_vulkan/vk_stream_buffer.h | |||
| @@ -13,13 +13,13 @@ | |||
| 13 | 13 | ||
| 14 | namespace Vulkan { | 14 | namespace Vulkan { |
| 15 | 15 | ||
| 16 | class VKDevice; | 16 | class Device; |
| 17 | class VKFenceWatch; | 17 | class VKFenceWatch; |
| 18 | class VKScheduler; | 18 | class VKScheduler; |
| 19 | 19 | ||
| 20 | class VKStreamBuffer final { | 20 | class VKStreamBuffer final { |
| 21 | public: | 21 | public: |
| 22 | explicit VKStreamBuffer(const VKDevice& device, VKScheduler& scheduler); | 22 | explicit VKStreamBuffer(const Device& device, VKScheduler& scheduler); |
| 23 | ~VKStreamBuffer(); | 23 | ~VKStreamBuffer(); |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| @@ -54,7 +54,7 @@ private: | |||
| 54 | 54 | ||
| 55 | void WaitPendingOperations(u64 requested_upper_bound); | 55 | void WaitPendingOperations(u64 requested_upper_bound); |
| 56 | 56 | ||
| 57 | const VKDevice& device; ///< Vulkan device manager. | 57 | const Device& device; ///< Vulkan device manager. |
| 58 | VKScheduler& scheduler; ///< Command scheduler. | 58 | VKScheduler& scheduler; ///< Command scheduler. |
| 59 | 59 | ||
| 60 | vk::Buffer buffer; ///< Mapped buffer. | 60 | vk::Buffer buffer; ///< Mapped buffer. |
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index 458aa4532..7020e2c66 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp | |||
| @@ -56,7 +56,7 @@ VkExtent2D ChooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, u32 wi | |||
| 56 | 56 | ||
| 57 | } // Anonymous namespace | 57 | } // Anonymous namespace |
| 58 | 58 | ||
| 59 | VKSwapchain::VKSwapchain(VkSurfaceKHR surface_, const VKDevice& device_, VKScheduler& scheduler_) | 59 | VKSwapchain::VKSwapchain(VkSurfaceKHR surface_, const Device& device_, VKScheduler& scheduler_) |
| 60 | : surface{surface_}, device{device_}, scheduler{scheduler_} {} | 60 | : surface{surface_}, device{device_}, scheduler{scheduler_} {} |
| 61 | 61 | ||
| 62 | VKSwapchain::~VKSwapchain() = default; | 62 | VKSwapchain::~VKSwapchain() = default; |
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h index 25eb20832..2eadd62b3 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.h +++ b/src/video_core/renderer_vulkan/vk_swapchain.h | |||
| @@ -15,12 +15,12 @@ struct FramebufferLayout; | |||
| 15 | 15 | ||
| 16 | namespace Vulkan { | 16 | namespace Vulkan { |
| 17 | 17 | ||
| 18 | class VKDevice; | 18 | class Device; |
| 19 | class VKScheduler; | 19 | class VKScheduler; |
| 20 | 20 | ||
| 21 | class VKSwapchain { | 21 | class VKSwapchain { |
| 22 | public: | 22 | public: |
| 23 | explicit VKSwapchain(VkSurfaceKHR surface, const VKDevice& device, VKScheduler& scheduler); | 23 | explicit VKSwapchain(VkSurfaceKHR surface, const Device& device, VKScheduler& scheduler); |
| 24 | ~VKSwapchain(); | 24 | ~VKSwapchain(); |
| 25 | 25 | ||
| 26 | /// Creates (or recreates) the swapchain with a given size. | 26 | /// Creates (or recreates) the swapchain with a given size. |
| @@ -73,7 +73,7 @@ private: | |||
| 73 | void Destroy(); | 73 | void Destroy(); |
| 74 | 74 | ||
| 75 | const VkSurfaceKHR surface; | 75 | const VkSurfaceKHR surface; |
| 76 | const VKDevice& device; | 76 | const Device& device; |
| 77 | VKScheduler& scheduler; | 77 | VKScheduler& scheduler; |
| 78 | 78 | ||
| 79 | vk::SwapchainKHR swapchain; | 79 | vk::SwapchainKHR swapchain; |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index e04dd23ef..cf8983f70 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -93,7 +93,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const VKDevice& device, const ImageInfo& info) { | 96 | [[nodiscard]] VkImageCreateInfo MakeImageCreateInfo(const Device& device, const ImageInfo& info) { |
| 97 | const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, info.format); | 97 | const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, info.format); |
| 98 | VkImageCreateFlags flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; | 98 | VkImageCreateFlags flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; |
| 99 | if (info.type == ImageType::e2D && info.resources.layers >= 6 && | 99 | if (info.type == ImageType::e2D && info.resources.layers >= 6 && |
| @@ -146,14 +146,14 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 146 | }; | 146 | }; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | [[nodiscard]] vk::Image MakeImage(const VKDevice& device, const ImageInfo& info) { | 149 | [[nodiscard]] vk::Image MakeImage(const Device& device, const ImageInfo& info) { |
| 150 | if (info.type == ImageType::Buffer) { | 150 | if (info.type == ImageType::Buffer) { |
| 151 | return vk::Image{}; | 151 | return vk::Image{}; |
| 152 | } | 152 | } |
| 153 | return device.GetLogical().CreateImage(MakeImageCreateInfo(device, info)); | 153 | return device.GetLogical().CreateImage(MakeImageCreateInfo(device, info)); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | [[nodiscard]] vk::Buffer MakeBuffer(const VKDevice& device, const ImageInfo& info) { | 156 | [[nodiscard]] vk::Buffer MakeBuffer(const Device& device, const ImageInfo& info) { |
| 157 | if (info.type != ImageType::Buffer) { | 157 | if (info.type != ImageType::Buffer) { |
| 158 | return vk::Buffer{}; | 158 | return vk::Buffer{}; |
| 159 | } | 159 | } |
| @@ -205,7 +205,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) { | |||
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | [[nodiscard]] VkAttachmentDescription AttachmentDescription(const VKDevice& device, | 208 | [[nodiscard]] VkAttachmentDescription AttachmentDescription(const Device& device, |
| 209 | const ImageView* image_view) { | 209 | const ImageView* image_view) { |
| 210 | const auto pixel_format = image_view->format; | 210 | const auto pixel_format = image_view->format; |
| 211 | return VkAttachmentDescription{ | 211 | return VkAttachmentDescription{ |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 576515bcc..e68a3db43 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h | |||
| @@ -19,11 +19,11 @@ using VideoCommon::Offset2D; | |||
| 19 | using VideoCommon::RenderTargets; | 19 | using VideoCommon::RenderTargets; |
| 20 | using VideoCore::Surface::PixelFormat; | 20 | using VideoCore::Surface::PixelFormat; |
| 21 | 21 | ||
| 22 | class VKDevice; | ||
| 23 | class VKScheduler; | 22 | class VKScheduler; |
| 24 | class VKStagingBufferPool; | 23 | class VKStagingBufferPool; |
| 25 | 24 | ||
| 26 | class BlitImageHelper; | 25 | class BlitImageHelper; |
| 26 | class Device; | ||
| 27 | class Image; | 27 | class Image; |
| 28 | class ImageView; | 28 | class ImageView; |
| 29 | class Framebuffer; | 29 | class Framebuffer; |
| @@ -68,7 +68,7 @@ struct ImageBufferMap { | |||
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | struct TextureCacheRuntime { | 70 | struct TextureCacheRuntime { |
| 71 | const VKDevice& device; | 71 | const Device& device; |
| 72 | VKScheduler& scheduler; | 72 | VKScheduler& scheduler; |
| 73 | VKMemoryManager& memory_manager; | 73 | VKMemoryManager& memory_manager; |
| 74 | VKStagingBufferPool& staging_buffer_pool; | 74 | VKStagingBufferPool& staging_buffer_pool; |
| @@ -177,7 +177,7 @@ public: | |||
| 177 | private: | 177 | private: |
| 178 | [[nodiscard]] vk::ImageView MakeDepthStencilView(VkImageAspectFlags aspect_mask); | 178 | [[nodiscard]] vk::ImageView MakeDepthStencilView(VkImageAspectFlags aspect_mask); |
| 179 | 179 | ||
| 180 | const VKDevice* device = nullptr; | 180 | const Device* device = nullptr; |
| 181 | std::array<vk::ImageView, VideoCommon::NUM_IMAGE_VIEW_TYPES> image_views; | 181 | std::array<vk::ImageView, VideoCommon::NUM_IMAGE_VIEW_TYPES> image_views; |
| 182 | vk::ImageView depth_view; | 182 | vk::ImageView depth_view; |
| 183 | vk::ImageView stencil_view; | 183 | vk::ImageView stencil_view; |
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.cpp b/src/video_core/renderer_vulkan/vk_update_descriptor.cpp index c0603ac22..19948845e 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.cpp +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.cpp | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | namespace Vulkan { | 15 | namespace Vulkan { |
| 16 | 16 | ||
| 17 | VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const VKDevice& device_, VKScheduler& scheduler_) | 17 | VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const Device& device_, VKScheduler& scheduler_) |
| 18 | : device{device_}, scheduler{scheduler_} {} | 18 | : device{device_}, scheduler{scheduler_} {} |
| 19 | 19 | ||
| 20 | VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; | 20 | VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; |
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h index d0ae49010..e214f7195 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.h +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | namespace Vulkan { | 13 | namespace Vulkan { |
| 14 | 14 | ||
| 15 | class VKDevice; | 15 | class Device; |
| 16 | class VKScheduler; | 16 | class VKScheduler; |
| 17 | 17 | ||
| 18 | struct DescriptorUpdateEntry { | 18 | struct DescriptorUpdateEntry { |
| @@ -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 Device& device_, VKScheduler& scheduler_); |
| 35 | ~VKUpdateDescriptorQueue(); | 35 | ~VKUpdateDescriptorQueue(); |
| 36 | 36 | ||
| 37 | void TickFrame(); | 37 | void TickFrame(); |
| @@ -69,7 +69,7 @@ public: | |||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | private: | 71 | private: |
| 72 | const VKDevice& device; | 72 | const Device& device; |
| 73 | VKScheduler& scheduler; | 73 | VKScheduler& scheduler; |
| 74 | 74 | ||
| 75 | const DescriptorUpdateEntry* upload_start = nullptr; | 75 | const DescriptorUpdateEntry* upload_start = nullptr; |
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp index 09f93463b..9707136e9 100644 --- a/src/video_core/shader/async_shaders.cpp +++ b/src/video_core/shader/async_shaders.cpp | |||
| @@ -134,7 +134,7 @@ void AsyncShaders::QueueOpenGLShader(const OpenGL::Device& device, | |||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, | 136 | void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, |
| 137 | const Vulkan::VKDevice& device, Vulkan::VKScheduler& scheduler, | 137 | const Vulkan::Device& device, Vulkan::VKScheduler& scheduler, |
| 138 | Vulkan::VKDescriptorPool& descriptor_pool, | 138 | Vulkan::VKDescriptorPool& descriptor_pool, |
| 139 | Vulkan::VKUpdateDescriptorQueue& update_descriptor_queue, | 139 | Vulkan::VKUpdateDescriptorQueue& update_descriptor_queue, |
| 140 | std::vector<VkDescriptorSetLayoutBinding> bindings, | 140 | std::vector<VkDescriptorSetLayoutBinding> bindings, |
diff --git a/src/video_core/shader/async_shaders.h b/src/video_core/shader/async_shaders.h index 004e214a8..f26bbe5ac 100644 --- a/src/video_core/shader/async_shaders.h +++ b/src/video_core/shader/async_shaders.h | |||
| @@ -94,7 +94,7 @@ public: | |||
| 94 | CompilerSettings compiler_settings, const Registry& registry, | 94 | CompilerSettings compiler_settings, const Registry& registry, |
| 95 | VAddr cpu_addr); | 95 | VAddr cpu_addr); |
| 96 | 96 | ||
| 97 | void QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, const Vulkan::VKDevice& device, | 97 | void QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, const Vulkan::Device& device, |
| 98 | Vulkan::VKScheduler& scheduler, | 98 | Vulkan::VKScheduler& scheduler, |
| 99 | Vulkan::VKDescriptorPool& descriptor_pool, | 99 | Vulkan::VKDescriptorPool& descriptor_pool, |
| 100 | Vulkan::VKUpdateDescriptorQueue& update_descriptor_queue, | 100 | Vulkan::VKUpdateDescriptorQueue& update_descriptor_queue, |
| @@ -123,7 +123,7 @@ private: | |||
| 123 | 123 | ||
| 124 | // For Vulkan | 124 | // For Vulkan |
| 125 | Vulkan::VKPipelineCache* pp_cache; | 125 | Vulkan::VKPipelineCache* pp_cache; |
| 126 | const Vulkan::VKDevice* vk_device; | 126 | const Vulkan::Device* vk_device; |
| 127 | Vulkan::VKScheduler* scheduler; | 127 | Vulkan::VKScheduler* scheduler; |
| 128 | Vulkan::VKDescriptorPool* descriptor_pool; | 128 | Vulkan::VKDescriptorPool* descriptor_pool; |
| 129 | Vulkan::VKUpdateDescriptorQueue* update_descriptor_queue; | 129 | Vulkan::VKUpdateDescriptorQueue* update_descriptor_queue; |