From: Tim Rowley Date: Fri, 11 Mar 2016 01:19:30 +0000 (-0600) Subject: swr: [rasterizer] Stop setting viewport size to larger than hottile array X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fee56fda6fd78f7fb10b0e8fced0a604ca43f0c0;p=mesa.git swr: [rasterizer] Stop setting viewport size to larger than hottile array Guard against enquing work to invalid tiles --- diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp index 6db36395c86..27afc9640c7 100644 --- a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp @@ -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(macroTileEndX, KNOB_NUM_HOT_TILES_X); + macroTileEndY = std::min(macroTileEndY, KNOB_NUM_HOT_TILES_Y); + // load tiles BE_WORK work; work.type = DISCARDINVALIDATETILES;