swr: [rasterizer] Stop setting viewport size to larger than hottile array
authorTim Rowley <timothy.o.rowley@intel.com>
Fri, 11 Mar 2016 01:19:30 +0000 (19:19 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Fri, 25 Mar 2016 19:43:14 +0000 (14:43 -0500)
Guard against enquing work to invalid tiles

src/gallium/drivers/swr/rasterizer/core/frontend.cpp

index 6db36395c86aa4cbce88fa1f310f5f1960b3284d..27afc9640c7b3065a5631be9507f077c8e832a2b 100644 (file)
@@ -243,6 +243,12 @@ void ProcessDiscardInvalidateTiles(
         macroTileEndY = (rect.bottom + macroHeight - 1) / macroHeight;
     }
 
+    SWR_ASSERT(macroTileEndX < KNOB_NUM_HOT_TILES_X);
+    SWR_ASSERT(macroTileEndY < KNOB_NUM_HOT_TILES_Y);
+
+    macroTileEndX = std::min<uint32_t>(macroTileEndX, KNOB_NUM_HOT_TILES_X);
+    macroTileEndY = std::min<uint32_t>(macroTileEndY, KNOB_NUM_HOT_TILES_Y);
+
     // load tiles
     BE_WORK work;
     work.type = DISCARDINVALIDATETILES;