swr/rast: Renamed variable in vertexbufferstate

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
George Kyriazis 2018-02-01 22:12:22 -06:00
parent b25efa36e6
commit 036c8b6247
3 changed files with 8 additions and 6 deletions

View 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)

View 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
}
}

View 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;