VERY experimental Nintendo Switch 2 emulator
C++
vertex_loader: Add constructors to facilitate immediate and two-step initialization
Lioncash561157d259ff
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cppindex dd13795034..941c5af9f4 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) {// Processes information about internal vertex attributes to figure out how a vertex is loaded.// Later, these can be compiled and cached.- VertexLoader loader;const u32 base_address = regs.vertex_attributes.GetPhysicalBaseAddress();- loader.Setup(regs);+ VertexLoader loader(regs);// Load verticesbool is_indexed = (id == PICA_REG_INDEX(trigger_draw_indexed));diff --git a/src/video_core/vertex_loader.h b/src/video_core/vertex_loader.hindex 4ed8cd3fd8..2a97b97c83 100644--- a/src/video_core/vertex_loader.h+++ b/src/video_core/vertex_loader.h@@ -17,6 +17,11 @@ class InputVertex;class VertexLoader {public:+ VertexLoader() = default;+ explicit VertexLoader(const Pica::Regs& regs) {+ Setup(regs);+ }+void Setup(const Pica::Regs& regs);void LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses);