diff options
Diffstat (limited to 'src/video_core/shader')
| -rw-r--r-- | src/video_core/shader/shader.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/shader/shader.h | 18 | ||||
| -rw-r--r-- | src/video_core/shader/shader_interpreter.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/shader/shader_jit_x64.cpp | 2 |
4 files changed, 22 insertions, 2 deletions
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 44c234ed8..5e8930476 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #include "video_core/debug_utils/debug_utils.h" | 15 | #include "video_core/debug_utils/debug_utils.h" |
| 16 | #include "video_core/pica.h" | 16 | #include "video_core/pica.h" |
| 17 | #include "video_core/pica_state.h" | ||
| 17 | #include "video_core/video_core.h" | 18 | #include "video_core/video_core.h" |
| 18 | 19 | ||
| 19 | #include "shader.h" | 20 | #include "shader.h" |
| @@ -145,7 +146,7 @@ OutputVertex Run(UnitState<false>& state, const InputVertex& input, int num_attr | |||
| 145 | return ret; | 146 | return ret; |
| 146 | } | 147 | } |
| 147 | 148 | ||
| 148 | DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const State::ShaderSetup& setup) { | 149 | DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const ShaderSetup& setup) { |
| 149 | UnitState<true> state; | 150 | UnitState<true> state; |
| 150 | 151 | ||
| 151 | state.program_counter = config.main_offset; | 152 | state.program_counter = config.main_offset; |
diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index f068cd93f..1be4e3734 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h | |||
| @@ -77,6 +77,22 @@ struct OutputVertex { | |||
| 77 | static_assert(std::is_pod<OutputVertex>::value, "Structure is not POD"); | 77 | static_assert(std::is_pod<OutputVertex>::value, "Structure is not POD"); |
| 78 | static_assert(sizeof(OutputVertex) == 32 * sizeof(float), "OutputVertex has invalid size"); | 78 | static_assert(sizeof(OutputVertex) == 32 * sizeof(float), "OutputVertex has invalid size"); |
| 79 | 79 | ||
| 80 | /// Vertex shader memory | ||
| 81 | struct ShaderSetup { | ||
| 82 | struct { | ||
| 83 | // The float uniforms are accessed by the shader JIT using SSE instructions, and are | ||
| 84 | // therefore required to be 16-byte aligned. | ||
| 85 | Math::Vec4<float24> MEMORY_ALIGNED16(f[96]); | ||
| 86 | |||
| 87 | std::array<bool, 16> b; | ||
| 88 | std::array<Math::Vec4<u8>, 4> i; | ||
| 89 | } uniforms; | ||
| 90 | |||
| 91 | Math::Vec4<float24> default_attributes[16]; | ||
| 92 | |||
| 93 | std::array<u32, 1024> program_code; | ||
| 94 | std::array<u32, 1024> swizzle_data; | ||
| 95 | }; | ||
| 80 | 96 | ||
| 81 | // Helper structure used to keep track of data useful for inspection of shader emulation | 97 | // Helper structure used to keep track of data useful for inspection of shader emulation |
| 82 | template<bool full_debugging> | 98 | template<bool full_debugging> |
| @@ -347,7 +363,7 @@ OutputVertex Run(UnitState<false>& state, const InputVertex& input, int num_attr | |||
| 347 | * @param setup Setup object for the shader pipeline | 363 | * @param setup Setup object for the shader pipeline |
| 348 | * @return Debug information for this shader with regards to the given vertex | 364 | * @return Debug information for this shader with regards to the given vertex |
| 349 | */ | 365 | */ |
| 350 | DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const State::ShaderSetup& setup); | 366 | DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, const Regs::ShaderConfig& config, const ShaderSetup& setup); |
| 351 | 367 | ||
| 352 | } // namespace Shader | 368 | } // namespace Shader |
| 353 | 369 | ||
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index aeced71b0..79fcc56b9 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <nihstro/shader_bytecode.h> | 7 | #include <nihstro/shader_bytecode.h> |
| 8 | 8 | ||
| 9 | #include "video_core/pica.h" | 9 | #include "video_core/pica.h" |
| 10 | #include "video_core/pica_state.h" | ||
| 10 | #include "video_core/shader/shader.h" | 11 | #include "video_core/shader/shader.h" |
| 11 | #include "video_core/shader/shader_interpreter.h" | 12 | #include "video_core/shader/shader_interpreter.h" |
| 12 | 13 | ||
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 4249675a5..5083d7e54 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #include "shader.h" | 11 | #include "shader.h" |
| 12 | #include "shader_jit_x64.h" | 12 | #include "shader_jit_x64.h" |
| 13 | 13 | ||
| 14 | #include "video_core/pica_state.h" | ||
| 15 | |||
| 14 | namespace Pica { | 16 | namespace Pica { |
| 15 | 17 | ||
| 16 | namespace Shader { | 18 | namespace Shader { |