mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-19 15:48:19 +02:00
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>
28 lines
806 B
C
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);
|
|
}
|