diff options
| author | 2020-10-29 21:13:04 -0700 | |
|---|---|---|
| committer | 2020-11-01 01:52:38 -0700 | |
| commit | c64545d07ae57816bc658ca7c45559d0b0d49f89 (patch) | |
| tree | 37642d8f8e2d870637c64d7ca89fa0098afa54fb /src/video_core/dma_pusher.h | |
| parent | service: hle: nvflinger: Fix potential shutdown crash when GPU is destroyed. (diff) | |
| download | yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.gz yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.xz yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.zip | |
video_core: dma_pusher: Add support for prefetched command lists.
Diffstat (limited to 'src/video_core/dma_pusher.h')
| -rw-r--r-- | src/video_core/dma_pusher.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/video_core/dma_pusher.h b/src/video_core/dma_pusher.h index 2026b7857..99b30ca0d 100644 --- a/src/video_core/dma_pusher.h +++ b/src/video_core/dma_pusher.h | |||
| @@ -74,9 +74,26 @@ union CommandHeader { | |||
| 74 | static_assert(std::is_standard_layout_v<CommandHeader>, "CommandHeader is not standard layout"); | 74 | static_assert(std::is_standard_layout_v<CommandHeader>, "CommandHeader is not standard layout"); |
| 75 | static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!"); | 75 | static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!"); |
| 76 | 76 | ||
| 77 | static constexpr CommandHeader BuildCommandHeader(BufferMethods method, u32 arg_count, | ||
| 78 | SubmissionMode mode) { | ||
| 79 | CommandHeader result{}; | ||
| 80 | result.method.Assign(static_cast<u32>(method)); | ||
| 81 | result.arg_count.Assign(arg_count); | ||
| 82 | result.mode.Assign(mode); | ||
| 83 | return result; | ||
| 84 | } | ||
| 85 | |||
| 77 | class GPU; | 86 | class GPU; |
| 78 | 87 | ||
| 79 | using CommandList = std::vector<Tegra::CommandListHeader>; | 88 | struct CommandList final { |
| 89 | CommandList() = default; | ||
| 90 | explicit CommandList(std::size_t size) : command_lists(size) {} | ||
| 91 | explicit CommandList(std::vector<Tegra::CommandHeader>&& prefetch_command_list) | ||
| 92 | : prefetch_command_list{std::move(prefetch_command_list)} {} | ||
| 93 | |||
| 94 | std::vector<Tegra::CommandListHeader> command_lists; | ||
| 95 | std::vector<Tegra::CommandHeader> prefetch_command_list; | ||
| 96 | }; | ||
| 80 | 97 | ||
| 81 | /** | 98 | /** |
| 82 | * The DmaPusher class implements DMA submission to FIFOs, providing an area of memory that the | 99 | * The DmaPusher class implements DMA submission to FIFOs, providing an area of memory that the |
| @@ -85,7 +102,7 @@ using CommandList = std::vector<Tegra::CommandListHeader>; | |||
| 85 | * See https://envytools.readthedocs.io/en/latest/hw/fifo/dma-pusher.html#fifo-dma-pusher for | 102 | * See https://envytools.readthedocs.io/en/latest/hw/fifo/dma-pusher.html#fifo-dma-pusher for |
| 86 | * details on this implementation. | 103 | * details on this implementation. |
| 87 | */ | 104 | */ |
| 88 | class DmaPusher { | 105 | class DmaPusher final { |
| 89 | public: | 106 | public: |
| 90 | explicit DmaPusher(Core::System& system, GPU& gpu); | 107 | explicit DmaPusher(Core::System& system, GPU& gpu); |
| 91 | ~DmaPusher(); | 108 | ~DmaPusher(); |