swr: fix array-bounds warning

Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9502>
This commit is contained in:
Michel Zou 2021-03-11 21:32:40 +01:00 committed by Marge Bot
parent 12af7f97ee
commit 6083ebe078

View file

@ -1856,9 +1856,11 @@ void ProcessDraw(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32_t workerId, vo
vIndex = _simd16_add_epi32(_simd16_set1_epi32(work.startVertexID), vScale);
fetchInfo_lo.xpIndices = pDC->pContext->pfnMakeGfxPtr(GetPrivateState(pDC), &vIndex);
fetchInfo_hi.xpIndices = pDC->pContext->pfnMakeGfxPtr(
GetPrivateState(pDC),
&vIndex + KNOB_SIMD_WIDTH * sizeof(int32_t)); // 1/2 of KNOB_SIMD16_WIDTH
int32_t* sysAddr = reinterpret_cast<int32_t*>(&vIndex);
sysAddr += KNOB_SIMD_WIDTH; // 1/2 of KNOB_SIMD16_WIDTH
fetchInfo_hi.xpIndices = pDC->pContext->pfnMakeGfxPtr(GetPrivateState(pDC), sysAddr);
}
fetchInfo_lo.CurInstance = instanceNum;