From 8c1af8854bf4382adf45308ecf80d4ea31ce8b04 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 15 Dec 2022 11:02:57 -0800 Subject: [PATCH] microsoft/compiler: Make nir_var_to_dxil_sysvalue_type static Part-of: --- src/microsoft/compiler/dxil_nir.c | 29 ++++++++++++++++++++++++++++ src/microsoft/compiler/nir_to_dxil.c | 23 ---------------------- src/microsoft/compiler/nir_to_dxil.h | 9 --------- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c index f382a6f4564..5990cce45d5 100644 --- a/src/microsoft/compiler/dxil_nir.c +++ b/src/microsoft/compiler/dxil_nir.c @@ -1683,6 +1683,35 @@ dxil_sort_ps_outputs(nir_shader* s) } } +enum dxil_sysvalue_type { + DXIL_NO_SYSVALUE = 0, + DXIL_SYSVALUE, + DXIL_GENERATED_SYSVALUE +}; + +static enum dxil_sysvalue_type +nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask) +{ + switch (var->data.location) { + case VARYING_SLOT_FACE: + return DXIL_GENERATED_SYSVALUE; + case VARYING_SLOT_POS: + case VARYING_SLOT_PRIMITIVE_ID: + case VARYING_SLOT_CLIP_DIST0: + case VARYING_SLOT_CLIP_DIST1: + case VARYING_SLOT_PSIZ: + case VARYING_SLOT_TESS_LEVEL_INNER: + case VARYING_SLOT_TESS_LEVEL_OUTER: + case VARYING_SLOT_VIEWPORT: + case VARYING_SLOT_LAYER: + if (!((1ull << var->data.location) & other_stage_mask)) + return DXIL_SYSVALUE; + FALLTHROUGH; + default: + return DXIL_NO_SYSVALUE; + } +} + /* Order between stage values so that normal varyings come first, * then sysvalues and then system generated values. */ diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 1d851a79b31..cb98c33857f 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -6232,26 +6232,3 @@ out: free(ctx); return retval; } - -enum dxil_sysvalue_type -nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask) -{ - switch (var->data.location) { - case VARYING_SLOT_FACE: - return DXIL_GENERATED_SYSVALUE; - case VARYING_SLOT_POS: - case VARYING_SLOT_PRIMITIVE_ID: - case VARYING_SLOT_CLIP_DIST0: - case VARYING_SLOT_CLIP_DIST1: - case VARYING_SLOT_PSIZ: - case VARYING_SLOT_TESS_LEVEL_INNER: - case VARYING_SLOT_TESS_LEVEL_OUTER: - case VARYING_SLOT_VIEWPORT: - case VARYING_SLOT_LAYER: - if (!((1ull << var->data.location) & other_stage_mask)) - return DXIL_SYSVALUE; - FALLTHROUGH; - default: - return DXIL_NO_SYSVALUE; - } -} diff --git a/src/microsoft/compiler/nir_to_dxil.h b/src/microsoft/compiler/nir_to_dxil.h index 5e04641ac2e..fceb87ef8c5 100644 --- a/src/microsoft/compiler/nir_to_dxil.h +++ b/src/microsoft/compiler/nir_to_dxil.h @@ -35,15 +35,6 @@ extern "C" { struct blob; -enum dxil_sysvalue_type { - DXIL_NO_SYSVALUE = 0, - DXIL_SYSVALUE, - DXIL_GENERATED_SYSVALUE -}; - -enum dxil_sysvalue_type -nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask); - /* Controls how resource decls/accesses are handled. Common to all: * Images, textures, and samplers map to D3D UAV, SRV, and sampler types * Shared is lowered to explicit I/O and then to a DXIL-specific intrinsic for 4-byte indices instead of byte addressing