diff options
author | Carl Worth <[email protected]> | 2016-04-14 10:59:16 +1000 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2017-10-31 23:36:54 -0700 |
commit | 540636045fc4893d19f68f04157ce246a2ccbebe (patch) | |
tree | 5c4f459022e2d24bd2f98dfcb2125c5d3dde44d7 /src/intel/compiler/brw_shader.cpp | |
parent | 1edf0fe612d595bf1eee711b60db17eb25759f82 (diff) |
intel/compiler: add new field for storing program size
This will be used by the on disk shader cache.
v2:
* Set in brw_compile_* rather than brw_codegen_*. (Jason)
Signed-off-by: Timothy Arceri <[email protected]>
[[email protected]: Only add to brw_stage_prog_data]
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_shader.cpp')
-rw-r--r-- | src/intel/compiler/brw_shader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_shader.cpp index ddb941c1cbf..7253f5d5531 100644 --- a/src/intel/compiler/brw_shader.cpp +++ b/src/intel/compiler/brw_shader.cpp @@ -1162,6 +1162,7 @@ brw_compile_tes(const struct brw_compiler *compiler, { const struct gen_device_info *devinfo = compiler->devinfo; const bool is_scalar = compiler->scalar_stage[MESA_SHADER_TESS_EVAL]; + const unsigned *assembly; nir_shader *nir = nir_shader_clone(mem_ctx, src_shader); nir->info.inputs_read = key->inputs_read; @@ -1270,7 +1271,7 @@ brw_compile_tes(const struct brw_compiler *compiler, g.generate_code(v.cfg, 8); - return g.get_assembly(final_assembly_size); + assembly = g.get_assembly(final_assembly_size); } else { brw::vec4_tes_visitor v(compiler, log_data, key, prog_data, nir, mem_ctx, shader_time_index); @@ -1283,8 +1284,11 @@ brw_compile_tes(const struct brw_compiler *compiler, if (unlikely(INTEL_DEBUG & DEBUG_TES)) v.dump_instructions(); - return brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir, - &prog_data->base, v.cfg, - final_assembly_size); + assembly = brw_vec4_generate_assembly(compiler, log_data, mem_ctx, nir, + &prog_data->base, v.cfg, + final_assembly_size); } + + prog_data->base.base.program_size = *final_assembly_size; + return assembly; } |