7namespace Grindstone::GraphicsAPI {
17 ClearColor() : float32{ 0.0f, 0.0f, 0.0f, 0.0f } {};
18 ClearColor(
float* v) : float32{ v[0], v[1], v[2], v[3] } {};
19 ClearColor(int32_t* v) : int32{ v[0], v[1], v[2], v[3] } {};
20 ClearColor(uint32_t* v) : uint32{ v[0], v[1], v[2], v[3] } {};
22 ClearColor(
float r,
float g,
float b,
float a) : float32{ r, g, b, a } {};
23 ClearColor(int32_t r, int32_t g, int32_t b, int32_t a) : int32{ r, g, b, a } {};
24 ClearColor(uint32_t r, uint32_t g, uint32_t b, uint32_t a) : uint32{ r, g, b, a } {};
26 ClearColor(
const ClearColor& other) : uint32{ other.uint32[0], other.uint32[1] , other.uint32[2] , other.uint32[3] } {};
28 ClearColor& operator=(
const ClearColor& other) {
29 float32[0] = other.float32[0];
30 float32[1] = other.float32[1];
31 float32[2] = other.float32[2];
32 float32[3] = other.float32[3];
36 ~ClearColor() =
default;
50 ClearUnion() : color() {}
54 ClearUnion(
const ClearUnion& other) : color(other.color) {}
56 ClearUnion& operator=(
const ClearUnion& other) {
73 enum class TextureWrapMode : uint8_t {
81 enum class TextureFilter : uint8_t {
86 enum class ClearMode : uint8_t {
94 enum class ImageLayout : uint8_t {
106 enum class MemoryUsage {
114 enum class ImageDimension {
121 enum class ImageAspectBits : uint16_t {
125 Stencil = 0x00000004,
126 Metadata = 0x00000008,
130 MemoryPlane0 = 0x00000080,
131 MemoryPlane1 = 0x00000100,
132 MemoryPlane2 = 0x00000200,
133 MemoryPlane3 = 0x00000400,
136 inline ImageAspectBits operator|(ImageAspectBits a, ImageAspectBits b) {
137 return static_cast<ImageAspectBits
>(
static_cast<uint32_t
>(a) |
static_cast<uint32_t
>(b));
140 inline ImageAspectBits& operator|=(ImageAspectBits& a, ImageAspectBits b) {
145 enum class PipelineStageBit : uint32_t {
147 TopOfPipe = 0x00000001,
148 DrawIndirect = 0x00000002,
149 VertexInput = 0x00000004,
150 VertexShader = 0x00000008,
151 TesslationControlShader = 0x00000010,
152 TesselationEvaluationShader = 0x00000020,
153 GeometryShader = 0x00000040,
154 FragmentShader = 0x00000080,
155 EarlyFragmentTests = 0x00000100,
156 LateFragmentTests = 0x00000200,
157 ColorAttachmentOutput = 0x00000400,
158 ComputeShader = 0x00000800,
159 Transfer = 0x00001000,
160 BottomOfPipe = 0x00002000,
162 AllGraphics = 0x00008000,
163 AllCommands = 0x00010000,
164 TransformFeedback = 0x01000000,
165 ConditionalRendering = 0x00040000,
166 AccelerationStructureBuild = 0x02000000,
167 RayTracingShader = 0x00200000,
168 FragmentDensityProcess = 0x00800000,
169 FragmentShaderRateAttachment = 0x00400000,
170 CommandPreprocess = 0x00020000,
171 TaskShader = 0x00080000,
172 MeshShader = 0x00100000,
175 inline PipelineStageBit operator|(PipelineStageBit a, PipelineStageBit b) {
176 return static_cast<PipelineStageBit
>(
static_cast<uint32_t
>(a) |
static_cast<uint32_t
>(b));
179 inline PipelineStageBit& operator|=(PipelineStageBit& a, PipelineStageBit b) {
187 R4G4B4A4_UNORM_PACK16,
188 B4G4R4A4_UNORM_PACK16,
191 R5G5B5A1_UNORM_PACK16,
192 B5G5R5A1_UNORM_PACK16,
193 A1R5G5B5_UNORM_PACK16,
236 A8B8G8R8_UNORM_PACK32,
237 A8B8G8R8_SNORM_PACK32,
238 A8B8G8R8_USCALED_PACK32,
239 A8B8G8R8_SSCALED_PACK32,
240 A8B8G8R8_UINT_PACK32,
241 A8B8G8R8_SINT_PACK32,
242 A8B8G8R8_SRGB_PACK32,
243 A2R10G10B10_UNORM_PACK32,
244 A2R10G10B10_SNORM_PACK32,
245 A2R10G10B10_USCALED_PACK32,
246 A2R10G10B10_SSCALED_PACK32,
247 A2R10G10B10_UINT_PACK32,
248 A2R10G10B10_SINT_PACK32,
249 A2B10G10R10_UNORM_PACK32,
250 A2B10G10R10_SNORM_PACK32,
251 A2B10G10R10_USCALED_PACK32,
252 A2B10G10R10_SSCALED_PACK32,
253 A2B10G10R10_UINT_PACK32,
254 A2B10G10R10_SINT_PACK32,
278 R16G16B16A16_USCALED,
279 R16G16B16A16_SSCALED,
307 B10G11R11_UFLOAT_PACK32,
308 E5B9G9R9_UFLOAT_PACK32,
320 BC1_RGBA_UNORM_BLOCK,
334 ETC2_R8G8B8_UNORM_BLOCK,
335 ETC2_R8G8B8_SRGB_BLOCK,
336 ETC2_R8G8B8A1_UNORM_BLOCK,
337 ETC2_R8G8B8A1_SRGB_BLOCK,
338 ETC2_R8G8B8A8_UNORM_BLOCK,
339 ETC2_R8G8B8A8_SRGB_BLOCK,
342 EAC_R11G11_UNORM_BLOCK,
343 EAC_R11G11_SNORM_BLOCK,
344 ASTC_4x4_UNORM_BLOCK,
346 ASTC_5x4_UNORM_BLOCK,
348 ASTC_5x5_UNORM_BLOCK,
350 ASTC_6x5_UNORM_BLOCK,
352 ASTC_6x6_UNORM_BLOCK,
354 ASTC_8x5_UNORM_BLOCK,
356 ASTC_8x6_UNORM_BLOCK,
358 ASTC_8x8_UNORM_BLOCK,
360 ASTC_10x5_UNORM_BLOCK,
361 ASTC_10x5_SRGB_BLOCK,
362 ASTC_10x6_UNORM_BLOCK,
363 ASTC_10x6_SRGB_BLOCK,
364 ASTC_10x8_UNORM_BLOCK,
365 ASTC_10x8_SRGB_BLOCK,
366 ASTC_10x10_UNORM_BLOCK,
367 ASTC_10x10_SRGB_BLOCK,
368 ASTC_12x10_UNORM_BLOCK,
369 ASTC_12x10_SRGB_BLOCK,
370 ASTC_12x12_UNORM_BLOCK,
371 ASTC_12x12_SRGB_BLOCK,
374 G8_B8_R8_3PLANE_420_UNORM,
375 G8_B8R8_2PLANE_420_UNORM,
376 G8_B8_R8_3PLANE_422_UNORM,
377 G8_B8R8_2PLANE_422_UNORM,
378 G8_B8_R8_3PLANE_444_UNORM,
380 R10X6G10X6_UNORM_2PACK16,
381 R10X6G10X6B10X6A10X6_UNORM_4PACK16,
382 G10X6B10X6G10X6R10X6_422_UNORM_4PACK16,
383 B10X6G10X6R10X6G10X6_422_UNORM_4PACK16,
384 G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16,
385 G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16,
386 G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16,
387 G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16,
388 G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16,
390 R12X4G12X4_UNORM_2PACK16,
391 R12X4G12X4B12X4A12X4_UNORM_4PACK16,
392 G12X4B12X4G12X4R12X4_422_UNORM_4PACK16,
393 B12X4G12X4R12X4G12X4_422_UNORM_4PACK16,
394 G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16,
395 G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16,
396 G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16,
397 G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16,
398 G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16,
399 G16B16G16R16_422_UNORM,
400 B16G16R16G16_422_UNORM,
401 G16_B16_R16_3PLANE_420_UNORM,
402 G16_B16R16_2PLANE_420_UNORM,
403 G16_B16_R16_3PLANE_422_UNORM,
404 G16_B16R16_2PLANE_422_UNORM,
405 G16_B16_R16_3PLANE_444_UNORM,
406 G8_B8R8_2PLANE_444_UNORM,
407 G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
408 G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16,
409 G16_B16R16_2PLANE_444_UNORM,
410 A4R4G4B4_UNORM_PACK16,
411 A4B4G4R4_UNORM_PACK16,
437 A1B5G5R5_UNORM_PACK16,
441 enum class FormatDepthStencilType : uint8_t {
445 DepthStencil =
static_cast<uint8_t
>(FormatDepthStencilType::Depth) |
static_cast<uint8_t
>(FormatDepthStencilType::Stencil)
448 FormatDepthStencilType GetFormatDepthStencilType(Format format);
449 bool IsFormatCompressed(Format format);
450 uint8_t GetCompressedFormatBlockSize(Format format);
451 uint8_t GetFormatBytesPerPixel(Grindstone::GraphicsAPI::Format format);
453 #define SHADER_STAGE_TYPES \
454 GSExpandEntry(Vertex, 1 << 0),\
455 GSExpandEntry(TesselationEvaluation, 1 << 1),\
456 GSExpandEntry(TesselationControl, 1 << 2),\
457 GSExpandEntry(Geometry, 1 << 3),\
458 GSExpandEntry(Fragment, 1 << 4),\
459 GSExpandEntry(Task, 1 << 5),\
460 GSExpandEntry(Mesh, 1 << 6),\
461 GSExpandEntry(Compute, 1 << 7)
463 enum class ShaderStage : uint8_t {
464 #define GSExpandEntry(key, bit) key
467 GraphicsCount = Compute,
471 constexpr uint8_t numShaderGraphicStage =
static_cast<uint8_t
>(ShaderStage::GraphicsCount);
472 constexpr uint8_t numShaderTotalStage =
static_cast<uint8_t
>(ShaderStage::Count);
474 enum class ShaderStageBit : uint8_t {
476#define GSExpandEntry(key, bit) key = bit
479 AllGraphics = Vertex | TesselationEvaluation | TesselationControl | Geometry | Fragment | Task | Mesh,
480 All = AllGraphics | Compute
483 constexpr const char* shaderStageNames[] = {
484 #define GSExpandEntry(key, bit) #key
489 inline const char* GetShaderStageName(Grindstone::GraphicsAPI::ShaderStage stage) {
490 uint8_t index =
static_cast<uint8_t
>(stage);
491 if (index >=
static_cast<uint8_t
>(ShaderStage::Count)) {
495 return shaderStageNames[index];
498 enum class BindingType {
501 CombinedImageSampler,
508 UniformBufferDynamic,
509 StorageBufferDynamic,
510 AccelerationStructure
513#define BLEND_OPERATIONS_LIST \
514 GSExpandEntry(None),\
516 GSExpandEntry(Subtract),\
517 GSExpandEntry(ReverseSubtract),\
518 GSExpandEntry(Minimum),\
519 GSExpandEntry(Maximum),\
520 GSExpandEntry(Zero),\
521 GSExpandEntry(Source),\
522 GSExpandEntry(Destination),\
523 GSExpandEntry(SourceOver),\
524 GSExpandEntry(DestinationOver),\
525 GSExpandEntry(SourceIn),\
526 GSExpandEntry(DestinationIn),\
527 GSExpandEntry(SourceOut),\
528 GSExpandEntry(DestinationOut),\
529 GSExpandEntry(SourceAtop),\
530 GSExpandEntry(DestinationAtop),\
532 GSExpandEntry(Multiply),\
533 GSExpandEntry(Screen),\
534 GSExpandEntry(Overlay),\
535 GSExpandEntry(Darken),\
536 GSExpandEntry(Lighten),\
537 GSExpandEntry(ColorDodge),\
538 GSExpandEntry(ColorBurn),\
539 GSExpandEntry(HardLight),\
540 GSExpandEntry(SoftLight),\
541 GSExpandEntry(Difference),\
542 GSExpandEntry(Exclusion),\
543 GSExpandEntry(Invert),\
544 GSExpandEntry(InvertRGB),\
545 GSExpandEntry(LinearDodge),\
546 GSExpandEntry(LinearBurn),\
547 GSExpandEntry(VividLight),\
548 GSExpandEntry(LinearLight),\
549 GSExpandEntry(PinLight),\
550 GSExpandEntry(HardMix),\
551 GSExpandEntry(HSLHue),\
552 GSExpandEntry(HSLSaturation),\
553 GSExpandEntry(HSLColor),\
554 GSExpandEntry(HSLLuminosity),\
555 GSExpandEntry(Plus),\
556 GSExpandEntry(PlusClamped),\
557 GSExpandEntry(PlusClampedAlpha),\
558 GSExpandEntry(PlusDark),\
559 GSExpandEntry(Minus),\
560 GSExpandEntry(MinusClamped),\
561 GSExpandEntry(Contrast),\
562 GSExpandEntry(InvertOVG),\
564 GSExpandEntry(Green),\
567 enum class BlendOperation : uint8_t {
568#define GSExpandEntry(key) key
569 BLEND_OPERATIONS_LIST,
574 constexpr const char* blendOperationNames[] = {
575 #define GSExpandEntry(key) #key
576 BLEND_OPERATIONS_LIST
580 inline const char* GetBlendOperationName(Grindstone::GraphicsAPI::BlendOperation op) {
581 uint8_t index =
static_cast<uint8_t
>(op);
582 if (index >=
static_cast<uint8_t
>(BlendOperation::Count)) {
586 return blendOperationNames[index];
590#define BLEND_FACTORS_LIST \
591 GSExpandEntry(Zero),\
593 GSExpandEntry(SrcColor),\
594 GSExpandEntry(OneMinusSrcColor),\
595 GSExpandEntry(DstColor),\
596 GSExpandEntry(OneMinusDstColor),\
597 GSExpandEntry(SrcAlpha),\
598 GSExpandEntry(OneMinusSrcAlpha),\
599 GSExpandEntry(DstAlpha),\
600 GSExpandEntry(OneMinusDstAlpha),\
601 GSExpandEntry(ConstantColor),\
602 GSExpandEntry(OneMinusConstantColor),\
603 GSExpandEntry(ConstantAlpha),\
604 GSExpandEntry(OneMinusConstantAlpha),\
605 GSExpandEntry(SrcAlphaSaturate),\
606 GSExpandEntry(Src1Color),\
607 GSExpandEntry(OneMinusSrc1Color),\
608 GSExpandEntry(Src1Alpha),\
609 GSExpandEntry(OneMinusSrc1Alpha)
611 enum class BlendFactor : uint8_t {
612 #define GSExpandEntry(key) key
618 constexpr const char* blendFactorNames[] = {
619 #define GSExpandEntry(key) #key
624 inline const char* GetBlendFactorName(Grindstone::GraphicsAPI::BlendFactor factor) {
625 uint8_t index =
static_cast<uint8_t
>(factor);
626 if (index >=
static_cast<uint8_t
>(BlendFactor::Count)) {
630 return blendFactorNames[index];
634 BlendOperation colorOperation = BlendOperation::None;
635 BlendFactor colorFactorSrc = BlendFactor::One;
636 BlendFactor colorFactorDst = BlendFactor::One;
638 BlendOperation alphaOperation = BlendOperation::None;
639 BlendFactor alphaFactorSrc = BlendFactor::One;
640 BlendFactor alphaFactorDst = BlendFactor::One;
644 BlendOperation::None,
648 BlendOperation::None,
669 BlendFactor::SrcAlpha,
670 BlendFactor::OneMinusSrcAlpha,
674 BlendFactor::OneMinusSrcAlpha
679#define GEOMETRY_TYPES_LIST \
680 GSExpandEntry(Points),\
681 GSExpandEntry(Lines),\
682 GSExpandEntry(LineStrips),\
683 GSExpandEntry(LineLoops),\
684 GSExpandEntry(TriangleStrips),\
685 GSExpandEntry(TriangleFans),\
686 GSExpandEntry(Triangles),\
687 GSExpandEntry(LinesAdjacency),\
688 GSExpandEntry(TrianglesAdjacency),\
689 GSExpandEntry(TriangleStripsAdjacency),\
690 GSExpandEntry(Patches)
692 enum class GeometryType : uint8_t {
693 #define GSExpandEntry(key) key
699 constexpr const char* geometryTypeNames[] = {
700 #define GSExpandEntry(key) #key
705 inline const char* GetGeometryTypeName(Grindstone::GraphicsAPI::GeometryType stage) {
706 uint8_t index =
static_cast<uint8_t
>(stage);
707 if (index >=
static_cast<uint8_t
>(GeometryType::Count)) {
711 return geometryTypeNames[index];
714 enum class PolygonFillMode : uint8_t {
720 constexpr const char* polygonFillModeNames[] = {
726 inline const char* GetPolygonFillModeName(Grindstone::GraphicsAPI::PolygonFillMode mode) {
727 uint8_t index =
static_cast<uint8_t
>(mode);
728 if (index >
static_cast<uint8_t
>(PolygonFillMode::Fill)) {
732 return polygonFillModeNames[index];
735 enum class CompareOperation : uint8_t {
746 constexpr const char* compareOperationNames[] = {
747 #define GSExpandEntry(key, bit) #key
752 inline const char* GetCompareOperationName(Grindstone::GraphicsAPI::CompareOperation op) {
753 uint8_t index =
static_cast<uint8_t
>(op);
754 if (index >
static_cast<uint8_t
>(CompareOperation::Always)) {
758 return compareOperationNames[index];
761 enum class ColorMask : uint8_t {
775 RGB = Red | Green | Blue,
776 RGA = Red | Green | Alpha,
777 RBA = Red | Blue | Alpha,
778 GBA = Green | Blue | Alpha,
780 RGBA = Red | Green | Blue | Alpha
783 constexpr const char* colorMaskNames[] = {
802 inline const char* GetColorMaskName(Grindstone::GraphicsAPI::ColorMask colorMask) {
803 uint8_t index =
static_cast<uint8_t
>(colorMask);
804 if (index >
static_cast<uint8_t
>(ColorMask::RGBA)) {
808 return colorMaskNames[index];
811 enum class CullMode : uint8_t {
818 constexpr const char* cullModeNames[] = {
825 inline const char* GetCullModeName(Grindstone::GraphicsAPI::CullMode cullMode) {
826 uint8_t index =
static_cast<uint8_t
>(cullMode);
827 if (index >
static_cast<uint8_t
>(CullMode::Both)) {
831 return cullModeNames[index];
835 enum class AttributeUsage {
850 enum class VertexInputRate {
857 const char* name =
nullptr;
858 uint32_t bindingIndex;
859 uint32_t locationIndex = 0;
860 Format format = Format::R32_SFLOAT;
861 uint32_t byteOffset = 0;
862 AttributeUsage attributeUsage = AttributeUsage::Other;
867 uint32_t bindingIndex;
869 VertexInputRate inputRate = VertexInputRate::Vertex;
873 std::vector<VertexBindingDescription> bindings;
874 std::vector<VertexAttributeDescription> attributes;
877 struct VertexInputLayoutBuilder {
878 std::vector<VertexBindingDescription> bindings;
879 std::vector<VertexAttributeDescription> attributes;
881 VertexInputLayoutBuilder() =
default;
885 uint32_t locationIndex;
888 AttributeUsage attributeUsage;
891 VertexInputLayoutBuilder& AddBinding(
893 std::initializer_list<InlineAttribute> newAttributes
895 bindings.emplace_back(binding);
899 binding.bindingIndex,
900 attrib.locationIndex,
903 attrib.attributeUsage
910 VertexInputLayoutBuilder& AddBinding(VertexBindingDescription binding) {
911 bindings.emplace_back(binding);
915 VertexInputLayoutBuilder& AddAttribute(VertexAttributeDescription attribute) {
916 attributes.emplace_back(attribute);
920 VertexInputLayout Build() {
929inline Grindstone::GraphicsAPI::ShaderStageBit ToShaderStageBit(
const Grindstone::GraphicsAPI::ShaderStage stage) {
930 using ShaderStageType = uint8_t;
931 return static_cast<Grindstone::GraphicsAPI::ShaderStageBit
>(1 <<
static_cast<ShaderStageType
>(stage));
934inline Grindstone::GraphicsAPI::ShaderStageBit operator~(
const Grindstone::GraphicsAPI::ShaderStageBit stages) {
935 using ShaderStageBitType = uint8_t;
936 return static_cast<Grindstone::GraphicsAPI::ShaderStageBit
>(~static_cast<ShaderStageBitType>(stages));
939inline Grindstone::GraphicsAPI::ShaderStageBit operator|(
const Grindstone::GraphicsAPI::ShaderStageBit a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
940 using ShaderStageBitType = uint8_t;
941 return static_cast<Grindstone::GraphicsAPI::ShaderStageBit
>(
static_cast<ShaderStageBitType
>(a) |
static_cast<ShaderStageBitType
>(b));
944inline Grindstone::GraphicsAPI::ShaderStageBit operator&(
const Grindstone::GraphicsAPI::ShaderStageBit a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
945 using ShaderStageBitType = uint8_t;
946 return static_cast<Grindstone::GraphicsAPI::ShaderStageBit
>(
static_cast<ShaderStageBitType
>(a) &
static_cast<ShaderStageBitType
>(b));
949inline Grindstone::GraphicsAPI::ShaderStageBit operator^(
const Grindstone::GraphicsAPI::ShaderStageBit a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
950 using ShaderStageBitType = uint8_t;
951 return static_cast<Grindstone::GraphicsAPI::ShaderStageBit
>(
static_cast<ShaderStageBitType
>(a) ^
static_cast<ShaderStageBitType
>(b));
954inline Grindstone::GraphicsAPI::ShaderStageBit& operator|=(Grindstone::GraphicsAPI::ShaderStageBit& a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
959inline Grindstone::GraphicsAPI::ShaderStageBit& operator&=(Grindstone::GraphicsAPI::ShaderStageBit& a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
964inline Grindstone::GraphicsAPI::ShaderStageBit& operator^=(Grindstone::GraphicsAPI::ShaderStageBit& a,
const Grindstone::GraphicsAPI::ShaderStageBit b) {
969inline Grindstone::GraphicsAPI::ColorMask operator~(
const Grindstone::GraphicsAPI::ColorMask stages) {
970 using ColorMaskType = uint8_t;
971 return static_cast<Grindstone::GraphicsAPI::ColorMask
>(~static_cast<ColorMaskType>(stages));
974inline Grindstone::GraphicsAPI::ColorMask operator|(
const Grindstone::GraphicsAPI::ColorMask a,
const Grindstone::GraphicsAPI::ColorMask b) {
975 using ColorMaskType = uint8_t;
976 return static_cast<Grindstone::GraphicsAPI::ColorMask
>(
static_cast<ColorMaskType
>(a) |
static_cast<ColorMaskType
>(b));
979inline Grindstone::GraphicsAPI::ColorMask operator&(
const Grindstone::GraphicsAPI::ColorMask a,
const Grindstone::GraphicsAPI::ColorMask b) {
980 using ColorMaskType = uint8_t;
981 return static_cast<Grindstone::GraphicsAPI::ColorMask
>(
static_cast<ColorMaskType
>(a) &
static_cast<ColorMaskType
>(b));
984inline Grindstone::GraphicsAPI::ColorMask operator^(
const Grindstone::GraphicsAPI::ColorMask a,
const Grindstone::GraphicsAPI::ColorMask b) {
985 using ColorMaskType = uint8_t;
986 return static_cast<Grindstone::GraphicsAPI::ColorMask
>(
static_cast<ColorMaskType
>(a) ^
static_cast<ColorMaskType
>(b));
989inline Grindstone::GraphicsAPI::ColorMask& operator|=(Grindstone::GraphicsAPI::ColorMask& a,
const Grindstone::GraphicsAPI::ColorMask b) {
994inline Grindstone::GraphicsAPI::ColorMask& operator&=(Grindstone::GraphicsAPI::ColorMask& a,
const Grindstone::GraphicsAPI::ColorMask b) {
999inline Grindstone::GraphicsAPI::ColorMask& operator^=(Grindstone::GraphicsAPI::ColorMask& a,
const Grindstone::GraphicsAPI::ColorMask b) {
1006 struct std::hash<Grindstone::GraphicsAPI::VertexBindingDescription> {
1008 size_t result = std::hash<size_t>{}(
1009 static_cast<size_t>(binding.bindingIndex) << 8 |
1010 static_cast<size_t>(binding.stride) << 32
1012 result ^= std::hash<size_t>{}(
static_cast<size_t>(binding.inputRate));
1018 struct std::hash<Grindstone::GraphicsAPI::VertexAttributeDescription> {
1020 size_t result = std::hash<size_t>{}(
1021 static_cast<size_t>(attribute.attributeUsage) |
1022 static_cast<size_t>(attribute.bindingIndex) << 32
1025 result ^= std::hash<size_t>{}(
1026 static_cast<size_t>(attribute.byteOffset) |
1027 static_cast<size_t>(attribute.format) << 32
1030 result ^= std::hash<size_t>{}(
1031 static_cast<size_t>(attribute.locationIndex) << 32
1039 struct std::hash<Grindstone::GraphicsAPI::VertexInputLayout> {
1041 size_t result = std::hash<size_t>{}(vertexInputLayout.attributes.size()) ^ std::hash<size_t>{}(vertexInputLayout.bindings.size());
1044 result ^= std::hash<Grindstone::GraphicsAPI::VertexBindingDescription>{}(binding);
1048 result ^= std::hash<Grindstone::GraphicsAPI::VertexAttributeDescription>{}(attribute);
Definition Formats.hpp:633
Definition Formats.hpp:40
Definition Formats.hpp:856
Definition Formats.hpp:866
Definition Formats.hpp:12