nv2a: Sync on surface type change

This commit is contained in:
Matt Borgerson 2021-09-05 15:22:49 -07:00 committed by mborgerson
parent 8b373fde9b
commit fe4929c146
1 changed files with 1 additions and 15 deletions

View File

@ -5415,11 +5415,8 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color)
pg->surface_shape.clip_height);
bool should_create = true;
bool surface_type_changed = false;
if (found != NULL) {
surface_type_changed = (entry.color != found->color);
bool is_compatible =
pgraph_check_surface_compatibility(found, &entry, false);
NV2A_XPRINTF(DBG_SURFACES,
@ -5462,9 +5459,7 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color)
} else {
NV2A_XPRINTF(DBG_SURFACES, "Evicting incompatible surface\n");
pgraph_compare_surfaces(found, &entry);
if (!surface_type_changed) {
pgraph_download_surface_data_if_dirty(d, found);
}
pgraph_download_surface_data_if_dirty(d, found);
pgraph_surface_invalidate(d, found);
}
}
@ -5498,15 +5493,6 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color)
pg->surface_binding_dim.clip_height = entry.shape.clip_height;
}
/*
* Assume moving from color to zeta, or zeta to color, will clear the
* surface and in this case avoid syncronization.
*
* FIXME: It's possible that this assumption is too broad, especially if
* dimensions differ. For now keep things simple.
*/
found->upload_pending &= !surface_type_changed;
NV2A_XPRINTF(DBG_SURFACES,
"%6s: [%5s @ %" HWADDR_PRIx " (%dx%d)] (%s) "
"aa:%d, clip:x=%d,w=%d,y=%d,h=%d\n",