swr/rast: Fetch compile state changes
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 12 Sep 2017 18:38:31 +0000 (13:38 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Mon, 25 Sep 2017 18:38:57 +0000 (13:38 -0500)
Add ForceSequentialAccessEnable and InstanceIDOffsetEnable bools to
FETCH_COMPILE_STATE.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.h

index f3a4b27d9a9d6344445aea24ce522754ea01dcda..906129829c8b6f2768193281ccb29b4c33c591a7 100644 (file)
@@ -275,6 +275,12 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
                                  : JitGatherVertices(fetchState, streams, vIndices, pVtxOut);
 #endif
 
+    if (fetchState.bInstanceIDOffsetEnable)
+    {
+        // TODO: 
+        SWR_ASSERT((0), "Add support for handling InstanceID Offset Enable.");
+    }
+
     RET_VOID();
 
     JitManager::DumpToFile(fetch, "src");
index 0dd6de759adb33eb1fa92607dc2e734bdc86487e..18fa96357b8ccc4b977f8df09a3311d7e96874d1 100644 (file)
@@ -107,6 +107,9 @@ struct FETCH_COMPILE_STATE
     bool bVertexIDOffsetEnable{ false };    // Offset vertexID by StartVertex for non-indexed draws or BaseVertex for indexed draws
     bool bPartialVertexBuffer{ false };     // for indexed draws, map illegal indices to a known resident vertex
 
+    bool bForceSequentialAccessEnable{ false };
+    bool bInstanceIDOffsetEnable{ false };
+
     FETCH_COMPILE_STATE(bool disableVGATHER = false, bool diableIndexOOBCheck = false):
         bDisableVGATHER(disableVGATHER), bDisableIndexOOBCheck(diableIndexOOBCheck){ };
 
@@ -120,11 +123,13 @@ struct FETCH_COMPILE_STATE
         if (cutIndex != other.cutIndex) return false;
         if (bVertexIDOffsetEnable != other.bVertexIDOffsetEnable) return false;
         if (bPartialVertexBuffer != other.bPartialVertexBuffer) return false;
+        if (bForceSequentialAccessEnable != other.bForceSequentialAccessEnable) return false;
+        if (bInstanceIDOffsetEnable != other.bInstanceIDOffsetEnable) return false;
 
         for(uint32_t i = 0; i < numAttribs; ++i)
         {
             if((layout[i].bits != other.layout[i].bits) ||
-               ((layout[i].InstanceEnable == 1) &&
+               (((layout[i].InstanceEnable == 1) || (layout[i].InstanceStrideEnable == 1)) &&
                 (layout[i].InstanceAdvancementState != other.layout[i].InstanceAdvancementState))){
                 return false;
             }