VideoCore/Shader: Extract input vertex loading code into function

This commit is contained in:
Yuri Kunde Schlesner
2016-12-16 21:41:38 -08:00
parent 3feb3ce283
commit 34d581f2dc
3 changed files with 26 additions and 22 deletions

View File

@ -149,7 +149,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
if (g_debug_context)
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
static_cast<void*>(&immediate_input));
g_state.vs.Run(shader_unit, immediate_input, regs.vs.num_input_attributes + 1);
shader_unit.LoadInputVertex(immediate_input, regs.vs.num_input_attributes + 1);
g_state.vs.Run(shader_unit);
Shader::OutputVertex output_vertex =
shader_unit.output_registers.ToVertex(regs.vs);
@ -283,7 +284,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
if (g_debug_context)
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
(void*)&input);
g_state.vs.Run(shader_unit, input, loader.GetNumTotalAttributes());
shader_unit.LoadInputVertex(input, loader.GetNumTotalAttributes());
g_state.vs.Run(shader_unit);
// Retrieve vertex from register data
output_vertex = shader_unit.output_registers.ToVertex(regs.vs);