if (fs->program) {
memcpy(fs->program, passthrough_program, sizeof(passthrough_program));
memcpy(fs->decl, passthrough_decl, sizeof(passthrough_decl));
- fs->program_len = Elements(passthrough_program);
- fs->decl_len = Elements(passthrough_decl);
+ fs->program_len = ARRAY_SIZE(passthrough_program);
+ fs->decl_len = ARRAY_SIZE(passthrough_decl);
}
fs->num_constants = 0;
}
i915_texture_set_level_info(struct i915_texture *tex,
unsigned level, unsigned nr_images)
{
- assert(level < Elements(tex->nr_images));
+ assert(level < ARRAY_SIZE(tex->nr_images));
assert(nr_images);
assert(!tex->image_offset[level]);
if (tex->buffer)
iws->buffer_destroy(iws, tex->buffer);
- for (i = 0; i < Elements(tex->image_offset); i++)
+ for (i = 0; i < ARRAY_SIZE(tex->image_offset); i++)
FREE(tex->image_offset[i]);
FREE(tex);
struct i915_context *i915 = i915_context(pipe);
unsigned i;
- assert(start + num <= Elements(i915->vertex_samplers));
+ assert(start + num <= ARRAY_SIZE(i915->vertex_samplers));
/* Check for no-op */
if (num == i915->num_vertex_samplers &&
{
struct i915_winsys *iws = i915->iws;
unsigned i;
- for (i = 0; i < Elements(i915->mapped_vs_tex); i++) {
+ for (i = 0; i < ARRAY_SIZE(i915->mapped_vs_tex); i++) {
if (i915->mapped_vs_tex_buffer[i]) {
iws->buffer_unmap(iws, i915->mapped_vs_tex_buffer[i]);
pipe_resource_reference(&i915->mapped_vs_tex[i], NULL);
struct i915_context *i915 = i915_context(pipe);
uint i;
- assert(num <= Elements(i915->vertex_sampler_views));
+ assert(num <= ARRAY_SIZE(i915->vertex_sampler_views));
/* Check for no-op */
if (num == i915->num_vertex_sampler_views &&
return;
}
- for (i = 0; i < Elements(i915->vertex_sampler_views); i++) {
+ for (i = 0; i < ARRAY_SIZE(i915->vertex_sampler_views); i++) {
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view);
{
int i;
- for (i = 0; i < Elements(atoms); i++)
+ for (i = 0; i < ARRAY_SIZE(atoms); i++)
if (i915->dirty & atoms[i]->dirty)
atoms[i]->update(i915);
}
emit_invariant(struct i915_context *i915)
{
i915_winsys_batchbuffer_write(i915->batch, invariant_state,
- Elements(invariant_state)*sizeof(uint32_t));
+ ARRAY_SIZE(invariant_state)*sizeof(uint32_t));
}
static void
i915->num_validation_buffers = 0;
if (i915->hardware_dirty & I915_HW_INVARIANT)
- *batch_space = Elements(invariant_state);
+ *batch_space = ARRAY_SIZE(invariant_state);
else
*batch_space = 0;
{
int i;
- for (i = 0; i < Elements(atoms); i++)
+ for (i = 0; i < ARRAY_SIZE(atoms); i++)
if (i915->dirty & atoms[i]->dirty)
atoms[i]->update(i915);
}