diff options
| author | 2022-02-09 15:39:40 +0100 | |
|---|---|---|
| committer | 2023-01-01 16:43:57 -0500 | |
| commit | 0f89828073a541eaa2cfd985483f839bd2f97b74 (patch) | |
| tree | 3e26c71678e17ca97ec744a884f5ecb9ae2b6c5e /src/video_core/engines | |
| parent | MacroHLE: Add MultidrawIndirect HLE Macro. (diff) | |
| download | yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.gz yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.tar.xz yuzu-0f89828073a541eaa2cfd985483f839bd2f97b74.zip | |
MacroHLE: Implement DrawIndexedIndirect & DrawArraysIndirect.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/draw_manager.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/draw_manager.h | 5 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 12 |
4 files changed, 18 insertions, 5 deletions
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 4fa77b684..c60f32aad 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp | |||
| @@ -216,7 +216,7 @@ void DrawManager::ProcessDrawIndirect(bool draw_indexed) { | |||
| 216 | UpdateTopology(); | 216 | UpdateTopology(); |
| 217 | 217 | ||
| 218 | if (maxwell3d->ShouldExecute()) { | 218 | if (maxwell3d->ShouldExecute()) { |
| 219 | maxwell3d->rasterizer->DrawIndirect(draw_indexed); | 219 | maxwell3d->rasterizer->DrawIndirect(); |
| 220 | } | 220 | } |
| 221 | } | 221 | } |
| 222 | } // namespace Tegra::Engines | 222 | } // namespace Tegra::Engines |
diff --git a/src/video_core/engines/draw_manager.h b/src/video_core/engines/draw_manager.h index 0cdb37f83..437990162 100644 --- a/src/video_core/engines/draw_manager.h +++ b/src/video_core/engines/draw_manager.h | |||
| @@ -33,7 +33,10 @@ public: | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | struct IndirectParams { | 35 | struct IndirectParams { |
| 36 | GPUVAddr start_address; | 36 | bool is_indexed; |
| 37 | bool include_count; | ||
| 38 | GPUVAddr count_start_address; | ||
| 39 | GPUVAddr indirect_start_address; | ||
| 37 | size_t buffer_size; | 40 | size_t buffer_size; |
| 38 | size_t max_draw_counts; | 41 | size_t max_draw_counts; |
| 39 | size_t stride; | 42 | size_t stride; |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 9b182b653..cd6274a9b 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -130,11 +130,15 @@ void Maxwell3D::ProcessMacro(u32 method, const u32* base_start, u32 amount, bool | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | macro_params.insert(macro_params.end(), base_start, base_start + amount); | 132 | macro_params.insert(macro_params.end(), base_start, base_start + amount); |
| 133 | for (size_t i = 0; i < amount; i++) { | ||
| 134 | macro_addresses.push_back(current_dma_segment + i * sizeof(u32)); | ||
| 135 | } | ||
| 133 | 136 | ||
| 134 | // Call the macro when there are no more parameters in the command buffer | 137 | // Call the macro when there are no more parameters in the command buffer |
| 135 | if (is_last_call) { | 138 | if (is_last_call) { |
| 136 | CallMacroMethod(executing_macro, macro_params); | 139 | CallMacroMethod(executing_macro, macro_params); |
| 137 | macro_params.clear(); | 140 | macro_params.clear(); |
| 141 | macro_addresses.clear(); | ||
| 138 | } | 142 | } |
| 139 | } | 143 | } |
| 140 | 144 | ||
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 22b904319..ac5e87563 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -3066,6 +3066,15 @@ public: | |||
| 3066 | 3066 | ||
| 3067 | std::unique_ptr<DrawManager> draw_manager; | 3067 | std::unique_ptr<DrawManager> draw_manager; |
| 3068 | friend class DrawManager; | 3068 | friend class DrawManager; |
| 3069 | |||
| 3070 | std::vector<u8> inline_index_draw_indexes; | ||
| 3071 | std::vector<GPUVAddr> macro_addresses; | ||
| 3072 | |||
| 3073 | Core::System& system; | ||
| 3074 | MemoryManager& memory_manager; | ||
| 3075 | |||
| 3076 | /// Handles a write to the CLEAR_BUFFERS register. | ||
| 3077 | void ProcessClearBuffers(u32 layer_count); | ||
| 3069 | 3078 | ||
| 3070 | private: | 3079 | private: |
| 3071 | void InitializeRegisterDefaults(); | 3080 | void InitializeRegisterDefaults(); |
| @@ -3126,9 +3135,6 @@ private: | |||
| 3126 | /// Returns a query's value or an empty object if the value will be deferred through a cache. | 3135 | /// Returns a query's value or an empty object if the value will be deferred through a cache. |
| 3127 | std::optional<u64> GetQueryResult(); | 3136 | std::optional<u64> GetQueryResult(); |
| 3128 | 3137 | ||
| 3129 | Core::System& system; | ||
| 3130 | MemoryManager& memory_manager; | ||
| 3131 | |||
| 3132 | VideoCore::RasterizerInterface* rasterizer = nullptr; | 3138 | VideoCore::RasterizerInterface* rasterizer = nullptr; |
| 3133 | 3139 | ||
| 3134 | /// Start offsets of each macro in macro_memory | 3140 | /// Start offsets of each macro in macro_memory |