diff options
| author | 2023-12-25 07:32:16 +0100 | |
|---|---|---|
| committer | 2024-01-18 21:12:30 -0500 | |
| commit | 0a2536a0df1f4aea406f2132d3edda0430acc9d1 (patch) | |
| tree | c0ad53890581c9c7e180c5ccb3b66e3c63e3ba64 /src/video_core/renderer_vulkan | |
| parent | SMMU: Implement backing CPU page protect/unprotect (diff) | |
| download | yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.gz yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.xz yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.zip | |
SMMU: Initial adaptation to video_core.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/renderer_vulkan.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.cpp | 17 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_blit_screen.h | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.h | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.cpp | 56 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 43 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.h | 38 |
12 files changed, 109 insertions, 99 deletions
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 100b70918..0e1815076 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp | |||
| @@ -82,10 +82,10 @@ Device CreateDevice(const vk::Instance& instance, const vk::InstanceDispatch& dl | |||
| 82 | 82 | ||
| 83 | RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, | 83 | RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, |
| 84 | Core::Frontend::EmuWindow& emu_window, | 84 | Core::Frontend::EmuWindow& emu_window, |
| 85 | Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, | 85 | Tegra::MaxwellDeviceMemoryManager& device_memory_, Tegra::GPU& gpu_, |
| 86 | std::unique_ptr<Core::Frontend::GraphicsContext> context_) try | 86 | std::unique_ptr<Core::Frontend::GraphicsContext> context_) try |
| 87 | : RendererBase(emu_window, std::move(context_)), telemetry_session(telemetry_session_), | 87 | : RendererBase(emu_window, std::move(context_)), telemetry_session(telemetry_session_), |
| 88 | cpu_memory(cpu_memory_), gpu(gpu_), library(OpenLibrary(context.get())), | 88 | device_memory(device_memory_), gpu(gpu_), library(OpenLibrary(context.get())), |
| 89 | instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, | 89 | instance(CreateInstance(*library, dld, VK_API_VERSION_1_1, render_window.GetWindowInfo().type, |
| 90 | Settings::values.renderer_debug.GetValue())), | 90 | Settings::values.renderer_debug.GetValue())), |
| 91 | debug_messenger(Settings::values.renderer_debug ? CreateDebugUtilsCallback(instance) | 91 | debug_messenger(Settings::values.renderer_debug ? CreateDebugUtilsCallback(instance) |
| @@ -97,9 +97,9 @@ RendererVulkan::RendererVulkan(Core::TelemetrySession& telemetry_session_, | |||
| 97 | render_window.GetFramebufferLayout().height), | 97 | render_window.GetFramebufferLayout().height), |
| 98 | present_manager(instance, render_window, device, memory_allocator, scheduler, swapchain, | 98 | present_manager(instance, render_window, device, memory_allocator, scheduler, swapchain, |
| 99 | surface), | 99 | surface), |
| 100 | blit_screen(cpu_memory, render_window, device, memory_allocator, swapchain, present_manager, | 100 | blit_screen(device_memory, render_window, device, memory_allocator, swapchain, present_manager, |
| 101 | scheduler, screen_info), | 101 | scheduler, screen_info), |
| 102 | rasterizer(render_window, gpu, cpu_memory, screen_info, device, memory_allocator, | 102 | rasterizer(render_window, gpu, device_memory, screen_info, device, memory_allocator, |
| 103 | state_tracker, scheduler) { | 103 | state_tracker, scheduler) { |
| 104 | if (Settings::values.renderer_force_max_clock.GetValue() && device.ShouldBoostClocks()) { | 104 | if (Settings::values.renderer_force_max_clock.GetValue() && device.ShouldBoostClocks()) { |
| 105 | turbo_mode.emplace(instance, dld); | 105 | turbo_mode.emplace(instance, dld); |
| @@ -128,7 +128,7 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) { | |||
| 128 | screen_info.width = framebuffer->width; | 128 | screen_info.width = framebuffer->width; |
| 129 | screen_info.height = framebuffer->height; | 129 | screen_info.height = framebuffer->height; |
| 130 | 130 | ||
| 131 | const VAddr framebuffer_addr = framebuffer->address + framebuffer->offset; | 131 | const DAddr framebuffer_addr = framebuffer->address + framebuffer->offset; |
| 132 | const bool use_accelerated = | 132 | const bool use_accelerated = |
| 133 | rasterizer.AccelerateDisplay(*framebuffer, framebuffer_addr, framebuffer->stride); | 133 | rasterizer.AccelerateDisplay(*framebuffer, framebuffer_addr, framebuffer->stride); |
| 134 | RenderScreenshot(*framebuffer, use_accelerated); | 134 | RenderScreenshot(*framebuffer, use_accelerated); |
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h index 14e257cf7..e5ce4692d 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.h +++ b/src/video_core/renderer_vulkan/renderer_vulkan.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "video_core/vulkan_common/vulkan_device.h" | 20 | #include "video_core/vulkan_common/vulkan_device.h" |
| 21 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" | 21 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" |
| 22 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 22 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 23 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 23 | 24 | ||
| 24 | namespace Core { | 25 | namespace Core { |
| 25 | class TelemetrySession; | 26 | class TelemetrySession; |
| @@ -42,7 +43,7 @@ class RendererVulkan final : public VideoCore::RendererBase { | |||
| 42 | public: | 43 | public: |
| 43 | explicit RendererVulkan(Core::TelemetrySession& telemtry_session, | 44 | explicit RendererVulkan(Core::TelemetrySession& telemtry_session, |
| 44 | Core::Frontend::EmuWindow& emu_window, | 45 | Core::Frontend::EmuWindow& emu_window, |
| 45 | Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, | 46 | Tegra::MaxwellDeviceMemoryManager& device_memory_, Tegra::GPU& gpu_, |
| 46 | std::unique_ptr<Core::Frontend::GraphicsContext> context_); | 47 | std::unique_ptr<Core::Frontend::GraphicsContext> context_); |
| 47 | ~RendererVulkan() override; | 48 | ~RendererVulkan() override; |
| 48 | 49 | ||
| @@ -62,7 +63,7 @@ private: | |||
| 62 | void RenderScreenshot(const Tegra::FramebufferConfig& framebuffer, bool use_accelerated); | 63 | void RenderScreenshot(const Tegra::FramebufferConfig& framebuffer, bool use_accelerated); |
| 63 | 64 | ||
| 64 | Core::TelemetrySession& telemetry_session; | 65 | Core::TelemetrySession& telemetry_session; |
| 65 | Core::Memory::Memory& cpu_memory; | 66 | Tegra::MaxwellDeviceMemoryManager& device_memory; |
| 66 | Tegra::GPU& gpu; | 67 | Tegra::GPU& gpu; |
| 67 | 68 | ||
| 68 | std::shared_ptr<Common::DynamicLibrary> library; | 69 | std::shared_ptr<Common::DynamicLibrary> library; |
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp index 60432f5ad..610f27c84 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp +++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp | |||
| @@ -14,8 +14,8 @@ | |||
| 14 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 15 | #include "core/core.h" | 15 | #include "core/core.h" |
| 16 | #include "core/frontend/emu_window.h" | 16 | #include "core/frontend/emu_window.h" |
| 17 | #include "core/memory.h" | ||
| 18 | #include "video_core/gpu.h" | 17 | #include "video_core/gpu.h" |
| 18 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 19 | #include "video_core/host_shaders/fxaa_frag_spv.h" | 19 | #include "video_core/host_shaders/fxaa_frag_spv.h" |
| 20 | #include "video_core/host_shaders/fxaa_vert_spv.h" | 20 | #include "video_core/host_shaders/fxaa_vert_spv.h" |
| 21 | #include "video_core/host_shaders/present_bicubic_frag_spv.h" | 21 | #include "video_core/host_shaders/present_bicubic_frag_spv.h" |
| @@ -121,11 +121,12 @@ struct BlitScreen::BufferData { | |||
| 121 | // Unaligned image data goes here | 121 | // Unaligned image data goes here |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | BlitScreen::BlitScreen(Core::Memory::Memory& cpu_memory_, Core::Frontend::EmuWindow& render_window_, | 124 | BlitScreen::BlitScreen(Tegra::MaxwellDeviceMemoryManager& device_memory_, |
| 125 | const Device& device_, MemoryAllocator& memory_allocator_, | 125 | Core::Frontend::EmuWindow& render_window_, const Device& device_, |
| 126 | Swapchain& swapchain_, PresentManager& present_manager_, | 126 | MemoryAllocator& memory_allocator_, Swapchain& swapchain_, |
| 127 | Scheduler& scheduler_, const ScreenInfo& screen_info_) | 127 | PresentManager& present_manager_, Scheduler& scheduler_, |
| 128 | : cpu_memory{cpu_memory_}, render_window{render_window_}, device{device_}, | 128 | const ScreenInfo& screen_info_) |
| 129 | : device_memory{device_memory_}, render_window{render_window_}, device{device_}, | ||
| 129 | memory_allocator{memory_allocator_}, swapchain{swapchain_}, present_manager{present_manager_}, | 130 | memory_allocator{memory_allocator_}, swapchain{swapchain_}, present_manager{present_manager_}, |
| 130 | scheduler{scheduler_}, image_count{swapchain.GetImageCount()}, screen_info{screen_info_} { | 131 | scheduler{scheduler_}, image_count{swapchain.GetImageCount()}, screen_info{screen_info_} { |
| 131 | resource_ticks.resize(image_count); | 132 | resource_ticks.resize(image_count); |
| @@ -219,8 +220,8 @@ void BlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer, | |||
| 219 | if (!use_accelerated) { | 220 | if (!use_accelerated) { |
| 220 | const u64 image_offset = GetRawImageOffset(framebuffer); | 221 | const u64 image_offset = GetRawImageOffset(framebuffer); |
| 221 | 222 | ||
| 222 | const VAddr framebuffer_addr = framebuffer.address + framebuffer.offset; | 223 | const DAddr framebuffer_addr = framebuffer.address + framebuffer.offset; |
| 223 | const u8* const host_ptr = cpu_memory.GetPointer(framebuffer_addr); | 224 | const u8* const host_ptr = device_memory.GetPointer<u8>(framebuffer_addr); |
| 224 | 225 | ||
| 225 | // TODO(Rodrigo): Read this from HLE | 226 | // TODO(Rodrigo): Read this from HLE |
| 226 | constexpr u32 block_height_log2 = 4; | 227 | constexpr u32 block_height_log2 = 4; |
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h index 78b32416d..cb941a956 100644 --- a/src/video_core/renderer_vulkan/vk_blit_screen.h +++ b/src/video_core/renderer_vulkan/vk_blit_screen.h | |||
| @@ -8,15 +8,12 @@ | |||
| 8 | #include "core/frontend/framebuffer_layout.h" | 8 | #include "core/frontend/framebuffer_layout.h" |
| 9 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" | 9 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" |
| 10 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 10 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 11 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 11 | 12 | ||
| 12 | namespace Core { | 13 | namespace Core { |
| 13 | class System; | 14 | class System; |
| 14 | } | 15 | } |
| 15 | 16 | ||
| 16 | namespace Core::Memory { | ||
| 17 | class Memory; | ||
| 18 | } | ||
| 19 | |||
| 20 | namespace Core::Frontend { | 17 | namespace Core::Frontend { |
| 21 | class EmuWindow; | 18 | class EmuWindow; |
| 22 | } | 19 | } |
| @@ -56,7 +53,7 @@ struct ScreenInfo { | |||
| 56 | 53 | ||
| 57 | class BlitScreen { | 54 | class BlitScreen { |
| 58 | public: | 55 | public: |
| 59 | explicit BlitScreen(Core::Memory::Memory& cpu_memory, Core::Frontend::EmuWindow& render_window, | 56 | explicit BlitScreen(Tegra::MaxwellDeviceMemoryManager& device_memory, Core::Frontend::EmuWindow& render_window, |
| 60 | const Device& device, MemoryAllocator& memory_manager, Swapchain& swapchain, | 57 | const Device& device, MemoryAllocator& memory_manager, Swapchain& swapchain, |
| 61 | PresentManager& present_manager, Scheduler& scheduler, | 58 | PresentManager& present_manager, Scheduler& scheduler, |
| 62 | const ScreenInfo& screen_info); | 59 | const ScreenInfo& screen_info); |
| @@ -109,7 +106,7 @@ private: | |||
| 109 | u64 CalculateBufferSize(const Tegra::FramebufferConfig& framebuffer) const; | 106 | u64 CalculateBufferSize(const Tegra::FramebufferConfig& framebuffer) const; |
| 110 | u64 GetRawImageOffset(const Tegra::FramebufferConfig& framebuffer) const; | 107 | u64 GetRawImageOffset(const Tegra::FramebufferConfig& framebuffer) const; |
| 111 | 108 | ||
| 112 | Core::Memory::Memory& cpu_memory; | 109 | Tegra::MaxwellDeviceMemoryManager& device_memory; |
| 113 | Core::Frontend::EmuWindow& render_window; | 110 | Core::Frontend::EmuWindow& render_window; |
| 114 | const Device& device; | 111 | const Device& device; |
| 115 | MemoryAllocator& memory_allocator; | 112 | MemoryAllocator& memory_allocator; |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 3c61799fa..31001d142 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -79,7 +79,7 @@ vk::Buffer CreateBuffer(const Device& device, const MemoryAllocator& memory_allo | |||
| 79 | } // Anonymous namespace | 79 | } // Anonymous namespace |
| 80 | 80 | ||
| 81 | Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_params) | 81 | Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_params) |
| 82 | : VideoCommon::BufferBase<VideoCore::RasterizerInterface>(null_params), tracker{4096} { | 82 | : VideoCommon::BufferBase(null_params), tracker{4096} { |
| 83 | if (runtime.device.HasNullDescriptor()) { | 83 | if (runtime.device.HasNullDescriptor()) { |
| 84 | return; | 84 | return; |
| 85 | } | 85 | } |
| @@ -88,11 +88,9 @@ Buffer::Buffer(BufferCacheRuntime& runtime, VideoCommon::NullBufferParams null_p | |||
| 88 | is_null = true; | 88 | is_null = true; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | Buffer::Buffer(BufferCacheRuntime& runtime, VideoCore::RasterizerInterface& rasterizer_, | 91 | Buffer::Buffer(BufferCacheRuntime& runtime, DAddr cpu_addr_, u64 size_bytes_) |
| 92 | VAddr cpu_addr_, u64 size_bytes_) | 92 | : VideoCommon::BufferBase(cpu_addr_, size_bytes_), device{&runtime.device}, |
| 93 | : VideoCommon::BufferBase<VideoCore::RasterizerInterface>(rasterizer_, cpu_addr_, size_bytes_), | 93 | buffer{CreateBuffer(*device, runtime.memory_allocator, SizeBytes())}, tracker{SizeBytes()} { |
| 94 | device{&runtime.device}, buffer{CreateBuffer(*device, runtime.memory_allocator, SizeBytes())}, | ||
| 95 | tracker{SizeBytes()} { | ||
| 96 | if (runtime.device.HasDebuggingToolAttached()) { | 94 | if (runtime.device.HasDebuggingToolAttached()) { |
| 97 | buffer.SetObjectNameEXT(fmt::format("Buffer 0x{:x}", CpuAddr()).c_str()); | 95 | buffer.SetObjectNameEXT(fmt::format("Buffer 0x{:x}", CpuAddr()).c_str()); |
| 98 | } | 96 | } |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index dc300d7cb..e273f4988 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h | |||
| @@ -23,11 +23,10 @@ struct HostVertexBinding; | |||
| 23 | 23 | ||
| 24 | class BufferCacheRuntime; | 24 | class BufferCacheRuntime; |
| 25 | 25 | ||
| 26 | class Buffer : public VideoCommon::BufferBase<VideoCore::RasterizerInterface> { | 26 | class Buffer : public VideoCommon::BufferBase { |
| 27 | public: | 27 | public: |
| 28 | explicit Buffer(BufferCacheRuntime&, VideoCommon::NullBufferParams null_params); | 28 | explicit Buffer(BufferCacheRuntime&, VideoCommon::NullBufferParams null_params); |
| 29 | explicit Buffer(BufferCacheRuntime& runtime, VideoCore::RasterizerInterface& rasterizer_, | 29 | explicit Buffer(BufferCacheRuntime& runtime, VAddr cpu_addr_, u64 size_bytes_); |
| 30 | VAddr cpu_addr_, u64 size_bytes_); | ||
| 31 | 30 | ||
| 32 | [[nodiscard]] VkBufferView View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format); | 31 | [[nodiscard]] VkBufferView View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format); |
| 33 | 32 | ||
| @@ -173,7 +172,7 @@ struct BufferCacheParams { | |||
| 173 | using Runtime = Vulkan::BufferCacheRuntime; | 172 | using Runtime = Vulkan::BufferCacheRuntime; |
| 174 | using Buffer = Vulkan::Buffer; | 173 | using Buffer = Vulkan::Buffer; |
| 175 | using Async_Buffer = Vulkan::StagingBufferRef; | 174 | using Async_Buffer = Vulkan::StagingBufferRef; |
| 176 | using MemoryTracker = VideoCommon::MemoryTrackerBase<VideoCore::RasterizerInterface>; | 175 | using MemoryTracker = VideoCommon::MemoryTrackerBase<Tegra::MaxwellDeviceMemoryManager>; |
| 177 | 176 | ||
| 178 | static constexpr bool IS_OPENGL = false; | 177 | static constexpr bool IS_OPENGL = false; |
| 179 | static constexpr bool HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS = false; | 178 | static constexpr bool HAS_PERSISTENT_UNIFORM_BUFFER_BINDINGS = false; |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index d1841198d..bec20c21a 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include "video_core/renderer_vulkan/vk_compute_pipeline.h" | 30 | #include "video_core/renderer_vulkan/vk_compute_pipeline.h" |
| 31 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" | 31 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" |
| 32 | #include "video_core/renderer_vulkan/vk_pipeline_cache.h" | 32 | #include "video_core/renderer_vulkan/vk_pipeline_cache.h" |
| 33 | #include "video_core/renderer_vulkan/vk_rasterizer.h" | ||
| 34 | #include "video_core/renderer_vulkan/vk_scheduler.h" | 33 | #include "video_core/renderer_vulkan/vk_scheduler.h" |
| 35 | #include "video_core/renderer_vulkan/vk_shader_util.h" | 34 | #include "video_core/renderer_vulkan/vk_shader_util.h" |
| 36 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" | 35 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" |
| @@ -299,12 +298,12 @@ bool GraphicsPipelineCacheKey::operator==(const GraphicsPipelineCacheKey& rhs) c | |||
| 299 | return std::memcmp(&rhs, this, Size()) == 0; | 298 | return std::memcmp(&rhs, this, Size()) == 0; |
| 300 | } | 299 | } |
| 301 | 300 | ||
| 302 | PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device_, | 301 | PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const Device& device_, |
| 303 | Scheduler& scheduler_, DescriptorPool& descriptor_pool_, | 302 | Scheduler& scheduler_, DescriptorPool& descriptor_pool_, |
| 304 | GuestDescriptorQueue& guest_descriptor_queue_, | 303 | GuestDescriptorQueue& guest_descriptor_queue_, |
| 305 | RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, | 304 | RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, |
| 306 | TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) | 305 | TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) |
| 307 | : VideoCommon::ShaderCache{rasterizer_}, device{device_}, scheduler{scheduler_}, | 306 | : VideoCommon::ShaderCache{device_memory_}, device{device_}, scheduler{scheduler_}, |
| 308 | descriptor_pool{descriptor_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, | 307 | descriptor_pool{descriptor_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, |
| 309 | render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, | 308 | render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, |
| 310 | texture_cache{texture_cache_}, shader_notify{shader_notify_}, | 309 | texture_cache{texture_cache_}, shader_notify{shader_notify_}, |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index e323ea0fd..354fdc8ed 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include "video_core/renderer_vulkan/vk_graphics_pipeline.h" | 26 | #include "video_core/renderer_vulkan/vk_graphics_pipeline.h" |
| 27 | #include "video_core/renderer_vulkan/vk_texture_cache.h" | 27 | #include "video_core/renderer_vulkan/vk_texture_cache.h" |
| 28 | #include "video_core/shader_cache.h" | 28 | #include "video_core/shader_cache.h" |
| 29 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 29 | 30 | ||
| 30 | namespace Core { | 31 | namespace Core { |
| 31 | class System; | 32 | class System; |
| @@ -79,7 +80,6 @@ class ComputePipeline; | |||
| 79 | class DescriptorPool; | 80 | class DescriptorPool; |
| 80 | class Device; | 81 | class Device; |
| 81 | class PipelineStatistics; | 82 | class PipelineStatistics; |
| 82 | class RasterizerVulkan; | ||
| 83 | class RenderPassCache; | 83 | class RenderPassCache; |
| 84 | class Scheduler; | 84 | class Scheduler; |
| 85 | 85 | ||
| @@ -99,7 +99,7 @@ struct ShaderPools { | |||
| 99 | 99 | ||
| 100 | class PipelineCache : public VideoCommon::ShaderCache { | 100 | class PipelineCache : public VideoCommon::ShaderCache { |
| 101 | public: | 101 | public: |
| 102 | explicit PipelineCache(RasterizerVulkan& rasterizer, const Device& device, Scheduler& scheduler, | 102 | explicit PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, const Device& device, Scheduler& scheduler, |
| 103 | DescriptorPool& descriptor_pool, | 103 | DescriptorPool& descriptor_pool, |
| 104 | GuestDescriptorQueue& guest_descriptor_queue, | 104 | GuestDescriptorQueue& guest_descriptor_queue, |
| 105 | RenderPassCache& render_pass_cache, BufferCache& buffer_cache, | 105 | RenderPassCache& render_pass_cache, BufferCache& buffer_cache, |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index ad4caf688..d59fe698c 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -14,7 +14,9 @@ | |||
| 14 | #include "common/bit_util.h" | 14 | #include "common/bit_util.h" |
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | #include "core/memory.h" | 16 | #include "core/memory.h" |
| 17 | #include "video_core/rasterizer_interface.h" | ||
| 17 | #include "video_core/engines/draw_manager.h" | 18 | #include "video_core/engines/draw_manager.h" |
| 19 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 18 | #include "video_core/query_cache/query_cache.h" | 20 | #include "video_core/query_cache/query_cache.h" |
| 19 | #include "video_core/renderer_vulkan/vk_buffer_cache.h" | 21 | #include "video_core/renderer_vulkan/vk_buffer_cache.h" |
| 20 | #include "video_core/renderer_vulkan/vk_compute_pass.h" | 22 | #include "video_core/renderer_vulkan/vk_compute_pass.h" |
| @@ -102,7 +104,7 @@ private: | |||
| 102 | using BaseStreamer = VideoCommon::SimpleStreamer<VideoCommon::HostQueryBase>; | 104 | using BaseStreamer = VideoCommon::SimpleStreamer<VideoCommon::HostQueryBase>; |
| 103 | 105 | ||
| 104 | struct HostSyncValues { | 106 | struct HostSyncValues { |
| 105 | VAddr address; | 107 | DAddr address; |
| 106 | size_t size; | 108 | size_t size; |
| 107 | size_t offset; | 109 | size_t offset; |
| 108 | 110 | ||
| @@ -317,7 +319,7 @@ public: | |||
| 317 | pending_sync.clear(); | 319 | pending_sync.clear(); |
| 318 | } | 320 | } |
| 319 | 321 | ||
| 320 | size_t WriteCounter(VAddr address, bool has_timestamp, u32 value, | 322 | size_t WriteCounter(DAddr address, bool has_timestamp, u32 value, |
| 321 | [[maybe_unused]] std::optional<u32> subreport) override { | 323 | [[maybe_unused]] std::optional<u32> subreport) override { |
| 322 | PauseCounter(); | 324 | PauseCounter(); |
| 323 | auto index = BuildQuery(); | 325 | auto index = BuildQuery(); |
| @@ -738,7 +740,7 @@ public: | |||
| 738 | pending_sync.clear(); | 740 | pending_sync.clear(); |
| 739 | } | 741 | } |
| 740 | 742 | ||
| 741 | size_t WriteCounter(VAddr address, bool has_timestamp, u32 value, | 743 | size_t WriteCounter(DAddr address, bool has_timestamp, u32 value, |
| 742 | std::optional<u32> subreport_) override { | 744 | std::optional<u32> subreport_) override { |
| 743 | auto index = BuildQuery(); | 745 | auto index = BuildQuery(); |
| 744 | auto* new_query = GetQuery(index); | 746 | auto* new_query = GetQuery(index); |
| @@ -769,9 +771,9 @@ public: | |||
| 769 | return index; | 771 | return index; |
| 770 | } | 772 | } |
| 771 | 773 | ||
| 772 | std::optional<std::pair<VAddr, size_t>> GetLastQueryStream(size_t stream) { | 774 | std::optional<std::pair<DAddr, size_t>> GetLastQueryStream(size_t stream) { |
| 773 | if (last_queries[stream] != 0) { | 775 | if (last_queries[stream] != 0) { |
| 774 | std::pair<VAddr, size_t> result(last_queries[stream], last_queries_stride[stream]); | 776 | std::pair<DAddr, size_t> result(last_queries[stream], last_queries_stride[stream]); |
| 775 | return result; | 777 | return result; |
| 776 | } | 778 | } |
| 777 | return std::nullopt; | 779 | return std::nullopt; |
| @@ -974,7 +976,7 @@ private: | |||
| 974 | size_t buffers_count{}; | 976 | size_t buffers_count{}; |
| 975 | std::array<VkBuffer, NUM_STREAMS> counter_buffers{}; | 977 | std::array<VkBuffer, NUM_STREAMS> counter_buffers{}; |
| 976 | std::array<VkDeviceSize, NUM_STREAMS> offsets{}; | 978 | std::array<VkDeviceSize, NUM_STREAMS> offsets{}; |
| 977 | std::array<VAddr, NUM_STREAMS> last_queries; | 979 | std::array<DAddr, NUM_STREAMS> last_queries; |
| 978 | std::array<size_t, NUM_STREAMS> last_queries_stride; | 980 | std::array<size_t, NUM_STREAMS> last_queries_stride; |
| 979 | Maxwell3D::Regs::PrimitiveTopology out_topology; | 981 | Maxwell3D::Regs::PrimitiveTopology out_topology; |
| 980 | u64 streams_mask; | 982 | u64 streams_mask; |
| @@ -987,7 +989,7 @@ public: | |||
| 987 | : VideoCommon::QueryBase(0, VideoCommon::QueryFlagBits::IsHostManaged, 0) {} | 989 | : VideoCommon::QueryBase(0, VideoCommon::QueryFlagBits::IsHostManaged, 0) {} |
| 988 | 990 | ||
| 989 | // Parameterized constructor | 991 | // Parameterized constructor |
| 990 | PrimitivesQueryBase(bool has_timestamp, VAddr address) | 992 | PrimitivesQueryBase(bool has_timestamp, DAddr address) |
| 991 | : VideoCommon::QueryBase(address, VideoCommon::QueryFlagBits::IsHostManaged, 0) { | 993 | : VideoCommon::QueryBase(address, VideoCommon::QueryFlagBits::IsHostManaged, 0) { |
| 992 | if (has_timestamp) { | 994 | if (has_timestamp) { |
| 993 | flags |= VideoCommon::QueryFlagBits::HasTimestamp; | 995 | flags |= VideoCommon::QueryFlagBits::HasTimestamp; |
| @@ -995,7 +997,7 @@ public: | |||
| 995 | } | 997 | } |
| 996 | 998 | ||
| 997 | u64 stride{}; | 999 | u64 stride{}; |
| 998 | VAddr dependant_address{}; | 1000 | DAddr dependant_address{}; |
| 999 | Maxwell3D::Regs::PrimitiveTopology topology{Maxwell3D::Regs::PrimitiveTopology::Points}; | 1001 | Maxwell3D::Regs::PrimitiveTopology topology{Maxwell3D::Regs::PrimitiveTopology::Points}; |
| 1000 | size_t dependant_index{}; | 1002 | size_t dependant_index{}; |
| 1001 | bool dependant_manage{}; | 1003 | bool dependant_manage{}; |
| @@ -1005,15 +1007,15 @@ class PrimitivesSucceededStreamer : public VideoCommon::SimpleStreamer<Primitive | |||
| 1005 | public: | 1007 | public: |
| 1006 | explicit PrimitivesSucceededStreamer(size_t id_, QueryCacheRuntime& runtime_, | 1008 | explicit PrimitivesSucceededStreamer(size_t id_, QueryCacheRuntime& runtime_, |
| 1007 | TFBCounterStreamer& tfb_streamer_, | 1009 | TFBCounterStreamer& tfb_streamer_, |
| 1008 | Core::Memory::Memory& cpu_memory_) | 1010 | Tegra::MaxwellDeviceMemoryManager& device_memory_) |
| 1009 | : VideoCommon::SimpleStreamer<PrimitivesQueryBase>(id_), runtime{runtime_}, | 1011 | : VideoCommon::SimpleStreamer<PrimitivesQueryBase>(id_), runtime{runtime_}, |
| 1010 | tfb_streamer{tfb_streamer_}, cpu_memory{cpu_memory_} { | 1012 | tfb_streamer{tfb_streamer_}, device_memory{device_memory_} { |
| 1011 | MakeDependent(&tfb_streamer); | 1013 | MakeDependent(&tfb_streamer); |
| 1012 | } | 1014 | } |
| 1013 | 1015 | ||
| 1014 | ~PrimitivesSucceededStreamer() = default; | 1016 | ~PrimitivesSucceededStreamer() = default; |
| 1015 | 1017 | ||
| 1016 | size_t WriteCounter(VAddr address, bool has_timestamp, u32 value, | 1018 | size_t WriteCounter(DAddr address, bool has_timestamp, u32 value, |
| 1017 | std::optional<u32> subreport_) override { | 1019 | std::optional<u32> subreport_) override { |
| 1018 | auto index = BuildQuery(); | 1020 | auto index = BuildQuery(); |
| 1019 | auto* new_query = GetQuery(index); | 1021 | auto* new_query = GetQuery(index); |
| @@ -1063,6 +1065,8 @@ public: | |||
| 1063 | } | 1065 | } |
| 1064 | }); | 1066 | }); |
| 1065 | } | 1067 | } |
| 1068 | auto* ptr = device_memory.GetPointer<u8>(new_query->dependant_address); | ||
| 1069 | ASSERT(ptr != nullptr); | ||
| 1066 | 1070 | ||
| 1067 | new_query->dependant_manage = must_manage_dependance; | 1071 | new_query->dependant_manage = must_manage_dependance; |
| 1068 | pending_flush_queries.push_back(index); | 1072 | pending_flush_queries.push_back(index); |
| @@ -1100,7 +1104,7 @@ public: | |||
| 1100 | num_vertices = dependant_query->value / query->stride; | 1104 | num_vertices = dependant_query->value / query->stride; |
| 1101 | tfb_streamer.Free(query->dependant_index); | 1105 | tfb_streamer.Free(query->dependant_index); |
| 1102 | } else { | 1106 | } else { |
| 1103 | u8* pointer = cpu_memory.GetPointer(query->dependant_address); | 1107 | u8* pointer = device_memory.GetPointer<u8>(query->dependant_address); |
| 1104 | u32 result; | 1108 | u32 result; |
| 1105 | std::memcpy(&result, pointer, sizeof(u32)); | 1109 | std::memcpy(&result, pointer, sizeof(u32)); |
| 1106 | num_vertices = static_cast<u64>(result) / query->stride; | 1110 | num_vertices = static_cast<u64>(result) / query->stride; |
| @@ -1137,7 +1141,7 @@ public: | |||
| 1137 | private: | 1141 | private: |
| 1138 | QueryCacheRuntime& runtime; | 1142 | QueryCacheRuntime& runtime; |
| 1139 | TFBCounterStreamer& tfb_streamer; | 1143 | TFBCounterStreamer& tfb_streamer; |
| 1140 | Core::Memory::Memory& cpu_memory; | 1144 | Tegra::MaxwellDeviceMemoryManager& device_memory; |
| 1141 | 1145 | ||
| 1142 | // syncing queue | 1146 | // syncing queue |
| 1143 | std::vector<size_t> pending_sync; | 1147 | std::vector<size_t> pending_sync; |
| @@ -1152,12 +1156,12 @@ private: | |||
| 1152 | 1156 | ||
| 1153 | struct QueryCacheRuntimeImpl { | 1157 | struct QueryCacheRuntimeImpl { |
| 1154 | QueryCacheRuntimeImpl(QueryCacheRuntime& runtime, VideoCore::RasterizerInterface* rasterizer_, | 1158 | QueryCacheRuntimeImpl(QueryCacheRuntime& runtime, VideoCore::RasterizerInterface* rasterizer_, |
| 1155 | Core::Memory::Memory& cpu_memory_, Vulkan::BufferCache& buffer_cache_, | 1159 | Tegra::MaxwellDeviceMemoryManager& device_memory_, Vulkan::BufferCache& buffer_cache_, |
| 1156 | const Device& device_, const MemoryAllocator& memory_allocator_, | 1160 | const Device& device_, const MemoryAllocator& memory_allocator_, |
| 1157 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, | 1161 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, |
| 1158 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, | 1162 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, |
| 1159 | DescriptorPool& descriptor_pool) | 1163 | DescriptorPool& descriptor_pool) |
| 1160 | : rasterizer{rasterizer_}, cpu_memory{cpu_memory_}, | 1164 | : rasterizer{rasterizer_}, device_memory{device_memory_}, |
| 1161 | buffer_cache{buffer_cache_}, device{device_}, | 1165 | buffer_cache{buffer_cache_}, device{device_}, |
| 1162 | memory_allocator{memory_allocator_}, scheduler{scheduler_}, staging_pool{staging_pool_}, | 1166 | memory_allocator{memory_allocator_}, scheduler{scheduler_}, staging_pool{staging_pool_}, |
| 1163 | guest_streamer(0, runtime), | 1167 | guest_streamer(0, runtime), |
| @@ -1168,7 +1172,7 @@ struct QueryCacheRuntimeImpl { | |||
| 1168 | scheduler, memory_allocator, staging_pool), | 1172 | scheduler, memory_allocator, staging_pool), |
| 1169 | primitives_succeeded_streamer( | 1173 | primitives_succeeded_streamer( |
| 1170 | static_cast<size_t>(QueryType::StreamingPrimitivesSucceeded), runtime, tfb_streamer, | 1174 | static_cast<size_t>(QueryType::StreamingPrimitivesSucceeded), runtime, tfb_streamer, |
| 1171 | cpu_memory_), | 1175 | device_memory_), |
| 1172 | primitives_needed_minus_succeeded_streamer( | 1176 | primitives_needed_minus_succeeded_streamer( |
| 1173 | static_cast<size_t>(QueryType::StreamingPrimitivesNeededMinusSucceeded), runtime, 0u), | 1177 | static_cast<size_t>(QueryType::StreamingPrimitivesNeededMinusSucceeded), runtime, 0u), |
| 1174 | hcr_setup{}, hcr_is_set{}, is_hcr_running{}, maxwell3d{} { | 1178 | hcr_setup{}, hcr_is_set{}, is_hcr_running{}, maxwell3d{} { |
| @@ -1195,7 +1199,7 @@ struct QueryCacheRuntimeImpl { | |||
| 1195 | } | 1199 | } |
| 1196 | 1200 | ||
| 1197 | VideoCore::RasterizerInterface* rasterizer; | 1201 | VideoCore::RasterizerInterface* rasterizer; |
| 1198 | Core::Memory::Memory& cpu_memory; | 1202 | Tegra::MaxwellDeviceMemoryManager& device_memory; |
| 1199 | Vulkan::BufferCache& buffer_cache; | 1203 | Vulkan::BufferCache& buffer_cache; |
| 1200 | 1204 | ||
| 1201 | const Device& device; | 1205 | const Device& device; |
| @@ -1210,7 +1214,7 @@ struct QueryCacheRuntimeImpl { | |||
| 1210 | PrimitivesSucceededStreamer primitives_succeeded_streamer; | 1214 | PrimitivesSucceededStreamer primitives_succeeded_streamer; |
| 1211 | VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_succeeded_streamer; | 1215 | VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_succeeded_streamer; |
| 1212 | 1216 | ||
| 1213 | std::vector<std::pair<VAddr, VAddr>> little_cache; | 1217 | std::vector<std::pair<DAddr, DAddr>> little_cache; |
| 1214 | std::vector<std::pair<VkBuffer, VkDeviceSize>> buffers_to_upload_to; | 1218 | std::vector<std::pair<VkBuffer, VkDeviceSize>> buffers_to_upload_to; |
| 1215 | std::vector<size_t> redirect_cache; | 1219 | std::vector<size_t> redirect_cache; |
| 1216 | std::vector<std::vector<VkBufferCopy>> copies_setup; | 1220 | std::vector<std::vector<VkBufferCopy>> copies_setup; |
| @@ -1229,14 +1233,14 @@ struct QueryCacheRuntimeImpl { | |||
| 1229 | }; | 1233 | }; |
| 1230 | 1234 | ||
| 1231 | QueryCacheRuntime::QueryCacheRuntime(VideoCore::RasterizerInterface* rasterizer, | 1235 | QueryCacheRuntime::QueryCacheRuntime(VideoCore::RasterizerInterface* rasterizer, |
| 1232 | Core::Memory::Memory& cpu_memory_, | 1236 | Tegra::MaxwellDeviceMemoryManager& device_memory_, |
| 1233 | Vulkan::BufferCache& buffer_cache_, const Device& device_, | 1237 | Vulkan::BufferCache& buffer_cache_, const Device& device_, |
| 1234 | const MemoryAllocator& memory_allocator_, | 1238 | const MemoryAllocator& memory_allocator_, |
| 1235 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, | 1239 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, |
| 1236 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, | 1240 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, |
| 1237 | DescriptorPool& descriptor_pool) { | 1241 | DescriptorPool& descriptor_pool) { |
| 1238 | impl = std::make_unique<QueryCacheRuntimeImpl>( | 1242 | impl = std::make_unique<QueryCacheRuntimeImpl>( |
| 1239 | *this, rasterizer, cpu_memory_, buffer_cache_, device_, memory_allocator_, scheduler_, | 1243 | *this, rasterizer, device_memory_, buffer_cache_, device_, memory_allocator_, scheduler_, |
| 1240 | staging_pool_, compute_pass_descriptor_queue, descriptor_pool); | 1244 | staging_pool_, compute_pass_descriptor_queue, descriptor_pool); |
| 1241 | } | 1245 | } |
| 1242 | 1246 | ||
| @@ -1309,7 +1313,7 @@ void QueryCacheRuntime::HostConditionalRenderingCompareValueImpl(VideoCommon::Lo | |||
| 1309 | ResumeHostConditionalRendering(); | 1313 | ResumeHostConditionalRendering(); |
| 1310 | } | 1314 | } |
| 1311 | 1315 | ||
| 1312 | void QueryCacheRuntime::HostConditionalRenderingCompareBCImpl(VAddr address, bool is_equal) { | 1316 | void QueryCacheRuntime::HostConditionalRenderingCompareBCImpl(DAddr address, bool is_equal) { |
| 1313 | VkBuffer to_resolve; | 1317 | VkBuffer to_resolve; |
| 1314 | u32 to_resolve_offset; | 1318 | u32 to_resolve_offset; |
| 1315 | { | 1319 | { |
| @@ -1350,11 +1354,11 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku | |||
| 1350 | return false; | 1354 | return false; |
| 1351 | } | 1355 | } |
| 1352 | 1356 | ||
| 1353 | const auto check_in_bc = [&](VAddr address) { | 1357 | const auto check_in_bc = [&](DAddr address) { |
| 1354 | return impl->buffer_cache.IsRegionGpuModified(address, 8); | 1358 | return impl->buffer_cache.IsRegionGpuModified(address, 8); |
| 1355 | }; | 1359 | }; |
| 1356 | const auto check_value = [&](VAddr address) { | 1360 | const auto check_value = [&](DAddr address) { |
| 1357 | u8* ptr = impl->cpu_memory.GetPointer(address); | 1361 | u8* ptr = impl->device_memory.GetPointer<u8>(address); |
| 1358 | u64 value{}; | 1362 | u64 value{}; |
| 1359 | std::memcpy(&value, ptr, sizeof(value)); | 1363 | std::memcpy(&value, ptr, sizeof(value)); |
| 1360 | return value == 0; | 1364 | return value == 0; |
| @@ -1477,8 +1481,8 @@ void QueryCacheRuntime::SyncValues(std::span<SyncValuesType> values, VkBuffer ba | |||
| 1477 | for (auto& sync_val : values) { | 1481 | for (auto& sync_val : values) { |
| 1478 | total_size += sync_val.size; | 1482 | total_size += sync_val.size; |
| 1479 | bool found = false; | 1483 | bool found = false; |
| 1480 | VAddr base = Common::AlignDown(sync_val.address, Core::Memory::YUZU_PAGESIZE); | 1484 | DAddr base = Common::AlignDown(sync_val.address, Core::Memory::YUZU_PAGESIZE); |
| 1481 | VAddr base_end = base + Core::Memory::YUZU_PAGESIZE; | 1485 | DAddr base_end = base + Core::Memory::YUZU_PAGESIZE; |
| 1482 | for (size_t i = 0; i < impl->little_cache.size(); i++) { | 1486 | for (size_t i = 0; i < impl->little_cache.size(); i++) { |
| 1483 | const auto set_found = [&] { | 1487 | const auto set_found = [&] { |
| 1484 | impl->redirect_cache.push_back(i); | 1488 | impl->redirect_cache.push_back(i); |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.h b/src/video_core/renderer_vulkan/vk_query_cache.h index e9a1ea169..f6151123e 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.h +++ b/src/video_core/renderer_vulkan/vk_query_cache.h | |||
| @@ -27,7 +27,7 @@ struct QueryCacheRuntimeImpl; | |||
| 27 | class QueryCacheRuntime { | 27 | class QueryCacheRuntime { |
| 28 | public: | 28 | public: |
| 29 | explicit QueryCacheRuntime(VideoCore::RasterizerInterface* rasterizer, | 29 | explicit QueryCacheRuntime(VideoCore::RasterizerInterface* rasterizer, |
| 30 | Core::Memory::Memory& cpu_memory_, | 30 | Tegra::MaxwellDeviceMemoryManager& device_memory_, |
| 31 | Vulkan::BufferCache& buffer_cache_, const Device& device_, | 31 | Vulkan::BufferCache& buffer_cache_, const Device& device_, |
| 32 | const MemoryAllocator& memory_allocator_, Scheduler& scheduler_, | 32 | const MemoryAllocator& memory_allocator_, Scheduler& scheduler_, |
| 33 | StagingBufferPool& staging_pool_, | 33 | StagingBufferPool& staging_pool_, |
| @@ -61,7 +61,7 @@ public: | |||
| 61 | 61 | ||
| 62 | private: | 62 | private: |
| 63 | void HostConditionalRenderingCompareValueImpl(VideoCommon::LookupData object, bool is_equal); | 63 | void HostConditionalRenderingCompareValueImpl(VideoCommon::LookupData object, bool is_equal); |
| 64 | void HostConditionalRenderingCompareBCImpl(VAddr address, bool is_equal); | 64 | void HostConditionalRenderingCompareBCImpl(DAddr address, bool is_equal); |
| 65 | friend struct QueryCacheRuntimeImpl; | 65 | friend struct QueryCacheRuntimeImpl; |
| 66 | std::unique_ptr<QueryCacheRuntimeImpl> impl; | 66 | std::unique_ptr<QueryCacheRuntimeImpl> impl; |
| 67 | }; | 67 | }; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 241fc34be..efcc349a0 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "video_core/engines/draw_manager.h" | 18 | #include "video_core/engines/draw_manager.h" |
| 19 | #include "video_core/engines/kepler_compute.h" | 19 | #include "video_core/engines/kepler_compute.h" |
| 20 | #include "video_core/engines/maxwell_3d.h" | 20 | #include "video_core/engines/maxwell_3d.h" |
| 21 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 21 | #include "video_core/renderer_vulkan/blit_image.h" | 22 | #include "video_core/renderer_vulkan/blit_image.h" |
| 22 | #include "video_core/renderer_vulkan/fixed_pipeline_state.h" | 23 | #include "video_core/renderer_vulkan/fixed_pipeline_state.h" |
| 23 | #include "video_core/renderer_vulkan/maxwell_to_vk.h" | 24 | #include "video_core/renderer_vulkan/maxwell_to_vk.h" |
| @@ -37,6 +38,7 @@ | |||
| 37 | #include "video_core/vulkan_common/vulkan_device.h" | 38 | #include "video_core/vulkan_common/vulkan_device.h" |
| 38 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 39 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 39 | 40 | ||
| 41 | |||
| 40 | namespace Vulkan { | 42 | namespace Vulkan { |
| 41 | 43 | ||
| 42 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; | 44 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; |
| @@ -163,10 +165,11 @@ DrawParams MakeDrawParams(const MaxwellDrawState& draw_state, u32 num_instances, | |||
| 163 | } // Anonymous namespace | 165 | } // Anonymous namespace |
| 164 | 166 | ||
| 165 | RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, | 167 | RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, |
| 166 | Core::Memory::Memory& cpu_memory_, ScreenInfo& screen_info_, | 168 | Tegra::MaxwellDeviceMemoryManager& device_memory_, |
| 167 | const Device& device_, MemoryAllocator& memory_allocator_, | 169 | ScreenInfo& screen_info_, const Device& device_, |
| 168 | StateTracker& state_tracker_, Scheduler& scheduler_) | 170 | MemoryAllocator& memory_allocator_, StateTracker& state_tracker_, |
| 169 | : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, screen_info{screen_info_}, device{device_}, | 171 | Scheduler& scheduler_) |
| 172 | : gpu{gpu_}, device_memory{device_memory_}, screen_info{screen_info_}, device{device_}, | ||
| 170 | memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, | 173 | memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, |
| 171 | staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), | 174 | staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), |
| 172 | guest_descriptor_queue(device, scheduler), compute_pass_descriptor_queue(device, scheduler), | 175 | guest_descriptor_queue(device, scheduler), compute_pass_descriptor_queue(device, scheduler), |
| @@ -174,14 +177,14 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra | |||
| 174 | texture_cache_runtime{ | 177 | texture_cache_runtime{ |
| 175 | device, scheduler, memory_allocator, staging_pool, | 178 | device, scheduler, memory_allocator, staging_pool, |
| 176 | blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, | 179 | blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, |
| 177 | texture_cache(texture_cache_runtime, *this), | 180 | texture_cache(texture_cache_runtime, device_memory), |
| 178 | buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, | 181 | buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, |
| 179 | guest_descriptor_queue, compute_pass_descriptor_queue, descriptor_pool), | 182 | guest_descriptor_queue, compute_pass_descriptor_queue, descriptor_pool), |
| 180 | buffer_cache(*this, cpu_memory_, buffer_cache_runtime), | 183 | buffer_cache(device_memory, buffer_cache_runtime), |
| 181 | query_cache_runtime(this, cpu_memory_, buffer_cache, device, memory_allocator, scheduler, | 184 | query_cache_runtime(this, device_memory, buffer_cache, device, memory_allocator, scheduler, |
| 182 | staging_pool, compute_pass_descriptor_queue, descriptor_pool), | 185 | staging_pool, compute_pass_descriptor_queue, descriptor_pool), |
| 183 | query_cache(gpu, *this, cpu_memory_, query_cache_runtime), | 186 | query_cache(gpu, *this, device_memory, query_cache_runtime), |
| 184 | pipeline_cache(*this, device, scheduler, descriptor_pool, guest_descriptor_queue, | 187 | pipeline_cache(device_memory, device, scheduler, descriptor_pool, guest_descriptor_queue, |
| 185 | render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), | 188 | render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), |
| 186 | accelerate_dma(buffer_cache, texture_cache, scheduler), | 189 | accelerate_dma(buffer_cache, texture_cache, scheduler), |
| 187 | fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler), | 190 | fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache, device, scheduler), |
| @@ -508,7 +511,7 @@ void Vulkan::RasterizerVulkan::DisableGraphicsUniformBuffer(size_t stage, u32 in | |||
| 508 | 511 | ||
| 509 | void RasterizerVulkan::FlushAll() {} | 512 | void RasterizerVulkan::FlushAll() {} |
| 510 | 513 | ||
| 511 | void RasterizerVulkan::FlushRegion(VAddr addr, u64 size, VideoCommon::CacheType which) { | 514 | void RasterizerVulkan::FlushRegion(DAddr addr, u64 size, VideoCommon::CacheType which) { |
| 512 | if (addr == 0 || size == 0) { | 515 | if (addr == 0 || size == 0) { |
| 513 | return; | 516 | return; |
| 514 | } | 517 | } |
| @@ -525,7 +528,7 @@ void RasterizerVulkan::FlushRegion(VAddr addr, u64 size, VideoCommon::CacheType | |||
| 525 | } | 528 | } |
| 526 | } | 529 | } |
| 527 | 530 | ||
| 528 | bool RasterizerVulkan::MustFlushRegion(VAddr addr, u64 size, VideoCommon::CacheType which) { | 531 | bool RasterizerVulkan::MustFlushRegion(DAddr addr, u64 size, VideoCommon::CacheType which) { |
| 529 | if ((True(which & VideoCommon::CacheType::BufferCache))) { | 532 | if ((True(which & VideoCommon::CacheType::BufferCache))) { |
| 530 | std::scoped_lock lock{buffer_cache.mutex}; | 533 | std::scoped_lock lock{buffer_cache.mutex}; |
| 531 | if (buffer_cache.IsRegionGpuModified(addr, size)) { | 534 | if (buffer_cache.IsRegionGpuModified(addr, size)) { |
| @@ -542,7 +545,7 @@ bool RasterizerVulkan::MustFlushRegion(VAddr addr, u64 size, VideoCommon::CacheT | |||
| 542 | return false; | 545 | return false; |
| 543 | } | 546 | } |
| 544 | 547 | ||
| 545 | VideoCore::RasterizerDownloadArea RasterizerVulkan::GetFlushArea(VAddr addr, u64 size) { | 548 | VideoCore::RasterizerDownloadArea RasterizerVulkan::GetFlushArea(DAddr addr, u64 size) { |
| 546 | { | 549 | { |
| 547 | std::scoped_lock lock{texture_cache.mutex}; | 550 | std::scoped_lock lock{texture_cache.mutex}; |
| 548 | auto area = texture_cache.GetFlushArea(addr, size); | 551 | auto area = texture_cache.GetFlushArea(addr, size); |
| @@ -558,7 +561,7 @@ VideoCore::RasterizerDownloadArea RasterizerVulkan::GetFlushArea(VAddr addr, u64 | |||
| 558 | return new_area; | 561 | return new_area; |
| 559 | } | 562 | } |
| 560 | 563 | ||
| 561 | void RasterizerVulkan::InvalidateRegion(VAddr addr, u64 size, VideoCommon::CacheType which) { | 564 | void RasterizerVulkan::InvalidateRegion(DAddr addr, u64 size, VideoCommon::CacheType which) { |
| 562 | if (addr == 0 || size == 0) { | 565 | if (addr == 0 || size == 0) { |
| 563 | return; | 566 | return; |
| 564 | } | 567 | } |
| @@ -578,7 +581,7 @@ void RasterizerVulkan::InvalidateRegion(VAddr addr, u64 size, VideoCommon::Cache | |||
| 578 | } | 581 | } |
| 579 | } | 582 | } |
| 580 | 583 | ||
| 581 | void RasterizerVulkan::InnerInvalidation(std::span<const std::pair<VAddr, std::size_t>> sequences) { | 584 | void RasterizerVulkan::InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) { |
| 582 | { | 585 | { |
| 583 | std::scoped_lock lock{texture_cache.mutex}; | 586 | std::scoped_lock lock{texture_cache.mutex}; |
| 584 | for (const auto& [addr, size] : sequences) { | 587 | for (const auto& [addr, size] : sequences) { |
| @@ -599,7 +602,8 @@ void RasterizerVulkan::InnerInvalidation(std::span<const std::pair<VAddr, std::s | |||
| 599 | } | 602 | } |
| 600 | } | 603 | } |
| 601 | 604 | ||
| 602 | bool RasterizerVulkan::OnCPUWrite(VAddr addr, u64 size) { | 605 | bool RasterizerVulkan::OnCPUWrite(PAddr p_addr, u64 size) { |
| 606 | const DAddr addr = device_memory.GetAddressFromPAddr(p_addr); | ||
| 603 | if (addr == 0 || size == 0) { | 607 | if (addr == 0 || size == 0) { |
| 604 | return false; | 608 | return false; |
| 605 | } | 609 | } |
| @@ -620,7 +624,8 @@ bool RasterizerVulkan::OnCPUWrite(VAddr addr, u64 size) { | |||
| 620 | return false; | 624 | return false; |
| 621 | } | 625 | } |
| 622 | 626 | ||
| 623 | void RasterizerVulkan::OnCacheInvalidation(VAddr addr, u64 size) { | 627 | void RasterizerVulkan::OnCacheInvalidation(PAddr p_addr, u64 size) { |
| 628 | const DAddr addr = device_memory.GetAddressFromPAddr(p_addr); | ||
| 624 | if (addr == 0 || size == 0) { | 629 | if (addr == 0 || size == 0) { |
| 625 | return; | 630 | return; |
| 626 | } | 631 | } |
| @@ -640,7 +645,7 @@ void RasterizerVulkan::InvalidateGPUCache() { | |||
| 640 | gpu.InvalidateGPUCache(); | 645 | gpu.InvalidateGPUCache(); |
| 641 | } | 646 | } |
| 642 | 647 | ||
| 643 | void RasterizerVulkan::UnmapMemory(VAddr addr, u64 size) { | 648 | void RasterizerVulkan::UnmapMemory(DAddr addr, u64 size) { |
| 644 | { | 649 | { |
| 645 | std::scoped_lock lock{texture_cache.mutex}; | 650 | std::scoped_lock lock{texture_cache.mutex}; |
| 646 | texture_cache.UnmapMemory(addr, size); | 651 | texture_cache.UnmapMemory(addr, size); |
| @@ -679,7 +684,7 @@ void RasterizerVulkan::ReleaseFences(bool force) { | |||
| 679 | fence_manager.WaitPendingFences(force); | 684 | fence_manager.WaitPendingFences(force); |
| 680 | } | 685 | } |
| 681 | 686 | ||
| 682 | void RasterizerVulkan::FlushAndInvalidateRegion(VAddr addr, u64 size, | 687 | void RasterizerVulkan::FlushAndInvalidateRegion(DAddr addr, u64 size, |
| 683 | VideoCommon::CacheType which) { | 688 | VideoCommon::CacheType which) { |
| 684 | if (Settings::IsGPULevelExtreme()) { | 689 | if (Settings::IsGPULevelExtreme()) { |
| 685 | FlushRegion(addr, size, which); | 690 | FlushRegion(addr, size, which); |
| @@ -782,7 +787,7 @@ void RasterizerVulkan::AccelerateInlineToMemory(GPUVAddr address, size_t copy_si | |||
| 782 | } | 787 | } |
| 783 | 788 | ||
| 784 | bool RasterizerVulkan::AccelerateDisplay(const Tegra::FramebufferConfig& config, | 789 | bool RasterizerVulkan::AccelerateDisplay(const Tegra::FramebufferConfig& config, |
| 785 | VAddr framebuffer_addr, u32 pixel_stride) { | 790 | DAddr framebuffer_addr, u32 pixel_stride) { |
| 786 | if (!framebuffer_addr) { | 791 | if (!framebuffer_addr) { |
| 787 | return false; | 792 | return false; |
| 788 | } | 793 | } |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index ad069556c..d593f35df 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "video_core/control/channel_state_cache.h" | 13 | #include "video_core/control/channel_state_cache.h" |
| 14 | #include "video_core/engines/maxwell_dma.h" | 14 | #include "video_core/engines/maxwell_dma.h" |
| 15 | #include "video_core/rasterizer_accelerated.h" | ||
| 16 | #include "video_core/rasterizer_interface.h" | 15 | #include "video_core/rasterizer_interface.h" |
| 17 | #include "video_core/renderer_vulkan/blit_image.h" | 16 | #include "video_core/renderer_vulkan/blit_image.h" |
| 18 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" | 17 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" |
| @@ -25,6 +24,7 @@ | |||
| 25 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" | 24 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" |
| 26 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" | 25 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" |
| 27 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 26 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 27 | #include "video_core/host1x/gpu_device_memory_manager.h" | ||
| 28 | 28 | ||
| 29 | namespace Core { | 29 | namespace Core { |
| 30 | class System; | 30 | class System; |
| @@ -34,10 +34,14 @@ namespace Core::Frontend { | |||
| 34 | class EmuWindow; | 34 | class EmuWindow; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | namespace Tegra::Engines { | 37 | namespace Tegra { |
| 38 | |||
| 39 | namespace Engines { | ||
| 38 | class Maxwell3D; | 40 | class Maxwell3D; |
| 39 | } | 41 | } |
| 40 | 42 | ||
| 43 | } // namespace Tegra | ||
| 44 | |||
| 41 | namespace Vulkan { | 45 | namespace Vulkan { |
| 42 | 46 | ||
| 43 | struct ScreenInfo; | 47 | struct ScreenInfo; |
| @@ -70,13 +74,14 @@ private: | |||
| 70 | Scheduler& scheduler; | 74 | Scheduler& scheduler; |
| 71 | }; | 75 | }; |
| 72 | 76 | ||
| 73 | class RasterizerVulkan final : public VideoCore::RasterizerAccelerated, | 77 | class RasterizerVulkan final : public VideoCore::RasterizerInterface, |
| 74 | protected VideoCommon::ChannelSetupCaches<VideoCommon::ChannelInfo> { | 78 | protected VideoCommon::ChannelSetupCaches<VideoCommon::ChannelInfo> { |
| 75 | public: | 79 | public: |
| 76 | explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, | 80 | explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, |
| 77 | Core::Memory::Memory& cpu_memory_, ScreenInfo& screen_info_, | 81 | Tegra::MaxwellDeviceMemoryManager& device_memory_, |
| 78 | const Device& device_, MemoryAllocator& memory_allocator_, | 82 | ScreenInfo& screen_info_, const Device& device_, |
| 79 | StateTracker& state_tracker_, Scheduler& scheduler_); | 83 | MemoryAllocator& memory_allocator_, StateTracker& state_tracker_, |
| 84 | Scheduler& scheduler_); | ||
| 80 | ~RasterizerVulkan() override; | 85 | ~RasterizerVulkan() override; |
| 81 | 86 | ||
| 82 | void Draw(bool is_indexed, u32 instance_count) override; | 87 | void Draw(bool is_indexed, u32 instance_count) override; |
| @@ -90,18 +95,18 @@ public: | |||
| 90 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; | 95 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; |
| 91 | void DisableGraphicsUniformBuffer(size_t stage, u32 index) override; | 96 | void DisableGraphicsUniformBuffer(size_t stage, u32 index) override; |
| 92 | void FlushAll() override; | 97 | void FlushAll() override; |
| 93 | void FlushRegion(VAddr addr, u64 size, | 98 | void FlushRegion(DAddr addr, u64 size, |
| 94 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; | 99 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; |
| 95 | bool MustFlushRegion(VAddr addr, u64 size, | 100 | bool MustFlushRegion(DAddr addr, u64 size, |
| 96 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; | 101 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; |
| 97 | VideoCore::RasterizerDownloadArea GetFlushArea(VAddr addr, u64 size) override; | 102 | VideoCore::RasterizerDownloadArea GetFlushArea(DAddr addr, u64 size) override; |
| 98 | void InvalidateRegion(VAddr addr, u64 size, | 103 | void InvalidateRegion(DAddr addr, u64 size, |
| 99 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; | 104 | VideoCommon::CacheType which = VideoCommon::CacheType::All) override; |
| 100 | void InnerInvalidation(std::span<const std::pair<VAddr, std::size_t>> sequences) override; | 105 | void InnerInvalidation(std::span<const std::pair<DAddr, std::size_t>> sequences) override; |
| 101 | void OnCacheInvalidation(VAddr addr, u64 size) override; | 106 | void OnCacheInvalidation(DAddr addr, u64 size) override; |
| 102 | bool OnCPUWrite(VAddr addr, u64 size) override; | 107 | bool OnCPUWrite(DAddr addr, u64 size) override; |
| 103 | void InvalidateGPUCache() override; | 108 | void InvalidateGPUCache() override; |
| 104 | void UnmapMemory(VAddr addr, u64 size) override; | 109 | void UnmapMemory(DAddr addr, u64 size) override; |
| 105 | void ModifyGPUMemory(size_t as_id, GPUVAddr addr, u64 size) override; | 110 | void ModifyGPUMemory(size_t as_id, GPUVAddr addr, u64 size) override; |
| 106 | void SignalFence(std::function<void()>&& func) override; | 111 | void SignalFence(std::function<void()>&& func) override; |
| 107 | void SyncOperation(std::function<void()>&& func) override; | 112 | void SyncOperation(std::function<void()>&& func) override; |
| @@ -109,7 +114,7 @@ public: | |||
| 109 | void SignalReference() override; | 114 | void SignalReference() override; |
| 110 | void ReleaseFences(bool force = true) override; | 115 | void ReleaseFences(bool force = true) override; |
| 111 | void FlushAndInvalidateRegion( | 116 | void FlushAndInvalidateRegion( |
| 112 | VAddr addr, u64 size, VideoCommon::CacheType which = VideoCommon::CacheType::All) override; | 117 | DAddr addr, u64 size, VideoCommon::CacheType which = VideoCommon::CacheType::All) override; |
| 113 | void WaitForIdle() override; | 118 | void WaitForIdle() override; |
| 114 | void FragmentBarrier() override; | 119 | void FragmentBarrier() override; |
| 115 | void TiledCacheBarrier() override; | 120 | void TiledCacheBarrier() override; |
| @@ -122,7 +127,7 @@ public: | |||
| 122 | Tegra::Engines::AccelerateDMAInterface& AccessAccelerateDMA() override; | 127 | Tegra::Engines::AccelerateDMAInterface& AccessAccelerateDMA() override; |
| 123 | void AccelerateInlineToMemory(GPUVAddr address, size_t copy_size, | 128 | void AccelerateInlineToMemory(GPUVAddr address, size_t copy_size, |
| 124 | std::span<const u8> memory) override; | 129 | std::span<const u8> memory) override; |
| 125 | bool AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr, | 130 | bool AccelerateDisplay(const Tegra::FramebufferConfig& config, DAddr framebuffer_addr, |
| 126 | u32 pixel_stride) override; | 131 | u32 pixel_stride) override; |
| 127 | void LoadDiskResources(u64 title_id, std::stop_token stop_loading, | 132 | void LoadDiskResources(u64 title_id, std::stop_token stop_loading, |
| 128 | const VideoCore::DiskResourceLoadCallback& callback) override; | 133 | const VideoCore::DiskResourceLoadCallback& callback) override; |
| @@ -176,6 +181,7 @@ private: | |||
| 176 | void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs); | 181 | void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs); |
| 177 | 182 | ||
| 178 | Tegra::GPU& gpu; | 183 | Tegra::GPU& gpu; |
| 184 | Tegra::MaxwellDeviceMemoryManager& device_memory; | ||
| 179 | 185 | ||
| 180 | ScreenInfo& screen_info; | 186 | ScreenInfo& screen_info; |
| 181 | const Device& device; | 187 | const Device& device; |