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 kAdd = 0, 108 kSubtract, 109 kReverseSubtract, 110 kMin, 111 kMax, 112 kZero, 113 kSrc, 114 kDst, 115 kSrcOver, 116 kDstOver, 117 kSrcIn, 118 kDstIn, 119 kSrcOut, 120 kDstOut, 121 kSrcAtop, 122 kDstAtop, 123 kXor, 124 kMultiply, 125 kScreen, 126 kOverlay, 127 kDarken, 128 kLighten, 129 kColorDodge, 130 kColorBurn, 131 kHardLight, 132 kSoftLight, 133 kDifference, 134 kExclusion, 135 kInvert, 136 kInvertRGB, 137 kLinearDodge, 138 kLinearBurn, 139 kVividLight, 140 kLinearLight, 141 kPinLight, 142 kHardMix, 143 kHslHue, 144 kHslSaturation, 145 kHslColor, 146 kHslLuminosity, 147 kPlus, 148 kPlusClamped, 149 kPlusClampedAlpha, 150 kPlusDarker, 151 kMinus, 152 kMinusClamped, 153 kContrast, 154 kInvertOvg, 155 kRed, 156 kGreen, 157 kBlue, 158 }; 159 160 enum class BlendFactor : uint8_t { 161 kZero = 0, 162 kOne, 163 kSrcColor, 164 kOneMinusSrcColor, 165 kDstColor, 166 kOneMinusDstColor, 167 kSrcAlpha, 168 kOneMinusSrcAlpha, 169 kDstAlpha, 170 kOneMinusDstAlpha, 171 kConstantColor, 172 kOneMinusConstantColor, 173 kConstantAlpha, 174 kOneMinusConstantAlpha, 175 kSrcAlphaSaturate, 176 kSrc1Color, 177 kOneMinusSrc1Color, 178 kSrc1Alpha, 179 kOneMinusSrc1Alpha, 180 }; 181 182 Topology NameToTopology(const std::string& name); 183 184 } // namespace amber 185 186 #endif // SRC_COMMAND_DATA_H_ 187