[Mesa-dev] [PATCH 1/4] swr: [rasterizer core] actually perform clear before store in GetHotTile

Rowley, Timothy O timothy.o.rowley at intel.com
Wed Nov 23 19:58:19 UTC 2016


Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com<mailto:timothy.o.rowley at intel.com>>

On Nov 17, 2016, at 6:51 PM, Ilia Mirkin <imirkin at alum.mit.edu<mailto:imirkin at alum.mit.edu>> wrote:

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 at alum.mit.edu<mailto:imirkin at alum.mit.edu>>
---
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 804fc4f..f398667 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.7.3


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161123/ae8aec8a/attachment-0001.html>


More information about the mesa-dev mailing list