swr: [rasterizer core] actually perform clear before store in GetHotTile
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 18 Nov 2016 00:39:20 +0000 (19:39 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Nov 2016 01:33:32 +0000 (20:33 -0500)
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 <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp

index 804fc4f..f398667 100644 (file)
@@ -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,