[Mesa-dev] [PATCH 03/43] intel/blorp: Move the gen7 stencil format workaround to blorp_blit

Jason Ekstrand jason at jlekstrand.net
Tue May 16 22:44:57 UTC 2017


It's not needed for blorp_copy because it already overrides formats.
It's also not needed for blorp_clear because it clears stencil as
stencil.
---
 src/intel/blorp/blorp.c      | 5 -----
 src/intel/blorp/blorp_blit.c | 9 +++++++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 9834275..f9727f7 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -81,11 +81,6 @@ brw_blorp_surface_info_init(struct blorp_context *blorp,
        * map it as 8-bit BGRA.
        */
       format = ISL_FORMAT_B8G8R8A8_UNORM;
-   } else if (surf->surf->usage & ISL_SURF_USAGE_STENCIL_BIT) {
-      assert(surf->surf->format == ISL_FORMAT_R8_UINT);
-      /* Prior to Broadwell, we can't render to R8_UINT */
-      if (blorp->isl_dev->info->gen < 8)
-         format = ISL_FORMAT_R8_UNORM;
    }
 
    info->surf = *surf->surf;
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index 04ea98a..144bfb3 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -2020,6 +2020,15 @@ blorp_blit(struct blorp_batch *batch,
    struct blorp_params params;
    blorp_params_init(&params);
 
+   if (dst_surf->surf->usage & ISL_SURF_USAGE_STENCIL_BIT) {
+      assert(src_surf->surf->usage & ISL_SURF_USAGE_STENCIL_BIT);
+      /* Prior to Broadwell, we can't render to R8_UINT */
+      if (batch->blorp->isl_dev->info->gen < 8) {
+         src_format = ISL_FORMAT_R8_UNORM;
+         dst_format = ISL_FORMAT_R8_UNORM;
+      }
+   }
+
    brw_blorp_surface_info_init(batch->blorp, &params.src, src_surf, src_level,
                                src_layer, src_format, false);
    brw_blorp_surface_info_init(batch->blorp, &params.dst, dst_surf, dst_level,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list