swr/rast: add memory api to SwrGetInterface()

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
Tim Rowley 2017-04-21 22:14:16 -05:00
parent a46539af11
commit 18d5c452d0
6 changed files with 54 additions and 28 deletions

View File

@ -1705,4 +1705,7 @@ void SwrGetInterface(SWR_INTERFACE &out_funcs)
out_funcs.pfnSwrEnableStatsBE = SwrEnableStatsBE;
out_funcs.pfnSwrEndFrame = SwrEndFrame;
out_funcs.pfnSwrInit = SwrInit;
out_funcs.pfnSwrLoadHotTile = SwrLoadHotTile;
out_funcs.pfnSwrStoreHotTileToSurface = SwrStoreHotTileToSurface;
out_funcs.pfnSwrStoreHotTileClear = SwrStoreHotTileClear;
}

View File

@ -660,6 +660,48 @@ SWR_FUNC(void, SwrEndFrame,
SWR_FUNC(void, SwrInit);
//////////////////////////////////////////////////////////////////////////
/// @brief Loads a full hottile from a render surface
/// @param hPrivateContext - Handle to private DC
/// @param dstFormat - Format for hot tile.
/// @param renderTargetIndex - Index to src render target
/// @param x, y - Coordinates to raster tile.
/// @param pDstHotTile - Pointer to Hot Tile
SWR_FUNC(void, SwrLoadHotTile,
const SWR_SURFACE_STATE *pSrcSurface,
SWR_FORMAT dstFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
uint32_t x, uint32_t y, uint32_t renderTargetArrayIndex,
uint8_t *pDstHotTile);
//////////////////////////////////////////////////////////////////////////
/// @brief Deswizzles and stores a full hottile to a render surface
/// @param hPrivateContext - Handle to private DC
/// @param srcFormat - Format for hot tile.
/// @param renderTargetIndex - Index to destination render target
/// @param x, y - Coordinates to raster tile.
/// @param pSrcHotTile - Pointer to Hot Tile
SWR_FUNC(void, SwrStoreHotTileToSurface,
SWR_SURFACE_STATE *pDstSurface,
SWR_FORMAT srcFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
uint32_t x, uint32_t y, uint32_t renderTargetArrayIndex,
uint8_t *pSrcHotTile);
//////////////////////////////////////////////////////////////////////////
/// @brief Writes clear color to every pixel of a render surface
/// @param hPrivateContext - Handle to private DC
/// @param renderTargetIndex - Index to destination render target
/// @param x, y - Coordinates to raster tile.
/// @param pClearColor - Pointer to clear color
SWR_FUNC(void, SwrStoreHotTileClear,
SWR_SURFACE_STATE *pDstSurface,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
UINT x,
UINT y,
uint32_t renderTargetArrayIndex,
const float* pClearColor);
struct SWR_INTERFACE
{
PFNSwrCreateContext pfnSwrCreateContext;
@ -707,6 +749,9 @@ struct SWR_INTERFACE
PFNSwrEnableStatsBE pfnSwrEnableStatsBE;
PFNSwrEndFrame pfnSwrEndFrame;
PFNSwrInit pfnSwrInit;
PFNSwrLoadHotTile pfnSwrLoadHotTile;
PFNSwrStoreHotTileToSurface pfnSwrStoreHotTileToSurface;
PFNSwrStoreHotTileClear pfnSwrStoreHotTileClear;
};
extern "C" {

View File

@ -152,7 +152,7 @@ struct StoreMacroTileClear
/// @param renderTargetIndex - Index to destination render target
/// @param x, y - Coordinates to raster tile.
/// @param pClearColor - Pointer to clear color
void StoreHotTileClear(
void SwrStoreHotTileClear(
SWR_SURFACE_STATE *pDstSurface,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
UINT x,

View File

@ -53,7 +53,7 @@ static std::mutex sBucketMutex;
/// @param renderTargetIndex - Index to src render target
/// @param x, y - Coordinates to raster tile.
/// @param pDstHotTile - Pointer to Hot Tile
void LoadHotTile(
void SwrLoadHotTile(
const SWR_SURFACE_STATE *pSrcSurface,
SWR_FORMAT dstFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,

View File

@ -58,7 +58,7 @@ static std::vector<int32_t> sBuckets(NUM_SWR_FORMATS, -1);
/// @param renderTargetIndex - Index to destination render target
/// @param x, y - Coordinates to raster tile.
/// @param pSrcHotTile - Pointer to Hot Tile
void StoreHotTileToSurface(
void SwrStoreHotTileToSurface(
SWR_SURFACE_STATE *pDstSurface,
SWR_FORMAT srcFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,

View File

@ -23,28 +23,6 @@
#pragma once
void LoadHotTile(
const SWR_SURFACE_STATE *pSrcSurface,
SWR_FORMAT dstFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
UINT x, UINT y, uint32_t renderTargetArrayIndex,
uint8_t *pDstHotTile);
void StoreHotTileToSurface(
SWR_SURFACE_STATE *pDstSurface,
SWR_FORMAT srcFormat,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
UINT x, UINT y, uint32_t renderTargetArrayIndex,
uint8_t *pSrcHotTile);
void StoreHotTileClear(
SWR_SURFACE_STATE *pDstSurface,
SWR_RENDERTARGET_ATTACHMENT renderTargetIndex,
UINT x,
UINT y,
uint32_t renderTargetArrayIndex,
const float* pClearColor);
INLINE void
swr_LoadHotTile(HANDLE hPrivateContext,
SWR_FORMAT dstFormat,
@ -56,7 +34,7 @@ swr_LoadHotTile(HANDLE hPrivateContext,
swr_draw_context *pDC = (swr_draw_context*)hPrivateContext;
SWR_SURFACE_STATE *pSrcSurface = &pDC->renderTargets[renderTargetIndex];
LoadHotTile(pSrcSurface, dstFormat, renderTargetIndex, x, y, renderTargetArrayIndex, pDstHotTile);
SwrLoadHotTile(pSrcSurface, dstFormat, renderTargetIndex, x, y, renderTargetArrayIndex, pDstHotTile);
}
INLINE void
@ -70,7 +48,7 @@ swr_StoreHotTile(HANDLE hPrivateContext,
swr_draw_context *pDC = (swr_draw_context*)hPrivateContext;
SWR_SURFACE_STATE *pDstSurface = &pDC->renderTargets[renderTargetIndex];
StoreHotTileToSurface(pDstSurface, srcFormat, renderTargetIndex, x, y, renderTargetArrayIndex, pSrcHotTile);
SwrStoreHotTileToSurface(pDstSurface, srcFormat, renderTargetIndex, x, y, renderTargetArrayIndex, pSrcHotTile);
}
INLINE void
@ -85,5 +63,5 @@ swr_StoreHotTileClear(HANDLE hPrivateContext,
swr_draw_context *pDC = (swr_draw_context*)hPrivateContext;
SWR_SURFACE_STATE *pDstSurface = &pDC->renderTargets[renderTargetIndex];
StoreHotTileClear(pDstSurface, renderTargetIndex, x, y, renderTargetArrayIndex, pClearColor);
SwrStoreHotTileClear(pDstSurface, renderTargetIndex, x, y, renderTargetArrayIndex, pClearColor);
}