diff options
| author | 2015-07-21 19:04:05 -0400 | |
|---|---|---|
| committer | 2015-08-15 17:33:41 -0400 | |
| commit | 642b9b503040f7da02dcb2c52f3cd4cbf6fee4b2 (patch) | |
| tree | 85643112608a15fafc304d41c4457a50c453bfcd /src | |
| parent | Merge pull request #1027 from lioncash/debugger (diff) | |
| download | yuzu-642b9b503040f7da02dcb2c52f3cd4cbf6fee4b2.tar.gz yuzu-642b9b503040f7da02dcb2c52f3cd4cbf6fee4b2.tar.xz yuzu-642b9b503040f7da02dcb2c52f3cd4cbf6fee4b2.zip | |
GPU: Refactor "VertexShader" namespace to "Shader".
- Also renames "vertex_shader.*" to "shader_interpreter.*"
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/video_core/clipper.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/clipper.h | 4 | ||||
| -rw-r--r-- | src/video_core/command_processor.cpp | 19 | ||||
| -rw-r--r-- | src/video_core/hwrasterizer_base.h | 8 | ||||
| -rw-r--r-- | src/video_core/primitive_assembly.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/primitive_assembly.h | 2 | ||||
| -rw-r--r-- | src/video_core/rasterizer.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/rasterizer.h | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 10 | ||||
| -rw-r--r-- | src/video_core/shader_interpreter.cpp (renamed from src/video_core/vertex_shader.cpp) | 14 | ||||
| -rw-r--r-- | src/video_core/shader_interpreter.h (renamed from src/video_core/vertex_shader.h) | 3 |
14 files changed, 49 insertions, 51 deletions
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index f42a2f4ce..566a986f5 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include <QBoxLayout> | 8 | #include <QBoxLayout> |
| 9 | #include <QTreeView> | 9 | #include <QTreeView> |
| 10 | 10 | ||
| 11 | #include "video_core/vertex_shader.h" | 11 | #include "video_core/shader_interpreter.h" |
| 12 | 12 | ||
| 13 | #include "graphics_vertex_shader.h" | 13 | #include "graphics_vertex_shader.h" |
| 14 | 14 | ||
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 162108301..e06d368e5 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -11,8 +11,8 @@ set(SRCS | |||
| 11 | pica.cpp | 11 | pica.cpp |
| 12 | primitive_assembly.cpp | 12 | primitive_assembly.cpp |
| 13 | rasterizer.cpp | 13 | rasterizer.cpp |
| 14 | shader_interpreter.cpp | ||
| 14 | utils.cpp | 15 | utils.cpp |
| 15 | vertex_shader.cpp | ||
| 16 | video_core.cpp | 16 | video_core.cpp |
| 17 | ) | 17 | ) |
| 18 | 18 | ||
| @@ -35,8 +35,8 @@ set(HEADERS | |||
| 35 | primitive_assembly.h | 35 | primitive_assembly.h |
| 36 | rasterizer.h | 36 | rasterizer.h |
| 37 | renderer_base.h | 37 | renderer_base.h |
| 38 | shader_interpreter.h | ||
| 38 | utils.h | 39 | utils.h |
| 39 | vertex_shader.h | ||
| 40 | video_core.h | 40 | video_core.h |
| 41 | ) | 41 | ) |
| 42 | 42 | ||
diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp index 558b49d60..e397ca2e8 100644 --- a/src/video_core/clipper.cpp +++ b/src/video_core/clipper.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "clipper.h" | 7 | #include "clipper.h" |
| 8 | #include "pica.h" | 8 | #include "pica.h" |
| 9 | #include "rasterizer.h" | 9 | #include "rasterizer.h" |
| 10 | #include "vertex_shader.h" | 10 | #include "shader_interpreter.h" |
| 11 | 11 | ||
| 12 | namespace Pica { | 12 | namespace Pica { |
| 13 | 13 | ||
diff --git a/src/video_core/clipper.h b/src/video_core/clipper.h index 19ce8e140..6ed01e877 100644 --- a/src/video_core/clipper.h +++ b/src/video_core/clipper.h | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | 6 | ||
| 7 | namespace Pica { | 7 | namespace Pica { |
| 8 | 8 | ||
| 9 | namespace VertexShader { | 9 | namespace Shader { |
| 10 | struct OutputVertex; | 10 | struct OutputVertex; |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | namespace Clipper { | 13 | namespace Clipper { |
| 14 | 14 | ||
| 15 | using VertexShader::OutputVertex; | 15 | using Shader::OutputVertex; |
| 16 | 16 | ||
| 17 | void ProcessTriangle(OutputVertex& v0, OutputVertex& v1, OutputVertex& v2); | 17 | void ProcessTriangle(OutputVertex& v0, OutputVertex& v1, OutputVertex& v2); |
| 18 | 18 | ||
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 243abe842..e199424c3 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #include "pica.h" | 18 | #include "pica.h" |
| 19 | #include "primitive_assembly.h" | 19 | #include "primitive_assembly.h" |
| 20 | #include "renderer_base.h" | 20 | #include "renderer_base.h" |
| 21 | #include "vertex_shader.h" | 21 | #include "shader_interpreter.h" |
| 22 | #include "video_core.h" | 22 | #include "video_core.h" |
| 23 | 23 | ||
| 24 | namespace Pica { | 24 | namespace Pica { |
| @@ -165,7 +165,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 165 | DebugUtils::GeometryDumper geometry_dumper; | 165 | DebugUtils::GeometryDumper geometry_dumper; |
| 166 | PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex> dumping_primitive_assembler(regs.triangle_topology.Value()); | 166 | PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex> dumping_primitive_assembler(regs.triangle_topology.Value()); |
| 167 | #endif | 167 | #endif |
| 168 | PrimitiveAssembler<VertexShader::OutputVertex> primitive_assembler(regs.triangle_topology.Value()); | 168 | PrimitiveAssembler<Shader::OutputVertex> primitive_assembler(regs.triangle_topology.Value()); |
| 169 | 169 | ||
| 170 | if (g_debug_context) { | 170 | if (g_debug_context) { |
| 171 | for (int i = 0; i < 3; ++i) { | 171 | for (int i = 0; i < 3; ++i) { |
| @@ -210,7 +210,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 210 | // The size has been tuned for optimal balance between hit-rate and the cost of lookup | 210 | // The size has been tuned for optimal balance between hit-rate and the cost of lookup |
| 211 | const size_t VERTEX_CACHE_SIZE = 32; | 211 | const size_t VERTEX_CACHE_SIZE = 32; |
| 212 | std::array<u16, VERTEX_CACHE_SIZE> vertex_cache_ids; | 212 | std::array<u16, VERTEX_CACHE_SIZE> vertex_cache_ids; |
| 213 | std::array<VertexShader::OutputVertex, VERTEX_CACHE_SIZE> vertex_cache; | 213 | std::array<Shader::OutputVertex, VERTEX_CACHE_SIZE> vertex_cache; |
| 214 | 214 | ||
| 215 | unsigned int vertex_cache_pos = 0; | 215 | unsigned int vertex_cache_pos = 0; |
| 216 | vertex_cache_ids.fill(-1); | 216 | vertex_cache_ids.fill(-1); |
| @@ -224,7 +224,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 224 | ASSERT(vertex != -1); | 224 | ASSERT(vertex != -1); |
| 225 | 225 | ||
| 226 | bool vertex_cache_hit = false; | 226 | bool vertex_cache_hit = false; |
| 227 | VertexShader::OutputVertex output; | 227 | Shader::OutputVertex output; |
| 228 | 228 | ||
| 229 | if (is_indexed) { | 229 | if (is_indexed) { |
| 230 | if (g_debug_context && Pica::g_debug_context->recorder) { | 230 | if (g_debug_context && Pica::g_debug_context->recorder) { |
| @@ -243,7 +243,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 243 | 243 | ||
| 244 | if (!vertex_cache_hit) { | 244 | if (!vertex_cache_hit) { |
| 245 | // Initialize data for the current vertex | 245 | // Initialize data for the current vertex |
| 246 | VertexShader::InputVertex input; | 246 | Shader::InputVertex input; |
| 247 | 247 | ||
| 248 | for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) { | 248 | for (int i = 0; i < attribute_config.GetNumTotalAttributes(); ++i) { |
| 249 | if (vertex_attribute_elements[i] != 0) { | 249 | if (vertex_attribute_elements[i] != 0) { |
| @@ -306,9 +306,8 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 306 | std::bind(&DebugUtils::GeometryDumper::AddTriangle, | 306 | std::bind(&DebugUtils::GeometryDumper::AddTriangle, |
| 307 | &geometry_dumper, _1, _2, _3)); | 307 | &geometry_dumper, _1, _2, _3)); |
| 308 | #endif | 308 | #endif |
| 309 | |||
| 310 | // Send to vertex shader | 309 | // Send to vertex shader |
| 311 | output = VertexShader::RunShader(input, attribute_config.GetNumTotalAttributes(), g_state.regs.vs, g_state.vs); | 310 | output = Shader::RunShader(input, attribute_config.GetNumTotalAttributes(), g_state.regs.vs, g_state.vs); |
| 312 | 311 | ||
| 313 | if (is_indexed) { | 312 | if (is_indexed) { |
| 314 | vertex_cache[vertex_cache_pos] = output; | 313 | vertex_cache[vertex_cache_pos] = output; |
| @@ -319,9 +318,9 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 319 | 318 | ||
| 320 | if (Settings::values.use_hw_renderer) { | 319 | if (Settings::values.use_hw_renderer) { |
| 321 | // Send to hardware renderer | 320 | // Send to hardware renderer |
| 322 | static auto AddHWTriangle = [](const Pica::VertexShader::OutputVertex& v0, | 321 | static auto AddHWTriangle = [](const Pica::Shader::OutputVertex& v0, |
| 323 | const Pica::VertexShader::OutputVertex& v1, | 322 | const Pica::Shader::OutputVertex& v1, |
| 324 | const Pica::VertexShader::OutputVertex& v2) { | 323 | const Pica::Shader::OutputVertex& v2) { |
| 325 | VideoCore::g_renderer->hw_rasterizer->AddTriangle(v0, v1, v2); | 324 | VideoCore::g_renderer->hw_rasterizer->AddTriangle(v0, v1, v2); |
| 326 | }; | 325 | }; |
| 327 | 326 | ||
diff --git a/src/video_core/hwrasterizer_base.h b/src/video_core/hwrasterizer_base.h index c8746c608..54b8892fb 100644 --- a/src/video_core/hwrasterizer_base.h +++ b/src/video_core/hwrasterizer_base.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace Pica { | 9 | namespace Pica { |
| 10 | namespace VertexShader { | 10 | namespace Shader { |
| 11 | struct OutputVertex; | 11 | struct OutputVertex; |
| 12 | } | 12 | } |
| 13 | } | 13 | } |
| @@ -24,9 +24,9 @@ public: | |||
| 24 | virtual void Reset() = 0; | 24 | virtual void Reset() = 0; |
| 25 | 25 | ||
| 26 | /// Queues the primitive formed by the given vertices for rendering | 26 | /// Queues the primitive formed by the given vertices for rendering |
| 27 | virtual void AddTriangle(const Pica::VertexShader::OutputVertex& v0, | 27 | virtual void AddTriangle(const Pica::Shader::OutputVertex& v0, |
| 28 | const Pica::VertexShader::OutputVertex& v1, | 28 | const Pica::Shader::OutputVertex& v1, |
| 29 | const Pica::VertexShader::OutputVertex& v2) = 0; | 29 | const Pica::Shader::OutputVertex& v2) = 0; |
| 30 | 30 | ||
| 31 | /// Draw the current batch of triangles | 31 | /// Draw the current batch of triangles |
| 32 | virtual void DrawTriangles() = 0; | 32 | virtual void DrawTriangles() = 0; |
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index 2f22bdcce..e15a1daba 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "pica.h" | 5 | #include "pica.h" |
| 6 | #include "primitive_assembly.h" | 6 | #include "primitive_assembly.h" |
| 7 | #include "vertex_shader.h" | 7 | #include "shader_interpreter.h" |
| 8 | 8 | ||
| 9 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 10 | #include "video_core/debug_utils/debug_utils.h" | 10 | #include "video_core/debug_utils/debug_utils.h" |
| @@ -56,7 +56,7 @@ void PrimitiveAssembler<VertexType>::SubmitVertex(VertexType& vtx, TriangleHandl | |||
| 56 | 56 | ||
| 57 | // explicitly instantiate use cases | 57 | // explicitly instantiate use cases |
| 58 | template | 58 | template |
| 59 | struct PrimitiveAssembler<VertexShader::OutputVertex>; | 59 | struct PrimitiveAssembler<Shader::OutputVertex>; |
| 60 | template | 60 | template |
| 61 | struct PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex>; | 61 | struct PrimitiveAssembler<DebugUtils::GeometryDumper::Vertex>; |
| 62 | 62 | ||
diff --git a/src/video_core/primitive_assembly.h b/src/video_core/primitive_assembly.h index 52ff4cd89..0de0b8810 100644 --- a/src/video_core/primitive_assembly.h +++ b/src/video_core/primitive_assembly.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include "video_core/pica.h" | 9 | #include "video_core/pica.h" |
| 10 | 10 | ||
| 11 | #include "video_core/vertex_shader.h" | 11 | #include "video_core/shader_interpreter.h" |
| 12 | 12 | ||
| 13 | namespace Pica { | 13 | namespace Pica { |
| 14 | 14 | ||
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 68b7cc05d..4f94313df 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include "math.h" | 16 | #include "math.h" |
| 17 | #include "pica.h" | 17 | #include "pica.h" |
| 18 | #include "rasterizer.h" | 18 | #include "rasterizer.h" |
| 19 | #include "vertex_shader.h" | 19 | #include "shader_interpreter.h" |
| 20 | #include "video_core/utils.h" | 20 | #include "video_core/utils.h" |
| 21 | 21 | ||
| 22 | namespace Pica { | 22 | namespace Pica { |
| @@ -272,9 +272,9 @@ static Common::Profiling::TimingCategory rasterization_category("Rasterization") | |||
| 272 | * Helper function for ProcessTriangle with the "reversed" flag to allow for implementing | 272 | * Helper function for ProcessTriangle with the "reversed" flag to allow for implementing |
| 273 | * culling via recursion. | 273 | * culling via recursion. |
| 274 | */ | 274 | */ |
| 275 | static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, | 275 | static void ProcessTriangleInternal(const Shader::OutputVertex& v0, |
| 276 | const VertexShader::OutputVertex& v1, | 276 | const Shader::OutputVertex& v1, |
| 277 | const VertexShader::OutputVertex& v2, | 277 | const Shader::OutputVertex& v2, |
| 278 | bool reversed = false) | 278 | bool reversed = false) |
| 279 | { | 279 | { |
| 280 | const auto& regs = g_state.regs; | 280 | const auto& regs = g_state.regs; |
| @@ -1107,9 +1107,9 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, | |||
| 1107 | } | 1107 | } |
| 1108 | } | 1108 | } |
| 1109 | 1109 | ||
| 1110 | void ProcessTriangle(const VertexShader::OutputVertex& v0, | 1110 | void ProcessTriangle(const Shader::OutputVertex& v0, |
| 1111 | const VertexShader::OutputVertex& v1, | 1111 | const Shader::OutputVertex& v1, |
| 1112 | const VertexShader::OutputVertex& v2) { | 1112 | const Shader::OutputVertex& v2) { |
| 1113 | ProcessTriangleInternal(v0, v1, v2); | 1113 | ProcessTriangleInternal(v0, v1, v2); |
| 1114 | } | 1114 | } |
| 1115 | 1115 | ||
diff --git a/src/video_core/rasterizer.h b/src/video_core/rasterizer.h index 42148f8b1..a6a9634b4 100644 --- a/src/video_core/rasterizer.h +++ b/src/video_core/rasterizer.h | |||
| @@ -6,15 +6,15 @@ | |||
| 6 | 6 | ||
| 7 | namespace Pica { | 7 | namespace Pica { |
| 8 | 8 | ||
| 9 | namespace VertexShader { | 9 | namespace Shader { |
| 10 | struct OutputVertex; | 10 | struct OutputVertex; |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | namespace Rasterizer { | 13 | namespace Rasterizer { |
| 14 | 14 | ||
| 15 | void ProcessTriangle(const VertexShader::OutputVertex& v0, | 15 | void ProcessTriangle(const Shader::OutputVertex& v0, |
| 16 | const VertexShader::OutputVertex& v1, | 16 | const Shader::OutputVertex& v1, |
| 17 | const VertexShader::OutputVertex& v2); | 17 | const Shader::OutputVertex& v2); |
| 18 | 18 | ||
| 19 | } // namespace Rasterizer | 19 | } // namespace Rasterizer |
| 20 | 20 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e7c1cfeb7..9f1552adf 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -202,9 +202,9 @@ void RasterizerOpenGL::Reset() { | |||
| 202 | res_cache.FullFlush(); | 202 | res_cache.FullFlush(); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | void RasterizerOpenGL::AddTriangle(const Pica::VertexShader::OutputVertex& v0, | 205 | void RasterizerOpenGL::AddTriangle(const Pica::Shader::OutputVertex& v0, |
| 206 | const Pica::VertexShader::OutputVertex& v1, | 206 | const Pica::Shader::OutputVertex& v1, |
| 207 | const Pica::VertexShader::OutputVertex& v2) { | 207 | const Pica::Shader::OutputVertex& v2) { |
| 208 | vertex_batch.push_back(HardwareVertex(v0)); | 208 | vertex_batch.push_back(HardwareVertex(v0)); |
| 209 | vertex_batch.push_back(HardwareVertex(v1)); | 209 | vertex_batch.push_back(HardwareVertex(v1)); |
| 210 | vertex_batch.push_back(HardwareVertex(v2)); | 210 | vertex_batch.push_back(HardwareVertex(v2)); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index ae7b26fc6..9018b5e88 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | #include "video_core/hwrasterizer_base.h" | 11 | #include "video_core/hwrasterizer_base.h" |
| 12 | #include "video_core/vertex_shader.h" | 12 | #include "video_core/shader_interpreter.h" |
| 13 | 13 | ||
| 14 | #include "gl_state.h" | 14 | #include "gl_state.h" |
| 15 | #include "gl_rasterizer_cache.h" | 15 | #include "gl_rasterizer_cache.h" |
| @@ -27,9 +27,9 @@ public: | |||
| 27 | void Reset() override; | 27 | void Reset() override; |
| 28 | 28 | ||
| 29 | /// Queues the primitive formed by the given vertices for rendering | 29 | /// Queues the primitive formed by the given vertices for rendering |
| 30 | void AddTriangle(const Pica::VertexShader::OutputVertex& v0, | 30 | void AddTriangle(const Pica::Shader::OutputVertex& v0, |
| 31 | const Pica::VertexShader::OutputVertex& v1, | 31 | const Pica::Shader::OutputVertex& v1, |
| 32 | const Pica::VertexShader::OutputVertex& v2) override; | 32 | const Pica::Shader::OutputVertex& v2) override; |
| 33 | 33 | ||
| 34 | /// Draw the current batch of triangles | 34 | /// Draw the current batch of triangles |
| 35 | void DrawTriangles() override; | 35 | void DrawTriangles() override; |
| @@ -82,7 +82,7 @@ private: | |||
| 82 | 82 | ||
| 83 | /// Structure that the hardware rendered vertices are composed of | 83 | /// Structure that the hardware rendered vertices are composed of |
| 84 | struct HardwareVertex { | 84 | struct HardwareVertex { |
| 85 | HardwareVertex(const Pica::VertexShader::OutputVertex& v) { | 85 | HardwareVertex(const Pica::Shader::OutputVertex& v) { |
| 86 | position[0] = v.pos.x.ToFloat32(); | 86 | position[0] = v.pos.x.ToFloat32(); |
| 87 | position[1] = v.pos.y.ToFloat32(); | 87 | position[1] = v.pos.y.ToFloat32(); |
| 88 | position[2] = v.pos.z.ToFloat32(); | 88 | position[2] = v.pos.z.ToFloat32(); |
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/shader_interpreter.cpp index 5f66f3455..3cce26d36 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/shader_interpreter.cpp | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "common/profiler.h" | 12 | #include "common/profiler.h" |
| 13 | 13 | ||
| 14 | #include "pica.h" | 14 | #include "pica.h" |
| 15 | #include "vertex_shader.h" | 15 | #include "shader_interpreter.h" |
| 16 | #include "debug_utils/debug_utils.h" | 16 | #include "debug_utils/debug_utils.h" |
| 17 | 17 | ||
| 18 | using nihstro::OpCode; | 18 | using nihstro::OpCode; |
| @@ -23,9 +23,9 @@ using nihstro::SwizzlePattern; | |||
| 23 | 23 | ||
| 24 | namespace Pica { | 24 | namespace Pica { |
| 25 | 25 | ||
| 26 | namespace VertexShader { | 26 | namespace Shader { |
| 27 | 27 | ||
| 28 | struct VertexShaderState { | 28 | struct ShaderState { |
| 29 | u32 program_counter; | 29 | u32 program_counter; |
| 30 | 30 | ||
| 31 | const float24* input_register_table[16]; | 31 | const float24* input_register_table[16]; |
| @@ -60,7 +60,7 @@ struct VertexShaderState { | |||
| 60 | } debug; | 60 | } debug; |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static void ProcessShaderCode(VertexShaderState& state) { | 63 | static void ProcessShaderCode(ShaderState& state) { |
| 64 | const auto& uniforms = g_state.vs.uniforms; | 64 | const auto& uniforms = g_state.vs.uniforms; |
| 65 | const auto& swizzle_data = g_state.vs.swizzle_data; | 65 | const auto& swizzle_data = g_state.vs.swizzle_data; |
| 66 | const auto& program_code = g_state.vs.program_code; | 66 | const auto& program_code = g_state.vs.program_code; |
| @@ -90,7 +90,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 90 | const Instruction instr = { program_code[state.program_counter] }; | 90 | const Instruction instr = { program_code[state.program_counter] }; |
| 91 | const SwizzlePattern swizzle = { swizzle_data[instr.common.operand_desc_id] }; | 91 | const SwizzlePattern swizzle = { swizzle_data[instr.common.operand_desc_id] }; |
| 92 | 92 | ||
| 93 | static auto call = [](VertexShaderState& state, u32 offset, u32 num_instructions, | 93 | static auto call = [](ShaderState& state, u32 offset, u32 num_instructions, |
| 94 | u32 return_offset, u8 repeat_count, u8 loop_increment) { | 94 | u32 return_offset, u8 repeat_count, u8 loop_increment) { |
| 95 | state.program_counter = offset - 1; // -1 to make sure when incrementing the PC we end up at the correct offset | 95 | state.program_counter = offset - 1; // -1 to make sure when incrementing the PC we end up at the correct offset |
| 96 | ASSERT(state.call_stack.size() < state.call_stack.capacity()); | 96 | ASSERT(state.call_stack.size() < state.call_stack.capacity()); |
| @@ -413,7 +413,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 413 | 413 | ||
| 414 | default: | 414 | default: |
| 415 | { | 415 | { |
| 416 | static auto evaluate_condition = [](const VertexShaderState& state, bool refx, bool refy, Instruction::FlowControlType flow_control) { | 416 | static auto evaluate_condition = [](const ShaderState& state, bool refx, bool refy, Instruction::FlowControlType flow_control) { |
| 417 | bool results[2] = { refx == state.conditional_code[0], | 417 | bool results[2] = { refx == state.conditional_code[0], |
| 418 | refy == state.conditional_code[1] }; | 418 | refy == state.conditional_code[1] }; |
| 419 | 419 | ||
| @@ -547,7 +547,7 @@ static Common::Profiling::TimingCategory shader_category("Vertex Shader"); | |||
| 547 | OutputVertex RunShader(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const State::ShaderSetup& setup) { | 547 | OutputVertex RunShader(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const State::ShaderSetup& setup) { |
| 548 | Common::Profiling::ScopeTimer timer(shader_category); | 548 | Common::Profiling::ScopeTimer timer(shader_category); |
| 549 | 549 | ||
| 550 | VertexShaderState state; | 550 | ShaderState state; |
| 551 | 551 | ||
| 552 | state.program_counter = config.main_offset; | 552 | state.program_counter = config.main_offset; |
| 553 | state.debug.max_offset = 0; | 553 | state.debug.max_offset = 0; |
diff --git a/src/video_core/vertex_shader.h b/src/video_core/shader_interpreter.h index 97f9250dd..942a30841 100644 --- a/src/video_core/vertex_shader.h +++ b/src/video_core/shader_interpreter.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | namespace Pica { | 13 | namespace Pica { |
| 14 | 14 | ||
| 15 | namespace VertexShader { | 15 | namespace Shader { |
| 16 | 16 | ||
| 17 | struct InputVertex { | 17 | struct InputVertex { |
| 18 | Math::Vec4<float24> attr[16]; | 18 | Math::Vec4<float24> attr[16]; |
| @@ -70,4 +70,3 @@ OutputVertex RunShader(const InputVertex& input, int num_attributes, const Regs: | |||
| 70 | } // namespace | 70 | } // namespace |
| 71 | 71 | ||
| 72 | } // namespace | 72 | } // namespace |
| 73 | |||