mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
asahi/clc: add bindless image intrinsics
for decomp. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30981>
This commit is contained in:
parent
b4b4c1908c
commit
3497cd2ed2
1 changed files with 40 additions and 0 deletions
|
|
@ -94,6 +94,46 @@ lower_builtins(nir_builder *b, nir_instr *instr, void *data)
|
|||
b->cursor = nir_instr_remove(&call->instr);
|
||||
nir_fence_helper_exit_agx(b);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "nir_bindless_image_load_array") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
|
||||
nir_def *texel = nir_bindless_image_load(
|
||||
b, 4, 32, call->params[1].ssa, call->params[2].ssa, nir_imm_int(b, 0),
|
||||
nir_imm_int(b, 0), .image_array = true,
|
||||
.image_dim = GLSL_SAMPLER_DIM_2D, .dest_type = nir_type_uint32,
|
||||
.access = ACCESS_IN_BOUNDS_AGX);
|
||||
|
||||
nir_store_deref(b, nir_src_as_deref(call->params[0]), texel, 0xf);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "nir_bindless_image_store_array") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
|
||||
nir_bindless_image_store(
|
||||
b, call->params[0].ssa, call->params[1].ssa, nir_imm_int(b, 0),
|
||||
call->params[2].ssa, nir_imm_int(b, 0), .image_array = true,
|
||||
.image_dim = GLSL_SAMPLER_DIM_2D, .src_type = nir_type_uint32,
|
||||
.access = ACCESS_NON_READABLE);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "nir_bindless_image_load_ms_array") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
|
||||
nir_def *texel = nir_bindless_image_load(
|
||||
b, 4, 32, call->params[1].ssa, call->params[2].ssa,
|
||||
call->params[3].ssa, nir_imm_int(b, 0), .image_array = true,
|
||||
.image_dim = GLSL_SAMPLER_DIM_MS, .dest_type = nir_type_uint32,
|
||||
.access = ACCESS_IN_BOUNDS_AGX);
|
||||
|
||||
nir_store_deref(b, nir_src_as_deref(call->params[0]), texel, 0xf);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "nir_bindless_image_store_ms_array") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
|
||||
nir_bindless_image_store(
|
||||
b, call->params[0].ssa, call->params[1].ssa, call->params[2].ssa,
|
||||
call->params[3].ssa, nir_imm_int(b, 0), .image_array = true,
|
||||
.image_dim = GLSL_SAMPLER_DIM_MS, .src_type = nir_type_uint32,
|
||||
.access = ACCESS_NON_READABLE);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue