diff options
author | Matt Turner <[email protected]> | 2016-10-17 14:10:26 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2019-07-30 14:35:43 -0700 |
commit | dabb5d4bee0705deba29e96725b6f8a63943c28e (patch) | |
tree | 591fdc4ea3f0a8e324b633b836858bc4ea8091ee /src/intel/compiler/brw_fs.cpp | |
parent | 11a49f289d17128c24dd9aa339b940b819cb7e41 (diff) |
i965/fs: Add a shader_stats struct.
It'll grow further, and we'd like to avoid adding an additional
parameter to fs_generator() for each new piece of data.
v2 (idr): Rebase on 17 months. Track a visitor instead of a cfg.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs.cpp')
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index c8dae0c85d9..c5d30a0e7ed 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -8108,7 +8108,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data, } fs_generator g(compiler, log_data, mem_ctx, &prog_data->base, - v8.promoted_constants, v8.runtime_check_aads_emit, + v8.shader_stats, v8.runtime_check_aads_emit, MESA_SHADER_FRAGMENT); if (unlikely(INTEL_DEBUG & DEBUG_WM)) { @@ -8258,9 +8258,8 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, unsigned max_dispatch_width = 32; fs_visitor *v8 = NULL, *v16 = NULL, *v32 = NULL; - cfg_t *cfg = NULL; + fs_visitor *v = NULL; const char *fail_msg = NULL; - unsigned promoted_constants = 0; if ((int)key->base.subgroup_size_type >= (int)BRW_SUBGROUP_SIZE_REQUIRE_8) { /* These enum values are expressly chosen to be equal to the subgroup @@ -8294,10 +8293,9 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, /* We should always be able to do SIMD32 for compute shaders */ assert(v8->max_dispatch_width >= 32); - cfg = v8->cfg; + v = v8; cs_set_simd_size(prog_data, 8); cs_fill_push_const_info(compiler->devinfo, prog_data); - promoted_constants = v8->promoted_constants; } } @@ -8317,7 +8315,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, compiler->shader_perf_log(log_data, "SIMD16 shader failed to compile: %s", v16->fail_msg); - if (!cfg) { + if (!v) { fail_msg = "Couldn't generate SIMD16 program and not " "enough threads for SIMD8"; @@ -8326,10 +8324,9 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, /* We should always be able to do SIMD32 for compute shaders */ assert(v16->max_dispatch_width >= 32); - cfg = v16->cfg; + v = v16; cs_set_simd_size(prog_data, 16); cs_fill_push_const_info(compiler->devinfo, prog_data); - promoted_constants = v16->promoted_constants; } } @@ -8354,27 +8351,27 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, compiler->shader_perf_log(log_data, "SIMD32 shader failed to compile: %s", v16->fail_msg); - if (!cfg) { + if (!v) { fail_msg = "Couldn't generate SIMD32 program and not " "enough threads for SIMD16"; } } else { - cfg = v32->cfg; + v = v32; cs_set_simd_size(prog_data, 32); cs_fill_push_const_info(compiler->devinfo, prog_data); - promoted_constants = v32->promoted_constants; } } const unsigned *ret = NULL; - if (unlikely(cfg == NULL)) { + if (unlikely(v == NULL)) { assert(fail_msg); if (error_str) *error_str = ralloc_strdup(mem_ctx, fail_msg); } else { fs_generator g(compiler, log_data, mem_ctx, &prog_data->base, - promoted_constants, false, MESA_SHADER_COMPUTE); + v->shader_stats, v->runtime_check_aads_emit, + MESA_SHADER_COMPUTE); if (INTEL_DEBUG & DEBUG_CS) { char *name = ralloc_asprintf(mem_ctx, "%s compute shader %s", src_shader->info.label ? @@ -8383,7 +8380,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data, g.enable_debug(name); } - g.generate_code(cfg, prog_data->simd_size); + g.generate_code(v->cfg, prog_data->simd_size); ret = g.get_assembly(); } |