gallium/swr: remove use of BYTE from swr driver
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 8 Mar 2016 17:22:54 +0000 (11:22 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 10 Mar 2016 17:20:58 +0000 (11:20 -0600)
Remove use of a win32-style type leaked from the swr rasterizer.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/swr_memory.h
src/gallium/drivers/swr/swr_scratch.cpp
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/swr/swr_state.cpp

index d1167810b4af9a13e1b7c6265d4a15e13a46c52e..65fc169c85fe72823e002f896f36c3853885296a 100644 (file)
@@ -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;
index e6c448cb9e7c6cbffa993c8311ec24e0a7e9cc5a..28eb2acb9102f019d6f0c00b938320ccba4423ec 100644 (file)
@@ -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 */
index f0d48cd3f7955e90d5db0af727c4520733b26e81..89de17aacb892b031688a5026a57633e8992496f 100644 (file)
@@ -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);
       }
    }
index 49035b50ccd3baea06dc241cc85da64190abe51b..706bf10f265359088b517c92e1e2df4b6bc6c147 100644 (file)
@@ -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);