nv2a/vk: Ensure texture bindings exist before dirty check

This commit is contained in:
Matt Borgerson 2024-07-26 17:21:01 -07:00 committed by mborgerson
parent 4bd0406797
commit 71d00d2208
1 changed files with 5 additions and 2 deletions

View File

@ -1283,8 +1283,10 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
static bool check_textures_dirty(PGRAPHState *pg)
{
PGRAPHVkState *r = pg->vk_renderer_state;
for (int i = 0; i < NV2A_MAX_TEXTURES; i++) {
if (pg->texture_dirty[i]) {
if (!r->texture_bindings[i] || pg->texture_dirty[i]) {
return true;
}
}
@ -1324,7 +1326,8 @@ void pgraph_vk_bind_textures(NV2AState *d)
r->texture_bindings[i] = &r->dummy_texture;
continue;
}
if (!pg->texture_dirty[i]) { // FIXME: Fails to check memory
if (r->texture_bindings[i] && !pg->texture_dirty[i]) {
// FIXME: Fails to check memory
continue;
}