pDC->FeWork.type = DRAW;
pDC->FeWork.pfnWork = GetProcessDrawFunc(
false, // IsIndexed
+ false, // bEnableCutIndex
pState->tsState.tsEnable,
pState->gsState.gsEnable,
pState->soState.soEnable,
pDC->FeWork.type = DRAW;
pDC->FeWork.pfnWork = GetProcessDrawFunc(
true, // IsIndexed
+ pState->frontendState.bEnableCutIndex,
pState->tsState.tsEnable,
pState->gsState.gsEnable,
pState->soState.soEnable,
/// @param pUserData - Pointer to DRAW_WORK
template <
typename IsIndexedT,
+ typename IsCutIndexEnabledT,
typename HasTessellationT,
typename HasGeometryShaderT,
typename HasStreamOutT,
}
// choose primitive assembler
- PA_FACTORY<IsIndexedT> paFactory(pDC, state.topology, work.numVerts);
+ PA_FACTORY<IsIndexedT, IsCutIndexEnabledT> paFactory(pDC, state.topology, work.numVerts);
PA_STATE& pa = paFactory.GetPA();
/// @todo: temporarily move instance loop in the FE to ensure SO ordering
// Selector for correct templated Draw front-end function
PFN_FE_WORK_FUNC GetProcessDrawFunc(
bool IsIndexed,
+ bool IsCutIndexEnabled,
bool HasTessellation,
bool HasGeometryShader,
bool HasStreamOut,
bool HasRasterization)
{
- return TemplateArgUnroller<FEDrawChooser>::GetFunc(IsIndexed, HasTessellation, HasGeometryShader, HasStreamOut, HasRasterization);
+ return TemplateArgUnroller<FEDrawChooser>::GetFunc(IsIndexed, IsCutIndexEnabled, HasTessellation, HasGeometryShader, HasStreamOut, HasRasterization);
}
// ProcessDraw front-end function. All combinations of parameter values are available
PFN_FE_WORK_FUNC GetProcessDrawFunc(
bool IsIndexed,
+ bool IsCutIndexEnabled,
bool HasTessellation,
bool HasGeometryShader,
bool HasStreamOut,
// Primitive Assembler factory class, responsible for creating and initializing the correct assembler
// based on state.
-template <typename IsIndexedT>
+template <typename IsIndexedT, typename IsCutIndexEnabledT>
struct PA_FACTORY
{
PA_FACTORY(DRAW_CONTEXT* pDC, PRIMITIVE_TOPOLOGY in_topo, uint32_t numVerts) : topo(in_topo)
{
#if KNOB_ENABLE_CUT_AWARE_PA == TRUE
const API_STATE& state = GetApiState(pDC);
- if ((IsIndexedT::value && (
+ if ((IsIndexedT::value && IsCutIndexEnabledT::value && (
topo == TOP_TRIANGLE_STRIP || topo == TOP_POINT_LIST ||
topo == TOP_LINE_LIST || topo == TOP_LINE_STRIP ||
topo == TOP_TRIANGLE_LIST || topo == TOP_LINE_LIST_ADJ ||
// skip clip test, perspective divide, and viewport transform
// intended for verts in screen space
bool vpTransformDisable;
+ bool bEnableCutIndex;
union
{
struct
uint32_t triStripList : 2;
};
uint32_t bits;
- }provokingVertex;
+ } provokingVertex;
uint32_t topologyProvokingVertex; // provoking vertex for the draw topology
};
SwrSetFetchFunc(ctx->swrContext, velems->fsFunc);
+ /* Set up frontend state
+ * XXX setup provokingVertex & topologyProvokingVertex */
+ SWR_FRONTEND_STATE feState = {0};
+ feState.bEnableCutIndex = info->primitive_restart;
+ SwrSetFrontendState(ctx->swrContext, &feState);
+
if (info->indexed)
SwrDrawIndexedInstanced(ctx->swrContext,
swr_convert_prim_topology(info->mode),
SwrSetLinkage(ctx->swrContext, linkage, NULL);
- // set up frontend state
- SWR_FRONTEND_STATE feState = {0};
- SwrSetFrontendState(ctx->swrContext, &feState);
-
// set up backend state
SWR_BACKEND_STATE backendState = {0};
backendState.numAttributes = 1;