[Mesa-dev] [PATCH 28/31] swr/rast: Add semantics for translating address

George Kyriazis george.kyriazis at intel.com
Tue Feb 13 22:42:46 UTC 2018


Added support for another full translation path in fetch jitter.
---
 src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h | 1 +
 src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
index 4e78098..4f49634 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
@@ -75,3 +75,4 @@ Value* pScatterStackSrc{ nullptr };
 Value* pScatterStackOffsets{ nullptr };
 
 
+virtual Value* TRANSLATE_ADDRESS(Value* address) { return address; }
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
index aa2d4c3..880aaf8 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
@@ -1830,12 +1830,16 @@ Value* FetchJit::GetSimdValid16bitIndices(Value* pIndices, Value* pLastIndex)
     Value* pZeroIndex = ALLOCA(mInt16Ty);
     STORE(C((uint16_t)0), pZeroIndex);
 
+    pLastIndex = TRANSLATE_ADDRESS(pLastIndex);
+
     // Load a SIMD of index pointers
     for(int64_t lane = 0; lane < mVWidth; lane++)
     {
         // Calculate the address of the requested index
         Value *pIndex = GEP(pIndices, C(lane));
 
+        pIndex = TRANSLATE_ADDRESS(pIndex);
+
         // check if the address is less than the max index, 
         Value* mask = ICMP_ULT(pIndex, pLastIndex);
 
-- 
2.7.4



More information about the mesa-dev mailing list