diff options
Diffstat (limited to 'src/shader_recompiler/frontend/ir/attribute.h')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/attribute.h | 242 |
1 files changed, 242 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/attribute.h b/src/shader_recompiler/frontend/ir/attribute.h new file mode 100644 index 000000000..bb2cad6af --- /dev/null +++ b/src/shader_recompiler/frontend/ir/attribute.h | |||
| @@ -0,0 +1,242 @@ | |||
| 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 <fmt/format.h> | ||
| 8 | |||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 11 | namespace Shader::IR { | ||
| 12 | |||
| 13 | enum class Attribute : u64 { | ||
| 14 | PrimitiveId = 24, | ||
| 15 | Layer = 25, | ||
| 16 | ViewportIndex = 26, | ||
| 17 | PointSize = 27, | ||
| 18 | PositionX = 28, | ||
| 19 | PositionY = 29, | ||
| 20 | PositionZ = 30, | ||
| 21 | PositionW = 31, | ||
| 22 | Generic0X = 32, | ||
| 23 | Generic0Y = 33, | ||
| 24 | Generic0Z = 34, | ||
| 25 | Generic0W = 35, | ||
| 26 | Generic1X = 36, | ||
| 27 | Generic1Y = 37, | ||
| 28 | Generic1Z = 38, | ||
| 29 | Generic1W = 39, | ||
| 30 | Generic2X = 40, | ||
| 31 | Generic2Y = 41, | ||
| 32 | Generic2Z = 42, | ||
| 33 | Generic2W = 43, | ||
| 34 | Generic3X = 44, | ||
| 35 | Generic3Y = 45, | ||
| 36 | Generic3Z = 46, | ||
| 37 | Generic3W = 47, | ||
| 38 | Generic4X = 48, | ||
| 39 | Generic4Y = 49, | ||
| 40 | Generic4Z = 50, | ||
| 41 | Generic4W = 51, | ||
| 42 | Generic5X = 52, | ||
| 43 | Generic5Y = 53, | ||
| 44 | Generic5Z = 54, | ||
| 45 | Generic5W = 55, | ||
| 46 | Generic6X = 56, | ||
| 47 | Generic6Y = 57, | ||
| 48 | Generic6Z = 58, | ||
| 49 | Generic6W = 59, | ||
| 50 | Generic7X = 60, | ||
| 51 | Generic7Y = 61, | ||
| 52 | Generic7Z = 62, | ||
| 53 | Generic7W = 63, | ||
| 54 | Generic8X = 64, | ||
| 55 | Generic8Y = 65, | ||
| 56 | Generic8Z = 66, | ||
| 57 | Generic8W = 67, | ||
| 58 | Generic9X = 68, | ||
| 59 | Generic9Y = 69, | ||
| 60 | Generic9Z = 70, | ||
| 61 | Generic9W = 71, | ||
| 62 | Generic10X = 72, | ||
| 63 | Generic10Y = 73, | ||
| 64 | Generic10Z = 74, | ||
| 65 | Generic10W = 75, | ||
| 66 | Generic11X = 76, | ||
| 67 | Generic11Y = 77, | ||
| 68 | Generic11Z = 78, | ||
| 69 | Generic11W = 79, | ||
| 70 | Generic12X = 80, | ||
| 71 | Generic12Y = 81, | ||
| 72 | Generic12Z = 82, | ||
| 73 | Generic12W = 83, | ||
| 74 | Generic13X = 84, | ||
| 75 | Generic13Y = 85, | ||
| 76 | Generic13Z = 86, | ||
| 77 | Generic13W = 87, | ||
| 78 | Generic14X = 88, | ||
| 79 | Generic14Y = 89, | ||
| 80 | Generic14Z = 90, | ||
| 81 | Generic14W = 91, | ||
| 82 | Generic15X = 92, | ||
| 83 | Generic15Y = 93, | ||
| 84 | Generic15Z = 94, | ||
| 85 | Generic15W = 95, | ||
| 86 | Generic16X = 96, | ||
| 87 | Generic16Y = 97, | ||
| 88 | Generic16Z = 98, | ||
| 89 | Generic16W = 99, | ||
| 90 | Generic17X = 100, | ||
| 91 | Generic17Y = 101, | ||
| 92 | Generic17Z = 102, | ||
| 93 | Generic17W = 103, | ||
| 94 | Generic18X = 104, | ||
| 95 | Generic18Y = 105, | ||
| 96 | Generic18Z = 106, | ||
| 97 | Generic18W = 107, | ||
| 98 | Generic19X = 108, | ||
| 99 | Generic19Y = 109, | ||
| 100 | Generic19Z = 110, | ||
| 101 | Generic19W = 111, | ||
| 102 | Generic20X = 112, | ||
| 103 | Generic20Y = 113, | ||
| 104 | Generic20Z = 114, | ||
| 105 | Generic20W = 115, | ||
| 106 | Generic21X = 116, | ||
| 107 | Generic21Y = 117, | ||
| 108 | Generic21Z = 118, | ||
| 109 | Generic21W = 119, | ||
| 110 | Generic22X = 120, | ||
| 111 | Generic22Y = 121, | ||
| 112 | Generic22Z = 122, | ||
| 113 | Generic22W = 123, | ||
| 114 | Generic23X = 124, | ||
| 115 | Generic23Y = 125, | ||
| 116 | Generic23Z = 126, | ||
| 117 | Generic23W = 127, | ||
| 118 | Generic24X = 128, | ||
| 119 | Generic24Y = 129, | ||
| 120 | Generic24Z = 130, | ||
| 121 | Generic24W = 131, | ||
| 122 | Generic25X = 132, | ||
| 123 | Generic25Y = 133, | ||
| 124 | Generic25Z = 134, | ||
| 125 | Generic25W = 135, | ||
| 126 | Generic26X = 136, | ||
| 127 | Generic26Y = 137, | ||
| 128 | Generic26Z = 138, | ||
| 129 | Generic26W = 139, | ||
| 130 | Generic27X = 140, | ||
| 131 | Generic27Y = 141, | ||
| 132 | Generic27Z = 142, | ||
| 133 | Generic27W = 143, | ||
| 134 | Generic28X = 144, | ||
| 135 | Generic28Y = 145, | ||
| 136 | Generic28Z = 146, | ||
| 137 | Generic28W = 147, | ||
| 138 | Generic29X = 148, | ||
| 139 | Generic29Y = 149, | ||
| 140 | Generic29Z = 150, | ||
| 141 | Generic29W = 151, | ||
| 142 | Generic30X = 152, | ||
| 143 | Generic30Y = 153, | ||
| 144 | Generic30Z = 154, | ||
| 145 | Generic30W = 155, | ||
| 146 | Generic31X = 156, | ||
| 147 | Generic31Y = 157, | ||
| 148 | Generic31Z = 158, | ||
| 149 | Generic31W = 159, | ||
| 150 | ColorFrontDiffuseR = 160, | ||
| 151 | ColorFrontDiffuseG = 161, | ||
| 152 | ColorFrontDiffuseB = 162, | ||
| 153 | ColorFrontDiffuseA = 163, | ||
| 154 | ColorFrontSpecularR = 164, | ||
| 155 | ColorFrontSpecularG = 165, | ||
| 156 | ColorFrontSpecularB = 166, | ||
| 157 | ColorFrontSpecularA = 167, | ||
| 158 | ColorBackDiffuseR = 168, | ||
| 159 | ColorBackDiffuseG = 169, | ||
| 160 | ColorBackDiffuseB = 170, | ||
| 161 | ColorBackDiffuseA = 171, | ||
| 162 | ColorBackSpecularR = 172, | ||
| 163 | ColorBackSpecularG = 173, | ||
| 164 | ColorBackSpecularB = 174, | ||
| 165 | ColorBackSpecularA = 175, | ||
| 166 | ClipDistance0 = 176, | ||
| 167 | ClipDistance1 = 177, | ||
| 168 | ClipDistance2 = 178, | ||
| 169 | ClipDistance3 = 179, | ||
| 170 | ClipDistance4 = 180, | ||
| 171 | ClipDistance5 = 181, | ||
| 172 | ClipDistance6 = 182, | ||
| 173 | ClipDistance7 = 183, | ||
| 174 | PointSpriteS = 184, | ||
| 175 | PointSpriteT = 185, | ||
| 176 | FogCoordinate = 186, | ||
| 177 | TessellationEvaluationPointU = 188, | ||
| 178 | TessellationEvaluationPointV = 189, | ||
| 179 | InstanceId = 190, | ||
| 180 | VertexId = 191, | ||
| 181 | FixedFncTexture0S = 192, | ||
| 182 | FixedFncTexture0T = 193, | ||
| 183 | FixedFncTexture0R = 194, | ||
| 184 | FixedFncTexture0Q = 195, | ||
| 185 | FixedFncTexture1S = 196, | ||
| 186 | FixedFncTexture1T = 197, | ||
| 187 | FixedFncTexture1R = 198, | ||
| 188 | FixedFncTexture1Q = 199, | ||
| 189 | FixedFncTexture2S = 200, | ||
| 190 | FixedFncTexture2T = 201, | ||
| 191 | FixedFncTexture2R = 202, | ||
| 192 | FixedFncTexture2Q = 203, | ||
| 193 | FixedFncTexture3S = 204, | ||
| 194 | FixedFncTexture3T = 205, | ||
| 195 | FixedFncTexture3R = 206, | ||
| 196 | FixedFncTexture3Q = 207, | ||
| 197 | FixedFncTexture4S = 208, | ||
| 198 | FixedFncTexture4T = 209, | ||
| 199 | FixedFncTexture4R = 210, | ||
| 200 | FixedFncTexture4Q = 211, | ||
| 201 | FixedFncTexture5S = 212, | ||
| 202 | FixedFncTexture5T = 213, | ||
| 203 | FixedFncTexture5R = 214, | ||
| 204 | FixedFncTexture5Q = 215, | ||
| 205 | FixedFncTexture6S = 216, | ||
| 206 | FixedFncTexture6T = 217, | ||
| 207 | FixedFncTexture6R = 218, | ||
| 208 | FixedFncTexture6Q = 219, | ||
| 209 | FixedFncTexture7S = 220, | ||
| 210 | FixedFncTexture7T = 221, | ||
| 211 | FixedFncTexture7R = 222, | ||
| 212 | FixedFncTexture7Q = 223, | ||
| 213 | FixedFncTexture8S = 224, | ||
| 214 | FixedFncTexture8T = 225, | ||
| 215 | FixedFncTexture8R = 226, | ||
| 216 | FixedFncTexture8Q = 227, | ||
| 217 | FixedFncTexture9S = 228, | ||
| 218 | FixedFncTexture9T = 229, | ||
| 219 | FixedFncTexture9R = 230, | ||
| 220 | FixedFncTexture9Q = 231, | ||
| 221 | ViewportMask = 232, | ||
| 222 | FrontFace = 255, | ||
| 223 | }; | ||
| 224 | |||
| 225 | [[nodiscard]] bool IsGeneric(Attribute attribute) noexcept; | ||
| 226 | |||
| 227 | [[nodiscard]] int GenericAttributeIndex(Attribute attribute); | ||
| 228 | |||
| 229 | [[nodiscard]] std::string NameOf(Attribute attribute); | ||
| 230 | |||
| 231 | } // namespace Shader::IR | ||
| 232 | |||
| 233 | template <> | ||
| 234 | struct fmt::formatter<Shader::IR::Attribute> { | ||
| 235 | constexpr auto parse(format_parse_context& ctx) { | ||
| 236 | return ctx.begin(); | ||
| 237 | } | ||
| 238 | template <typename FormatContext> | ||
| 239 | auto format(const Shader::IR::Attribute& attribute, FormatContext& ctx) { | ||
| 240 | return fmt::format_to(ctx.out(), "{}", Shader::IR::NameOf(attribute)); | ||
| 241 | } | ||
| 242 | }; | ||