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);
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");
}
setup_cs_payload();
+ if (INTEL_DEBUG & DEBUG_SHADER_TIME)
+ emit_shader_time_begin();
+
emit_nir_code();
if (failed)
emit_cs_terminate();
+ if (INTEL_DEBUG & DEBUG_SHADER_TIME)
+ emit_shader_time_end();
+
calculate_cfg();
optimize();
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;
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++) {
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;
case ST_GS:
case ST_FS8:
case ST_FS16:
+ case ST_CS:
get_written_and_reset(brw, i, &written, &reset);
break;
case ST_GS:
case ST_FS8:
case ST_FS16:
+ case ST_CS:
total_by_type[type] += scaled[i];
break;
default:
case ST_FS16:
stage = "fs16";
break;
+ case ST_CS:
+ stage = "cs";
+ break;
default:
stage = "other";
break;
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