From 74943db82c9b559ddad8773822ade93eafb24849 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 17 Nov 2016 19:39:20 -0500 Subject: [PATCH] swr: [rasterizer core] actually perform clear before store in GetHotTile When switching render target array indexes (as might happen in a GS, or in a future change, with layered clears), if the previous state is HOTTILE_CLEAR, we should actually clear the tile before saving it off. Signed-off-by: Ilia Mirkin Reviewed-by: Tim Rowley --- src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp index 804fc4f2699..f3986672275 100644 --- a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp @@ -149,6 +149,18 @@ HOTTILE* HotTileMgr::GetHotTile(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32 default: SWR_ASSERT(false, "Unknown attachment: %d", attachment); format = KNOB_COLOR_HOT_TILE_FORMAT; break; } + if (hotTile.state == HOTTILE_CLEAR) + { + if (attachment == SWR_ATTACHMENT_STENCIL) + ClearStencilHotTile(&hotTile); + else if (attachment == SWR_ATTACHMENT_DEPTH) + ClearDepthHotTile(&hotTile); + else + ClearColorHotTile(&hotTile); + + hotTile.state = HOTTILE_DIRTY; + } + if (hotTile.state == HOTTILE_DIRTY) { pContext->pfnStoreTile(GetPrivateState(pDC), format, attachment, -- 2.30.2