[GPU] VGT major mode info, swap IsPrimitiveTwoFaced arguments

This commit is contained in:
Triang3l 2019-07-13 22:18:06 +03:00
parent 244f5d4f1c
commit 1cc06ea3e7
1 changed files with 11 additions and 1 deletions

View File

@ -36,6 +36,15 @@ enum class PrimitiveType : uint32_t {
kQuadList = 0x0D, kQuadList = 0x0D,
kQuadStrip = 0x0E, kQuadStrip = 0x0E,
kPolygon = 0x0F, kPolygon = 0x0F,
// Starting with this primitive mode, registers like VGT_OUTPUT_PATH_CNTL have
// effect (deduced from R6xx/R7xx registers, and Halo 3 also doesn't reset
// VGT_OUTPUT_PATH_CNTL after the first draw with tessellation).
// TODO(Triang3l): Find out if VGT_DRAW_INITIATOR (0x21FC on Adreno 2xx, but
// not seen being used in games) specifies the major mode (or if it's set
// somewhere else).
kExplicitMajorModeForceStart = 0x10,
k2DCopyRectListV0 = 0x10, k2DCopyRectListV0 = 0x10,
k2DCopyRectListV1 = 0x11, k2DCopyRectListV1 = 0x11,
k2DCopyRectListV2 = 0x12, k2DCopyRectListV2 = 0x12,
@ -43,6 +52,7 @@ enum class PrimitiveType : uint32_t {
k2DFillRectList = 0x14, k2DFillRectList = 0x14,
k2DLineStrip = 0x15, k2DLineStrip = 0x15,
k2DTriStrip = 0x16, k2DTriStrip = 0x16,
// Tessellation patches (D3DTPT) when VGT_OUTPUT_PATH_CNTL & 3 is // Tessellation patches (D3DTPT) when VGT_OUTPUT_PATH_CNTL & 3 is
// VGT_OUTPATH_TESS_EN (1). // VGT_OUTPATH_TESS_EN (1).
kLinePatch = 0x10, kLinePatch = 0x10,
@ -50,7 +60,7 @@ enum class PrimitiveType : uint32_t {
kQuadPatch = 0x12, kQuadPatch = 0x12,
}; };
inline bool IsPrimitiveTwoFaced(PrimitiveType type, bool tessellated) { inline bool IsPrimitiveTwoFaced(bool tessellated, PrimitiveType type) {
if (tessellated) { if (tessellated) {
return type == PrimitiveType::kTrianglePatch || return type == PrimitiveType::kTrianglePatch ||
type == PrimitiveType::kQuadPatch; type == PrimitiveType::kQuadPatch;