From 244f5d4f1cc30c8428e61a1d8d5f9892776f32ef Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sat, 13 Jul 2019 15:30:14 +0300 Subject: [PATCH] [GPU] xenos.h: Add IsPrimitiveTwoFaced --- src/xenia/gpu/xenos.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/xenos.h b/src/xenia/gpu/xenos.h index 88c3177e8..db795569c 100644 --- a/src/xenia/gpu/xenos.h +++ b/src/xenia/gpu/xenos.h @@ -43,12 +43,33 @@ enum class PrimitiveType : uint32_t { k2DFillRectList = 0x14, k2DLineStrip = 0x15, 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, kTrianglePatch = 0x11, 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 { kDiscrete = 0, kContinuous = 1,