ac/shader: gather If TES reads TESSINNER or TESSOUTER
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 12 Jan 2018 11:49:28 +0000 (12:49 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 15 Jan 2018 10:51:47 +0000 (11:51 +0100)
This shouldn't be scanned in the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_nir_to_llvm.h
src/amd/common/ac_shader_info.c
src/amd/common/ac_shader_info.h
src/amd/vulkan/radv_pipeline.c

index 4de31fc812deed0835e400da28203d99ed4b3336..cf7035edf1c3426a77376a3946290978410567ca 100644 (file)
@@ -6310,7 +6310,7 @@ write_tess_factors(struct nir_to_llvm_context *ctx)
                                            16 + tf_offset, 1, 0, true, false);
 
        //store to offchip for TES to read - only if TES reads them
-       if (ctx->options->key.tcs.tes_reads_tess_factors) {
+       if (ctx->shader_info->info.tes.reads_tess_factors) {
                LLVMValueRef inner_vec, outer_vec, tf_outer_offset;
                LLVMValueRef tf_inner_offset;
                unsigned param_outer, param_inner;
index 1737866166ea7e0d23a5000afc0132f08553ca10..70cecd6a624baf0f5d3bc11d7ae768de473be8c0 100644 (file)
@@ -55,7 +55,6 @@ struct ac_tcs_variant_key {
        struct ac_vs_variant_key vs_key;
        unsigned primitive_mode;
        unsigned input_vertices;
-       uint32_t tes_reads_tess_factors:1;
 };
 
 struct ac_fs_variant_key {
index 5716ec043d56c14d7fd55535cf1bc74df7aab97f..7261261850512ce78d611b5e3479e7641c7ca26a 100644 (file)
@@ -106,6 +106,10 @@ gather_intrinsic_info(const nir_intrinsic_instr *instr,
                mark_sampler_desc(instr->variables[0]->var, info);
                break;
        }
+       case nir_intrinsic_load_tess_level_inner:
+       case nir_intrinsic_load_tess_level_outer:
+               info->tes.reads_tess_factors = true;
+               break;
        default:
                break;
        }
index 2be61679fc71121c6db91c3ab251fa89987bdbd5..fbafeb9f0e75f349664e4addf304d7c7a3e2c319 100644 (file)
@@ -49,6 +49,9 @@ struct ac_shader_info {
                bool uses_thread_id[3];
                bool uses_local_invocation_idx;
        } cs;
+       struct {
+               bool reads_tess_factors;
+       } tes;
 };
 
 /* A NIR pass to gather all the info needed to optimise the allocation patterns
index c3c17af8500d60ab1c7ef033cd44a7582c1aba95..0bb1cd9dff3fc02fe056be1605248cfe2372247d 100644 (file)
@@ -1759,8 +1759,6 @@ radv_fill_shader_keys(struct ac_shader_variant_key *keys,
                keys[MESA_SHADER_VERTEX].vs.as_ls = true;
                keys[MESA_SHADER_TESS_CTRL].tcs.input_vertices = key->tess_input_vertices;
                keys[MESA_SHADER_TESS_CTRL].tcs.primitive_mode = nir[MESA_SHADER_TESS_EVAL]->info.tess.primitive_mode;
-
-               keys[MESA_SHADER_TESS_CTRL].tcs.tes_reads_tess_factors = !!(nir[MESA_SHADER_TESS_EVAL]->info.inputs_read & (VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER));
        }
 
        if (nir[MESA_SHADER_GEOMETRY]) {