nv50, nvc0: unlock tic and update address when invalidating resource
PATCH 1/1 nv50, nvc0: unlock tic and update address when invalidating resource
When updating texture buffers, we might end up replacing the whole buffer. When the resource is invalidated, we never actually recreate the sampler view, so we have to make sure that it gets reuploaded, and that it gets the proper new address.
This fixes arb_direct_state_access-texture-buffer.
Signed-off-by Ilia Mirkin <[email protected]>
Cc "11.0" <[email protected]>
--- src/gallium/drivers/nouveau/nv50/nv50_context.c | 6 ++++++ src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 6 ++++++ 2 files changed, 12 insertions(+)
src/gallium/drivers/nouveau/nv50/nv50_context.c +6 -0
@@ -212,8 +212,14 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,for (i =0 ; i < nv50->num_textures[s]; ++i) {if (nv50->textures[s][i] && nv50->textures[s][i]->texture == res) { +struct nv50_tic_entry *tic =nv50_tic_entry (nv50->textures[s][i]); nv50->dirty |=NV50_NEW_TEXTURES ;nouveau_bufctx_reset (nv50->bufctx_3d,NV50_BIND_TEXTURES ); +nv50_screen_tic_unlock (nv50->screen, tic); + tic->id =-1 ; + tic->tic[1 ] =nv04_resource (res)->address; + tic->tic[2 ] &=0xffffff00 ; + tic->tic[2 ] |=nv04_resource (res)->address >>32 ;if (!--ref)return ref; }
src/gallium/drivers/nouveau/nvc0/nvc0_context.c +6 -0
@@ -229,9 +229,15 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx,for (i =0 ; i < nvc0->num_textures[s]; ++i) {if (nvc0->textures[s][i] && nvc0->textures[s][i]->texture == res) { +struct nv50_tic_entry *tic =nv50_tic_entry (nvc0->textures[s][i]); nvc0->textures_dirty[s] |=1 << i; nvc0->dirty |=NVC0_NEW_TEXTURES ;nouveau_bufctx_reset (nvc0->bufctx_3d,NVC0_BIND_TEX (s, i)); +nvc0_screen_tic_unlock (nvc0->screen, tic); + tic->id =-1 ; + tic->tic[1 ] =nv04_resource (res)->address; + tic->tic[2 ] &=0xffffff00 ; + tic->tic[2 ] |=nv04_resource (res)->address >>32 ;if (!--ref)return ref; }
Signature · 6 lines
2.4.6 _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau