i965/blorp: Use isl_format_get_depth_format for setting depth formats
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Aug 2016 11:30:25 +0000 (04:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 29 Aug 2016 19:17:34 +0000 (12:17 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/blorp.c

index 1c4102f73338da01e540c516f8af1addc1730b3f..28045d37c395fc9b7ead023a8157cb565cb9b248 100644 (file)
@@ -284,20 +284,7 @@ blorp_gen6_hiz_op(struct blorp_batch *batch,
 
    params.dst.surf.samples = params.depth.surf.samples;
    params.dst.surf.logical_level0_px = params.depth.surf.logical_level0_px;
-
-   switch (surf->surf->format) {
-   case ISL_FORMAT_R16_UNORM:
-      params.depth_format = BRW_DEPTHFORMAT_D16_UNORM;
-      break;
-   case ISL_FORMAT_R32_FLOAT:
-      params.depth_format = BRW_DEPTHFORMAT_D32_FLOAT;
-      break;
-   case ISL_FORMAT_R24_UNORM_X8_TYPELESS:
-      params.depth_format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT;
-      break;
-   default:
-      unreachable("not reached");
-   }
+   params.depth_format = isl_format_get_depth_format(surf->surf->format, false);
 
    batch->blorp->exec(batch, &params);
 }