diff options
author | Brian Paul <[email protected]> | 2016-04-25 15:53:04 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-04-27 10:23:19 -0600 |
commit | f93802c465b021592837c846d713146ddc1a8155 (patch) | |
tree | febd0e2fe18c326c0de10d48c870ad617b7a1b7d /src/gallium/drivers/softpipe/sp_context.c | |
parent | 562c4a17b7e4fb56c7db679233b4a48f8b80b0f2 (diff) |
softpipe: s/Elements/ARRAY_SIZE/
Try to standardize on the later, which is defined in the common util/
directory.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 1690e38f1ca..323f74ff3bd 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -94,15 +94,15 @@ softpipe_destroy( struct pipe_context *pipe ) sp_destroy_tile_cache(softpipe->zsbuf_cache); pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL); - for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) { - for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) { + for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { + for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]); pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL); } } - for (sh = 0; sh < Elements(softpipe->constants); sh++) { - for (i = 0; i < Elements(softpipe->constants[0]); i++) { + for (sh = 0; sh < ARRAY_SIZE(softpipe->constants); sh++) { + for (i = 0; i < ARRAY_SIZE(softpipe->constants[0]); i++) { if (softpipe->constants[sh][i]) { pipe_resource_reference(&softpipe->constants[sh][i], NULL); } @@ -159,8 +159,8 @@ softpipe_is_resource_referenced( struct pipe_context *pipe, } /* check if any of the tex_cache textures are this texture */ - for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) { - for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) { + for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { + for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { if (softpipe->tex_cache[sh][i] && softpipe->tex_cache[sh][i]->texture == texture) return SP_REFERENCED_FOR_READ; @@ -251,8 +251,8 @@ softpipe_create_context(struct pipe_screen *screen, softpipe->zsbuf_cache = sp_create_tile_cache( &softpipe->pipe ); /* Allocate texture caches */ - for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) { - for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) { + for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { + for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) { softpipe->tex_cache[sh][i] = sp_create_tex_tile_cache(&softpipe->pipe); if (!softpipe->tex_cache[sh][i]) goto fail; |