From ba7efa4dfaf8c740c7315cd18ca96819772bc60b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 6 Mar 2023 10:44:27 -0500 Subject: [PATCH] gallivm: handle A8_UNORM image stores Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c index e64fc93c481..fde96c95652 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c @@ -1026,6 +1026,7 @@ lp_build_store_rgba_soa(struct gallivm_state *gallivm, memset(packed, 0, sizeof(LLVMValueRef) * 4); if (format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN && format_desc->colorspace == UTIL_FORMAT_COLORSPACE_RGB && + !util_format_is_alpha(format) && format_desc->block.width == 1 && format_desc->block.height == 1 && format_desc->block.bits <= type.width && @@ -1084,6 +1085,12 @@ lp_build_store_rgba_soa(struct gallivm_state *gallivm, } else if (format == PIPE_FORMAT_R11G11B10_FLOAT) { packed[0] = lp_build_float_to_r11g11b10(gallivm, rgba_in); num_stores = 1; + } else if (util_format_is_alpha(format)) { + assert(format_desc->format == PIPE_FORMAT_A8_UNORM); + struct lp_build_context bld; + lp_build_context_init(&bld, gallivm, type); + lp_build_insert_soa_chan(&bld, type.width, format_desc->channel[0], &packed[0], rgba_in[3]); + num_stores = 1; } else assert(0);