diff options
author | Ilia Mirkin <[email protected]> | 2015-09-15 01:32:40 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-09-17 19:50:47 -0400 |
commit | 323c91250682ac931941047f282a613c74b1ba26 (patch) | |
tree | b630973ab9b86c7a80a54c1317268837b6e85955 /src/gallium/drivers/nouveau/nv50 | |
parent | 8d3b92af21afb58b6a65e18bb05785d7aae72c27 (diff) |
nv50,nvc0: detect underlying resource changes and update tic
When updating texture buffers, we might end up replacing the whole
buffer. Check that the tic address matches the resource address, and if
not, update the tic and reupload it.
This fixes:
arb_direct_state_access-texture-buffer
arb_texture_buffer_object-data-sync
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: "11.0" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_tex.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c index fc6374d1b1b..6083ea995c8 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c @@ -221,6 +221,26 @@ nv50_create_texture_view(struct pipe_context *pipe, return &view->pipe; } +static void +nv50_update_tic(struct nv50_context *nv50, struct nv50_tic_entry *tic, + struct nv04_resource *res) +{ + uint64_t address = res->address; + if (res->base.target != PIPE_BUFFER) + return; + address += tic->pipe.u.buf.first_element * + util_format_get_blocksize(tic->pipe.format); + if (tic->tic[1] == (uint32_t)address && + (tic->tic[2] & 0xff) == address >> 32) + return; + + nv50_screen_tic_unlock(nv50->screen, tic); + tic->id = -1; + tic->tic[1] = address; + tic->tic[2] &= 0xffffff00; + tic->tic[2] |= address >> 32; +} + static bool nv50_validate_tic(struct nv50_context *nv50, int s) { @@ -240,6 +260,7 @@ nv50_validate_tic(struct nv50_context *nv50, int s) continue; } res = &nv50_miptree(tic->pipe.texture)->base; + nv50_update_tic(nv50, tic, res); if (tic->id < 0) { tic->id = nv50_screen_tic_alloc(nv50->screen, tic); |