mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
etnaviv: fix segfault after compile failure
Do not try to determine the shader stage from the compiled shader variant, which may be NULL after compile failure. Instead, get it from the NIR shader. Fixes a segfault when trying to evaluate etna_shader_stage(NULL) after compile failure. Suggested-by: Christian Gmeiner <cgmeiner@igalia.com> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Fixes:3d49619071("etnaviv: add support for performance warnings") Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24178> (cherry picked from commitf626605cbf)
This commit is contained in:
parent
f4083ba2a4
commit
4c5c6cf254
2 changed files with 5 additions and 5 deletions
|
|
@ -654,7 +654,7 @@
|
|||
"description": "etnaviv: fix segfault after compile failure",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "3d496190715b012613c58de1f22c043e1573d671",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -347,9 +347,9 @@ etna_shader_update_vs_inputs(struct compiled_shader_state *cs,
|
|||
}
|
||||
|
||||
static inline const char *
|
||||
etna_shader_stage(struct etna_shader_variant *shader)
|
||||
etna_shader_stage(struct etna_shader *shader)
|
||||
{
|
||||
switch (shader->stage) {
|
||||
switch (shader->nir->info.stage) {
|
||||
case MESA_SHADER_VERTEX: return "VERT";
|
||||
case MESA_SHADER_FRAGMENT: return "FRAG";
|
||||
case MESA_SHADER_COMPUTE: return "CL";
|
||||
|
|
@ -368,7 +368,7 @@ dump_shader_info(struct etna_shader_variant *v, struct util_debug_callback *debu
|
|||
util_debug_message(debug, SHADER_INFO,
|
||||
"%s shader: %u instructions, %u temps, "
|
||||
"%u immediates, %u loops",
|
||||
etna_shader_stage(v),
|
||||
etna_shader_stage(v->shader),
|
||||
v->code_size / 4,
|
||||
v->num_temps,
|
||||
v->uniforms.count,
|
||||
|
|
@ -445,7 +445,7 @@ etna_shader_variant(struct etna_shader *shader,
|
|||
perf_debug_message(debug, SHADER_INFO,
|
||||
"%s shader: recompiling at draw time: global "
|
||||
"0x%08x\n",
|
||||
etna_shader_stage(v), key->global);
|
||||
etna_shader_stage(shader), key->global);
|
||||
}
|
||||
|
||||
return v;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue