diff options
| author | 2016-05-23 21:13:34 -0400 | |
|---|---|---|
| committer | 2016-05-23 21:13:34 -0400 | |
| commit | a316fbb15aedbc23b58474aaca95569788933774 (patch) | |
| tree | 19ead61153a7aaaed3e03a0a7244a6b1cc9bcbd7 /src/video_core/vertex_loader.cpp | |
| parent | Merge pull request #1837 from wwylele/sync-trap (diff) | |
| parent | vertex_loader: Correct forward declaration of InputVertex (diff) | |
| download | yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.gz yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.xz yuzu-a316fbb15aedbc23b58474aaca95569788933774.zip | |
Merge pull request #1733 from lioncash/vert_loader
VertexLoader: Minor changes
Diffstat (limited to 'src/video_core/vertex_loader.cpp')
| -rw-r--r-- | src/video_core/vertex_loader.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index 83896814f..e40f0f1ee 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | #include <boost/range/algorithm/fill.hpp> | 3 | #include <boost/range/algorithm/fill.hpp> |
| 4 | 4 | ||
| 5 | #include "common/assert.h" | ||
| 6 | #include "common/alignment.h" | 5 | #include "common/alignment.h" |
| 6 | #include "common/assert.h" | ||
| 7 | #include "common/bit_field.h" | 7 | #include "common/bit_field.h" |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| @@ -21,6 +21,8 @@ | |||
| 21 | namespace Pica { | 21 | namespace Pica { |
| 22 | 22 | ||
| 23 | void VertexLoader::Setup(const Pica::Regs& regs) { | 23 | void VertexLoader::Setup(const Pica::Regs& regs) { |
| 24 | ASSERT_MSG(!is_setup, "VertexLoader is not intended to be setup more than once."); | ||
| 25 | |||
| 24 | const auto& attribute_config = regs.vertex_attributes; | 26 | const auto& attribute_config = regs.vertex_attributes; |
| 25 | num_total_attributes = attribute_config.GetNumTotalAttributes(); | 27 | num_total_attributes = attribute_config.GetNumTotalAttributes(); |
| 26 | 28 | ||
| @@ -60,9 +62,13 @@ void VertexLoader::Setup(const Pica::Regs& regs) { | |||
| 60 | } | 62 | } |
| 61 | } | 63 | } |
| 62 | } | 64 | } |
| 65 | |||
| 66 | is_setup = true; | ||
| 63 | } | 67 | } |
| 64 | 68 | ||
| 65 | void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses) { | 69 | void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses) { |
| 70 | ASSERT_MSG(is_setup, "A VertexLoader needs to be setup before loading vertices."); | ||
| 71 | |||
| 66 | for (int i = 0; i < num_total_attributes; ++i) { | 72 | for (int i = 0; i < num_total_attributes; ++i) { |
| 67 | if (vertex_attribute_elements[i] != 0) { | 73 | if (vertex_attribute_elements[i] != 0) { |
| 68 | // Load per-vertex data from the loader arrays | 74 | // Load per-vertex data from the loader arrays |