From: Tim Rowley Date: Tue, 8 Mar 2016 17:22:54 +0000 (-0600) Subject: gallium/swr: remove use of BYTE from swr driver X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84f857bef79d66d229a001554719e9299ebe0881;p=mesa.git gallium/swr: remove use of BYTE from swr driver Remove use of a win32-style type leaked from the swr rasterizer. Reviewed-by: Bruce Cherniak --- diff --git a/src/gallium/drivers/swr/swr_memory.h b/src/gallium/drivers/swr/swr_memory.h index d1167810b4a..65fc169c85f 100644 --- a/src/gallium/drivers/swr/swr_memory.h +++ b/src/gallium/drivers/swr/swr_memory.h @@ -28,14 +28,14 @@ void LoadHotTile( SWR_FORMAT dstFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, UINT x, UINT y, uint32_t renderTargetArrayIndex, - BYTE *pDstHotTile); + uint8_t *pDstHotTile); void StoreHotTile( SWR_SURFACE_STATE *pDstSurface, SWR_FORMAT srcFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, UINT x, UINT y, uint32_t renderTargetArrayIndex, - BYTE *pSrcHotTile); + uint8_t *pSrcHotTile); void StoreHotTileClear( SWR_SURFACE_STATE *pDstSurface, @@ -49,7 +49,7 @@ swr_LoadHotTile(HANDLE hPrivateContext, SWR_FORMAT dstFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, UINT x, UINT y, - uint32_t renderTargetArrayIndex, BYTE* pDstHotTile) + uint32_t renderTargetArrayIndex, uint8_t* pDstHotTile) { // Grab source surface state from private context swr_draw_context *pDC = (swr_draw_context*)hPrivateContext; @@ -63,7 +63,7 @@ swr_StoreHotTile(HANDLE hPrivateContext, SWR_FORMAT srcFormat, SWR_RENDERTARGET_ATTACHMENT renderTargetIndex, UINT x, UINT y, - uint32_t renderTargetArrayIndex, BYTE* pSrcHotTile) + uint32_t renderTargetArrayIndex, uint8_t* pSrcHotTile) { // Grab destination surface state from private context swr_draw_context *pDC = (swr_draw_context*)hPrivateContext; diff --git a/src/gallium/drivers/swr/swr_scratch.cpp b/src/gallium/drivers/swr/swr_scratch.cpp index e6c448cb9e7..28eb2acb910 100644 --- a/src/gallium/drivers/swr/swr_scratch.cpp +++ b/src/gallium/drivers/swr/swr_scratch.cpp @@ -58,14 +58,14 @@ swr_copy_to_scratch_space(struct swr_context *ctx, } if (!space->base) { - space->base = (BYTE *)align_malloc(space->current_size, 4); + space->base = (uint8_t *)align_malloc(space->current_size, 4); space->head = (void *)space->base; } } /* Wrap */ - if (((BYTE *)space->head + size) - >= ((BYTE *)space->base + space->current_size)) { + if (((uint8_t *)space->head + size) + >= ((uint8_t *)space->base + space->current_size)) { /* * TODO XXX: Should add a fence on wrap. Assumption is that * current_space >> size, and there are at least MAX_DRAWS_IN_FLIGHT @@ -78,7 +78,7 @@ swr_copy_to_scratch_space(struct swr_context *ctx, } ptr = space->head; - space->head = (BYTE *)space->head + size; + space->head = (uint8_t *)space->head + size; } /* Copy user_buffer to scratch */ diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp index f0d48cd3f79..89de17aacb8 100644 --- a/src/gallium/drivers/swr/swr_screen.cpp +++ b/src/gallium/drivers/swr/swr_screen.cpp @@ -537,7 +537,7 @@ swr_texture_layout(struct swr_screen *screen, res->swr.pitch = res->row_stride[0]; if (allocate) { - res->swr.pBaseAddress = (BYTE *)_aligned_malloc(total_size, 64); + res->swr.pBaseAddress = (uint8_t *)_aligned_malloc(total_size, 64); if (res->has_depth && res->has_stencil) { SWR_FORMAT_INFO finfo = GetFormatInfo(res->secondary.format); @@ -550,7 +550,7 @@ swr_texture_layout(struct swr_screen *screen, res->secondary.numSamples = (1 << pt->nr_samples); res->secondary.pitch = res->alignedWidth * finfo.Bpp; - res->secondary.pBaseAddress = (BYTE *)_aligned_malloc( + res->secondary.pBaseAddress = (uint8_t *)_aligned_malloc( res->alignedHeight * res->secondary.pitch, 64); } } diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 49035b50ccd..706bf10f265 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -1032,12 +1032,12 @@ swr_update_derived(struct swr_context *ctx, pDC->num_constantsVS[i] = cb->buffer_size; if (cb->buffer) pDC->constantVS[i] = - (const float *)((const BYTE *)cb->buffer + cb->buffer_offset); + (const float *)((const uint8_t *)cb->buffer + cb->buffer_offset); else { /* Need to copy these constants to scratch space */ if (cb->user_buffer && cb->buffer_size) { const void *ptr = - ((const BYTE *)cb->user_buffer + cb->buffer_offset); + ((const uint8_t *)cb->user_buffer + cb->buffer_offset); uint32_t size = AlignUp(cb->buffer_size, 4); ptr = swr_copy_to_scratch_space( ctx, &ctx->scratch->vs_constants, ptr, size); @@ -1057,12 +1057,12 @@ swr_update_derived(struct swr_context *ctx, pDC->num_constantsFS[i] = cb->buffer_size; if (cb->buffer) pDC->constantFS[i] = - (const float *)((const BYTE *)cb->buffer + cb->buffer_offset); + (const float *)((const uint8_t *)cb->buffer + cb->buffer_offset); else { /* Need to copy these constants to scratch space */ if (cb->user_buffer && cb->buffer_size) { const void *ptr = - ((const BYTE *)cb->user_buffer + cb->buffer_offset); + ((const uint8_t *)cb->user_buffer + cb->buffer_offset); uint32_t size = AlignUp(cb->buffer_size, 4); ptr = swr_copy_to_scratch_space( ctx, &ctx->scratch->fs_constants, ptr, size);