[GPU] xenos.h: Add IsPrimitiveTwoFaced

This commit is contained in:
Triang3l 2019-07-13 15:30:14 +03:00
parent 3238fae758
commit 244f5d4f1c
1 changed files with 22 additions and 1 deletions

View File

@ -43,12 +43,33 @@ enum class PrimitiveType : uint32_t {
k2DFillRectList = 0x14, k2DFillRectList = 0x14,
k2DLineStrip = 0x15, k2DLineStrip = 0x15,
k2DTriStrip = 0x16, k2DTriStrip = 0x16,
// Tessellation patches (D3DTPT) - reusing 2DCopyRectList types. // Tessellation patches (D3DTPT) when VGT_OUTPUT_PATH_CNTL & 3 is
// VGT_OUTPATH_TESS_EN (1).
kLinePatch = 0x10, kLinePatch = 0x10,
kTrianglePatch = 0x11, kTrianglePatch = 0x11,
kQuadPatch = 0x12, kQuadPatch = 0x12,
}; };
inline bool IsPrimitiveTwoFaced(PrimitiveType type, bool tessellated) {
if (tessellated) {
return type == PrimitiveType::kTrianglePatch ||
type == PrimitiveType::kQuadPatch;
}
switch (type) {
case PrimitiveType::kTriangleList:
case PrimitiveType::kTriangleFan:
case PrimitiveType::kTriangleStrip:
case PrimitiveType::kTriangleWithWFlags:
case PrimitiveType::kQuadList:
case PrimitiveType::kQuadStrip:
case PrimitiveType::kPolygon:
return true;
default:
break;
}
return false;
}
enum class TessellationMode : uint32_t { enum class TessellationMode : uint32_t {
kDiscrete = 0, kDiscrete = 0,
kContinuous = 1, kContinuous = 1,