summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_processor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/command_processor.cpp')
-rw-r--r--src/video_core/command_processor.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index be1a936b2..bf4664f9e 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -128,7 +128,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
// TODO: Verify that this actually modifies the register!
if (setup.index < 15) {
- g_state.vs.default_attributes[setup.index] = attribute;
+ g_state.vs_default_attributes[setup.index] = attribute;
setup.index++;
} else {
// Put each attribute into an immediate input buffer.
@@ -144,13 +144,12 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
immediate_attribute_id = 0;
Shader::UnitState<false> shader_unit;
- Shader::Setup();
-
- if (g_debug_context)
- g_debug_context->OnEvent(DebugContext::Event::VertexLoaded, static_cast<void*>(&immediate_input));
+ g_state.vs.Setup();
// Send to vertex shader
- Shader::OutputVertex output = Shader::Run(shader_unit, immediate_input, regs.vs.num_input_attributes+1);
+ if (g_debug_context)
+ g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation, static_cast<void*>(&immediate_input));
+ Shader::OutputVertex output = g_state.vs.Run(shader_unit, immediate_input, regs.vs.num_input_attributes+1);
// Send to renderer
using Pica::Shader::OutputVertex;
@@ -200,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 vertices
bool is_indexed = (id == PICA_REG_INDEX(trigger_draw_indexed));
@@ -238,7 +236,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
vertex_cache_ids.fill(-1);
Shader::UnitState<false> shader_unit;
- Shader::Setup();
+ g_state.vs.Setup();
for (unsigned int index = 0; index < regs.num_vertices; ++index)
{
@@ -272,11 +270,10 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
Shader::InputVertex input;
loader.LoadVertex(base_address, index, vertex, input, memory_accesses);
- if (g_debug_context)
- g_debug_context->OnEvent(DebugContext::Event::VertexLoaded, (void*)&input);
-
// Send to vertex shader
- output = Shader::Run(shader_unit, input, loader.GetNumTotalAttributes());
+ if (g_debug_context)
+ g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation, (void*)&input);
+ output = g_state.vs.Run(shader_unit, input, loader.GetNumTotalAttributes());
if (is_indexed) {
vertex_cache[vertex_cache_pos] = output;