Mesa (master): i965/blorp: Use R32_FLOAT for Z32F surfaces.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Oct 9 23:36:31 UTC 2013


Module: Mesa
Branch: master
Commit: 590d71791a50c9b2caebffa79ae4382c78deca80
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=590d71791a50c9b2caebffa79ae4382c78deca80

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Oct  7 11:19:11 2013 -0700

i965/blorp: Use R32_FLOAT for Z32F surfaces.

Currently, all that matters is that we copy the correct number of bits,
so any format that has 32-bits of data will work fine.

Once BLORP begins handling format conversions, the sampler will need to
correctly interpret the data.  We don't need a depth format, but we do
need the right number of components and data type (FLOAT).

For Z32F, this means using R32_FLOAT.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

---

 src/mesa/drivers/dri/i965/brw_blorp.cpp |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index 46bb244..f71db4f 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
@@ -86,15 +86,17 @@ brw_blorp_surface_info::set(struct brw_context *brw,
       this->brw_surfaceformat = BRW_SURFACEFORMAT_R8_UNORM;
       break;
    case MESA_FORMAT_X8_Z24:
-   case MESA_FORMAT_Z32_FLOAT:
-      /* The miptree consists of 32 bits per pixel, arranged either as 24-bit
-       * depth values interleaved with 8 "don't care" bits, or as 32-bit
-       * floating point depth values.  Since depth values don't require any
-       * blending, it doesn't matter how we interpret the bit pattern as long
-       * as we copy the right amount of data, so just map it as 8-bit BGRA.
+      /* The miptree consists of 32 bits per pixel, arranged as 24-bit depth
+       * values interleaved with 8 "don't care" bits.  Since depth values don't
+       * require any blending, it doesn't matter how we interpret the bit
+       * pattern as long as we copy the right amount of data, so just map it
+       * as 8-bit BGRA.
        */
       this->brw_surfaceformat = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
       break;
+   case MESA_FORMAT_Z32_FLOAT:
+      this->brw_surfaceformat = BRW_SURFACEFORMAT_R32_FLOAT;
+      break;
    case MESA_FORMAT_Z16:
       this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
       break;




More information about the mesa-commit mailing list