diff options
| author | 2016-04-29 11:23:40 -0400 | |
|---|---|---|
| committer | 2016-05-08 23:03:32 -0400 | |
| commit | 1357724cd946f3a9f31dbe3ace55a9588f3c6f2f (patch) | |
| tree | 7cbe25e63e854c1b412c34bd5ae3a449ecb4a56c | |
| parent | vertex_loader: initialize_num_total_attributes. (diff) | |
| download | yuzu-1357724cd946f3a9f31dbe3ace55a9588f3c6f2f.tar.gz yuzu-1357724cd946f3a9f31dbe3ace55a9588f3c6f2f.tar.xz yuzu-1357724cd946f3a9f31dbe3ace55a9588f3c6f2f.zip | |
vertex_loader: Add constructors to facilitate immediate and two-step initialization
| -rw-r--r-- | src/video_core/command_processor.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/vertex_loader.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index dd1379503..941c5af9f 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -199,9 +199,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 199 | 199 | ||
| 200 | // Processes information about internal vertex attributes to figure out how a vertex is loaded. | 200 | // Processes information about internal vertex attributes to figure out how a vertex is loaded. |
| 201 | // Later, these can be compiled and cached. | 201 | // Later, these can be compiled and cached. |
| 202 | VertexLoader loader; | ||
| 203 | const u32 base_address = regs.vertex_attributes.GetPhysicalBaseAddress(); | 202 | const u32 base_address = regs.vertex_attributes.GetPhysicalBaseAddress(); |
| 204 | loader.Setup(regs); | 203 | VertexLoader loader(regs); |
| 205 | 204 | ||
| 206 | // Load vertices | 205 | // Load vertices |
| 207 | bool is_indexed = (id == PICA_REG_INDEX(trigger_draw_indexed)); | 206 | bool is_indexed = (id == PICA_REG_INDEX(trigger_draw_indexed)); |
diff --git a/src/video_core/vertex_loader.h b/src/video_core/vertex_loader.h index 4ed8cd3fd..2a97b97c8 100644 --- a/src/video_core/vertex_loader.h +++ b/src/video_core/vertex_loader.h | |||
| @@ -17,6 +17,11 @@ class InputVertex; | |||
| 17 | 17 | ||
| 18 | class VertexLoader { | 18 | class VertexLoader { |
| 19 | public: | 19 | public: |
| 20 | VertexLoader() = default; | ||
| 21 | explicit VertexLoader(const Pica::Regs& regs) { | ||
| 22 | Setup(regs); | ||
| 23 | } | ||
| 24 | |||
| 20 | void Setup(const Pica::Regs& regs); | 25 | void Setup(const Pica::Regs& regs); |
| 21 | void LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses); | 26 | void LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses); |
| 22 | 27 | ||