summaryrefslogtreecommitdiffstats
path: root/src/video_core/dma_pusher.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-30 05:13:04 +0100
committerbunnei <bunneidev@gmail.com>2020-11-01 09:52:38 +0100
commitc64545d07ae57816bc658ca7c45559d0b0d49f89 (patch)
tree37642d8f8e2d870637c64d7ca89fa0098afa54fb /src/video_core/dma_pusher.h
parentservice: hle: nvflinger: Fix potential shutdown crash when GPU is destroyed. (diff)
downloadyuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.gz
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.bz2
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.lz
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.xz
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.tar.zst
yuzu-c64545d07ae57816bc658ca7c45559d0b0d49f89.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/dma_pusher.h21
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 {
static_assert(std::is_standard_layout_v<CommandHeader>, "CommandHeader is not standard layout");
static_assert(sizeof(CommandHeader) == sizeof(u32), "CommandHeader has incorrect size!");
+static constexpr CommandHeader BuildCommandHeader(BufferMethods method, u32 arg_count,
+ SubmissionMode mode) {
+ CommandHeader result{};
+ result.method.Assign(static_cast<u32>(method));
+ result.arg_count.Assign(arg_count);
+ result.mode.Assign(mode);
+ return result;
+}
+
class GPU;
-using CommandList = std::vector<Tegra::CommandListHeader>;
+struct CommandList final {
+ CommandList() = default;
+ explicit CommandList(std::size_t size) : command_lists(size) {}
+ explicit CommandList(std::vector<Tegra::CommandHeader>&& prefetch_command_list)
+ : prefetch_command_list{std::move(prefetch_command_list)} {}
+
+ std::vector<Tegra::CommandListHeader> command_lists;
+ std::vector<Tegra::CommandHeader> prefetch_command_list;
+};
/**
* 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>;
* See https://envytools.readthedocs.io/en/latest/hw/fifo/dma-pusher.html#fifo-dma-pusher for
* details on this implementation.
*/
-class DmaPusher {
+class DmaPusher final {
public:
explicit DmaPusher(Core::System& system, GPU& gpu);
~DmaPusher();