etnaviv: properly check number of layers in surface creation

3D textures store their number of layers in the resource depth. As the
assert only checks the array_size, it fails on perfectly valid surface
creation requests. Use the proper helper to get the number of layers.

Fixes piglit spec@arb_framebuffer_object@fbo-incomplete

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17996>
This commit is contained in:
Lucas Stach 2022-08-10 21:27:27 +02:00 committed by Marge Bot
parent 88fd397c74
commit 2d93327cc4

View file

@ -90,7 +90,7 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
assert(templat->u.tex.first_layer == templat->u.tex.last_layer);
unsigned layer = templat->u.tex.first_layer;
unsigned level = templat->u.tex.level;
assert(layer < rsc->base.array_size);
assert(layer <= util_max_layer(prsc, level));
surf->base.context = pctx;