1 // Copyright 2018 The Amber Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef SRC_COMMAND_DATA_H_ 16 #define SRC_COMMAND_DATA_H_ 17 18 #include <cstdint> 19 #include <string> 20 21 namespace amber { 22 23 enum class Topology : uint8_t { 24 kUnknown = 0, 25 kPointList, 26 kLineList, 27 kLineStrip, 28 kTriangleList, 29 kTriangleStrip, 30 kTriangleFan, 31 kLineListWithAdjacency, 32 kLineStripWithAdjacency, 33 kTriangleListWithAdjacency, 34 kTriangleStripWithAdjacency, 35 kPatchList, 36 }; 37 38 enum class PolygonMode : uint8_t { 39 kFill = 0, 40 kLine, 41 kPoint, 42 }; 43 44 enum class CullMode : uint8_t { 45 kNone = 0, 46 kFront, 47 kBack, 48 kFrontAndBack, 49 }; 50 51 enum class FrontFace : uint8_t { 52 kCounterClockwise = 0, 53 kClockwise, 54 }; 55 56 enum ColorMask { 57 kColorMaskR = 1 << 0, 58 kColorMaskG = 1 << 1, 59 kColorMaskB = 1 << 2, 60 kColorMaskA = 1 << 3, 61 }; 62 63 enum class CompareOp : uint8_t { 64 kUnknown = 0, 65 kNever, 66 kLess, 67 kEqual, 68 kLessOrEqual, 69 kGreater, 70 kNotEqual, 71 kGreaterOrEqual, 72 kAlways, 73 }; 74 75 enum class StencilOp : uint8_t { 76 kUnknown = 0, 77 kKeep, 78 kZero, 79 kReplace, 80 kIncrementAndClamp, 81 kDecrementAndClamp, 82 kInvert, 83 kIncrementAndWrap, 84 kDecrementAndWrap, 85 }; 86 87 enum class LogicOp : uint8_t { 88 kClear = 0, 89 kAnd, 90 kAndReverse, 91 kCopy, 92 kAndInverted, 93 kNoOp, 94 kXor, 95 kOr, 96 kNor, 97 kEquivalent, 98 kInvert, 99 kOrReverse, 100 kCopyInverted, 101 kOrInverted, 102 kNand, 103 kSet, 104 }; 105 106 enum class BlendOp : uint8_t { 107 kUnknown = 0, 108 kAdd, 109 kSubtract, 110 kReverseSubtract, 111 kMin, 112 kMax, 113 kZero, 114 kSrc, 115 kDst, 116 kSrcOver, 117 kDstOver, 118 kSrcIn, 119 kDstIn, 120 kSrcOut, 121 kDstOut, 122 kSrcAtop, 123 kDstAtop, 124 kXor, 125 kMultiply, 126 kScreen, 127 kOverlay, 128 kDarken, 129 kLighten, 130 kColorDodge, 131 kColorBurn, 132 kHardLight, 133 kSoftLight, 134 kDifference, 135 kExclusion, 136 kInvert, 137 kInvertRGB, 138 kLinearDodge, 139 kLinearBurn, 140 kVividLight, 141 kLinearLight, 142 kPinLight, 143 kHardMix, 144 kHslHue, 145 kHslSaturation, 146 kHslColor, 147 kHslLuminosity, 148 kPlus, 149 kPlusClamped, 150 kPlusClampedAlpha, 151 kPlusDarker, 152 kMinus, 153 kMinusClamped, 154 kContrast, 155 kInvertOvg, 156 kRed, 157 kGreen, 158 kBlue, 159 }; 160 161 enum class BlendFactor : uint8_t { 162 kUnknown = 0, 163 kZero, 164 kOne, 165 kSrcColor, 166 kOneMinusSrcColor, 167 kDstColor, 168 kOneMinusDstColor, 169 kSrcAlpha, 170 kOneMinusSrcAlpha, 171 kDstAlpha, 172 kOneMinusDstAlpha, 173 kConstantColor, 174 kOneMinusConstantColor, 175 kConstantAlpha, 176 kOneMinusConstantAlpha, 177 kSrcAlphaSaturate, 178 kSrc1Color, 179 kOneMinusSrc1Color, 180 kSrc1Alpha, 181 kOneMinusSrc1Alpha, 182 }; 183 184 Topology NameToTopology(const std::string& name); 185 BlendFactor NameToBlendFactor(const std::string& name); 186 BlendOp NameToBlendOp(const std::string& name); 187 188 } // namespace amber 189 190 #endif // SRC_COMMAND_DATA_H_ 191