nv2a: Fallback to recreating texture on surface size mismatch.

There is no requirement that a surface and texture using the same VRAM address
match with respect to size (in particular pitch). This change prevents
incorrect reuse of a surface binding in the event that the texture size does
not match.

Fixes #1127
This commit is contained in:
Erik Abair 2022-06-30 18:22:46 -07:00 committed by mborgerson
parent ea0a906707
commit 1e221e8da9
1 changed files with 6 additions and 0 deletions

View File

@ -5354,6 +5354,12 @@ static bool pgraph_check_surface_to_texture_compatibility(
{
// FIXME: Better checks/handling on formats and surface-texture compat
if (surface->pitch != shape->pitch ||
surface->width != shape->width ||
surface->height != shape->height) {
return false;
}
int surface_fmt = surface->shape.color_format;
int texture_fmt = shape->color_format;