diff options
author | Dave Airlie <[email protected]> | 2017-01-17 08:38:14 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-01-18 06:20:48 +1000 |
commit | 5dadd7ca27da6cd5bbac95c8e09130ec4a384e2b (patch) | |
tree | ea3bb5ca270b53bcb474152f70d29d6a7de28048 /src/amd/common | |
parent | 6b635bbe16c93ad13afa3390d20c2f0f033e065d (diff) |
radv/ac: switch an if to switch
makes it easier to add other shader stages.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 3173aa51231..6d98fde11bf 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4626,11 +4626,16 @@ void ac_compile_nir_shader(LLVMTargetMachineRef tm, /* +3 for scratch wave offset and VCC */ config->num_sgprs = MAX2(config->num_sgprs, shader_info->num_input_sgprs + 3); - if (nir->stage == MESA_SHADER_COMPUTE) { + + switch (nir->stage) { + case MESA_SHADER_COMPUTE: for (int i = 0; i < 3; ++i) shader_info->cs.block_size[i] = nir->info->cs.local_size[i]; - } - - if (nir->stage == MESA_SHADER_FRAGMENT) + break; + case MESA_SHADER_FRAGMENT: shader_info->fs.early_fragment_test = nir->info->fs.early_fragment_tests; + break; + default: + break; + } } |