diff options
author | Chia-I Wu <[email protected]> | 2015-06-25 22:27:04 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-06-26 13:45:28 +0800 |
commit | cbdc26aa3f76dc20285caa7e62ca8809cb2fe638 (patch) | |
tree | b3692f4e7b2fc294b8d335498f84f51e090de06b /src/gallium/drivers/ilo/ilo_format.h | |
parent | 2ee95f6d64aca9e9490c1ac293dd711b5f60a16b (diff) |
ilo: replace pipe_format by gen_surface_format
Replace pipe_format by gen_surface_format in ilo_image. Change how depth
format is specified in ilo_state_zs.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_format.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_format.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_format.h b/src/gallium/drivers/ilo/ilo_format.h index 4e955c09c14..0a19c02659e 100644 --- a/src/gallium/drivers/ilo/ilo_format.h +++ b/src/gallium/drivers/ilo/ilo_format.h @@ -165,4 +165,39 @@ ilo_format_translate_vertex(const struct ilo_dev *dev, return ilo_format_translate(dev, format, PIPE_BIND_VERTEX_BUFFER); } +static inline enum gen_depth_format +ilo_format_translate_depth(const struct ilo_dev *dev, + enum pipe_format format) +{ + if (ilo_dev_gen(dev) >= ILO_GEN(7)) { + switch (format) { + case PIPE_FORMAT_Z32_FLOAT: + return GEN6_ZFORMAT_D32_FLOAT; + case PIPE_FORMAT_Z24X8_UNORM: + return GEN6_ZFORMAT_D24_UNORM_X8_UINT; + case PIPE_FORMAT_Z16_UNORM: + return GEN6_ZFORMAT_D16_UNORM; + default: + assert(!"unknown depth format"); + return GEN6_ZFORMAT_D32_FLOAT; + } + } else { + switch (format) { + case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: + return GEN6_ZFORMAT_D32_FLOAT_S8X24_UINT; + case PIPE_FORMAT_Z32_FLOAT: + return GEN6_ZFORMAT_D32_FLOAT; + case PIPE_FORMAT_Z24_UNORM_S8_UINT: + return GEN6_ZFORMAT_D24_UNORM_S8_UINT; + case PIPE_FORMAT_Z24X8_UNORM: + return GEN6_ZFORMAT_D24_UNORM_X8_UINT; + case PIPE_FORMAT_Z16_UNORM: + return GEN6_ZFORMAT_D16_UNORM; + default: + assert(!"unknown depth format"); + return GEN6_ZFORMAT_D32_FLOAT; + } + } +} + #endif /* ILO_FORMAT_H */ |