diff options
author | Samuel Pitoiset <[email protected]> | 2016-05-12 21:06:05 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2016-05-12 21:37:08 +0200 |
commit | abb3401095e24f9551c964a01729e870414395af (patch) | |
tree | f46daf3e9a233ced6e33c4fbf59e5ff8155f3ef5 /src/gallium/drivers/nouveau | |
parent | b8f0b00a9a541868e40eed0a81dccc7ce59a8129 (diff) |
nvc0: save some CPU cycles in nvc0_context_unreference_resources()
This reduces the number of loop iterations for invalidating buffers
and images.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c index d51e89d672f..bf8437130e9 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c @@ -150,20 +150,18 @@ nvc0_context_unreference_resources(struct nvc0_context *nvc0) for (i = 0; i < NVC0_MAX_PIPE_CONSTBUFS; ++i) if (!nvc0->constbuf[s][i].user) pipe_resource_reference(&nvc0->constbuf[s][i].u.buf, NULL); - } - - for (s = 0; s < 2; ++s) { - for (i = 0; i < NVC0_MAX_SURFACE_SLOTS; ++i) - pipe_surface_reference(&nvc0->surfaces[s][i], NULL); - } - for (s = 0; s < 6; ++s) for (i = 0; i < NVC0_MAX_BUFFERS; ++i) pipe_resource_reference(&nvc0->buffers[s][i].buffer, NULL); - for (s = 0; s < 6; ++s) for (i = 0; i < NVC0_MAX_IMAGES; ++i) pipe_resource_reference(&nvc0->images[s][i].resource, NULL); + } + + for (s = 0; s < 2; ++s) { + for (i = 0; i < NVC0_MAX_SURFACE_SLOTS; ++i) + pipe_surface_reference(&nvc0->surfaces[s][i], NULL); + } for (i = 0; i < nvc0->num_tfbbufs; ++i) pipe_so_target_reference(&nvc0->tfbbuf[i], NULL); |