From 1c19d0bb81b7be833759f5a7822499709aea566d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 8 Aug 2013 13:01:39 +0800 Subject: ilo: fold gen6_translate_depth_format into the caller There is only one caller so fold it. --- src/gallium/drivers/ilo/ilo_gpe_gen6.h | 42 ++++++++-------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) (limited to 'src/gallium/drivers/ilo') diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen6.h b/src/gallium/drivers/ilo/ilo_gpe_gen6.h index 840dce73dd3..893cc2f6160 100644 --- a/src/gallium/drivers/ilo/ilo_gpe_gen6.h +++ b/src/gallium/drivers/ilo/ilo_gpe_gen6.h @@ -144,29 +144,6 @@ ilo_gpe_gen6_get(void); /* Below are helpers for other GENs */ -/** - * Translate a depth/stencil pipe format to the matching hardware - * format. Return -1 on errors. - */ -static inline int -gen6_translate_depth_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_Z16_UNORM: - return BRW_DEPTHFORMAT_D16_UNORM; - case PIPE_FORMAT_Z32_FLOAT: - return BRW_DEPTHFORMAT_D32_FLOAT; - case PIPE_FORMAT_Z24X8_UNORM: - return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; - case PIPE_FORMAT_Z24_UNORM_S8_UINT: - return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT; - case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: - return BRW_DEPTHFORMAT_D32_FLOAT_S8X24_UINT; - default: - return -1; - } -} - /** * Translate winsys tiling to hardware tiling. */ @@ -266,24 +243,23 @@ ilo_gpe_gen6_fill_3dstate_sf_raster(const struct ilo_dev_info *dev, /* separate stencil */ switch (depth_format) { - case PIPE_FORMAT_Z24_UNORM_S8_UINT: - depth_format = PIPE_FORMAT_Z24X8_UNORM; + case PIPE_FORMAT_Z16_UNORM: + format = BRW_DEPTHFORMAT_D16_UNORM; break; + case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: - depth_format = PIPE_FORMAT_Z32_FLOAT;; + format = BRW_DEPTHFORMAT_D32_FLOAT; break; - case PIPE_FORMAT_S8_UINT: - depth_format = PIPE_FORMAT_NONE; + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24_UNORM_S8_UINT: + format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; break; default: + /* FLOAT surface is assumed when there is no depth buffer */ + format = BRW_DEPTHFORMAT_D32_FLOAT; break; } - format = gen6_translate_depth_format(depth_format); - /* FLOAT surface is assumed when there is no depth buffer */ - if (format < 0) - format = BRW_DEPTHFORMAT_D32_FLOAT; - payload[0] |= format << GEN7_SF_DEPTH_BUFFER_SURFACE_FORMAT_SHIFT; } } -- cgit v1.2.3