diff options
author | Jordan Justen <[email protected]> | 2015-04-15 18:27:50 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-05-02 00:49:59 -0700 |
commit | b750e14fbbeb20a6daa869ae642c0c1e1ce6e6d2 (patch) | |
tree | a6ee10e51cd53b8325f0895a3e895ca0aa8ee76a /src | |
parent | 6b1b484b60890380a5899517a4e91a674be0c4a2 (diff) |
i965/fs: Add CS shader time support
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cs.cpp | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 13 |
4 files changed, 33 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 106b237506b..54cb162b03f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -834,6 +834,9 @@ enum shader_time_shader_type { ST_FS16, ST_FS16_WRITTEN, ST_FS16_RESET, + ST_CS, + ST_CS_WRITTEN, + ST_CS_RESET, }; struct brw_vertex_buffer { diff --git a/src/mesa/drivers/dri/i965/brw_cs.cpp b/src/mesa/drivers/dri/i965/brw_cs.cpp index 02bc375f98d..e2f3d6310dd 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.cpp +++ b/src/mesa/drivers/dri/i965/brw_cs.cpp @@ -297,6 +297,14 @@ brw_upload_cs_state(struct brw_context *brw) struct brw_cs_prog_data *cs_prog_data = brw->cs.prog_data; struct brw_stage_prog_data *prog_data = &cs_prog_data->base; + if (INTEL_DEBUG & DEBUG_SHADER_TIME) { + brw->vtbl.emit_buffer_surface_state( + brw, &stage_state->surf_offset[ + prog_data->binding_table.shader_time_start], + brw->shader_time.bo, 0, BRW_SURFACEFORMAT_RAW, + brw->shader_time.bo->size, 1, true); + } + uint32_t *bind = (uint32_t*) brw_state_batch(brw, AUB_TRACE_BINDING_TABLE, prog_data->binding_table.size_bytes, 32, &stage_state->bind_bo_offset); diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 90a85625581..c0abff1ba0e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -758,6 +758,11 @@ fs_visitor::emit_shader_time_end() reset_type = ST_FS16_RESET; } break; + case MESA_SHADER_COMPUTE: + type = ST_CS; + written_type = ST_CS_WRITTEN; + reset_type = ST_CS_RESET; + break; default: unreachable("fs_visitor::emit_shader_time_end missing code"); } @@ -4139,6 +4144,9 @@ fs_visitor::run_cs() setup_cs_payload(); + if (INTEL_DEBUG & DEBUG_SHADER_TIME) + emit_shader_time_begin(); + emit_nir_code(); if (failed) @@ -4146,6 +4154,9 @@ fs_visitor::run_cs() emit_cs_terminate(); + if (INTEL_DEBUG & DEBUG_SHADER_TIME) + emit_shader_time_end(); + calculate_cfg(); optimize(); diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 81a0c191420..e5c0d3c7604 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -323,7 +323,8 @@ get_written_and_reset(struct brw_context *brw, int i, uint64_t *written, uint64_t *reset) { enum shader_time_shader_type type = brw->shader_time.types[i]; - assert(type == ST_VS || type == ST_GS || type == ST_FS8 || type == ST_FS16); + assert(type == ST_VS || type == ST_GS || type == ST_FS8 || + type == ST_FS16 || type == ST_CS); /* Find where we recorded written and reset. */ int wi, ri; @@ -363,7 +364,7 @@ brw_report_shader_time(struct brw_context *brw) uint64_t scaled[brw->shader_time.num_entries]; uint64_t *sorted[brw->shader_time.num_entries]; - uint64_t total_by_type[ST_FS16 + 1]; + uint64_t total_by_type[ST_CS + 1]; memset(total_by_type, 0, sizeof(total_by_type)); double total = 0; for (int i = 0; i < brw->shader_time.num_entries; i++) { @@ -381,6 +382,8 @@ brw_report_shader_time(struct brw_context *brw) case ST_FS8_RESET: case ST_FS16_WRITTEN: case ST_FS16_RESET: + case ST_CS_WRITTEN: + case ST_CS_RESET: /* We'll handle these when along with the time. */ scaled[i] = 0; continue; @@ -389,6 +392,7 @@ brw_report_shader_time(struct brw_context *brw) case ST_GS: case ST_FS8: case ST_FS16: + case ST_CS: get_written_and_reset(brw, i, &written, &reset); break; @@ -413,6 +417,7 @@ brw_report_shader_time(struct brw_context *brw) case ST_GS: case ST_FS8: case ST_FS16: + case ST_CS: total_by_type[type] += scaled[i]; break; default: @@ -455,6 +460,9 @@ brw_report_shader_time(struct brw_context *brw) case ST_FS16: stage = "fs16"; break; + case ST_CS: + stage = "cs"; + break; default: stage = "other"; break; @@ -469,6 +477,7 @@ brw_report_shader_time(struct brw_context *brw) print_shader_time_line("total", "gs", 0, total_by_type[ST_GS], total); print_shader_time_line("total", "fs8", 0, total_by_type[ST_FS8], total); print_shader_time_line("total", "fs16", 0, total_by_type[ST_FS16], total); + print_shader_time_line("total", "cs", 0, total_by_type[ST_CS], total); } static void |