diff options
author | Jan Vesely <[email protected]> | 2016-05-17 09:25:44 -0400 |
---|---|---|
committer | Jan Vesely <[email protected]> | 2016-05-17 15:28:04 -0400 |
commit | 47b390fe45e5e6f982c60b58985892438959cd8e (patch) | |
tree | 61a26199f85287a7e918c6c52db243280b6a3cba /src/gallium/drivers/r600 | |
parent | 322cd2457ccf66a0a88d92f0b0dec1cb3f93eae4 (diff) |
Treewide: Remove Elements() macro
Signed-off-by: Jan Vesely <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/r600/sb/sb_bc_parser.cpp | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 62152c03f7e..23dd475bf9e 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1504,18 +1504,18 @@ static void evergreen_emit_msaa_state(struct r600_context *rctx, int nr_samples, nr_samples = 0; break; case 2: - radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, Elements(eg_sample_locs_2x)); - radeon_emit_array(cs, eg_sample_locs_2x, Elements(eg_sample_locs_2x)); + radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, ARRAY_SIZE(eg_sample_locs_2x)); + radeon_emit_array(cs, eg_sample_locs_2x, ARRAY_SIZE(eg_sample_locs_2x)); max_dist = eg_max_dist_2x; break; case 4: - radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, Elements(eg_sample_locs_4x)); - radeon_emit_array(cs, eg_sample_locs_4x, Elements(eg_sample_locs_4x)); + radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, ARRAY_SIZE(eg_sample_locs_4x)); + radeon_emit_array(cs, eg_sample_locs_4x, ARRAY_SIZE(eg_sample_locs_4x)); max_dist = eg_max_dist_4x; break; case 8: - radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, Elements(sample_locs_8x)); - radeon_emit_array(cs, sample_locs_8x, Elements(sample_locs_8x)); + radeon_set_context_reg_seq(cs, R_028C1C_PA_SC_AA_SAMPLE_LOCS_0, ARRAY_SIZE(sample_locs_8x)); + radeon_emit_array(cs, sample_locs_8x, ARRAY_SIZE(sample_locs_8x)); max_dist = max_dist_8x; break; } diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index cd5ae449dee..101f666f683 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -858,7 +858,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx) case TGSI_FILE_INPUT: for (j = 0; j < count; j++) { i = ctx->shader->ninput + j; - assert(i < Elements(ctx->shader->input)); + assert(i < ARRAY_SIZE(ctx->shader->input)); ctx->shader->input[i].name = d->Semantic.Name; ctx->shader->input[i].sid = d->Semantic.Index + j; ctx->shader->input[i].interpolate = d->Interp.Interpolate; @@ -902,7 +902,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx) case TGSI_FILE_OUTPUT: for (j = 0; j < count; j++) { i = ctx->shader->noutput + j; - assert(i < Elements(ctx->shader->output)); + assert(i < ARRAY_SIZE(ctx->shader->output)); ctx->shader->output[i].name = d->Semantic.Name; ctx->shader->output[i].sid = d->Semantic.Index + j; ctx->shader->output[i].gpr = ctx->file_offset[TGSI_FILE_OUTPUT] + d->Range.First + j; @@ -1117,7 +1117,7 @@ static int allocate_system_value_inputs(struct r600_shader_ctx *ctx, int gpr_off } else if (parse.FullToken.Token.Type == TGSI_TOKEN_TYPE_DECLARATION) { struct tgsi_full_declaration *d = &parse.FullToken.FullDeclaration; if (d->Declaration.File == TGSI_FILE_SYSTEM_VALUE) { - for (k = 0; k < Elements(inputs); k++) { + for (k = 0; k < ARRAY_SIZE(inputs); k++) { if (d->Semantic.Name == inputs[k].name || d->Semantic.Name == inputs[k].alternate_name) { inputs[k].enabled = true; @@ -1129,7 +1129,7 @@ static int allocate_system_value_inputs(struct r600_shader_ctx *ctx, int gpr_off tgsi_parse_free(&parse); - for (i = 0; i < Elements(inputs); i++) { + for (i = 0; i < ARRAY_SIZE(inputs); i++) { boolean enabled = inputs[i].enabled; int *reg = inputs[i].reg; unsigned name = inputs[i].name; @@ -1217,7 +1217,7 @@ static int evergreen_gpr_count(struct r600_shader_ctx *ctx) /* assign gpr to each interpolator according to priority */ num_baryc = 0; - for (i = 0; i < Elements(ctx->eg_interpolators); i++) { + for (i = 0; i < ARRAY_SIZE(ctx->eg_interpolators); i++) { if (ctx->eg_interpolators[i].enabled) { ctx->eg_interpolators[i].ij_index = num_baryc; num_baryc ++; diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index cac240e8fba..b75f61b3065 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -121,7 +121,7 @@ static unsigned r600_conv_pipe_prim(unsigned prim) [PIPE_PRIM_PATCHES] = V_008958_DI_PT_PATCH, [R600_PRIM_RECTANGLE_LIST] = V_008958_DI_PT_RECTLIST }; - assert(prim < Elements(prim_conv)); + assert(prim < ARRAY_SIZE(prim_conv)); return prim_conv[prim]; } @@ -145,7 +145,7 @@ unsigned r600_conv_prim_to_gs_out(unsigned mode) [PIPE_PRIM_PATCHES] = V_028A6C_OUTPRIM_TYPE_POINTLIST, [R600_PRIM_RECTANGLE_LIST] = V_028A6C_OUTPRIM_TYPE_TRISTRIP }; - assert(mode < Elements(prim_conv)); + assert(mode < ARRAY_SIZE(prim_conv)); return prim_conv[mode]; } @@ -1283,7 +1283,7 @@ void r600_set_sample_locations_constant_buffer(struct r600_context *rctx) struct pipe_context *ctx = &rctx->b.b; assert(rctx->framebuffer.nr_samples < R600_UCP_SIZE); - assert(rctx->framebuffer.nr_samples <= Elements(rctx->sample_positions)/4); + assert(rctx->framebuffer.nr_samples <= ARRAY_SIZE(rctx->sample_positions)/4); memset(rctx->sample_positions, 0, 4 * 4 * 16); for (i = 0; i < rctx->framebuffer.nr_samples; i++) { diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp index 0983974ab5d..ae92a767b4c 100644 --- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp +++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp @@ -176,7 +176,7 @@ int bc_parser::parse_decls() { if (ps_interp) { /* add the egcm ij interpolators to live inputs */ unsigned num_ij = 0; - for (unsigned i = 0; i < Elements(ij_interpolators); i++) { + for (unsigned i = 0; i < ARRAY_SIZE(ij_interpolators); i++) { num_ij += ij_interpolators[i]; } |