summaryrefslogtreecommitdiff
path: root/src/video_core/dma_pusher.h
diff options
context:
space:
mode:
authorGravatar ameerj2022-12-07 00:45:06 -0500
committerGravatar ameerj2022-12-19 18:08:04 -0500
commit61e4f2d931449e60d8d720862997ac565fce6634 (patch)
tree9bb7071fdf11dbe8a86d25c7f819c66d5dc127f4 /src/video_core/dma_pusher.h
parentbuffer_cache: Use Common::ScratchBuffer for ImmediateBuffer usage (diff)
downloadyuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.gz
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.tar.xz
yuzu-61e4f2d931449e60d8d720862997ac565fce6634.zip
dma_pusher: Rework command_headers usage
Uses ScratchBuffer and avoids overwriting the command_headers buffer with the prefetch_command_list
Diffstat (limited to 'src/video_core/dma_pusher.h')
-rw-r--r--src/video_core/dma_pusher.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/dma_pusher.h b/src/video_core/dma_pusher.h
index 938f0f11c..6f00de937 100644
--- a/src/video_core/dma_pusher.h
+++ b/src/video_core/dma_pusher.h
@@ -4,11 +4,13 @@
4#pragma once 4#pragma once
5 5
6#include <array> 6#include <array>
7#include <span>
7#include <vector> 8#include <vector>
8#include <queue> 9#include <queue>
9 10
10#include "common/bit_field.h" 11#include "common/bit_field.h"
11#include "common/common_types.h" 12#include "common/common_types.h"
13#include "common/scratch_buffer.h"
12#include "video_core/engines/engine_interface.h" 14#include "video_core/engines/engine_interface.h"
13#include "video_core/engines/puller.h" 15#include "video_core/engines/puller.h"
14 16
@@ -136,13 +138,15 @@ private:
136 static constexpr u32 non_puller_methods = 0x40; 138 static constexpr u32 non_puller_methods = 0x40;
137 static constexpr u32 max_subchannels = 8; 139 static constexpr u32 max_subchannels = 8;
138 bool Step(); 140 bool Step();
141 void ProcessCommands(std::span<const CommandHeader> commands);
139 142
140 void SetState(const CommandHeader& command_header); 143 void SetState(const CommandHeader& command_header);
141 144
142 void CallMethod(u32 argument) const; 145 void CallMethod(u32 argument) const;
143 void CallMultiMethod(const u32* base_start, u32 num_methods) const; 146 void CallMultiMethod(const u32* base_start, u32 num_methods) const;
144 147
145 std::vector<CommandHeader> command_headers; ///< Buffer for list of commands fetched at once 148 Common::ScratchBuffer<CommandHeader>
149 command_headers; ///< Buffer for list of commands fetched at once
146 150
147 std::queue<CommandList> dma_pushbuffer; ///< Queue of command lists to be processed 151 std::queue<CommandList> dma_pushbuffer; ///< Queue of command lists to be processed
148 std::size_t dma_pushbuffer_subindex{}; ///< Index within a command list within the pushbuffer 152 std::size_t dma_pushbuffer_subindex{}; ///< Index within a command list within the pushbuffer
@@ -159,7 +163,7 @@ private:
159 DmaState dma_state{}; 163 DmaState dma_state{};
160 bool dma_increment_once{}; 164 bool dma_increment_once{};
161 165
162 bool ib_enable{true}; ///< IB mode enabled 166 const bool ib_enable{true}; ///< IB mode enabled
163 167
164 std::array<Engines::EngineInterface*, max_subchannels> subchannels{}; 168 std::array<Engines::EngineInterface*, max_subchannels> subchannels{};
165 169