llvmpipe: swizzle image stores for CL BGRA

OpenCL requires image stores to BGRA to work, so add the swizzle
code here.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13404>
This commit is contained in:
Dave Airlie 2021-10-18 17:14:41 +10:00 committed by Marge Bot
parent 86b24fba05
commit 37d6ce4ebb
2 changed files with 6 additions and 1 deletions

View file

@ -987,6 +987,7 @@ lp_build_pack_rgba_soa(struct gallivm_state *gallivm,
{
unsigned chan;
struct lp_build_context bld;
LLVMValueRef rgba_swiz[4];
assert(format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN);
assert(format_desc->block.width == 1);
assert(format_desc->block.height == 1);
@ -995,13 +996,16 @@ lp_build_pack_rgba_soa(struct gallivm_state *gallivm,
assert(type.width == 32);
lp_build_context_init(&bld, gallivm, type);
lp_build_format_swizzle_soa(format_desc, &bld, rgba_in, rgba_swiz);
for (chan = 0; chan < format_desc->nr_channels; ++chan) {
struct util_format_channel_description chan_desc = format_desc->channel[chan];
lp_build_insert_soa_chan(&bld, format_desc->block.bits,
chan_desc,
packed,
rgba_in[chan]);
rgba_swiz[chan]);
}
}

View file

@ -728,6 +728,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
case PIPE_FORMAT_R8G8_SNORM:
case PIPE_FORMAT_R16_SNORM:
case PIPE_FORMAT_R8_SNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
break;
default: