swr/rast: Renamed variable in vertexbufferstate
authorGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 2 Feb 2018 04:12:22 +0000 (22:12 -0600)
committerGeorge Kyriazis <george.kyriazis@intel.com>
Fri, 16 Feb 2018 16:54:00 +0000 (10:54 -0600)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/state.h
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
src/gallium/drivers/swr/swr_state.cpp

index c8995b313f9675db67d371d74b5fc4d572049e4b..d959c64361dbf0f787431bf583ac12a261517513 100644 (file)
@@ -555,7 +555,7 @@ struct SWR_VERTEX_BUFFER_STATE
 {
     uint32_t index;
     uint32_t pitch;
-    const uint8_t *pData;
+    gfxptr_t xpData;
     uint32_t size;
     uint32_t numaNode;
     uint32_t minVertex;             // min vertex (for bounds checking)
index 9bb62976f60ba6dd5d7b8f15c498a17f588bc87c..aa2d4c365717c6bc1956b09fc33fdcbe6f369a14 100644 (file)
@@ -445,7 +445,7 @@ void FetchJit::JitLoadVertices(const FETCH_COMPILE_STATE &fetchState, Value* str
         }
 
         // load SWR_VERTEX_BUFFER_STATE::pData
-        Value *stream = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_pData});
+        Value *stream = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_xpData});
 
         // load SWR_VERTEX_BUFFER_STATE::pitch
         Value *stride = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_pitch});
@@ -933,10 +933,10 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState,
         SWR_ASSERT((info.bpp != 0), "Unsupported format in JitGatherVertices.");
         uint32_t bpc = info.bpp / info.numComps;  ///@todo Code below assumes all components are same size. Need to fix.
 
-        Value *stream = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_pData});
+        Value *stream = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_xpData});
 
         // VGATHER* takes an *i8 src pointer
-        Value *pStreamBase = BITCAST(stream, PointerType::get(mInt8Ty, 0));
+        Value *pStreamBase = INT_TO_PTR(stream, PointerType::get(mInt8Ty, 0));
 
         Value *stride = LOAD(streams, {ied.StreamIndex, SWR_VERTEX_BUFFER_STATE_pitch});
 #if USE_SIMD16_GATHERS
@@ -1039,6 +1039,7 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState,
         // calculate byte offset to the start of the VB
         Value* baseOffset = MUL(Z_EXT(startOffset, mInt64Ty), Z_EXT(stride, mInt64Ty));
         pStreamBase = GEP(pStreamBase, baseOffset);
+        Value* pStreamBaseGFX = ADD(stream, baseOffset);
 
         // if we have a start offset, subtract from max vertex. Used for OOB check
         maxVertex = SUB(Z_EXT(maxVertex, mInt64Ty), Z_EXT(startOffset, mInt64Ty));
@@ -1364,7 +1365,7 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState,
                                 // But, we know that elements must be aligned for FETCH. :)
                                 // Right shift the offset by a bit and then scale by 2 to remove the sign extension.
                                 Value *vShiftedOffsets = LSHR(vOffsets, 1);
-                                vVertexElements[currentVertexElement++] = GATHERPS(gatherSrc, pStreamBase, vShiftedOffsets, vGatherMask, 2);
+                                vVertexElements[currentVertexElement++] = GATHERPS(gatherSrc, pStreamBaseGFX, vShiftedOffsets, vGatherMask, 2);
                             }
                             else
                             {
@@ -1385,6 +1386,7 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE &fetchState,
 
                         // offset base to the next component in the vertex to gather
                         pStreamBase = GEP(pStreamBase, C((char)4));
+                        pStreamBaseGFX = ADD(pStreamBaseGFX, C((int64_t)4));
 #endif
                     }
                 }
index d320c901168a2d3c5b9ae47c3c6c73461d789aba..d11323ef2e78fe0a3f12924e30623188804e1c3c 100644 (file)
@@ -1325,7 +1325,7 @@ swr_update_derived(struct pipe_context *pipe,
          swrVertexBuffers[i] = {0};
          swrVertexBuffers[i].index = i;
          swrVertexBuffers[i].pitch = pitch;
-         swrVertexBuffers[i].pData = p_data;
+         swrVertexBuffers[i].xpData = (gfxptr_t) p_data;
          swrVertexBuffers[i].size = size;
          swrVertexBuffers[i].minVertex = min_vertex_index;
          swrVertexBuffers[i].maxVertex = elems;