[Mesa-dev] [PATCH 3/7] i965: Add an image format metadata array
Chad Versace
chad.versace at intel.com
Mon Nov 9 12:24:25 PST 2015
On Wed 04 Nov 2015, Jason Ekstrand wrote:
> This little data structure and associated array contains all of the image
> format metadata needed for doing image_load_store work-arounds. This way
> we can pull metadata from within the i965 driver without having to go out
> to core mesa for it. It is a bit of duplication with what we have in core
> mesa but it's limited enough that it's easily verified and not a big deal.
> ---
> src/mesa/drivers/dri/i965/brw_image_load_store.c | 45 ++++++++++++++++++++++++
> src/mesa/drivers/dri/i965/brw_image_load_store.h | 20 +++++++++++
> 2 files changed, 65 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_image_load_store.c b/src/mesa/drivers/dri/i965/brw_image_load_store.c
> index 4876041..b78d6b2 100644
> --- a/src/mesa/drivers/dri/i965/brw_image_load_store.c
> +++ b/src/mesa/drivers/dri/i965/brw_image_load_store.c
> @@ -26,6 +26,51 @@
> #include "brw_defines.h"
> #include "brw_image_load_store.h"
>
> +#define IF(r, g, b, a, dt, f) \
> + [BRW_SURFACEFORMAT_##f] = { true, r, g, b, a, BRW_IMAGE_FORMAT_##dt },
> +const struct brw_image_format_info brw_image_format_info[] = {
> + IF( 8, 0, 0, 0, UNORM, R8_UNORM)
> + IF( 8, 0, 0, 0, SNORM, R8_SNORM)
> + IF( 8, 0, 0, 0, UINT, R8_UINT)
> + IF( 8, 0, 0, 0, SINT, R8_SINT)
> + IF( 8, 8, 0, 0, UNORM, R8G8_UNORM)
Reviewed-by: Chad Versace <chad.versace at intel.com>
One small nit... Place the table's key in the rightmost column looks
very wrong to me. My eyes strongly desire the key in the leftmost
column.
Anyway, leftmost or rightmost, my rb still stands.
More information about the mesa-dev
mailing list