panfrost: fix an incorrect stencil clear optimization
We track stencil clears and writes to optimize them. Unfortunately, the code for doing this tracks the whole resource, not individual layers or levels within the resource, which can result in incorrect output when different levels or layers are accessed. Modified to optimize only the first layer/level; this will handle the common case of a single stencil texture while allowing arrays or mipmaps to still work (albeit slightly slower). The original optimization was introduced in a2463ec2 ("panfrost: Constant stencil buffer tracking") but the code has been reformatted since then, so this change won't apply as-is that far back (although it's fairly obvious how to apply it by hand). Fixes: a2463ec2 ("panfrost: Constant stencil value tracking") Signed-off-by:Eric R. Smith <eric.smith@collabora.com> Reviewed-by:
Boris Brezillon <boris.brezillon@collabora.com> Acked-by:
Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <mesa/mesa!28832>