| 1 | #pragma once |
| 2 | |
| 3 | #include <nn/gfx/detail/gfx_Misc.h> |
| 4 | #include <nn/nn_BitTypes.h> |
| 5 | #include <nn/util/util_BitPack.h> |
| 6 | |
| 7 | namespace nn::gfx { |
| 8 | |
| 9 | struct MultisampleStateInfoData { |
| 10 | enum Flag { Flag_AlphaToCoverageEnable }; |
| 11 | |
| 12 | uint8_t sampleCount; |
| 13 | char reserved2; |
| 14 | nn::util::BitPack16 flag; |
| 15 | uint32_t sampleMask; |
| 16 | char reserved[8]; |
| 17 | }; |
| 18 | |
| 19 | struct RasterizerStateInfoData { |
| 20 | enum Flag { |
| 21 | Flag_RasterDisable, |
| 22 | Flag_MultisampleEnable, |
| 23 | Flag_DepthClipDisable, |
| 24 | Flag_ScissorEnable |
| 25 | }; |
| 26 | |
| 27 | Bit8 fillMode; |
| 28 | Bit8 frontFace; |
| 29 | Bit8 cullMode; |
| 30 | Bit8 primitiveTopologyType; |
| 31 | nn::util::BitPack16 flag; |
| 32 | Bit8 conservativeRasterizationMode; |
| 33 | char reserved2; |
| 34 | float slopeScaledDepthBias; |
| 35 | int32_t depthBias; |
| 36 | float depthBiasClamp; |
| 37 | char reserved3[4]; |
| 38 | MultisampleStateInfoData multisample; |
| 39 | char reserved[24]; |
| 40 | }; |
| 41 | |
| 42 | struct BlendTargetStateInfoData { |
| 43 | enum Flag { Flag_BlendEnable }; |
| 44 | |
| 45 | nn::util::BitPack8 flag; |
| 46 | Bit8 sourceColorBlendFactor; |
| 47 | Bit8 destinationColorBlendFactor; |
| 48 | Bit8 colorBlendFunction; |
| 49 | Bit8 sourceAlphaBlendFactor; |
| 50 | Bit8 destinationAlphaBlendFactor; |
| 51 | Bit8 alphaBlendFunction; |
| 52 | Bit8 channelMask; |
| 53 | char reserved[24]; |
| 54 | }; |
| 55 | |
| 56 | struct BlendStateInfoData { |
| 57 | enum Flag { |
| 58 | Flag_AlphaToCoverageEnable, |
| 59 | Flag_DualSourceBlendEnable, |
| 60 | Flag_IndependentBlendEnable, |
| 61 | Flag_LogicOperationEnable |
| 62 | }; |
| 63 | |
| 64 | uint8_t blendTargetCount; |
| 65 | Bit8 logicOperation; |
| 66 | nn::util::BitPack16 flag; |
| 67 | float blendConstant[4]; |
| 68 | char reserved2[4]; |
| 69 | detail::Ptr<const BlendTargetStateInfoData> pBlendTargetArray; |
| 70 | char reserved[16]; |
| 71 | }; |
| 72 | |
| 73 | struct StencilStateInfoData { |
| 74 | Bit8 stencilFailOperation; |
| 75 | Bit8 depthFailOperation; |
| 76 | Bit8 depthPassOperation; |
| 77 | Bit8 comparisonFunction; |
| 78 | uint8_t stencilRef; |
| 79 | char reserved[11]; |
| 80 | }; |
| 81 | |
| 82 | struct DepthStencilStateInfoData { |
| 83 | enum Flag { |
| 84 | Flag_DepthTestEnable, |
| 85 | Flag_DepthWriteEnable, |
| 86 | Flag_StencilTestEnable, |
| 87 | Flag_DepthBoundsTestEnable |
| 88 | }; |
| 89 | |
| 90 | Bit8 depthComparisonFunction; |
| 91 | uint8_t stencilReadMask; |
| 92 | uint8_t stencilWriteMask; |
| 93 | char reserved2; |
| 94 | nn::util::BitPack16 flag; |
| 95 | char reserved3[2]; |
| 96 | StencilStateInfoData frontStencil; |
| 97 | StencilStateInfoData backStencil; |
| 98 | char reserved[24]; |
| 99 | }; |
| 100 | |
| 101 | struct ColorTargetStateInfoData { |
| 102 | Bit32 format; |
| 103 | char reserved[28]; |
| 104 | }; |
| 105 | |
| 106 | struct RenderTargetStateInfoData { |
| 107 | uint8_t colorTargetCount; |
| 108 | char reserved2[3]; |
| 109 | Bit32 depthStencilFormat; |
| 110 | detail::Ptr<const ColorTargetStateInfoData> pColorTargetStateArray; |
| 111 | char reserved[16]; |
| 112 | }; |
| 113 | |
| 114 | struct VertexAttributeStateInfoData { |
| 115 | uint8_t semanticIndex; |
| 116 | char reserved2; |
| 117 | int16_t shaderSlot; |
| 118 | uint16_t bufferIndex; |
| 119 | char reserved3[2]; |
| 120 | uint32_t offset; |
| 121 | Bit32 format; |
| 122 | detail::Ptr<const char> pName; |
| 123 | char reserved[16]; |
| 124 | }; |
| 125 | |
| 126 | struct VertexBufferStateInfoData { |
| 127 | int32_t stride; |
| 128 | uint32_t divisor; |
| 129 | char reserved[8]; |
| 130 | }; |
| 131 | |
| 132 | struct VertexStateInfoData { |
| 133 | uint16_t attributeCount; |
| 134 | uint16_t bufferCount; |
| 135 | char reserved2[4]; |
| 136 | detail::Ptr<const VertexAttributeStateInfoData> pAttributeArray; |
| 137 | detail::Ptr<const VertexBufferStateInfoData> pBufferArray; |
| 138 | char reserved[24]; |
| 139 | }; |
| 140 | |
| 141 | struct TessellationStateInfoData { |
| 142 | uint16_t patchControlPointCount; |
| 143 | char reserved[30]; |
| 144 | }; |
| 145 | |
| 146 | struct DepthRangeInfoData { |
| 147 | float minDepth; |
| 148 | float maxDepth; |
| 149 | char reserved[8]; |
| 150 | }; |
| 151 | |
| 152 | struct ViewportStateInfoData { |
| 153 | float originX; |
| 154 | float originY; |
| 155 | float width; |
| 156 | float height; |
| 157 | DepthRangeInfoData depthRange; |
| 158 | char reserved[16]; |
| 159 | }; |
| 160 | |
| 161 | struct ScissorStateInfoData { |
| 162 | uint32_t originX; |
| 163 | uint32_t originY; |
| 164 | uint32_t width; |
| 165 | uint32_t height; |
| 166 | char reserved[16]; |
| 167 | }; |
| 168 | |
| 169 | struct ViewportScissorStateInfoData { |
| 170 | enum Flag { Flag_ScissorEnable }; |
| 171 | |
| 172 | nn::util::BitPack8 flag; |
| 173 | char reserved2; |
| 174 | uint16_t viewportCount; |
| 175 | uint16_t scissorCount; |
| 176 | char reserved3[2]; |
| 177 | detail::Ptr<const ViewportStateInfoData> pViewportArray; |
| 178 | detail::Ptr<const ScissorStateInfoData> pScissorArray; |
| 179 | char reserved[8]; |
| 180 | }; |
| 181 | |
| 182 | } // namespace nn::gfx |