[Mesa-dev] [PATCH] radv/meta: fix image clears for r4g4 format.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Fri Mar 17 08:26:59 UTC 2017
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Fri, Mar 17, 2017 at 5:24 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This just uses an 8-bit clear and packs the values.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/radv_meta_clear.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
> index c07775f..6583d64 100644
> --- a/src/amd/vulkan/radv_meta_clear.c
> +++ b/src/amd/vulkan/radv_meta_clear.c
> @@ -1175,6 +1175,14 @@ radv_cmd_clear_image(struct radv_cmd_buffer *cmd_buffer,
> internal_clear_value.color.uint32[0] = value;
> }
>
> + if (format == VK_FORMAT_R4G4_UNORM_PACK8) {
> + uint8_t r, g;
> + format = VK_FORMAT_R8_UINT;
> + r = float_to_ubyte(clear_value->color.float32[0]) >> 4;
> + g = float_to_ubyte(clear_value->color.float32[1]) >> 4;
> + internal_clear_value.color.uint32[0] = (r << 4) | (g & 0xf);
> + }
> +
> for (uint32_t r = 0; r < range_count; r++) {
> const VkImageSubresourceRange *range = &ranges[r];
> for (uint32_t l = 0; l < radv_get_levelCount(image, range); ++l) {
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list