[Mesa-dev] [PATCH 3/4] radv: reduce vk_format_descriptions memory usage.
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 31 11:44:11 UTC 2018
On 30 January 2018 at 23:41, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This repacks to reduce the usage from 72->64 bytes, but also
> makes the descriptions static const so they don't just stay in
> the same unit.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/vk_format.h | 3 ++-
> src/amd/vulkan/vk_format_table.py | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/vk_format.h b/src/amd/vulkan/vk_format.h
> index 43265ed3d97..7e2c1e8ae3f 100644
> --- a/src/amd/vulkan/vk_format.h
> +++ b/src/amd/vulkan/vk_format.h
> @@ -117,11 +117,12 @@ struct vk_format_channel_description {
> struct vk_format_description
> {
> VkFormat format;
> + enum vk_format_layout layout;
> +
> const char *name;
> const char *short_name;
>
> struct vk_format_block block;
> - enum vk_format_layout layout;
>
> unsigned nr_channels:3;
> unsigned is_array:1;
> diff --git a/src/amd/vulkan/vk_format_table.py b/src/amd/vulkan/vk_format_table.py
> index 36352b108d0..df08ab17970 100644
> --- a/src/amd/vulkan/vk_format_table.py
> +++ b/src/amd/vulkan/vk_format_table.py
> @@ -125,13 +125,13 @@ def write_format_table(formats):
> print " },"
>
> for format in formats:
> - print 'const struct vk_format_description'
> + print 'static const struct vk_format_description'
> print 'vk_format_%s_description = {' % (format.short_name(),)
> print " %s," % (format.name,)
> + print " %s," % (layout_map(format.layout),)
It'll be nice to make this a designated initializer.
It will spare similar changes in the future, plus make it easier to
search though ;-)
-Emil
More information about the mesa-dev
mailing list