diff options
author | Tim Rowley <[email protected]> | 2016-04-03 23:20:58 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-04-22 18:47:02 -0500 |
commit | 244ae7af1ba4ea8c5160b9da8db5e652e19b1a01 (patch) | |
tree | 2b11cf201d0417211f6f074933fd384220e8a1ec /src/gallium | |
parent | ee9621e2f5653cf2dfa8589bd3a57bafb122c6bd (diff) |
swr: [rasterizer core] Use CS spill/fill size in core
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium')
4 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/api.cpp b/src/gallium/drivers/swr/rasterizer/core/api.cpp index ca9cfdb629e..06cbf7fb93d 100644 --- a/src/gallium/drivers/swr/rasterizer/core/api.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/api.cpp @@ -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( diff --git a/src/gallium/drivers/swr/rasterizer/core/api.h b/src/gallium/drivers/swr/rasterizer/core/api.h index 90c2f038c46..04cdb9e4e65 100644 --- a/src/gallium/drivers/swr/rasterizer/core/api.h +++ b/src/gallium/drivers/swr/rasterizer/core/api.h @@ -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. diff --git a/src/gallium/drivers/swr/rasterizer/core/backend.cpp b/src/gallium/drivers/swr/rasterizer/core/backend.cpp index b2d3d9ef4f4..d8ffdaa3ab4 100644 --- a/src/gallium/drivers/swr/rasterizer/core/backend.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/backend.cpp @@ -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); diff --git a/src/gallium/drivers/swr/rasterizer/core/context.h b/src/gallium/drivers/swr/rasterizer/core/context.h index 6464aa20af7..540c690556a 100644 --- a/src/gallium/drivers/swr/rasterizer/core/context.h +++ b/src/gallium/drivers/swr/rasterizer/core/context.h @@ -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; |