diff options
author | Tim Rowley <[email protected]> | 2017-09-07 15:17:23 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-09-13 10:09:24 -0500 |
commit | 6f0fcec07a16eb48ebdafffd0b4ae0bb5ac611a4 (patch) | |
tree | 113f46f7e7eb085167982405c1984192df2e25d0 /src/gallium/drivers/swr/rasterizer | |
parent | ae2412dbbdcff6583d7e4cf0430a409b86cb9e80 (diff) |
swr/rast: Migrate memory pointers to gfxptr_t type
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer')
4 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py index 94f3f9feffb..ccf2bde1edd 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py +++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py @@ -42,7 +42,7 @@ def gen_llvm_type(type, name, is_pointer, is_pointer_pointer, is_array, is_array else: if type == 'BYTE' or type == 'char' or type == 'uint8_t' or type == 'int8_t' or type == 'bool': llvm_type = 'Type::getInt8Ty(ctx)' - elif type == 'UINT64' or type == 'INT64' or type == 'uint64_t' or type == 'int64_t': + elif type == 'UINT64' or type == 'INT64' or type == 'uint64_t' or type == 'int64_t' or type == 'gfxptr_t': llvm_type = 'Type::getInt64Ty(ctx)' elif type == 'UINT16' or type == 'int16_t' or type == 'uint16_t': llvm_type = 'Type::getInt16Ty(ctx)' diff --git a/src/gallium/drivers/swr/rasterizer/core/state.h b/src/gallium/drivers/swr/rasterizer/core/state.h index b0af663d50e..13c1d8b7e95 100644 --- a/src/gallium/drivers/swr/rasterizer/core/state.h +++ b/src/gallium/drivers/swr/rasterizer/core/state.h @@ -29,6 +29,7 @@ #include "common/formats.h" #include "common/intrin.h" +using gfxptr_t = unsigned long long; #include <functional> #include <algorithm> @@ -513,7 +514,7 @@ enum SWR_AUX_MODE ////////////////////////////////////////////////////////////////////////// struct SWR_SURFACE_STATE { - uint8_t *pBaseAddress; + gfxptr_t xpBaseAddress; SWR_SURFACE_TYPE type; // @llvm_enum SWR_FORMAT format; // @llvm_enum uint32_t width; @@ -536,7 +537,7 @@ struct SWR_SURFACE_STATE uint32_t lodOffsets[2][15]; // lod offsets for sampled surfaces - uint8_t *pAuxBaseAddress; // Used for compression, append/consume counter, etc. + gfxptr_t xpAuxBaseAddress; // Used for compression, append/consume counter, etc. SWR_AUX_MODE auxMode; // @llvm_enum diff --git a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h index c3d14e95092..512c3380270 100644 --- a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h +++ b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h @@ -1179,7 +1179,7 @@ struct StoreRasterTile resolveColor[3] *= oneOverNumSamples; // Use the resolve surface state - SWR_SURFACE_STATE* pResolveSurface = (SWR_SURFACE_STATE*)pDstSurface->pAuxBaseAddress; + SWR_SURFACE_STATE* pResolveSurface = (SWR_SURFACE_STATE*)pDstSurface->xpAuxBaseAddress; uint8_t *pDst = (uint8_t*)ComputeSurfaceAddress<false, false>((x + rx), (y + ry), pResolveSurface->arrayIndex + renderTargetArrayIndex, pResolveSurface->arrayIndex + renderTargetArrayIndex, 0, pResolveSurface->lod, pResolveSurface); @@ -2390,7 +2390,7 @@ struct StoreMacroTile } } - if (pDstSurface->pAuxBaseAddress) + if (pDstSurface->xpAuxBaseAddress) { uint32_t sampleOffset = KNOB_TILE_X_DIM * KNOB_TILE_Y_DIM * (FormatTraits<SrcFormat>::bpp / 8); // Store each raster tile from the hot tile to the destination surface. diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h index 9222d3edfb8..6c801c7ff69 100644 --- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h +++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h @@ -694,5 +694,5 @@ template<bool UseCachedOffsets, bool IsRead> INLINE void* ComputeSurfaceAddress(uint32_t x, uint32_t y, uint32_t z, uint32_t array, uint32_t sampleNum, uint32_t lod, const SWR_SURFACE_STATE *pState) { - return pState->pBaseAddress + ComputeSurfaceOffset<UseCachedOffsets>(x, y, z, array, sampleNum, lod, pState); + return (void*)(pState->xpBaseAddress + ComputeSurfaceOffset<UseCachedOffsets>(x, y, z, array, sampleNum, lod, pState)); } |