[Mesa-dev] [PATCH] swr: set an explicit clear_rect if scissor is not enabled.

Rowley, Timothy O timothy.o.rowley at intel.com
Mon Jun 26 15:54:46 UTC 2017


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

On Jun 26, 2017, at 10:26 AM, Bruce Cherniak <bruce.cherniak at intel.com<mailto:bruce.cherniak at intel.com>> wrote:

Fix regression of "no rendering" on simple apps like glxgears by
setting an explicit full surface clear_rect when scissor is not
enabled.

This regressed with commit 00173d91 "st/mesa: don't set 16
scissors and 16 viewports if they're unused" due to an assumption
that a default scissor rect is always set, which was the case prior
to this optimization.
---
src/gallium/drivers/swr/swr_clear.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/swr/swr_clear.cpp b/src/gallium/drivers/swr/swr_clear.cpp
index 53f4e02d45..3a35805a7a 100644
--- a/src/gallium/drivers/swr/swr_clear.cpp
+++ b/src/gallium/drivers/swr/swr_clear.cpp
@@ -68,11 +68,19 @@ swr_clear(struct pipe_context *pipe,
   ((union pipe_color_union *)color)->f[3] = 1.0; /* cast off your const'd-ness */
#endif

+   SWR_RECT clear_rect;
+   /* If enabled, clear to scissor; otherwise clear full surface */
+   if (ctx->rasterizer && ctx->rasterizer->scissor) {
+      clear_rect = ctx->swr_scissor;
+   } else {
+      clear_rect = {0, 0, (int32_t)fb->width, (int32_t)fb->height};
+   }
+
   for (unsigned i = 0; i < layers; ++i) {
      swr_update_draw_context(ctx);
      SwrClearRenderTarget(ctx->swrContext, clearMask, i,
                           color->f, depth, stencil,
-                           ctx->swr_scissor);
+                           clear_rect);

      // Mask out the attachments that are out of layers.
      if (fb->zsbuf &&
--
2.11.0

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org<mailto:mesa-dev at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170626/2965af94/attachment.html>


More information about the mesa-dev mailing list