gallivm: fix oob imageLoad with formats that have <4 components

it's expected that these loads will have full alpha

fixes spec@arb_shader_image_load_store@invalid

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11049>
This commit is contained in:
Mike Blumenkrantz
2021-05-27 14:23:14 -04:00
committed by Marge Bot
parent 35691edea0
commit 5275ab1bf3
@@ -4235,10 +4235,16 @@ lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state,
NULL,
outdata);
for (unsigned chan = 0; chan < 4; chan++) {
for (unsigned chan = 0; chan < 3; chan++) {
outdata[chan] = lp_build_select(&texel_bld, out_of_bounds,
texel_bld.zero, outdata[chan]);
}
if (format_desc->swizzle[3] == PIPE_SWIZZLE_1)
outdata[3] = lp_build_select(&texel_bld, out_of_bounds,
texel_bld.one, outdata[3]);
else
outdata[3] = lp_build_select(&texel_bld, out_of_bounds,
texel_bld.zero, outdata[3]);
} else if (params->img_op == LP_IMG_STORE) {
lp_build_store_rgba_soa(gallivm, format_desc, params->type, params->exec_mask, base_ptr, offset, out_of_bounds,
params->indata);