summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-04-25 16:00:31 -0600
committerBrian Paul <[email protected]>2016-04-27 10:23:19 -0600
commit1d242b688265a405dfd8077ea32ac4ea673b02a2 (patch)
treebb81e4f70e9b2449f1e98c64955a6741d4662dcf /src/gallium/drivers/llvmpipe/lp_setup.c
parent23c55e5c233927fee2a866d9aa842c975024933f (diff)
llvmpipe: s/Elements/ARRAY_SIZE/
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 34d3c812b60..0a45db94723 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -69,7 +69,7 @@ lp_setup_get_empty_scene(struct lp_setup_context *setup)
assert(setup->scene == NULL);
setup->scene_idx++;
- setup->scene_idx %= Elements(setup->scenes);
+ setup->scene_idx %= ARRAY_SIZE(setup->scenes);
setup->scene = setup->scenes[setup->scene_idx];
@@ -123,7 +123,7 @@ void lp_setup_reset( struct lp_setup_context *setup )
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
/* Reset derived state */
- for (i = 0; i < Elements(setup->constants); ++i) {
+ for (i = 0; i < ARRAY_SIZE(setup->constants); ++i) {
setup->constants[i].stored_size = 0;
setup->constants[i].stored_data = NULL;
}
@@ -650,12 +650,12 @@ lp_setup_set_fs_constants(struct lp_setup_context *setup,
LP_DBG(DEBUG_SETUP, "%s %p\n", __FUNCTION__, (void *) buffers);
- assert(num <= Elements(setup->constants));
+ assert(num <= ARRAY_SIZE(setup->constants));
for (i = 0; i < num; ++i) {
util_copy_constant_buffer(&setup->constants[i].current, &buffers[i]);
}
- for (; i < Elements(setup->constants); i++) {
+ for (; i < ARRAY_SIZE(setup->constants); i++) {
util_copy_constant_buffer(&setup->constants[i].current, NULL);
}
setup->dirty |= LP_SETUP_NEW_CONSTANTS;
@@ -990,7 +990,7 @@ lp_setup_is_resource_referenced( const struct lp_setup_context *setup,
}
/* check textures referenced by the scene */
- for (i = 0; i < Elements(setup->scenes); i++) {
+ for (i = 0; i < ARRAY_SIZE(setup->scenes); i++) {
if (lp_scene_is_resource_referenced(setup->scenes[i], texture)) {
return LP_REFERENCED_FOR_READ;
}
@@ -1081,7 +1081,7 @@ try_update_scene_state( struct lp_setup_context *setup )
}
if (setup->dirty & LP_SETUP_NEW_CONSTANTS) {
- for (i = 0; i < Elements(setup->constants); ++i) {
+ for (i = 0; i < ARRAY_SIZE(setup->constants); ++i) {
struct pipe_resource *buffer = setup->constants[i].current.buffer;
const unsigned current_size = MIN2(setup->constants[i].current.buffer_size,
LP_MAX_TGSI_CONST_BUFFER_SIZE);
@@ -1166,7 +1166,7 @@ try_update_scene_state( struct lp_setup_context *setup )
/* The scene now references the textures in the rasterization
* state record. Note that now.
*/
- for (i = 0; i < Elements(setup->fs.current_tex); i++) {
+ for (i = 0; i < ARRAY_SIZE(setup->fs.current_tex); i++) {
if (setup->fs.current_tex[i]) {
if (!lp_scene_add_resource_reference(scene,
setup->fs.current_tex[i],
@@ -1283,16 +1283,16 @@ lp_setup_destroy( struct lp_setup_context *setup )
util_unreference_framebuffer_state(&setup->fb);
- for (i = 0; i < Elements(setup->fs.current_tex); i++) {
+ for (i = 0; i < ARRAY_SIZE(setup->fs.current_tex); i++) {
pipe_resource_reference(&setup->fs.current_tex[i], NULL);
}
- for (i = 0; i < Elements(setup->constants); i++) {
+ for (i = 0; i < ARRAY_SIZE(setup->constants); i++) {
pipe_resource_reference(&setup->constants[i].current.buffer, NULL);
}
/* free the scenes in the 'empty' queue */
- for (i = 0; i < Elements(setup->scenes); i++) {
+ for (i = 0; i < ARRAY_SIZE(setup->scenes); i++) {
struct lp_scene *scene = setup->scenes[i];
if (scene->fence)