// store render target array index
OSALIGNSIMD(uint32_t) aRTAI[KNOB_SIMD_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simdvector vRtai[3];
pa.Assemble(VERTEX_SGV_SLOT, vRtai);
// store render target array index
OSALIGNSIMD16(uint32_t) aRTAI[KNOB_SIMD16_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simd16vector vRtai[3];
pa.Assemble_simd16(VERTEX_SGV_SLOT, vRtai);
// store render target array index
OSALIGNSIMD(uint32_t) aRTAI[KNOB_SIMD_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simdvector vRtai;
pa.Assemble(VERTEX_SGV_SLOT, &vRtai);
// store render target array index
OSALIGNSIMD(uint32_t) aRTAI[KNOB_SIMD_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simdvector vRtai[2];
pa.Assemble(VERTEX_SGV_SLOT, vRtai);
// store render target array index
OSALIGNSIMD16(uint32_t) aRTAI[KNOB_SIMD16_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simd16vector vRtai;
pa.Assemble_simd16(VERTEX_SGV_SLOT, &vRtai);
// store render target array index
OSALIGNSIMD16(uint32_t) aRTAI[KNOB_SIMD16_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simd16vector vRtai[2];
pa.Assemble_simd16(VERTEX_SGV_SLOT, vRtai);
// store render target array index
OSALIGNSIMD(uint32_t) aRTAI[KNOB_SIMD_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simdvector vRtai[2];
pa.Assemble(VERTEX_SGV_SLOT, vRtai);
// store render target array index
OSALIGNSIMD16(uint32_t) aRTAI[KNOB_SIMD16_WIDTH];
- if (gsState.gsEnable && gsState.emitsRenderTargetArrayIndex)
+ if (state.backendState.readRenderTargetArrayIndex)
{
simd16vector vRtai[2];
pa.Assemble_simd16(VERTEX_SGV_SLOT, vRtai);
// instance count
uint32_t instanceCount;
- // geometry shader emits renderTargetArrayIndex
- bool emitsRenderTargetArrayIndex;
-
// geometry shader emits ViewportArrayIndex
bool emitsViewportArrayIndex;
// setting up attributes for the backend, otherwise
// all attributes up to numAttributes will be sent
SWR_ATTRIB_SWIZZLE swizzleMap[32];
+
+ bool readRenderTargetArrayIndex; // Forward render target array index from last FE stage to the backend
};
(ctx->rasterizer->flatshade ? ctx->fs->flatConstantMask : 0);
backendState.pointSpriteTexCoordMask = ctx->fs->pointSpriteMask;
+ if (ctx->gs)
+ backendState.readRenderTargetArrayIndex =
+ ctx->gs->info.base.writes_layer;
+ else
+ backendState.readRenderTargetArrayIndex =
+ ctx->vs->info.base.writes_layer;
+
SwrSetBackendState(ctx->swrContext, &backendState);
/* Ensure that any in-progress attachment change StoreTiles finish */