mesa: remove some conditions in mipmap code

This function already asserts that we have ZS format without stencil,
it should be guaranteed to have depth in it.

CID: 1602463
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29534>
This commit is contained in:
Tapani Pälli 2024-06-03 09:29:01 +03:00 committed by Marge Bot
parent 5eee101477
commit bbe9ab54d4

View file

@ -100,15 +100,14 @@ do_span_zs(enum pipe_format format, int srcWidth,
assert(desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS);
assert(srcWidth <= MAX_SPAN_WIDTH);
assert(dstWidth <= MAX_SPAN_WIDTH);
assert(util_format_has_depth(desc) &&
!util_format_has_stencil(desc));
float rowA[MAX_SPAN_WIDTH], rowB[MAX_SPAN_WIDTH],
result[MAX_SPAN_WIDTH];
if (util_format_has_depth(desc)) {
util_format_unpack_z_float(format, rowA, srcRowA, srcWidth);
util_format_unpack_z_float(format, rowB, srcRowB, srcWidth);
}
assert(!util_format_has_stencil(desc));
util_format_unpack_z_float(format, rowA, srcRowA, srcWidth);
util_format_unpack_z_float(format, rowB, srcRowB, srcWidth);
if (srcWidth == dstWidth) {
for (unsigned i = 0; i < dstWidth; ++i) {
@ -121,8 +120,7 @@ do_span_zs(enum pipe_format format, int srcWidth,
}
}
if (util_format_has_depth(desc))
util_format_pack_z_float(format, dstRow, result, dstWidth);
util_format_pack_z_float(format, dstRow, result, dstWidth);
}
static void