aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp')
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 0b3477161..bd191d864 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1497,7 +1497,7 @@ void
glsl_to_tgsi_visitor::visit(ir_expression *ir)
{
unsigned int operand;
- st_src_reg op[Elements(ir->operands)];
+ st_src_reg op[ARRAY_SIZE(ir->operands)];
st_src_reg result_src;
st_dst_reg result_dst;
@@ -3515,7 +3515,7 @@ get_src_arg_mask(st_dst_reg dst, st_src_reg src)
*/
for (comp = 0; comp < 4; ++comp) {
const unsigned coord = GET_SWZ(src.swizzle, comp);
- ASSERT(coord < 4);
+ assert(coord < 4);
if (dst.writemask & (1 << comp) && coord <= SWIZZLE_W)
read_mask |= 1 << coord;
}
@@ -4022,7 +4022,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code(void)
/* Continuing the block, clear any channels from the write array that
* are read by this instruction.
*/
- for (unsigned i = 0; i < Elements(inst->src); i++) {
+ for (unsigned i = 0; i < ARRAY_SIZE(inst->src); i++) {
if (inst->src[i].file == PROGRAM_TEMPORARY && inst->src[i].reladdr){
/* Any temporary might be read, so no dead code elimination
* across this instruction.
@@ -4067,7 +4067,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code(void)
* If there is already an instruction in the write array for one or more
* of the channels, flag that channel write as dead.
*/
- for (unsigned i = 0; i < Elements(inst->dst); i++) {
+ for (unsigned i = 0; i < ARRAY_SIZE(inst->dst); i++) {
if (inst->dst[i].file == PROGRAM_TEMPORARY &&
!inst->dst[i].reladdr &&
!inst->saturate) {
@@ -4625,7 +4625,7 @@ dst_register(struct st_translate *t,
case PROGRAM_ARRAY:
array = index >> 16;
- assert(array < Elements(t->arrays));
+ assert(array < ARRAY_SIZE(t->arrays));
if (ureg_dst_is_undef(t->arrays[array]))
t->arrays[array] = ureg_DECL_array_temporary(
@@ -4642,7 +4642,7 @@ dst_register(struct st_translate *t,
else
assert(index < VARYING_SLOT_MAX);
- assert(t->outputMapping[index] < Elements(t->outputs));
+ assert(t->outputMapping[index] < ARRAY_SIZE(t->outputs));
return t->outputs[t->outputMapping[index]];
@@ -4659,7 +4659,7 @@ dst_register(struct st_translate *t,
* Map a glsl_to_tgsi src register to a TGSI ureg_src register.
*/
static struct ureg_src
-src_register(struct st_translate *t, const struct st_src_reg *reg)
+src_register(struct st_translate *t, const st_src_reg *reg)
{
switch(reg->file) {
case PROGRAM_UNDEFINED:
@@ -4685,18 +4685,18 @@ src_register(struct st_translate *t, const struct st_src_reg *reg)
return t->immediates[reg->index];
case PROGRAM_INPUT:
- assert(t->inputMapping[reg->index] < Elements(t->inputs));
+ assert(t->inputMapping[reg->index] < ARRAY_SIZE(t->inputs));
return t->inputs[t->inputMapping[reg->index]];
case PROGRAM_OUTPUT:
- assert(t->outputMapping[reg->index] < Elements(t->outputs));
+ assert(t->outputMapping[reg->index] < ARRAY_SIZE(t->outputs));
return ureg_src(t->outputs[t->outputMapping[reg->index]]); /* not needed? */
case PROGRAM_ADDRESS:
return ureg_src(t->address[reg->index]);
case PROGRAM_SYSTEM_VALUE:
- assert(reg->index < (int) Elements(t->systemValues));
+ assert(reg->index < (int) ARRAY_SIZE(t->systemValues));
return t->systemValues[reg->index];
default:
@@ -4824,7 +4824,7 @@ translate_tex_offset(struct st_translate *t,
array = in_offset->index >> 16;
assert(array >= 0);
- assert(array < (int) Elements(t->arrays));
+ assert(array < (int) ARRAY_SIZE(t->arrays));
dst = t->arrays[array];
offset.File = dst.File;
@@ -5200,8 +5200,8 @@ st_translate_program(
unsigned i;
enum pipe_error ret = PIPE_OK;
- assert(numInputs <= Elements(t->inputs));
- assert(numOutputs <= Elements(t->outputs));
+ assert(numInputs <= ARRAY_SIZE(t->inputs));
+ assert(numOutputs <= ARRAY_SIZE(t->outputs));
assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_FRONT_FACE] ==
TGSI_SEMANTIC_FACE);