diff options
| author | 2021-03-08 18:31:53 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:23 -0400 | |
| commit | ab463712474de5f99eec137a9c6233e55fe184f0 (patch) | |
| tree | 30d79ac64dd03d5cfafd07c0c42c2baadc82de98 /src/shader_recompiler/shader_info.h | |
| parent | shader: Implement R2P (diff) | |
| download | yuzu-ab463712474de5f99eec137a9c6233e55fe184f0.tar.gz yuzu-ab463712474de5f99eec137a9c6233e55fe184f0.tar.xz yuzu-ab463712474de5f99eec137a9c6233e55fe184f0.zip | |
shader: Initial support for textures and TEX
Diffstat (limited to 'src/shader_recompiler/shader_info.h')
| -rw-r--r-- | src/shader_recompiler/shader_info.h | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h index 8766bf13e..103a2f0b4 100644 --- a/src/shader_recompiler/shader_info.h +++ b/src/shader_recompiler/shader_info.h | |||
| @@ -8,25 +8,51 @@ | |||
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | #include <boost/container/small_vector.hpp> | ||
| 11 | #include <boost/container/static_vector.hpp> | 12 | #include <boost/container/static_vector.hpp> |
| 12 | 13 | ||
| 13 | namespace Shader { | 14 | namespace Shader { |
| 14 | 15 | ||
| 16 | enum class TextureType : u32 { | ||
| 17 | Color1D, | ||
| 18 | ColorArray1D, | ||
| 19 | Color2D, | ||
| 20 | ColorArray2D, | ||
| 21 | Color3D, | ||
| 22 | ColorCube, | ||
| 23 | ColorArrayCube, | ||
| 24 | Shadow1D, | ||
| 25 | ShadowArray1D, | ||
| 26 | Shadow2D, | ||
| 27 | ShadowArray2D, | ||
| 28 | Shadow3D, | ||
| 29 | ShadowCube, | ||
| 30 | ShadowArrayCube, | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct TextureDescriptor { | ||
| 34 | TextureType type; | ||
| 35 | u32 cbuf_index; | ||
| 36 | u32 cbuf_offset; | ||
| 37 | u32 count; | ||
| 38 | }; | ||
| 39 | using TextureDescriptors = boost::container::small_vector<TextureDescriptor, 12>; | ||
| 40 | |||
| 41 | struct ConstantBufferDescriptor { | ||
| 42 | u32 index; | ||
| 43 | u32 count; | ||
| 44 | }; | ||
| 45 | |||
| 46 | struct StorageBufferDescriptor { | ||
| 47 | u32 cbuf_index; | ||
| 48 | u32 cbuf_offset; | ||
| 49 | u32 count; | ||
| 50 | }; | ||
| 51 | |||
| 15 | struct Info { | 52 | struct Info { |
| 16 | static constexpr size_t MAX_CBUFS{18}; | 53 | static constexpr size_t MAX_CBUFS{18}; |
| 17 | static constexpr size_t MAX_SSBOS{16}; | 54 | static constexpr size_t MAX_SSBOS{16}; |
| 18 | 55 | ||
| 19 | struct ConstantBufferDescriptor { | ||
| 20 | u32 index; | ||
| 21 | u32 count; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct StorageBufferDescriptor { | ||
| 25 | u32 cbuf_index; | ||
| 26 | u32 cbuf_offset; | ||
| 27 | u32 count; | ||
| 28 | }; | ||
| 29 | |||
| 30 | bool uses_workgroup_id{}; | 56 | bool uses_workgroup_id{}; |
| 31 | bool uses_local_invocation_id{}; | 57 | bool uses_local_invocation_id{}; |
| 32 | bool uses_fp16{}; | 58 | bool uses_fp16{}; |
| @@ -35,12 +61,16 @@ struct Info { | |||
| 35 | bool uses_fp16_denorms_preserve{}; | 61 | bool uses_fp16_denorms_preserve{}; |
| 36 | bool uses_fp32_denorms_flush{}; | 62 | bool uses_fp32_denorms_flush{}; |
| 37 | bool uses_fp32_denorms_preserve{}; | 63 | bool uses_fp32_denorms_preserve{}; |
| 64 | bool uses_image_1d{}; | ||
| 65 | bool uses_sampled_1d{}; | ||
| 66 | bool uses_sparse_residency{}; | ||
| 38 | 67 | ||
| 39 | u32 constant_buffer_mask{}; | 68 | u32 constant_buffer_mask{}; |
| 40 | 69 | ||
| 41 | boost::container::static_vector<ConstantBufferDescriptor, MAX_CBUFS> | 70 | boost::container::static_vector<ConstantBufferDescriptor, MAX_CBUFS> |
| 42 | constant_buffer_descriptors; | 71 | constant_buffer_descriptors; |
| 43 | boost::container::static_vector<StorageBufferDescriptor, MAX_SSBOS> storage_buffers_descriptors; | 72 | boost::container::static_vector<StorageBufferDescriptor, MAX_SSBOS> storage_buffers_descriptors; |
| 73 | TextureDescriptors texture_descriptors; | ||
| 44 | }; | 74 | }; |
| 45 | 75 | ||
| 46 | } // namespace Shader | 76 | } // namespace Shader |