swr: [rasterizer core] Use CS spill/fill size in core

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley 2016-04-03 23:20:58 -06:00
parent ee9621e2f5
commit 244ae7af1b
4 changed files with 9 additions and 5 deletions

View file

@ -527,11 +527,13 @@ void SwrSetGsFunc(
void SwrSetCsFunc(
HANDLE hContext,
PFN_CS_FUNC pfnCsFunc,
uint32_t totalThreadsInGroup)
uint32_t totalThreadsInGroup,
uint32_t totalSpillFillSize)
{
API_STATE* pState = GetDrawState(GetContext(hContext));
pState->pfnCsFunc = pfnCsFunc;
pState->totalThreadsInGroup = totalThreadsInGroup;
pState->totalSpillFillSize = totalSpillFillSize;
}
void SwrSetTsState(

View file

@ -254,12 +254,14 @@ void SWR_API SwrSetGsFunc(
//////////////////////////////////////////////////////////////////////////
/// @brief Set compute shader
/// @param hContext - Handle passed back from SwrCreateContext
/// @param pState - Pointer to compute shader function
/// @param pfnCsFunc - Pointer to compute shader function
/// @param totalThreadsInGroup - product of thread group dimensions.
/// @param totalSpillFillSize - size in bytes needed for spill/fill.
void SWR_API SwrSetCsFunc(
HANDLE hContext,
PFN_CS_FUNC pfnCsFunc,
uint32_t totalThreadsInGroup);
uint32_t totalThreadsInGroup,
uint32_t totalSpillFillSize);
//////////////////////////////////////////////////////////////////////////
/// @brief Set tessellation state.

View file

@ -82,8 +82,7 @@ void ProcessComputeBE(DRAW_CONTEXT* pDC, uint32_t workerId, uint32_t threadGroup
// Ensure spill fill memory has been allocated.
if (pSpillFillBuffer == nullptr)
{
///@todo Add state which indicates the spill fill size.
pSpillFillBuffer = pDC->pArena->AllocAlignedSync(4 * sizeof(MEGABYTE), sizeof(float) * 8);
pSpillFillBuffer = pDC->pArena->AllocAlignedSync(pDC->pState->state.totalSpillFillSize, sizeof(float) * 8);
}
const API_STATE& state = GetApiState(pDC);

View file

@ -245,6 +245,7 @@ OSALIGNLINE(struct) API_STATE
// CS - Compute Shader
PFN_CS_FUNC pfnCsFunc;
uint32_t totalThreadsInGroup;
uint32_t totalSpillFillSize;
// FE - Frontend State
SWR_FRONTEND_STATE frontendState;