diff options
author | Chia-I Wu <[email protected]> | 2014-07-24 09:32:34 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-07-24 09:33:33 +0800 |
commit | 2126541b0b6c15aa82c2ffb78ecc09d33a07ae53 (patch) | |
tree | b65db7a62a32c132f5300e1ec0439469e7166d39 /src/gallium/drivers/ilo/ilo_format.h | |
parent | 6bac86cd85bf85dd03df7e788232059dc63b9f65 (diff) |
ilo: allow for device-dependent format translation
Pass ilo_dev_info to all format translation functions.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_format.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_format.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/gallium/drivers/ilo/ilo_format.h b/src/gallium/drivers/ilo/ilo_format.h index 2ea7885694e..7d84c60a953 100644 --- a/src/gallium/drivers/ilo/ilo_format.h +++ b/src/gallium/drivers/ilo/ilo_format.h @@ -38,17 +38,19 @@ void ilo_init_format_functions(struct ilo_screen *is); int -ilo_translate_color_format(enum pipe_format format); +ilo_translate_color_format(const struct ilo_dev_info *dev, + enum pipe_format format); /** * Translate a pipe format to a hardware surface format suitable for * the given purpose. Return -1 on errors. * * This is an inline function not only for performance reasons. There are - * caveats that the callers should that before calling this function. + * caveats that the callers should be aware of before calling this function. */ static inline int -ilo_translate_format(enum pipe_format format, unsigned bind) +ilo_translate_format(const struct ilo_dev_info *dev, + enum pipe_format format, unsigned bind) { switch (bind) { case PIPE_BIND_RENDER_TARGET: @@ -61,7 +63,7 @@ ilo_translate_format(enum pipe_format format, unsigned bind) case PIPE_FORMAT_B8G8R8X8_UNORM: return GEN6_FORMAT_B8G8R8A8_UNORM; default: - return ilo_translate_color_format(format); + return ilo_translate_color_format(dev, format); } break; case PIPE_BIND_SAMPLER_VIEW: @@ -87,7 +89,7 @@ ilo_translate_format(enum pipe_format format, unsigned bind) case PIPE_FORMAT_ETC1_RGB8: return GEN6_FORMAT_R8G8B8X8_UNORM; default: - return ilo_translate_color_format(format); + return ilo_translate_color_format(dev, format); } break; case PIPE_BIND_VERTEX_BUFFER: @@ -110,7 +112,7 @@ ilo_translate_format(enum pipe_format format, unsigned bind) case PIPE_FORMAT_R8G8B8_SINT: return GEN6_FORMAT_R8G8B8A8_SINT; default: - return ilo_translate_color_format(format); + return ilo_translate_color_format(dev, format); } break; default: @@ -122,21 +124,24 @@ ilo_translate_format(enum pipe_format format, unsigned bind) } static inline int -ilo_translate_render_format(enum pipe_format format) +ilo_translate_render_format(const struct ilo_dev_info *dev, + enum pipe_format format) { - return ilo_translate_format(format, PIPE_BIND_RENDER_TARGET); + return ilo_translate_format(dev, format, PIPE_BIND_RENDER_TARGET); } static inline int -ilo_translate_texture_format(enum pipe_format format) +ilo_translate_texture_format(const struct ilo_dev_info *dev, + enum pipe_format format) { - return ilo_translate_format(format, PIPE_BIND_SAMPLER_VIEW); + return ilo_translate_format(dev, format, PIPE_BIND_SAMPLER_VIEW); } static inline int -ilo_translate_vertex_format(enum pipe_format format) +ilo_translate_vertex_format(const struct ilo_dev_info *dev, + enum pipe_format format) { - return ilo_translate_format(format, PIPE_BIND_VERTEX_BUFFER); + return ilo_translate_format(dev, format, PIPE_BIND_VERTEX_BUFFER); } #endif /* ILO_FORMAT_H */ |