diff options
Diffstat (limited to 'src/gallium/drivers/svga/svga_tgsi_vgpu10.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index a899c47cd7f..8639333707f 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -1022,7 +1022,7 @@ emit_src_register(struct svga_shader_emitter_v10 *emit, } } else if (file == TGSI_FILE_SYSTEM_VALUE) { - assert(index < Elements(emit->system_value_indexes)); + assert(index < ARRAY_SIZE(emit->system_value_indexes)); index = emit->system_value_indexes[index]; } } @@ -1078,7 +1078,7 @@ emit_src_register(struct svga_shader_emitter_v10 *emit, if (operand0.operandType == VGPU10_OPERAND_TYPE_IMMEDIATE32) { /* Emit the four float/int in-line immediate values */ unsigned *c; - assert(index < Elements(emit->immediates)); + assert(index < ARRAY_SIZE(emit->immediates)); assert(file == TGSI_FILE_IMMEDIATE); assert(swizzleX < 4); assert(swizzleY < 4); @@ -1735,7 +1735,7 @@ alloc_immediate_4(struct svga_shader_emitter_v10 *emit, { unsigned n = emit->num_immediates++; assert(!emit->immediates_emitted); - assert(n < Elements(emit->immediates)); + assert(n < ARRAY_SIZE(emit->immediates)); emit->immediates[n][0] = imm[0]; emit->immediates[n][1] = imm[1]; emit->immediates[n][2] = imm[2]; @@ -1785,7 +1785,7 @@ static unsigned alloc_system_value_index(struct svga_shader_emitter_v10 *emit, unsigned index) { const unsigned n = emit->info.file_max[TGSI_FILE_INPUT] + 1 + index; - assert(index < Elements(emit->system_value_indexes)); + assert(index < ARRAY_SIZE(emit->system_value_indexes)); emit->system_value_indexes[index] = n; return n; } @@ -1922,14 +1922,14 @@ emit_vgpu10_property(struct svga_shader_emitter_v10 *emit, switch (prop->Property.PropertyName) { case TGSI_PROPERTY_GS_INPUT_PRIM: - assert(prop->u[0].Data < Elements(primType)); + assert(prop->u[0].Data < ARRAY_SIZE(primType)); emit->gs.prim_type = primType[prop->u[0].Data]; assert(emit->gs.prim_type != VGPU10_PRIMITIVE_UNDEFINED); emit->gs.input_size = inputArraySize[emit->gs.prim_type]; break; case TGSI_PROPERTY_GS_OUTPUT_PRIM: - assert(prop->u[0].Data < Elements(primTopology)); + assert(prop->u[0].Data < ARRAY_SIZE(primTopology)); emit->gs.prim_topology = primTopology[prop->u[0].Data]; assert(emit->gs.prim_topology != VGPU10_PRIMITIVE_TOPOLOGY_UNDEFINED); break; @@ -2269,7 +2269,7 @@ emit_vgpu10_declaration(struct svga_shader_emitter_v10 *emit, * have linked due to constbuf index out of bounds, so we shouldn't * have reached here. */ - assert(constbuf < Elements(emit->num_shader_consts)); + assert(constbuf < ARRAY_SIZE(emit->num_shader_consts)); num_consts = MAX2(emit->num_shader_consts[constbuf], decl->Range.Last + 1); @@ -2490,7 +2490,7 @@ emit_output_declarations(struct svga_shader_emitter_v10 *emit) if (emit->unit == PIPE_SHADER_FRAGMENT) { if (semantic_name == TGSI_SEMANTIC_COLOR) { - assert(semantic_index < Elements(emit->fs.color_out_index)); + assert(semantic_index < ARRAY_SIZE(emit->fs.color_out_index)); emit->fs.color_out_index[semantic_index] = index; @@ -2875,7 +2875,7 @@ emit_constant_declaration(struct svga_shader_emitter_v10 *emit) } /* Declare remaining constant buffers (UBOs) */ - for (i = 1; i < Elements(emit->num_shader_consts); i++) { + for (i = 1; i < ARRAY_SIZE(emit->num_shader_consts); i++) { if (emit->num_shader_consts[i] > 0) { begin_emit_instruction(emit); emit_dword(emit, opcode0.value); @@ -6295,7 +6295,7 @@ alloc_common_immediates(struct svga_shader_emitter_v10 *emit) alloc_immediate_int4(emit, 22, 30, 0, 0); } - assert(n <= Elements(emit->common_immediate_pos)); + assert(n <= ARRAY_SIZE(emit->common_immediate_pos)); emit->num_common_immediates = n; } |