mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
panfrost: assert(0) -> unreachable for some switch
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
629806b55b
commit
c65271c929
2 changed files with 18 additions and 31 deletions
|
|
@ -438,8 +438,7 @@ translate_tex_wrap(enum pipe_tex_wrap w)
|
|||
return MALI_WRAP_MIRRORED_REPEAT;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("Invalid wrap");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -454,8 +453,7 @@ translate_tex_filter(enum pipe_tex_filter f)
|
|||
return MALI_LINEAR;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("Invalid filter");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -492,10 +490,10 @@ panfrost_translate_compare_func(enum pipe_compare_func in)
|
|||
|
||||
case PIPE_FUNC_ALWAYS:
|
||||
return MALI_FUNC_ALWAYS;
|
||||
}
|
||||
|
||||
assert (0);
|
||||
return 0; /* Unreachable */
|
||||
default:
|
||||
unreachable("Invalid func");
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned
|
||||
|
|
@ -525,10 +523,10 @@ panfrost_translate_alt_compare_func(enum pipe_compare_func in)
|
|||
|
||||
case PIPE_FUNC_ALWAYS:
|
||||
return MALI_ALT_FUNC_ALWAYS;
|
||||
}
|
||||
|
||||
assert (0);
|
||||
return 0; /* Unreachable */
|
||||
default:
|
||||
unreachable("Invalid alt func");
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned
|
||||
|
|
@ -558,10 +556,10 @@ panfrost_translate_stencil_op(enum pipe_stencil_op in)
|
|||
|
||||
case PIPE_STENCIL_OP_INVERT:
|
||||
return MALI_STENCIL_INVERT;
|
||||
}
|
||||
|
||||
assert (0);
|
||||
return 0; /* Unreachable */
|
||||
default:
|
||||
unreachable("Invalid stencil op");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1200,8 +1198,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
|
|||
break;
|
||||
|
||||
default:
|
||||
DBG("Unknown shader stage %d in uniform upload\n", i);
|
||||
assert(0);
|
||||
unreachable("Invalid shader stage\n");
|
||||
}
|
||||
|
||||
/* Also attach the same buffer as a UBO for extended access */
|
||||
|
|
@ -1432,9 +1429,7 @@ g2m_draw_mode(enum pipe_prim_type mode)
|
|||
DEFINE_CASE(POLYGON);
|
||||
|
||||
default:
|
||||
DBG("Illegal draw mode %d\n", mode);
|
||||
assert(0);
|
||||
return MALI_LINE_LOOP;
|
||||
unreachable("Invalid draw mode");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1454,9 +1449,7 @@ panfrost_translate_index_size(unsigned size)
|
|||
return MALI_DRAW_INDEXED_UINT32;
|
||||
|
||||
default:
|
||||
DBG("Unknown index size %d\n", size);
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("Invalid index size");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ panfrost_translate_swizzle(enum pipe_swizzle s)
|
|||
return MALI_CHANNEL_ONE;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("INvalid swizzle");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -100,9 +99,7 @@ panfrost_translate_channel_width(unsigned size)
|
|||
case 32:
|
||||
return MALI_CHANNEL_32;
|
||||
default:
|
||||
fprintf(stderr, "Unknown width %d\n", size);
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("Invalid width");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -128,8 +125,7 @@ panfrost_translate_channel_type(unsigned type, unsigned size, bool norm) {
|
|||
}
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
return 0;
|
||||
unreachable("Invalid type");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,9 +228,7 @@ panfrost_find_format(const struct util_format_description *desc)
|
|||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unknown format type in %s\n", desc->name);
|
||||
assert(0);
|
||||
break;
|
||||
unreachable("Invalid format type");
|
||||
}
|
||||
|
||||
return (enum mali_format) format;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue