summaryrefslogtreecommitdiff
path: root/src/video_core/vertex_shader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/vertex_shader.cpp')
-rw-r--r--src/video_core/vertex_shader.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index d32c2e371..b77503806 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -546,20 +546,18 @@ static void ProcessShaderCode(VertexShaderState& state) {
546 546
547static Common::Profiling::TimingCategory shader_category("Vertex Shader"); 547static Common::Profiling::TimingCategory shader_category("Vertex Shader");
548 548
549OutputVertex RunShader(const InputVertex& input, int num_attributes) { 549OutputVertex RunShader(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const State::ShaderSetup& setup) {
550 Common::Profiling::ScopeTimer timer(shader_category); 550 Common::Profiling::ScopeTimer timer(shader_category);
551 551
552 const auto& regs = g_state.regs;
553 const auto& vs = g_state.vs;
554 VertexShaderState state; 552 VertexShaderState state;
555 553
556 const u32* main = &vs.program_code[regs.vs_main_offset]; 554 const u32* main = &setup.program_code[config.main_offset];
557 state.program_counter = (u32*)main; 555 state.program_counter = (u32*)main;
558 state.debug.max_offset = 0; 556 state.debug.max_offset = 0;
559 state.debug.max_opdesc_id = 0; 557 state.debug.max_opdesc_id = 0;
560 558
561 // Setup input register table 559 // Setup input register table
562 const auto& attribute_register_map = regs.vs_input_register_map; 560 const auto& attribute_register_map = config.input_register_map;
563 float24 dummy_register; 561 float24 dummy_register;
564 boost::fill(state.input_register_table, &dummy_register); 562 boost::fill(state.input_register_table, &dummy_register);
565 563
@@ -584,16 +582,16 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes) {
584 state.conditional_code[1] = false; 582 state.conditional_code[1] = false;
585 583
586 ProcessShaderCode(state); 584 ProcessShaderCode(state);
587 DebugUtils::DumpShader(vs.program_code.data(), state.debug.max_offset, vs.swizzle_data.data(), 585 DebugUtils::DumpShader(setup.program_code.data(), state.debug.max_offset, setup.swizzle_data.data(),
588 state.debug.max_opdesc_id, regs.vs_main_offset, 586 state.debug.max_opdesc_id, config.main_offset,
589 regs.vs_output_attributes); 587 g_state.regs.vs_output_attributes); // TODO: Don't hardcode VS here
590 588
591 // Setup output data 589 // Setup output data
592 OutputVertex ret; 590 OutputVertex ret;
593 // TODO(neobrain): Under some circumstances, up to 16 attributes may be output. We need to 591 // TODO(neobrain): Under some circumstances, up to 16 attributes may be output. We need to
594 // figure out what those circumstances are and enable the remaining outputs then. 592 // figure out what those circumstances are and enable the remaining outputs then.
595 for (int i = 0; i < 7; ++i) { 593 for (int i = 0; i < 7; ++i) {
596 const auto& output_register_map = regs.vs_output_attributes[i]; 594 const auto& output_register_map = g_state.regs.vs_output_attributes[i]; // TODO: Don't hardcode VS here
597 595
598 u32 semantics[4] = { 596 u32 semantics[4] = {
599 output_register_map.map_x, output_register_map.map_y, 597 output_register_map.map_x, output_register_map.map_y,