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 <chad.versace@intel.com>
This commit is contained in:
Nanley Chery
2015-09-28 17:42:39 -07:00
parent a6c7d1e016
commit 7b4244dea0
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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),
+3
View File
@@ -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;