<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 17, 2016, at 6:51 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">When switching render target array indexes (as might happen in a GS, or<br class="">
in a future change, with layered clears), if the previous state is<br class="">
HOTTILE_CLEAR, we should actually clear the tile before saving it off.<br class="">
<br class="">
Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
---<br class="">
src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp | 12 ++++++++++++<br class="">
1 file changed, 12 insertions(+)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp<br class="">
index 804fc4f..f398667 100644<br class="">
--- a/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp<br class="">
+++ b/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp<br class="">
@@ -149,6 +149,18 @@ HOTTILE* HotTileMgr::GetHotTile(SWR_CONTEXT* pContext, DRAW_CONTEXT* pDC, uint32<br class="">
default: SWR_ASSERT(false, "Unknown attachment: %d", attachment); format = KNOB_COLOR_HOT_TILE_FORMAT; break;<br class="">
}<br class="">
<br class="">
+ if (hotTile.state == HOTTILE_CLEAR)<br class="">
+ {<br class="">
+ if (attachment == SWR_ATTACHMENT_STENCIL)<br class="">
+ ClearStencilHotTile(&hotTile);<br class="">
+ else if (attachment == SWR_ATTACHMENT_DEPTH)<br class="">
+ ClearDepthHotTile(&hotTile);<br class="">
+ else<br class="">
+ ClearColorHotTile(&hotTile);<br class="">
+<br class="">
+ hotTile.state = HOTTILE_DIRTY;<br class="">
+ }<br class="">
+<br class="">
if (hotTile.state == HOTTILE_DIRTY)<br class="">
{<br class="">
pContext->pfnStoreTile(GetPrivateState(pDC), format, attachment,<br class="">
-- <br class="">
2.7.3<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>