mesa/src/intel/vulkan/anv_nir_lower_unaligned_dispatch.c
Kenneth Graunke 73cbb35442
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
brw: Move into a new src/intel/compiler/brw subdirectory
This keeps the directory structure a bit more organized:
- brw specific code
- elk specific code
- common NIR passes that could be used in both places

It also means that you can now 'git grep' in the brw directory without
finding a bunch of elk code, or having to "grep thing b*".

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37755>
2025-10-09 07:01:47 +00:00

28 lines
806 B
C

/*
* Copyright 2025 Intel Corporation
* SPDX-License-Identifier: MIT
*/
#include "anv_nir.h"
#include "nir_builder.h"
#include "compiler/brw/brw_nir.h"
bool
anv_nir_lower_unaligned_dispatch(nir_shader *shader)
{
nir_function_impl *impl = nir_shader_get_entrypoint(shader);
nir_builder b = nir_builder_at(nir_before_impl(impl));
nir_def *global_idx = nir_channel(&b, nir_load_global_invocation_id(&b, 32), 0);
nir_def *max_unaligned_invocations_x =
nir_load_inline_data_intel(&b, 1, 32,
.base = ANV_INLINE_PARAM_UNALIGNED_INVOCATIONS_X_OFFSET);
nir_push_if(&b, nir_uge(&b, global_idx, max_unaligned_invocations_x));
{
nir_jump(&b, nir_jump_return);
}
nir_pop_if(&b, NULL);
return nir_progress(true, impl, nir_metadata_none);
}