{
int ret = ir3_compile_shader_nir(v->shader->compiler, v);
if (ret) {
- debug_error("compile failed!");
+ _debug_printf("compile failed! (%s:%s)", v->shader->nir->info.name,
+ v->shader->nir->info.label);
return false;
}
assemble_variant(v);
if (!v->bin) {
- debug_error("assemble failed!");
+ _debug_printf("assemble failed! (%s:%s)", v->shader->nir->info.name,
+ v->shader->nir->info.label);
return false;
}
goto fail;
}
+ if (ir3_disk_cache_retrieve(shader->compiler, v))
+ return v;
+
+ if (!shader->nir_finalized) {
+ ir3_nir_post_finalize(shader->compiler, shader->nir);
+
+ if (ir3_shader_debug & IR3_DBG_DISASM) {
+ printf("dump nir%d: type=%d", shader->id, shader->type);
+ nir_print_shader(shader->nir, stdout);
+ }
+
+ shader->nir_finalized = true;
+ }
+
if (!compile_variant(v))
goto fail;
if (needs_binning_variant(v) && !compile_variant(v->binning))
goto fail;
+ ir3_disk_cache_store(shader->compiler, v);
+
return v;
fail:
key->safe_constlen = true;
+ key->ucp_enables = 0xff;
+
if (info->stage == MESA_SHADER_FRAGMENT) {
key->fsaturate_s = ~0;
key->fsaturate_t = ~0;
key->color_two_side = true;
}
+ if (info->inputs_read & VARYING_BIT_LAYER) {
+ key->layer_zero = true;
+ }
+
if ((info->outputs_written & ~(FRAG_RESULT_DEPTH |
FRAG_RESULT_STENCIL |
FRAG_RESULT_SAMPLE_MASK)) != 0) {
cur_total += constlens[i];
}
- unsigned max_stage;
+ unsigned max_stage = 0;
unsigned max_const = 0;
uint32_t trimmed = 0;
if (stream_output)
memcpy(&shader->stream_output, stream_output, sizeof(shader->stream_output));
shader->num_reserved_user_consts = reserved_user_consts;
-
- ir3_nir_post_finalize(compiler, nir);
-
shader->nir = nir;
- if (ir3_shader_debug & IR3_DBG_DISASM) {
- printf("dump nir%d: type=%d", shader->id, shader->type);
- nir_print_shader(shader->nir, stdout);
- }
+ ir3_disk_cache_init_shader_key(compiler, shader);
ir3_setup_used_key(shader);