From: Tim Rowley Date: Tue, 12 Apr 2016 23:24:18 +0000 (-0600) Subject: swr: [rasterizer memory] Constify load tiles X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec089cd987212566da146f0ddaf11dc28efec7ad;p=mesa.git swr: [rasterizer memory] Constify load tiles Reviewed-by: Bruce Cherniak --- diff --git a/src/gallium/drivers/swr/rasterizer/memory/LoadTile.cpp b/src/gallium/drivers/swr/rasterizer/memory/LoadTile.cpp index 5d9c0045a8a..24cfaefec93 100644 --- a/src/gallium/drivers/swr/rasterizer/memory/LoadTile.cpp +++ b/src/gallium/drivers/swr/rasterizer/memory/LoadTile.cpp @@ -33,7 +33,7 @@ #include "memory/tilingtraits.h" #include "memory/Convert.h" -typedef void(*PFN_LOAD_TILES)(SWR_SURFACE_STATE*, uint8_t*, uint32_t, uint32_t, uint32_t); +typedef void(*PFN_LOAD_TILES)(const SWR_SURFACE_STATE*, uint8_t*, uint32_t, uint32_t, uint32_t); ////////////////////////////////////////////////////////////////////////// /// Load Raster Tile Function Tables. @@ -83,7 +83,7 @@ struct LoadRasterTile /// @param pDst - Destination hot tile pointer /// @param x, y - Coordinates to raster tile. INLINE static void Load( - SWR_SURFACE_STATE* pSrcSurface, + const SWR_SURFACE_STATE* pSrcSurface, uint8_t* pDst, uint32_t x, uint32_t y, uint32_t sampleNum, uint32_t renderTargetArrayIndex) // (x, y) pixel coordinate to start of raster tile. { @@ -125,7 +125,7 @@ struct LoadMacroTile /// @param pDstSurface - Destination surface state /// @param x, y - Coordinates to macro tile static void Load( - SWR_SURFACE_STATE* pSrcSurface, + const SWR_SURFACE_STATE* pSrcSurface, uint8_t *pDstHotTile, uint32_t x, uint32_t y, uint32_t renderTargetArrayIndex) { @@ -145,6 +145,7 @@ struct LoadMacroTile } }; + static void BUCKETS_START(UINT id) { #ifdef KNOB_ENABLE_RDTSC @@ -171,7 +172,7 @@ static std::mutex sBucketMutex; /// @param x, y - Coordinates to raster tile. /// @param pDstHotTile - Pointer to Hot Tile void LoadHotTile( - SWR_SURFACE_STATE *pSrcSurface, + const SWR_SURFACE_STATE *pSrcSurface, SWR_FORMAT dstFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, uint32_t x, uint32_t y, uint32_t renderTargetArrayIndex, @@ -184,7 +185,7 @@ void LoadHotTile( { return; } - + // force 0 if requested renderTargetArrayIndex is OOB if (renderTargetArrayIndex >= pSrcSurface->depth) { @@ -274,6 +275,7 @@ void LoadHotTile( BUCKETS_STOP(sBuckets[pSrcSurface->format]); } + ////////////////////////////////////////////////////////////////////////// /// INIT_LOAD_TILES_TABLE - Helper macro for setting up the tables. #define INIT_LOAD_TILES_COLOR_TABLE(tilemode) \ diff --git a/src/gallium/drivers/swr/swr_memory.h b/src/gallium/drivers/swr/swr_memory.h index 65fc169c85f..e68dce0f8d1 100644 --- a/src/gallium/drivers/swr/swr_memory.h +++ b/src/gallium/drivers/swr/swr_memory.h @@ -24,7 +24,7 @@ #pragma once void LoadHotTile( - SWR_SURFACE_STATE *pSrcSurface, + const SWR_SURFACE_STATE *pSrcSurface, SWR_FORMAT dstFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, UINT x, UINT y, uint32_t renderTargetArrayIndex,