summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_surface.cpp3
-rw-r--r--src/video_core/clipper.cpp1
-rw-r--r--src/video_core/command_processor.cpp2
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp4
-rw-r--r--src/video_core/debug_utils/debug_utils.h4
-rw-r--r--src/video_core/pica.cpp2
-rw-r--r--src/video_core/rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h3
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp30
-rw-r--r--src/video_core/renderer_opengl/pica_to_gl.h4
-rw-r--r--src/video_core/shader/shader.cpp3
-rw-r--r--src/video_core/shader/shader.h3
14 files changed, 47 insertions, 25 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp
index f83c1f96c..47d9924e1 100644
--- a/src/citra_qt/debugger/graphics/graphics_surface.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp
@@ -17,7 +17,8 @@
17#include "core/hw/gpu.h" 17#include "core/hw/gpu.h"
18#include "core/memory.h" 18#include "core/memory.h"
19#include "video_core/pica_state.h" 19#include "video_core/pica_state.h"
20#include "video_core/regs.h" 20#include "video_core/regs_framebuffer.h"
21#include "video_core/regs_texturing.h"
21#include "video_core/texture/texture_decode.h" 22#include "video_core/texture/texture_decode.h"
22#include "video_core/utils.h" 23#include "video_core/utils.h"
23 24
diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp
index 0f71bbd06..1e8e751ba 100644
--- a/src/video_core/clipper.cpp
+++ b/src/video_core/clipper.cpp
@@ -15,7 +15,6 @@
15#include "video_core/pica_state.h" 15#include "video_core/pica_state.h"
16#include "video_core/pica_types.h" 16#include "video_core/pica_types.h"
17#include "video_core/rasterizer.h" 17#include "video_core/rasterizer.h"
18#include "video_core/regs.h"
19#include "video_core/shader/shader.h" 18#include "video_core/shader/shader.h"
20 19
21using Pica::Rasterizer::Vertex; 20using Pica::Rasterizer::Vertex;
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index ea541200b..2e32ff905 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -21,6 +21,8 @@
21#include "video_core/primitive_assembly.h" 21#include "video_core/primitive_assembly.h"
22#include "video_core/rasterizer_interface.h" 22#include "video_core/rasterizer_interface.h"
23#include "video_core/regs.h" 23#include "video_core/regs.h"
24#include "video_core/regs_pipeline.h"
25#include "video_core/regs_texturing.h"
24#include "video_core/renderer_base.h" 26#include "video_core/renderer_base.h"
25#include "video_core/shader/shader.h" 27#include "video_core/shader/shader.h"
26#include "video_core/vertex_loader.h" 28#include "video_core/vertex_loader.h"
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index e164e83a1..47dbc8cc8 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -32,7 +32,9 @@
32#include "video_core/pica_state.h" 32#include "video_core/pica_state.h"
33#include "video_core/pica_types.h" 33#include "video_core/pica_types.h"
34#include "video_core/rasterizer_interface.h" 34#include "video_core/rasterizer_interface.h"
35#include "video_core/regs.h" 35#include "video_core/regs_rasterizer.h"
36#include "video_core/regs_shader.h"
37#include "video_core/regs_texturing.h"
36#include "video_core/renderer_base.h" 38#include "video_core/renderer_base.h"
37#include "video_core/shader/shader.h" 39#include "video_core/shader/shader.h"
38#include "video_core/texture/texture_decode.h" 40#include "video_core/texture/texture_decode.h"
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h
index fd94bdbb8..89e418e27 100644
--- a/src/video_core/debug_utils/debug_utils.h
+++ b/src/video_core/debug_utils/debug_utils.h
@@ -17,7 +17,9 @@
17#include <vector> 17#include <vector>
18#include "common/common_types.h" 18#include "common/common_types.h"
19#include "common/vector_math.h" 19#include "common/vector_math.h"
20#include "video_core/regs.h" 20#include "video_core/regs_rasterizer.h"
21#include "video_core/regs_shader.h"
22#include "video_core/regs_texturing.h"
21 23
22namespace CiTrace { 24namespace CiTrace {
23class Recorder; 25class Recorder;
diff --git a/src/video_core/pica.cpp b/src/video_core/pica.cpp
index 13f0a4ab9..b95148a6a 100644
--- a/src/video_core/pica.cpp
+++ b/src/video_core/pica.cpp
@@ -5,7 +5,7 @@
5#include <cstring> 5#include <cstring>
6#include "video_core/pica.h" 6#include "video_core/pica.h"
7#include "video_core/pica_state.h" 7#include "video_core/pica_state.h"
8#include "video_core/regs.h" 8#include "video_core/regs_pipeline.h"
9 9
10namespace Pica { 10namespace Pica {
11 11
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index ca09c9d0e..83a08ebd7 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -19,7 +19,9 @@
19#include "video_core/pica_state.h" 19#include "video_core/pica_state.h"
20#include "video_core/pica_types.h" 20#include "video_core/pica_types.h"
21#include "video_core/rasterizer.h" 21#include "video_core/rasterizer.h"
22#include "video_core/regs.h" 22#include "video_core/regs_framebuffer.h"
23#include "video_core/regs_rasterizer.h"
24#include "video_core/regs_texturing.h"
23#include "video_core/shader/shader.h" 25#include "video_core/shader/shader.h"
24#include "video_core/texture/texture_decode.h" 26#include "video_core/texture/texture_decode.h"
25#include "video_core/utils.h" 27#include "video_core/utils.h"
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 75736c99f..ca818a672 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -15,7 +15,9 @@
15#include "common/vector_math.h" 15#include "common/vector_math.h"
16#include "core/hw/gpu.h" 16#include "core/hw/gpu.h"
17#include "video_core/pica_state.h" 17#include "video_core/pica_state.h"
18#include "video_core/regs.h" 18#include "video_core/regs_framebuffer.h"
19#include "video_core/regs_rasterizer.h"
20#include "video_core/regs_texturing.h"
19#include "video_core/renderer_opengl/gl_rasterizer.h" 21#include "video_core/renderer_opengl/gl_rasterizer.h"
20#include "video_core/renderer_opengl/gl_shader_gen.h" 22#include "video_core/renderer_opengl/gl_shader_gen.h"
21#include "video_core/renderer_opengl/gl_shader_util.h" 23#include "video_core/renderer_opengl/gl_shader_util.h"
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index bfee911b6..ecf737438 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -19,7 +19,10 @@
19#include "video_core/pica_state.h" 19#include "video_core/pica_state.h"
20#include "video_core/pica_types.h" 20#include "video_core/pica_types.h"
21#include "video_core/rasterizer_interface.h" 21#include "video_core/rasterizer_interface.h"
22#include "video_core/regs.h" 22#include "video_core/regs_framebuffer.h"
23#include "video_core/regs_lighting.h"
24#include "video_core/regs_rasterizer.h"
25#include "video_core/regs_texturing.h"
23#include "video_core/renderer_opengl/gl_rasterizer_cache.h" 26#include "video_core/renderer_opengl/gl_rasterizer_cache.h"
24#include "video_core/renderer_opengl/gl_resource_manager.h" 27#include "video_core/renderer_opengl/gl_resource_manager.h"
25#include "video_core/renderer_opengl/gl_state.h" 28#include "video_core/renderer_opengl/gl_state.h"
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 4072ed49e..aea20c693 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -21,7 +21,8 @@
21#include "common/common_funcs.h" 21#include "common/common_funcs.h"
22#include "common/common_types.h" 22#include "common/common_types.h"
23#include "core/hw/gpu.h" 23#include "core/hw/gpu.h"
24#include "video_core/regs.h" 24#include "video_core/regs_framebuffer.h"
25#include "video_core/regs_texturing.h"
25#include "video_core/renderer_opengl/gl_resource_manager.h" 26#include "video_core/renderer_opengl/gl_resource_manager.h"
26 27
27namespace MathUtil { 28namespace MathUtil {
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 3ea25f302..7abdeba05 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -7,15 +7,19 @@
7#include "common/assert.h" 7#include "common/assert.h"
8#include "common/bit_field.h" 8#include "common/bit_field.h"
9#include "common/logging/log.h" 9#include "common/logging/log.h"
10#include "video_core/regs.h" 10#include "video_core/regs_framebuffer.h"
11#include "video_core/regs_lighting.h"
12#include "video_core/regs_rasterizer.h"
13#include "video_core/regs_texturing.h"
11#include "video_core/renderer_opengl/gl_rasterizer.h" 14#include "video_core/renderer_opengl/gl_rasterizer.h"
12#include "video_core/renderer_opengl/gl_shader_gen.h" 15#include "video_core/renderer_opengl/gl_shader_gen.h"
13#include "video_core/renderer_opengl/gl_shader_util.h" 16#include "video_core/renderer_opengl/gl_shader_util.h"
14 17
15using Pica::Regs; 18using Pica::FramebufferRegs;
16using Pica::RasterizerRegs;
17using Pica::LightingRegs; 19using Pica::LightingRegs;
18using TevStageConfig = Pica::TexturingRegs::TevStageConfig; 20using Pica::RasterizerRegs;
21using Pica::TexturingRegs;
22using TevStageConfig = TexturingRegs::TevStageConfig;
19 23
20namespace GLShader { 24namespace GLShader {
21 25
@@ -48,10 +52,10 @@ static void AppendSource(std::string& out, const PicaShaderConfig& config,
48 case Source::Texture0: 52 case Source::Texture0:
49 // Only unit 0 respects the texturing type (according to 3DBrew) 53 // Only unit 0 respects the texturing type (according to 3DBrew)
50 switch (state.texture0_type) { 54 switch (state.texture0_type) {
51 case Pica::TexturingRegs::TextureConfig::Texture2D: 55 case TexturingRegs::TextureConfig::Texture2D:
52 out += "texture(tex[0], texcoord[0])"; 56 out += "texture(tex[0], texcoord[0])";
53 break; 57 break;
54 case Pica::TexturingRegs::TextureConfig::Projection2D: 58 case TexturingRegs::TextureConfig::Projection2D:
55 out += "textureProj(tex[0], vec3(texcoord[0], texcoord0_w))"; 59 out += "textureProj(tex[0], vec3(texcoord[0], texcoord0_w))";
56 break; 60 break;
57 default: 61 default:
@@ -278,8 +282,8 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper
278} 282}
279 283
280/// Writes the if-statement condition used to evaluate alpha testing 284/// Writes the if-statement condition used to evaluate alpha testing
281static void AppendAlphaTestCondition(std::string& out, Pica::FramebufferRegs::CompareFunc func) { 285static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareFunc func) {
282 using CompareFunc = Pica::FramebufferRegs::CompareFunc; 286 using CompareFunc = FramebufferRegs::CompareFunc;
283 switch (func) { 287 switch (func) {
284 case CompareFunc::Never: 288 case CompareFunc::Never:
285 out += "true"; 289 out += "true";
@@ -309,7 +313,7 @@ static void AppendAlphaTestCondition(std::string& out, Pica::FramebufferRegs::Co
309/// Writes the code to emulate the specified TEV stage 313/// Writes the code to emulate the specified TEV stage
310static void WriteTevStage(std::string& out, const PicaShaderConfig& config, unsigned index) { 314static void WriteTevStage(std::string& out, const PicaShaderConfig& config, unsigned index) {
311 const auto stage = 315 const auto stage =
312 static_cast<const Pica::TexturingRegs::TevStageConfig>(config.state.tev_stages[index]); 316 static_cast<const TexturingRegs::TevStageConfig>(config.state.tev_stages[index]);
313 if (!IsPassThroughTevStage(stage)) { 317 if (!IsPassThroughTevStage(stage)) {
314 std::string index_name = std::to_string(index); 318 std::string index_name = std::to_string(index);
315 319
@@ -642,7 +646,7 @@ vec4 secondary_fragment_color = vec4(0.0);
642)"; 646)";
643 647
644 // Do not do any sort of processing if it's obvious we're not going to pass the alpha test 648 // Do not do any sort of processing if it's obvious we're not going to pass the alpha test
645 if (state.alpha_test_func == Pica::FramebufferRegs::CompareFunc::Never) { 649 if (state.alpha_test_func == FramebufferRegs::CompareFunc::Never) {
646 out += "discard; }"; 650 out += "discard; }";
647 return out; 651 return out;
648 } 652 }
@@ -661,7 +665,7 @@ vec4 secondary_fragment_color = vec4(0.0);
661 665
662 out += "float z_over_w = 1.0 - gl_FragCoord.z * 2.0;\n"; 666 out += "float z_over_w = 1.0 - gl_FragCoord.z * 2.0;\n";
663 out += "float depth = z_over_w * depth_scale + depth_offset;\n"; 667 out += "float depth = z_over_w * depth_scale + depth_offset;\n";
664 if (state.depthmap_enable == Pica::RasterizerRegs::DepthBuffering::WBuffering) { 668 if (state.depthmap_enable == RasterizerRegs::DepthBuffering::WBuffering) {
665 out += "depth /= gl_FragCoord.w;\n"; 669 out += "depth /= gl_FragCoord.w;\n";
666 } 670 }
667 671
@@ -675,14 +679,14 @@ vec4 secondary_fragment_color = vec4(0.0);
675 for (size_t index = 0; index < state.tev_stages.size(); ++index) 679 for (size_t index = 0; index < state.tev_stages.size(); ++index)
676 WriteTevStage(out, config, (unsigned)index); 680 WriteTevStage(out, config, (unsigned)index);
677 681
678 if (state.alpha_test_func != Pica::FramebufferRegs::CompareFunc::Always) { 682 if (state.alpha_test_func != FramebufferRegs::CompareFunc::Always) {
679 out += "if ("; 683 out += "if (";
680 AppendAlphaTestCondition(out, state.alpha_test_func); 684 AppendAlphaTestCondition(out, state.alpha_test_func);
681 out += ") discard;\n"; 685 out += ") discard;\n";
682 } 686 }
683 687
684 // Append fog combiner 688 // Append fog combiner
685 if (state.fog_mode == Pica::TexturingRegs::FogMode::Fog) { 689 if (state.fog_mode == TexturingRegs::FogMode::Fog) {
686 // Get index into fog LUT 690 // Get index into fog LUT
687 if (state.fog_flip) { 691 if (state.fog_flip) {
688 out += "float fog_index = (1.0 - depth) * 128.0;\n"; 692 out += "float fog_index = (1.0 - depth) * 128.0;\n";
diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h
index 4b98dafc4..93d7b0b71 100644
--- a/src/video_core/renderer_opengl/pica_to_gl.h
+++ b/src/video_core/renderer_opengl/pica_to_gl.h
@@ -12,7 +12,9 @@
12#include "common/common_funcs.h" 12#include "common/common_funcs.h"
13#include "common/common_types.h" 13#include "common/common_types.h"
14#include "common/logging/log.h" 14#include "common/logging/log.h"
15#include "video_core/regs.h" 15#include "video_core/regs_framebuffer.h"
16#include "video_core/regs_lighting.h"
17#include "video_core/regs_texturing.h"
16 18
17using GLvec2 = std::array<GLfloat, 2>; 19using GLvec2 = std::array<GLfloat, 2>;
18using GLvec3 = std::array<GLfloat, 3>; 20using GLvec3 = std::array<GLfloat, 3>;
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index c860375a1..b42fa3cb4 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -8,7 +8,8 @@
8#include "common/logging/log.h" 8#include "common/logging/log.h"
9#include "common/microprofile.h" 9#include "common/microprofile.h"
10#include "video_core/pica_state.h" 10#include "video_core/pica_state.h"
11#include "video_core/regs.h" 11#include "video_core/regs_rasterizer.h"
12#include "video_core/regs_shader.h"
12#include "video_core/shader/shader.h" 13#include "video_core/shader/shader.h"
13#include "video_core/shader/shader_interpreter.h" 14#include "video_core/shader/shader_interpreter.h"
14#ifdef ARCHITECTURE_x86_64 15#ifdef ARCHITECTURE_x86_64
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h
index d52682479..38ea717ab 100644
--- a/src/video_core/shader/shader.h
+++ b/src/video_core/shader/shader.h
@@ -13,7 +13,8 @@
13#include "common/common_types.h" 13#include "common/common_types.h"
14#include "common/vector_math.h" 14#include "common/vector_math.h"
15#include "video_core/pica_types.h" 15#include "video_core/pica_types.h"
16#include "video_core/regs.h" 16#include "video_core/regs_rasterizer.h"
17#include "video_core/regs_shader.h"
17 18
18using nihstro::RegisterType; 19using nihstro::RegisterType;
19using nihstro::SourceRegister; 20using nihstro::SourceRegister;