From fee56fda6fd78f7fb10b0e8fced0a604ca43f0c0 Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Thu, 10 Mar 2016 19:19:30 -0600 Subject: swr: [rasterizer] Stop setting viewport size to larger than hottile array Guard against enquing work to invalid tiles --- src/gallium/drivers/swr/rasterizer/core/frontend.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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; -- cgit v1.2.3