diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/shader_recompiler/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp | 2 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_context.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/profile.h | 72 | ||||
| -rw-r--r-- | src/shader_recompiler/runtime_info.h | 83 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.h | 1 | ||||
| -rw-r--r-- | src/video_core/transform_feedback.h | 2 |
13 files changed, 93 insertions, 77 deletions
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt index 164e94071..f6719ad9d 100644 --- a/src/shader_recompiler/CMakeLists.txt +++ b/src/shader_recompiler/CMakeLists.txt | |||
| @@ -226,6 +226,7 @@ add_library(shader_recompiler STATIC | |||
| 226 | object_pool.h | 226 | object_pool.h |
| 227 | profile.h | 227 | profile.h |
| 228 | program_header.h | 228 | program_header.h |
| 229 | runtime_info.h | ||
| 229 | shader_info.h | 230 | shader_info.h |
| 230 | ) | 231 | ) |
| 231 | 232 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index 08918a5c2..21e14867c 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "shader_recompiler/backend/glasm/emit_context.h" | 8 | #include "shader_recompiler/backend/glasm/emit_context.h" |
| 9 | #include "shader_recompiler/frontend/ir/program.h" | 9 | #include "shader_recompiler/frontend/ir/program.h" |
| 10 | #include "shader_recompiler/profile.h" | 10 | #include "shader_recompiler/profile.h" |
| 11 | #include "shader_recompiler/runtime_info.h" | ||
| 11 | 12 | ||
| 12 | namespace Shader::Backend::GLASM { | 13 | namespace Shader::Backend::GLASM { |
| 13 | namespace { | 14 | namespace { |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 832b4fd40..66e4aea04 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "shader_recompiler/frontend/ir/ir_emitter.h" | 13 | #include "shader_recompiler/frontend/ir/ir_emitter.h" |
| 14 | #include "shader_recompiler/frontend/ir/program.h" | 14 | #include "shader_recompiler/frontend/ir/program.h" |
| 15 | #include "shader_recompiler/profile.h" | 15 | #include "shader_recompiler/profile.h" |
| 16 | #include "shader_recompiler/runtime_info.h" | ||
| 16 | 17 | ||
| 17 | namespace Shader::Backend::GLASM { | 18 | namespace Shader::Backend::GLASM { |
| 18 | namespace { | 19 | namespace { |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.h b/src/shader_recompiler/backend/glasm/emit_glasm.h index 3df32a4a6..bcb55f062 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "shader_recompiler/backend/bindings.h" | 9 | #include "shader_recompiler/backend/bindings.h" |
| 10 | #include "shader_recompiler/frontend/ir/program.h" | 10 | #include "shader_recompiler/frontend/ir/program.h" |
| 11 | #include "shader_recompiler/profile.h" | 11 | #include "shader_recompiler/profile.h" |
| 12 | #include "shader_recompiler/runtime_info.h" | ||
| 12 | 13 | ||
| 13 | namespace Shader::Backend::GLASM { | 14 | namespace Shader::Backend::GLASM { |
| 14 | 15 | ||
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp index cafb5c92a..af9fac7c1 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" |
| 9 | #include "shader_recompiler/frontend/ir/program.h" | 9 | #include "shader_recompiler/frontend/ir/program.h" |
| 10 | #include "shader_recompiler/frontend/ir/value.h" | 10 | #include "shader_recompiler/frontend/ir/value.h" |
| 11 | #include "shader_recompiler/profile.h" | 11 | #include "shader_recompiler/runtime_info.h" |
| 12 | 12 | ||
| 13 | namespace Shader::Backend::GLASM { | 13 | namespace Shader::Backend::GLASM { |
| 14 | namespace { | 14 | namespace { |
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 54aa88b63..93057ebb9 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include "shader_recompiler/backend/glsl/emit_context.h" | 6 | #include "shader_recompiler/backend/glsl/emit_context.h" |
| 7 | #include "shader_recompiler/frontend/ir/program.h" | 7 | #include "shader_recompiler/frontend/ir/program.h" |
| 8 | #include "shader_recompiler/profile.h" | 8 | #include "shader_recompiler/profile.h" |
| 9 | #include "shader_recompiler/runtime_info.h" | ||
| 9 | 10 | ||
| 10 | namespace Shader::Backend::GLSL { | 11 | namespace Shader::Backend::GLSL { |
| 11 | namespace { | 12 | namespace { |
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.h b/src/shader_recompiler/backend/glsl/emit_glsl.h index fe221fa7c..20e5719e6 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "shader_recompiler/backend/bindings.h" | 9 | #include "shader_recompiler/backend/bindings.h" |
| 10 | #include "shader_recompiler/frontend/ir/program.h" | 10 | #include "shader_recompiler/frontend/ir/program.h" |
| 11 | #include "shader_recompiler/profile.h" | 11 | #include "shader_recompiler/profile.h" |
| 12 | #include "shader_recompiler/runtime_info.h" | ||
| 12 | 13 | ||
| 13 | namespace Shader::Backend::GLSL { | 14 | namespace Shader::Backend::GLSL { |
| 14 | 15 | ||
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h index 9e812dabb..df28036e4 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h +++ b/src/shader_recompiler/backend/glsl/emit_glsl_instructions.h | |||
| @@ -18,9 +18,6 @@ class Value; | |||
| 18 | namespace Shader::Backend::GLSL { | 18 | namespace Shader::Backend::GLSL { |
| 19 | class EmitContext; | 19 | class EmitContext; |
| 20 | 20 | ||
| 21 | inline void EmitSetLoopSafetyVariable(EmitContext&) {} | ||
| 22 | inline void EmitGetLoopSafetyVariable(EmitContext&) {} | ||
| 23 | |||
| 24 | #define NotImplemented() throw NotImplementedException("GLSL instruction {}", __func__) | 21 | #define NotImplemented() throw NotImplementedException("GLSL instruction {}", __func__) |
| 25 | 22 | ||
| 26 | // Microinstruction emitters | 23 | // Microinstruction emitters |
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h index 961c9180c..527685fb8 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.h +++ b/src/shader_recompiler/backend/spirv/emit_context.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "shader_recompiler/backend/bindings.h" | 12 | #include "shader_recompiler/backend/bindings.h" |
| 13 | #include "shader_recompiler/frontend/ir/program.h" | 13 | #include "shader_recompiler/frontend/ir/program.h" |
| 14 | #include "shader_recompiler/profile.h" | 14 | #include "shader_recompiler/profile.h" |
| 15 | #include "shader_recompiler/runtime_info.h" | ||
| 15 | #include "shader_recompiler/shader_info.h" | 16 | #include "shader_recompiler/shader_info.h" |
| 16 | 17 | ||
| 17 | namespace Shader::Backend::SPIRV { | 18 | namespace Shader::Backend::SPIRV { |
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index a3c412a0f..d46be1638 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h | |||
| @@ -4,59 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 8 | #include <optional> | ||
| 9 | #include <vector> | ||
| 10 | |||
| 11 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 12 | 8 | ||
| 13 | namespace Shader { | 9 | namespace Shader { |
| 14 | 10 | ||
| 15 | enum class AttributeType : u8 { | ||
| 16 | Float, | ||
| 17 | SignedInt, | ||
| 18 | UnsignedInt, | ||
| 19 | Disabled, | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum class InputTopology { | ||
| 23 | Points, | ||
| 24 | Lines, | ||
| 25 | LinesAdjacency, | ||
| 26 | Triangles, | ||
| 27 | TrianglesAdjacency, | ||
| 28 | }; | ||
| 29 | |||
| 30 | enum class CompareFunction { | ||
| 31 | Never, | ||
| 32 | Less, | ||
| 33 | Equal, | ||
| 34 | LessThanEqual, | ||
| 35 | Greater, | ||
| 36 | NotEqual, | ||
| 37 | GreaterThanEqual, | ||
| 38 | Always, | ||
| 39 | }; | ||
| 40 | |||
| 41 | enum class TessPrimitive { | ||
| 42 | Isolines, | ||
| 43 | Triangles, | ||
| 44 | Quads, | ||
| 45 | }; | ||
| 46 | |||
| 47 | enum class TessSpacing { | ||
| 48 | Equal, | ||
| 49 | FractionalOdd, | ||
| 50 | FractionalEven, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct TransformFeedbackVarying { | ||
| 54 | u32 buffer{}; | ||
| 55 | u32 stride{}; | ||
| 56 | u32 offset{}; | ||
| 57 | u32 components{}; | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct Profile { | 11 | struct Profile { |
| 61 | u32 supported_spirv{0x00010000}; | 12 | u32 supported_spirv{0x00010000}; |
| 62 | 13 | ||
| @@ -114,27 +65,4 @@ struct Profile { | |||
| 114 | bool ignore_nan_fp_comparisons{}; | 65 | bool ignore_nan_fp_comparisons{}; |
| 115 | }; | 66 | }; |
| 116 | 67 | ||
| 117 | struct RuntimeInfo { | ||
| 118 | std::array<AttributeType, 32> generic_input_types{}; | ||
| 119 | bool convert_depth_mode{}; | ||
| 120 | bool force_early_z{}; | ||
| 121 | |||
| 122 | TessPrimitive tess_primitive{}; | ||
| 123 | TessSpacing tess_spacing{}; | ||
| 124 | bool tess_clockwise{}; | ||
| 125 | |||
| 126 | InputTopology input_topology{}; | ||
| 127 | |||
| 128 | std::optional<float> fixed_state_point_size; | ||
| 129 | std::optional<CompareFunction> alpha_test_func; | ||
| 130 | float alpha_test_reference{}; | ||
| 131 | |||
| 132 | // Static y negate value | ||
| 133 | bool y_negate{}; | ||
| 134 | // Use storage buffers instead of global pointers on GLASM | ||
| 135 | bool glasm_use_storage_buffers{}; | ||
| 136 | |||
| 137 | std::vector<TransformFeedbackVarying> xfb_varyings; | ||
| 138 | }; | ||
| 139 | |||
| 140 | } // namespace Shader | 68 | } // namespace Shader |
diff --git a/src/shader_recompiler/runtime_info.h b/src/shader_recompiler/runtime_info.h new file mode 100644 index 000000000..d4b047b4d --- /dev/null +++ b/src/shader_recompiler/runtime_info.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <array> | ||
| 8 | #include <optional> | ||
| 9 | #include <vector> | ||
| 10 | |||
| 11 | #include "common/common_types.h" | ||
| 12 | |||
| 13 | namespace Shader { | ||
| 14 | |||
| 15 | enum class AttributeType : u8 { | ||
| 16 | Float, | ||
| 17 | SignedInt, | ||
| 18 | UnsignedInt, | ||
| 19 | Disabled, | ||
| 20 | }; | ||
| 21 | |||
| 22 | enum class InputTopology { | ||
| 23 | Points, | ||
| 24 | Lines, | ||
| 25 | LinesAdjacency, | ||
| 26 | Triangles, | ||
| 27 | TrianglesAdjacency, | ||
| 28 | }; | ||
| 29 | |||
| 30 | enum class CompareFunction { | ||
| 31 | Never, | ||
| 32 | Less, | ||
| 33 | Equal, | ||
| 34 | LessThanEqual, | ||
| 35 | Greater, | ||
| 36 | NotEqual, | ||
| 37 | GreaterThanEqual, | ||
| 38 | Always, | ||
| 39 | }; | ||
| 40 | |||
| 41 | enum class TessPrimitive { | ||
| 42 | Isolines, | ||
| 43 | Triangles, | ||
| 44 | Quads, | ||
| 45 | }; | ||
| 46 | |||
| 47 | enum class TessSpacing { | ||
| 48 | Equal, | ||
| 49 | FractionalOdd, | ||
| 50 | FractionalEven, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct TransformFeedbackVarying { | ||
| 54 | u32 buffer{}; | ||
| 55 | u32 stride{}; | ||
| 56 | u32 offset{}; | ||
| 57 | u32 components{}; | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct RuntimeInfo { | ||
| 61 | std::array<AttributeType, 32> generic_input_types{}; | ||
| 62 | bool convert_depth_mode{}; | ||
| 63 | bool force_early_z{}; | ||
| 64 | |||
| 65 | TessPrimitive tess_primitive{}; | ||
| 66 | TessSpacing tess_spacing{}; | ||
| 67 | bool tess_clockwise{}; | ||
| 68 | |||
| 69 | InputTopology input_topology{}; | ||
| 70 | |||
| 71 | std::optional<float> fixed_state_point_size; | ||
| 72 | std::optional<CompareFunction> alpha_test_func; | ||
| 73 | float alpha_test_reference{}; | ||
| 74 | |||
| 75 | // Static y negate value | ||
| 76 | bool y_negate{}; | ||
| 77 | // Use storage buffers instead of global pointers on GLASM | ||
| 78 | bool glasm_use_storage_buffers{}; | ||
| 79 | |||
| 80 | std::vector<TransformFeedbackVarying> xfb_varyings; | ||
| 81 | }; | ||
| 82 | |||
| 83 | } // namespace Shader | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 6952a1f2c..ff5707119 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include "shader_recompiler/frontend/ir/value.h" | 16 | #include "shader_recompiler/frontend/ir/value.h" |
| 17 | #include "shader_recompiler/host_translate_info.h" | 17 | #include "shader_recompiler/host_translate_info.h" |
| 18 | #include "shader_recompiler/object_pool.h" | 18 | #include "shader_recompiler/object_pool.h" |
| 19 | #include "shader_recompiler/profile.h" | ||
| 19 | #include "video_core/engines/shader_type.h" | 20 | #include "video_core/engines/shader_type.h" |
| 20 | #include "video_core/renderer_opengl/gl_compute_pipeline.h" | 21 | #include "video_core/renderer_opengl/gl_compute_pipeline.h" |
| 21 | #include "video_core/renderer_opengl/gl_graphics_pipeline.h" | 22 | #include "video_core/renderer_opengl/gl_graphics_pipeline.h" |
diff --git a/src/video_core/transform_feedback.h b/src/video_core/transform_feedback.h index 6832c6db1..8f6946d65 100644 --- a/src/video_core/transform_feedback.h +++ b/src/video_core/transform_feedback.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | 9 | ||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "shader_recompiler/profile.h" | 11 | #include "shader_recompiler/runtime_info.h" |
| 12 | #include "video_core/engines/maxwell_3d.h" | 12 | #include "video_core/engines/maxwell_3d.h" |
| 13 | 13 | ||
| 14 | namespace VideoCommon { | 14 | namespace VideoCommon { |