mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-08 03:20:39 +02:00
libagx: polyfill glsl ballot()
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
parent
4a586c7e87
commit
b51282500d
2 changed files with 8 additions and 0 deletions
|
|
@ -111,6 +111,11 @@ lower_builtins(nir_builder *b, nir_instr *instr, void *data)
|
|||
nir_store_deref(b, nir_src_as_deref(call->params[0]),
|
||||
nir_load_helper_arg_hi_agx(b, 1, 32), 1);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "ballot") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
nir_store_deref(b, nir_src_as_deref(call->params[0]),
|
||||
nir_ballot(b, 1, 32, call->params[1].ssa), 1);
|
||||
return true;
|
||||
} else if (strcmp(func->name, "nir_fence_helper_exit_agx") == 0) {
|
||||
b->cursor = nir_instr_remove(&call->instr);
|
||||
nir_fence_helper_exit_agx(b);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ uint32_t nir_load_helper_arg_lo_agx(void);
|
|||
uint32_t nir_load_helper_arg_hi_agx(void);
|
||||
uint32_t nir_fence_helper_exit_agx(void);
|
||||
|
||||
/* I have no idea why CL doesn't have this */
|
||||
uint ballot(bool cond);
|
||||
|
||||
#define AGX_STATIC_ASSERT(_COND) \
|
||||
typedef char static_assertion_##__line__[(_COND) ? 1 : -1]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue