From: Tim Rowley Date: Mon, 4 Apr 2016 05:20:58 +0000 (-0600) Subject: swr: [rasterizer core] Use CS spill/fill size in core X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=244ae7af1ba4ea8c5160b9da8db5e652e19b1a01;p=mesa.git swr: [rasterizer core] Use CS spill/fill size in core Reviewed-by: Bruce Cherniak --- 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;