i965/blorp: Use R16_UNORM for Z16 surfaces.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Oct 2013 18:08:27 +0000 (11:08 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 9 Oct 2013 23:36:49 +0000 (16:36 -0700)
Currently, all that matters is that we copy the correct number of bits,
so any format that has 16-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 (UNORM).

For Z16, this means using R16_UNORM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/mesa/drivers/dri/i965/brw_blorp.cpp

index f5731b6c0f9e13616e14c3721373927b5170ebb4..46bb244b80cf806b45259ceda980c73d3ed6c5e4 100644 (file)
@@ -96,12 +96,7 @@ brw_blorp_surface_info::set(struct brw_context *brw,
       this->brw_surfaceformat = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
       break;
    case MESA_FORMAT_Z16:
-      /* The miptree consists of 16 bits per pixel of depth data.  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 is as 8-bit RG.
-       */
-      this->brw_surfaceformat = BRW_SURFACEFORMAT_R8G8_UNORM;
+      this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
       break;
    default:
       if (is_render_target) {