radeonsi: Fix clear-render-target shader for 1darrays in NIR

There are no GL CTS tests for 1darrays, relying on OpenCL CTS instead.
This patch should fix the `clEnqueueFillImage` tests in OpenCL CTS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25630>
This commit is contained in:
Ganesh Belgur Ramachandra 2023-10-10 01:17:55 -05:00 committed by Marge Bot
parent 63923d5d43
commit 2f7bc06643

View file

@ -601,6 +601,14 @@ void *si_clear_render_target_shader(struct si_context *sctx, enum pipe_texture_t
nir_def *zero = nir_imm_int(&b, 0);
nir_def *ubo = nir_load_ubo(&b, 4, 32, zero, zero, .range_base = 0, .range = 16);
/* TODO: No GL CTS tests for 1D arrays, relying on OpenCL CTS for now.
* As a sanity check, "OpenCL-CTS/test_conformance/images/clFillImage" tests should pass
*/
if (type == PIPE_TEXTURE_1D_ARRAY) {
unsigned swizzle[4] = {0, 2, 0, 0};
ubo = nir_swizzle(&b, ubo, swizzle, 4);
}
address = nir_iadd(&b, address, ubo);
nir_def *coord = nir_pad_vector(&b, address, 4);