summaryrefslogtreecommitdiffstats
path: root/src/video_core/vertex_loader.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-05-24 03:13:34 +0200
committerbunnei <bunneidev@gmail.com>2016-05-24 03:13:34 +0200
commita316fbb15aedbc23b58474aaca95569788933774 (patch)
tree19ead61153a7aaaed3e03a0a7244a6b1cc9bcbd7 /src/video_core/vertex_loader.cpp
parentMerge pull request #1837 from wwylele/sync-trap (diff)
parentvertex_loader: Correct forward declaration of InputVertex (diff)
downloadyuzu-a316fbb15aedbc23b58474aaca95569788933774.tar
yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.gz
yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.bz2
yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.lz
yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.xz
yuzu-a316fbb15aedbc23b58474aaca95569788933774.tar.zst
yuzu-a316fbb15aedbc23b58474aaca95569788933774.zip
Diffstat (limited to 'src/video_core/vertex_loader.cpp')
-rw-r--r--src/video_core/vertex_loader.cpp8
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 @@
#include <boost/range/algorithm/fill.hpp>
-#include "common/assert.h"
#include "common/alignment.h"
+#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_types.h"
#include "common/logging/log.h"
@@ -21,6 +21,8 @@
namespace Pica {
void VertexLoader::Setup(const Pica::Regs& regs) {
+ ASSERT_MSG(!is_setup, "VertexLoader is not intended to be setup more than once.");
+
const auto& attribute_config = regs.vertex_attributes;
num_total_attributes = attribute_config.GetNumTotalAttributes();
@@ -60,9 +62,13 @@ void VertexLoader::Setup(const Pica::Regs& regs) {
}
}
}
+
+ is_setup = true;
}
void VertexLoader::LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses) {
+ ASSERT_MSG(is_setup, "A VertexLoader needs to be setup before loading vertices.");
+
for (int i = 0; i < num_total_attributes; ++i) {
if (vertex_attribute_elements[i] != 0) {
// Load per-vertex data from the loader arrays