From: Nanley Chery Date: Tue, 29 Sep 2015 00:42:39 +0000 (-0700) Subject: anv/formats: Add fields for block dimensions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b4244dea02c38c194def5ff05636e09124cd6b7;p=mesa.git anv/formats: Add fields for block dimensions A non-compressed texture is a 1x1x1 block. Compressed textures could have values which vary in different dimensions WxHxD. Reviewed-by: Chad Versace --- diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c index 5631bea10e3..b588465e00e 100644 --- a/src/vulkan/anv_formats.c +++ b/src/vulkan/anv_formats.c @@ -27,7 +27,7 @@ #define UNSUPPORTED 0xffff #define fmt(__vk_fmt, __hw_fmt, ...) \ - [__vk_fmt] = { .vk_format = __vk_fmt, .name = #__vk_fmt, .surface_format = __hw_fmt, __VA_ARGS__ } + [__vk_fmt] = { .vk_format = __vk_fmt, .name = #__vk_fmt, .surface_format = __hw_fmt, .bw = 1, .bh = 1, .bd = 1, __VA_ARGS__ } static const struct anv_format anv_formats[] = { fmt(VK_FORMAT_UNDEFINED, RAW, .bs = 1, .num_channels = 1), diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 03d033ff0c5..8a8fe8d04a4 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -1208,6 +1208,9 @@ struct anv_format { const char *name; uint16_t surface_format; /**< RENDER_SURFACE_STATE.SurfaceFormat */ uint8_t bs; /**< Block size (in bytes) of anv_format::surface_format. */ + uint8_t bw; /**< Block width of anv_format::surface_format. */ + uint8_t bh; /**< Block height of anv_format::surface_format. */ + uint8_t bd; /**< Block depth of anv_format::surface_format. */ uint8_t num_channels; uint16_t depth_format; /**< 3DSTATE_DEPTH_BUFFER.SurfaceFormat */ bool has_stencil;