diff options
author | Brian Paul <[email protected]> | 2016-04-28 11:39:15 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-05-03 15:40:48 -0600 |
commit | e193c5dd59555cea56f5d72b4800a54cc77bc76d (patch) | |
tree | 6873c012a8e83c69462f88706a0f1fb2f30ee63c /src/gallium/drivers/ilo/shader | |
parent | 951bf8b4a64c9793d10e963889e74fc1659ddb4b (diff) |
ilo: s/Elements/ARRAY_SIZE/
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ilo/shader')
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_fs.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/ilo_shader_vs.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_compiler.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_compiler_asm.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_legalize.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_legalize_ra.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_tgsi.c | 12 |
7 files changed, 23 insertions, 23 deletions
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c index d2b205a370d..c55e9fa4b30 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c @@ -1123,7 +1123,7 @@ fs_lower_opcode_tgsi_sampling(struct fs_compile_context *fcc, toy_compiler_lower_to_send(tc, inst, false, GEN6_SFID_SAMPLER); inst->src[0] = tsrc(TOY_FILE_MRF, fcc->first_free_mrf, 0); inst->src[1] = desc; - for (i = 2; i < Elements(inst->src); i++) + for (i = 2; i < ARRAY_SIZE(inst->src); i++) inst->src[i] = tsrc_null(); /* write to temps first */ @@ -1450,12 +1450,12 @@ fs_write_fb(struct fs_compile_context *fcc) int color_slots[ILO_MAX_DRAW_BUFFERS], num_cbufs; int pos_slot = -1, cbuf, i; - for (i = 0; i < Elements(color_slots); i++) + for (i = 0; i < ARRAY_SIZE(color_slots); i++) color_slots[i] = -1; for (i = 0; i < fcc->tgsi.num_outputs; i++) { if (fcc->tgsi.outputs[i].semantic_name == TGSI_SEMANTIC_COLOR) { - assert(fcc->tgsi.outputs[i].semantic_index < Elements(color_slots)); + assert(fcc->tgsi.outputs[i].semantic_index < ARRAY_SIZE(color_slots)); color_slots[fcc->tgsi.outputs[i].semantic_index] = i; } else if (fcc->tgsi.outputs[i].semantic_name == TGSI_SEMANTIC_POSITION) { @@ -1674,7 +1674,7 @@ fs_setup_payloads(struct fs_compile_context *fcc) /* r1-r2: coordinates and etc. */ grf += (fcc->dispatch_mode == GEN6_PS_DISPATCH_32) ? 2 : 1; - for (i = 0; i < Elements(fcc->payloads); i++) { + for (i = 0; i < ARRAY_SIZE(fcc->payloads); i++) { const int reg_scale = (fcc->dispatch_mode == GEN6_PS_DISPATCH_8) ? 1 : 2; diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c index 514e636f327..2a1cad4bf2e 100644 --- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c +++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c @@ -329,7 +329,7 @@ vs_add_sampler_params(struct toy_compiler *tc, int msg_type, int base_mrf, assert(num_coords <= 4); assert(num_derivs <= 3 && num_derivs <= num_coords); - for (i = 0; i < Elements(m); i++) + for (i = 0; i < ARRAY_SIZE(m); i++) m[i] = tdst(TOY_FILE_MRF, base_mrf + i, 0); switch (msg_type) { diff --git a/src/gallium/drivers/ilo/shader/toy_compiler.c b/src/gallium/drivers/ilo/shader/toy_compiler.c index a4c2a2c4e20..99f1ad1505f 100644 --- a/src/gallium/drivers/ilo/shader/toy_compiler.c +++ b/src/gallium/drivers/ilo/shader/toy_compiler.c @@ -449,7 +449,7 @@ tc_dump_inst(struct toy_compiler *tc, const struct toy_inst *inst) tc_dump_dst(tc, inst->dst); - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { if (tsrc_is_null(inst->src[i])) break; @@ -522,10 +522,10 @@ tc_init_inst_templ(struct toy_compiler *tc) templ->marker = false; templ->dst = tdst_null(); - for (i = 0; i < Elements(templ->src); i++) + for (i = 0; i < ARRAY_SIZE(templ->src); i++) templ->src[i] = tsrc_null(); - for (i = 0; i < Elements(templ->tex.offsets); i++) + for (i = 0; i < ARRAY_SIZE(templ->tex.offsets); i++) templ->tex.offsets[i] = tsrc_null(); list_inithead(&templ->list); diff --git a/src/gallium/drivers/ilo/shader/toy_compiler_asm.c b/src/gallium/drivers/ilo/shader/toy_compiler_asm.c index ae1b135e83e..44bc2a79c5a 100644 --- a/src/gallium/drivers/ilo/shader/toy_compiler_asm.c +++ b/src/gallium/drivers/ilo/shader/toy_compiler_asm.c @@ -943,7 +943,7 @@ codegen_validate_region_restrictions(const struct codegen *cg) /* 1. (we don't do 32 anyway) */ assert(exec_size <= 16); - for (i = 0; i < Elements(cg->src); i++) { + for (i = 0; i < ARRAY_SIZE(cg->src); i++) { const int width = width_map[cg->src[i].width]; const int horz_stride = horz_stride_map[cg->src[i].horz_stride]; const int vert_stride = vert_stride_map[cg->src[i].vert_stride]; @@ -1077,7 +1077,7 @@ codegen_prepare(struct codegen *cg, const struct ilo_dev *dev, break; } - for (i = 0; i < Elements(cg->src); i++) { + for (i = 0; i < ARRAY_SIZE(cg->src); i++) { struct codegen_src *src = &cg->src[i]; src->file = translate_vfile(inst->src[i].file); diff --git a/src/gallium/drivers/ilo/shader/toy_legalize.c b/src/gallium/drivers/ilo/shader/toy_legalize.c index 4e573caadf4..d5d67ab8793 100644 --- a/src/gallium/drivers/ilo/shader/toy_legalize.c +++ b/src/gallium/drivers/ilo/shader/toy_legalize.c @@ -80,7 +80,7 @@ toy_compiler_lower_math(struct toy_compiler *tc, struct toy_inst *inst) int i; /* see commit 250770b74d33bb8625c780a74a89477af033d13a */ - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { if (tsrc_is_null(inst->src[i])) break; @@ -179,7 +179,7 @@ validate_imm(struct toy_compiler *tc, struct toy_inst *inst) bool move_inst = false; int i; - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { struct toy_dst tmp; if (tsrc_is_null(inst->src[i])) @@ -201,7 +201,7 @@ validate_imm(struct toy_compiler *tc, struct toy_inst *inst) } /* this is the last operand */ - if (i + 1 == Elements(inst->src) || tsrc_is_null(inst->src[i + 1])) + if (i + 1 == ARRAY_SIZE(inst->src) || tsrc_is_null(inst->src[i + 1])) break; /* need to use a temp if this imm is not the last operand */ @@ -600,7 +600,7 @@ toy_compiler_legalize_for_asm(struct toy_compiler *tc) /* MRF to GRF */ if (ilo_dev_gen(tc->dev) >= ILO_GEN(7)) { - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { if (inst->src[i].file != TOY_FILE_MRF) continue; else if (tsrc_is_null(inst->src[i])) diff --git a/src/gallium/drivers/ilo/shader/toy_legalize_ra.c b/src/gallium/drivers/ilo/shader/toy_legalize_ra.c index 1874faa6be3..04998747670 100644 --- a/src/gallium/drivers/ilo/shader/toy_legalize_ra.c +++ b/src/gallium/drivers/ilo/shader/toy_legalize_ra.c @@ -407,7 +407,7 @@ linear_scan_init_live_intervals(struct linear_scan *ls, } } - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { if (inst->src[i].file != TOY_FILE_VRF) continue; @@ -539,7 +539,7 @@ linear_scan_allocation(struct toy_compiler *tc, inst->dst.val32 = reg * TOY_REG_WIDTH + subreg; } - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { const uint32_t val32 = inst->src[i].val32; int reg, subreg; @@ -589,7 +589,7 @@ trivial_allocation(struct toy_compiler *tc, max_grf = reg; } - for (i = 0; i < Elements(inst->src); i++) { + for (i = 0; i < ARRAY_SIZE(inst->src); i++) { const uint32_t val32 = inst->src[i].val32; int reg, subreg; diff --git a/src/gallium/drivers/ilo/shader/toy_tgsi.c b/src/gallium/drivers/ilo/shader/toy_tgsi.c index 9a7140b9a9b..e5fbb6e592a 100644 --- a/src/gallium/drivers/ilo/shader/toy_tgsi.c +++ b/src/gallium/drivers/ilo/shader/toy_tgsi.c @@ -190,7 +190,7 @@ aos_simple(struct toy_compiler *tc, inst->dst = dst[0]; } - assert(num_src <= Elements(inst->src)); + assert(num_src <= ARRAY_SIZE(inst->src)); for (i = 0; i < num_src; i++) inst->src[i] = src[i]; } @@ -380,7 +380,7 @@ aos_tex(struct toy_compiler *tc, inst->opcode = opcode; inst->tex.target = tgsi_inst->Texture.Texture; - assert(tgsi_inst->Instruction.NumSrcRegs <= Elements(inst->src)); + assert(tgsi_inst->Instruction.NumSrcRegs <= ARRAY_SIZE(inst->src)); assert(tgsi_inst->Instruction.NumDstRegs == 1); inst->dst = dst[0]; @@ -449,7 +449,7 @@ aos_sample(struct toy_compiler *tc, inst = tc_add(tc); inst->opcode = opcode; - assert(tgsi_inst->Instruction.NumSrcRegs <= Elements(inst->src)); + assert(tgsi_inst->Instruction.NumSrcRegs <= ARRAY_SIZE(inst->src)); assert(tgsi_inst->Instruction.NumDstRegs == 1); inst->dst = dst[0]; @@ -2118,7 +2118,7 @@ decl_add_in(struct toy_tgsi *tgsi, const struct tgsi_full_declaration *decl) (decl->Declaration.Interpolate) ? &decl->Interp: &default_interp; int index; - if (decl->Range.Last >= Elements(tgsi->inputs)) { + if (decl->Range.Last >= ARRAY_SIZE(tgsi->inputs)) { assert(!"invalid IN"); return; } @@ -2146,7 +2146,7 @@ decl_add_out(struct toy_tgsi *tgsi, const struct tgsi_full_declaration *decl) { int index; - if (decl->Range.Last >= Elements(tgsi->outputs)) { + if (decl->Range.Last >= ARRAY_SIZE(tgsi->outputs)) { assert(!"invalid OUT"); return; } @@ -2169,7 +2169,7 @@ decl_add_sv(struct toy_tgsi *tgsi, const struct tgsi_full_declaration *decl) { int index; - if (decl->Range.Last >= Elements(tgsi->system_values)) { + if (decl->Range.Last >= ARRAY_SIZE(tgsi->system_values)) { assert(!"invalid SV"); return; } |