summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/blit_image.cpp6
-rw-r--r--src/video_core/renderer_vulkan/blit_image.h11
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp8
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.h8
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.cpp4
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.h10
-rw-r--r--src/video_core/renderer_vulkan/vk_command_pool.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_command_pool.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.h10
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_descriptor_pool.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_descriptor_pool.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_device.cpp38
-rw-r--r--src/video_core/renderer_vulkan/vk_device.h8
-rw-r--r--src/video_core/renderer_vulkan/vk_fence_manager.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_fence_manager.h12
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_master_semaphore.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_master_semaphore.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_memory_manager.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_memory_manager.h10
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.cpp20
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.h14
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_util.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_util.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_staging_buffer_pool.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_stream_buffer.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_stream_buffer.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_swapchain.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_update_descriptor.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_update_descriptor.h6
-rw-r--r--src/video_core/shader/async_shaders.cpp2
-rw-r--r--src/video_core/shader/async_shaders.h4
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
228void UpdateOneTextureDescriptorSet(const VKDevice& device, VkDescriptorSet descriptor_set, 228void 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
250void UpdateTwoTexturesDescriptorSet(const VKDevice& device, VkDescriptorSet descriptor_set, 250void 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
329BlitImageHelper::BlitImageHelper(const VKDevice& device_, VKScheduler& scheduler_, 329BlitImageHelper::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
16using VideoCommon::Offset2D; 16using VideoCommon::Offset2D;
17 17
18class VKDevice; 18class Device;
19class VKScheduler;
20class StateTracker;
21
22class Framebuffer; 19class Framebuffer;
23class ImageView; 20class ImageView;
21class StateTracker;
22class VKScheduler;
24 23
25struct BlitImagePipelineKey { 24struct 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
32class BlitImageHelper { 31class BlitImageHelper {
33public: 32public:
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
50VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode wrap_mode, 50VkSamplerAddressMode 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
225FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFormat pixel_format) { 225FormatInfo 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
283VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const VKDevice& device, 283VkPrimitiveTopology 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
529VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format) { 529VkIndexType 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
23VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter); 23VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter);
24 24
25VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode wrap_mode, 25VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wrap_mode,
26 Tegra::Texture::TextureFilter filter); 26 Tegra::Texture::TextureFilter filter);
27 27
28VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func); 28VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func);
@@ -35,17 +35,17 @@ struct FormatInfo {
35 bool storage; 35 bool storage;
36}; 36};
37 37
38FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFormat pixel_format); 38FormatInfo SurfaceFormat(const Device& device, FormatType format_type, PixelFormat pixel_format);
39 39
40VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage); 40VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage);
41 41
42VkPrimitiveTopology PrimitiveTopology(const VKDevice& device, Maxwell::PrimitiveTopology topology); 42VkPrimitiveTopology PrimitiveTopology(const Device& device, Maxwell::PrimitiveTopology topology);
43 43
44VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size); 44VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size);
45 45
46VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison); 46VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison);
47 47
48VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_format); 48VkIndexType IndexFormat(const Device& device, Maxwell::IndexFormat index_format);
49 49
50VkStencilOp StencilOp(Maxwell::StencilOp stencil_op); 50VkStencilOp 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
45std::string GetDriverVersion(const VKDevice& device) { 45std::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
190void RendererVulkan::Report() const { 190void 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
28namespace Vulkan { 28namespace Vulkan {
29 29
30class Device;
30class StateTracker; 31class StateTracker;
31class VKBlitScreen; 32class VKBlitScreen;
32class VKDevice;
33class VKMemoryManager; 33class VKMemoryManager;
34class VKSwapchain; 34class VKSwapchain;
35class VKScheduler; 35class 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
115VKBlitScreen::VKBlitScreen(Core::Memory::Memory& cpu_memory_, 115VKBlitScreen::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
34struct ScreenInfo; 34struct ScreenInfo;
35 35
36class Device;
36class RasterizerVulkan; 37class RasterizerVulkan;
37class VKDevice;
38class VKScheduler; 38class VKScheduler;
39class VKSwapchain; 39class VKSwapchain;
40 40
@@ -42,7 +42,7 @@ class VKBlitScreen final {
42public: 42public:
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 =
34constexpr VkAccessFlags TRANSFORM_FEEDBACK_WRITE_ACCESS = 34constexpr 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
37std::unique_ptr<VKStreamBuffer> CreateStreamBuffer(const VKDevice& device, VKScheduler& scheduler) { 37std::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
43Buffer::Buffer(const VKDevice& device_, VKMemoryManager& memory_manager, VKScheduler& scheduler_, 43Buffer::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
169VKBufferCache::VKBufferCache(VideoCore::RasterizerInterface& rasterizer_, 169VKBufferCache::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
16namespace Vulkan { 16namespace Vulkan {
17 17
18class VKDevice; 18class Device;
19class VKMemoryManager; 19class VKMemoryManager;
20class VKScheduler; 20class VKScheduler;
21 21
22class Buffer final : public VideoCommon::BufferBlock { 22class Buffer final : public VideoCommon::BufferBlock {
23public: 23public:
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
43private: 43private:
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
52public: 52public:
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
65private: 65private:
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
20CommandPool::CommandPool(MasterSemaphore& master_semaphore_, const VKDevice& device_) 20CommandPool::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
23CommandPool::~CommandPool() = default; 23CommandPool::~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
13namespace Vulkan { 13namespace Vulkan {
14 14
15class Device;
15class MasterSemaphore; 16class MasterSemaphore;
16class VKDevice;
17 17
18class CommandPool final : public ResourcePool { 18class CommandPool final : public ResourcePool {
19public: 19public:
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:
27private: 27private:
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
89VKComputePass::VKComputePass(const VKDevice& device, VKDescriptorPool& descriptor_pool, 89VKComputePass::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
165QuadArrayPass::QuadArrayPass(const VKDevice& device_, VKScheduler& scheduler_, 165QuadArrayPass::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
214Uint8Pass::Uint8Pass(const VKDevice& device, VKScheduler& scheduler_, 214Uint8Pass::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
258QuadIndexedPass::QuadIndexedPass(const VKDevice& device_, VKScheduler& scheduler_, 258QuadIndexedPass::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
16namespace Vulkan { 16namespace Vulkan {
17 17
18class VKDevice; 18class Device;
19class VKScheduler; 19class VKScheduler;
20class VKStagingBufferPool; 20class VKStagingBufferPool;
21class VKUpdateDescriptorQueue; 21class VKUpdateDescriptorQueue;
22 22
23class VKComputePass { 23class VKComputePass {
24public: 24public:
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
44class QuadArrayPass final : public VKComputePass { 44class QuadArrayPass final : public VKComputePass {
45public: 45public:
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
60class Uint8Pass final : public VKComputePass { 60class Uint8Pass final : public VKComputePass {
61public: 61public:
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
76class QuadIndexedPass final : public VKComputePass { 76class QuadIndexedPass final : public VKComputePass {
77public: 77public:
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
16namespace Vulkan { 16namespace Vulkan {
17 17
18VKComputePipeline::VKComputePipeline(const VKDevice& device_, VKScheduler& scheduler_, 18VKComputePipeline::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
12namespace Vulkan { 12namespace Vulkan {
13 13
14class VKDevice; 14class Device;
15class VKScheduler; 15class VKScheduler;
16class VKUpdateDescriptorQueue; 16class VKUpdateDescriptorQueue;
17 17
18class VKComputePipeline final { 18class VKComputePipeline final {
19public: 19public:
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
35VKDescriptorPool::VKDescriptorPool(const VKDevice& device_, VKScheduler& scheduler) 35VKDescriptorPool::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
12namespace Vulkan { 12namespace Vulkan {
13 13
14class VKDevice; 14class Device;
15class VKDescriptorPool; 15class VKDescriptorPool;
16class VKScheduler; 16class VKScheduler;
17 17
@@ -39,7 +39,7 @@ class VKDescriptorPool final {
39 friend DescriptorAllocator; 39 friend DescriptorAllocator;
40 40
41public: 41public:
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
209VKDevice::VKDevice(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR surface, 209Device::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
452VKDevice::~VKDevice() = default; 452Device::~Device() = default;
453 453
454VkFormat VKDevice::GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, 454VkFormat 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
486void VKDevice::ReportLoss() const { 486void 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
493void VKDevice::SaveShader(const std::vector<u32>& spirv) const { 493void Device::SaveShader(const std::vector<u32>& spirv) const {
494 nsight_aftermath_tracker.SaveShader(spirv); 494 nsight_aftermath_tracker.SaveShader(spirv);
495} 495}
496 496
497bool VKDevice::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) const { 497bool 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
531bool VKDevice::TestDepthStencilBlits() const { 531bool 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
541bool VKDevice::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, 541bool 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
552void VKDevice::CheckSuitability() const { 552void 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
617std::vector<const char*> VKDevice::LoadExtensions() { 617std::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
770void VKDevice::SetupFamilies(VkSurfaceKHR surface) { 770void 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
801void VKDevice::SetupFeatures() { 801void 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
808void VKDevice::CollectTelemetryParameters() { 808void 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
835void VKDevice::CollectToolingInfo() { 835void 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
861std::vector<VkDeviceQueueCreateInfo> VKDevice::GetDeviceQueueCreateInfos() const { 861std::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 };
22const u32 GuestWarpSize = 32; 22const u32 GuestWarpSize = 32;
23 23
24/// Handles data specific to a physical device. 24/// Handles data specific to a physical device.
25class VKDevice final { 25class Device final {
26public: 26public:
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
15namespace Vulkan { 15namespace Vulkan {
16 16
17InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, u32 payload_, 17InnerFence::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
21InnerFence::InnerFence(const VKDevice& device_, VKScheduler& scheduler_, GPUVAddr address_, 21InnerFence::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 {
75VKFenceManager::VKFenceManager(VideoCore::RasterizerInterface& rasterizer_, Tegra::GPU& gpu_, 75VKFenceManager::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
22namespace Vulkan { 22namespace Vulkan {
23 23
24class Device;
24class VKBufferCache; 25class VKBufferCache;
25class VKDevice;
26class VKQueryCache; 26class VKQueryCache;
27class VKScheduler; 27class VKScheduler;
28 28
29class InnerFence : public VideoCommon::FenceBase { 29class InnerFence : public VideoCommon::FenceBase {
30public: 30public:
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:
43private: 43private:
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
63protected: 63protected:
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
70private: 70private:
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
97VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device_, VKScheduler& scheduler_, 97VKGraphicsPipeline::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>
40static_assert(std::is_trivially_copyable_v<GraphicsPipelineCacheKey>); 40static_assert(std::is_trivially_copyable_v<GraphicsPipelineCacheKey>);
41static_assert(std::is_trivially_constructible_v<GraphicsPipelineCacheKey>); 41static_assert(std::is_trivially_constructible_v<GraphicsPipelineCacheKey>);
42 42
43class Device;
43class VKDescriptorPool; 44class VKDescriptorPool;
44class VKDevice;
45class VKScheduler; 45class VKScheduler;
46class VKUpdateDescriptorQueue; 46class VKUpdateDescriptorQueue;
47 47
@@ -49,7 +49,7 @@ using SPIRVProgram = std::array<std::optional<SPIRVShader>, Maxwell::MaxShaderSt
49 49
50class VKGraphicsPipeline final { 50class VKGraphicsPipeline final {
51public: 51public:
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
15using namespace std::chrono_literals; 15using namespace std::chrono_literals;
16 16
17MasterSemaphore::MasterSemaphore(const VKDevice& device) { 17MasterSemaphore::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
13namespace Vulkan { 13namespace Vulkan {
14 14
15class VKDevice; 15class Device;
16 16
17class MasterSemaphore { 17class MasterSemaphore {
18public: 18public:
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
30class VKMemoryAllocation final { 30class VKMemoryAllocation final {
31public: 31public:
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
120VKMemoryManager::VKMemoryManager(const VKDevice& device_) 120VKMemoryManager::VKMemoryManager(const Device& device_)
121 : device{device_}, properties{device_.GetPhysical().GetMemoryProperties()} {} 121 : device{device_}, properties{device_.GetPhysical().GetMemoryProperties()} {}
122 122
123VKMemoryManager::~VKMemoryManager() = default; 123VKMemoryManager::~VKMemoryManager() = default;
@@ -207,7 +207,7 @@ VKMemoryCommit VKMemoryManager::TryAllocCommit(const VkMemoryRequirements& requi
207 return {}; 207 return {};
208} 208}
209 209
210VKMemoryCommitImpl::VKMemoryCommitImpl(const VKDevice& device_, VKMemoryAllocation* allocation_, 210VKMemoryCommitImpl::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
14namespace Vulkan { 14namespace Vulkan {
15 15
16class Device;
16class MemoryMap; 17class MemoryMap;
17class VKDevice;
18class VKMemoryAllocation; 18class VKMemoryAllocation;
19class VKMemoryCommitImpl; 19class VKMemoryCommitImpl;
20 20
@@ -22,7 +22,7 @@ using VKMemoryCommit = std::unique_ptr<VKMemoryCommitImpl>;
22 22
23class VKMemoryManager final { 23class VKMemoryManager final {
24public: 24public:
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
61public: 61public:
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;
149VKPipelineCache::VKPipelineCache(RasterizerVulkan& rasterizer_, Tegra::GPU& gpu_, 149VKPipelineCache::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
34namespace Vulkan { 34namespace Vulkan {
35 35
36class Device;
36class RasterizerVulkan; 37class RasterizerVulkan;
37class VKComputePipeline; 38class VKComputePipeline;
38class VKDescriptorPool; 39class VKDescriptorPool;
39class VKDevice;
40class VKScheduler; 40class VKScheduler;
41class VKUpdateDescriptorQueue; 41class 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
30QueryPool::QueryPool(const VKDevice& device_, VKScheduler& scheduler, QueryType type_) 30QueryPool::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
33QueryPool::~QueryPool() = default; 33QueryPool::~QueryPool() = default;
@@ -68,7 +68,7 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) {
68 68
69VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer_, 69VKQueryCache::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) {
96HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, 96HostCounter::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
111void HostCounter::EndQuery() { 111void 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
116u64 HostCounter::BlockingQuery() const { 116u64 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;
21namespace Vulkan { 21namespace Vulkan {
22 22
23class CachedQuery; 23class CachedQuery;
24class Device;
24class HostCounter; 25class HostCounter;
25class VKDevice;
26class VKQueryCache; 26class VKQueryCache;
27class VKScheduler; 27class VKScheduler;
28 28
@@ -30,7 +30,7 @@ using CounterStream = VideoCommon::CounterStreamBase<VKQueryCache, HostCounter>;
30 30
31class QueryPool final : public ResourcePool { 31class QueryPool final : public ResourcePool {
32public: 32public:
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:
43private: 43private:
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
55public: 55public:
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
73private: 73private:
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
63constexpr auto COMPUTE_SHADER_INDEX = static_cast<size_t>(Tegra::Engines::ShaderType::Compute); 63constexpr auto COMPUTE_SHADER_INDEX = static_cast<size_t>(Tegra::Engines::ShaderType::Compute);
64 64
65VkViewport GetViewportState(const VKDevice& device, const Maxwell& regs, size_t index) { 65VkViewport 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 {
409RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, 409RasterizerVulkan::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 {
55public: 55public:
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
40VKScheduler::VKScheduler(const VKDevice& device_, StateTracker& state_tracker_) 40VKScheduler::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 @@
17namespace Vulkan { 17namespace Vulkan {
18 18
19class CommandPool; 19class CommandPool;
20class Device;
20class Framebuffer; 21class Framebuffer;
21class MasterSemaphore; 22class MasterSemaphore;
22class StateTracker; 23class StateTracker;
23class VKDevice;
24class VKQueryCache; 24class 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.
28class VKScheduler { 28class VKScheduler {
29public: 29public:
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
275class SPIRVDecompiler final : public Sirit::Module { 275class SPIRVDecompiler final : public Sirit::Module {
276public: 276public:
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
3133std::vector<u32> Decompile(const VKDevice& device, const VideoCommon::Shader::ShaderIR& ir, 3133std::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
17namespace Vulkan { 17namespace Vulkan {
18class VKDevice;
19}
20 18
21namespace Vulkan { 19class Device;
22 20
23using Maxwell = Tegra::Engines::Maxwell3D::Regs; 21using Maxwell = Tegra::Engines::Maxwell3D::Regs;
24using UniformTexelEntry = VideoCommon::Shader::SamplerEntry; 22using UniformTexelEntry = VideoCommon::Shader::SamplerEntry;
@@ -109,7 +107,7 @@ struct SPIRVShader {
109 107
110ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir); 108ShaderEntries GenerateShaderEntries(const VideoCommon::Shader::ShaderIR& ir);
111 109
112std::vector<u32> Decompile(const VKDevice& device, const VideoCommon::Shader::ShaderIR& ir, 110std::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
14namespace Vulkan { 14namespace Vulkan {
15 15
16vk::ShaderModule BuildShader(const VKDevice& device, std::span<const u32> code) { 16vk::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
12namespace Vulkan { 12namespace Vulkan {
13 13
14class VKDevice; 14class Device;
15 15
16vk::ShaderModule BuildShader(const VKDevice& device, std::span<const u32> code); 16vk::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 {
19VKStagingBufferPool::StagingBuffer::StagingBuffer(std::unique_ptr<VKBuffer> buffer_) 19VKStagingBufferPool::StagingBuffer::StagingBuffer(std::unique_ptr<VKBuffer> buffer_)
20 : buffer{std::move(buffer_)} {} 20 : buffer{std::move(buffer_)} {}
21 21
22VKStagingBufferPool::VKStagingBufferPool(const VKDevice& device_, VKMemoryManager& memory_manager_, 22VKStagingBufferPool::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
15namespace Vulkan { 15namespace Vulkan {
16 16
17class VKDevice; 17class Device;
18class VKScheduler; 18class VKScheduler;
19 19
20struct VKBuffer final { 20struct VKBuffer final {
@@ -24,7 +24,7 @@ struct VKBuffer final {
24 24
25class VKStagingBufferPool final { 25class VKStagingBufferPool final {
26public: 26public:
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
63VKStreamBuffer::VKStreamBuffer(const VKDevice& device_, VKScheduler& scheduler_) 63VKStreamBuffer::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
14namespace Vulkan { 14namespace Vulkan {
15 15
16class VKDevice; 16class Device;
17class VKFenceWatch; 17class VKFenceWatch;
18class VKScheduler; 18class VKScheduler;
19 19
20class VKStreamBuffer final { 20class VKStreamBuffer final {
21public: 21public:
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
59VKSwapchain::VKSwapchain(VkSurfaceKHR surface_, const VKDevice& device_, VKScheduler& scheduler_) 59VKSwapchain::VKSwapchain(VkSurfaceKHR surface_, const Device& device_, VKScheduler& scheduler_)
60 : surface{surface_}, device{device_}, scheduler{scheduler_} {} 60 : surface{surface_}, device{device_}, scheduler{scheduler_} {}
61 61
62VKSwapchain::~VKSwapchain() = default; 62VKSwapchain::~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
16namespace Vulkan { 16namespace Vulkan {
17 17
18class VKDevice; 18class Device;
19class VKScheduler; 19class VKScheduler;
20 20
21class VKSwapchain { 21class VKSwapchain {
22public: 22public:
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;
19using VideoCommon::RenderTargets; 19using VideoCommon::RenderTargets;
20using VideoCore::Surface::PixelFormat; 20using VideoCore::Surface::PixelFormat;
21 21
22class VKDevice;
23class VKScheduler; 22class VKScheduler;
24class VKStagingBufferPool; 23class VKStagingBufferPool;
25 24
26class BlitImageHelper; 25class BlitImageHelper;
26class Device;
27class Image; 27class Image;
28class ImageView; 28class ImageView;
29class Framebuffer; 29class Framebuffer;
@@ -68,7 +68,7 @@ struct ImageBufferMap {
68}; 68};
69 69
70struct TextureCacheRuntime { 70struct 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:
177private: 177private:
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
15namespace Vulkan { 15namespace Vulkan {
16 16
17VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const VKDevice& device_, VKScheduler& scheduler_) 17VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const Device& device_, VKScheduler& scheduler_)
18 : device{device_}, scheduler{scheduler_} {} 18 : device{device_}, scheduler{scheduler_} {}
19 19
20VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; 20VKUpdateDescriptorQueue::~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
13namespace Vulkan { 13namespace Vulkan {
14 14
15class VKDevice; 15class Device;
16class VKScheduler; 16class VKScheduler;
17 17
18struct DescriptorUpdateEntry { 18struct DescriptorUpdateEntry {
@@ -31,7 +31,7 @@ struct DescriptorUpdateEntry {
31 31
32class VKUpdateDescriptorQueue final { 32class VKUpdateDescriptorQueue final {
33public: 33public:
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
71private: 71private:
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
136void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, 136void 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;