From: Vivek Pandya Date: Mon, 22 Feb 2021 04:59:23 +0000 (+0530) Subject: Update libresoc_CmdClearColorImage to get color in output image. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed7212f4d2407f38d4b9fb7cd86a8a5226c8d678;p=mesa.git Update libresoc_CmdClearColorImage to get color in output image. --- diff --git a/src/libre-soc/vulkan/libresoc_meta_clear.c b/src/libre-soc/vulkan/libresoc_meta_clear.c index 5650d3e94a9..80ed9904080 100644 --- a/src/libre-soc/vulkan/libresoc_meta_clear.c +++ b/src/libre-soc/vulkan/libresoc_meta_clear.c @@ -34,11 +34,18 @@ void libresoc_CmdClearColorImage( { LIBRESOC_FROM_HANDLE(libresoc_image, image, image_h); - float r = pColor->float32[0]; - float g = pColor->float32[1]; - float b = pColor->float32[2]; - float temp = 100.00 * ((r * 0.3 ) + (g * 0.3) + (b * 0.3)); - for (int i=0; i < image->size; ++i) { - image->bytes[i] = temp; + uint32_t r = pColor->uint32[0]; + uint32_t g = pColor->uint32[1]; + uint32_t b = pColor->uint32[2]; + uint32_t a = pColor->uint32[3]; + for (int i=0; i < image->size / 4; ) { + image->bytes[i] = r; + i += 1; + image->bytes[i] = g; + i += 1; + image->bytes[i] = b; + i += 1; + image->bytes[i] = a; + i += 1; } }