nak: Lower away ldcx when NAK_DEBUG=no_ugpr is set
Reviewed-by: Mel Henning <mhenning@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
This commit is contained in:
committed by
Marge Bot
parent
becccebd21
commit
63263baeca
@@ -107,6 +107,11 @@ pub extern "C" fn nak_should_print_nir() -> bool {
|
||||
DEBUG.print()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn nak_debug_no_ugpr() -> bool {
|
||||
DEBUG.no_ugpr()
|
||||
}
|
||||
|
||||
fn nir_options(dev: &nv_device_info) -> nir_shader_compiler_options {
|
||||
let mut op: nir_shader_compiler_options = Default::default();
|
||||
|
||||
|
||||
@@ -72,6 +72,17 @@ lower_ldcx_to_global(nir_builder *b, nir_intrinsic_instr *load,
|
||||
nir_def_replace(&load->def, val);
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_all_ldcx_to_global_intrin(nir_builder *b, nir_intrinsic_instr *load,
|
||||
void *data)
|
||||
{
|
||||
if (load->intrinsic != nir_intrinsic_ldcx_nv)
|
||||
return false;
|
||||
|
||||
lower_ldcx_to_global(b, load, data);
|
||||
return true;
|
||||
}
|
||||
|
||||
struct non_uniform_section {
|
||||
nir_block *pred;
|
||||
nir_block *succ;
|
||||
@@ -491,6 +502,12 @@ bool
|
||||
nak_nir_lower_non_uniform_ldcx(nir_shader *nir,
|
||||
const struct nak_compiler *nak)
|
||||
{
|
||||
/* If we don't have UGPRs, lower all of them. */
|
||||
if (nak_debug_no_ugpr()) {
|
||||
return nir_shader_intrinsics_pass(nir, lower_all_ldcx_to_global_intrin,
|
||||
nir_metadata_none, (void *)nak);
|
||||
}
|
||||
|
||||
/* Real functions are going to make hash of this */
|
||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
|
||||
@@ -15,6 +15,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
bool nak_should_print_nir(void);
|
||||
bool nak_debug_no_ugpr(void);
|
||||
|
||||
struct nak_compiler {
|
||||
uint8_t sm;
|
||||
|
||||
Reference in New Issue
Block a user