sp_destroy_tile_cache(softpipe->zsbuf_cache);
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
- for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
+ for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) {
sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]);
pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL);
}
}
- for (sh = 0; sh < Elements(softpipe->constants); sh++) {
- for (i = 0; i < Elements(softpipe->constants[0]); i++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->constants); sh++) {
+ for (i = 0; i < ARRAY_SIZE(softpipe->constants[0]); i++) {
if (softpipe->constants[sh][i]) {
pipe_resource_reference(&softpipe->constants[sh][i], NULL);
}
}
/* check if any of the tex_cache textures are this texture */
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
- for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
+ for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) {
if (softpipe->tex_cache[sh][i] &&
softpipe->tex_cache[sh][i]->texture == texture)
return SP_REFERENCED_FOR_READ;
softpipe->zsbuf_cache = sp_create_tile_cache( &softpipe->pipe );
/* Allocate texture caches */
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
- for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
+ for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) {
softpipe->tex_cache[sh][i] = sp_create_tex_tile_cache(&softpipe->pipe);
if (!softpipe->tex_cache[sh][i])
goto fail;
if (flags & SP_FLUSH_TEXTURE_CACHE) {
unsigned sh;
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < softpipe->num_sampler_views[sh]; i++) {
sp_flush_tex_tile_cache(softpipe->tex_cache[sh][i]);
}
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i, sh;
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < softpipe->num_sampler_views[sh]; i++) {
sp_flush_tex_tile_cache(softpipe->tex_cache[sh][i]);
}
}
/* XXX is this really necessary here??? */
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[sh][i];
if (tc && tc->texture) {
struct softpipe_context *softpipe = softpipe_context(pipe);
unsigned i;
assert(shader < PIPE_SHADER_TYPES);
- assert(start + num <= Elements(softpipe->sampler_views[shader]));
+ assert(start + num <= ARRAY_SIZE(softpipe->sampler_views[shader]));
/* set the new images */
for (i = 0; i < num; i++) {
struct softpipe_context *softpipe = softpipe_context(pipe);
unsigned i;
assert(shader < PIPE_SHADER_TYPES);
- assert(start + num <= Elements(softpipe->buffers[shader]));
+ assert(start + num <= ARRAY_SIZE(softpipe->buffers[shader]));
/* set the new images */
for (i = 0; i < num; i++) {
unsigned i;
assert(shader < PIPE_SHADER_TYPES);
- assert(start + num <= Elements(softpipe->samplers[shader]));
+ assert(start + num <= ARRAY_SIZE(softpipe->samplers[shader]));
draw_flush(softpipe->draw);
uint i;
assert(shader < PIPE_SHADER_TYPES);
- assert(start + num <= Elements(softpipe->sampler_views[shader]));
+ assert(start + num <= ARRAY_SIZE(softpipe->sampler_views[shader]));
draw_flush(softpipe->draw);
softpipe_cleanup_vertex_sampling(struct softpipe_context *ctx)
{
unsigned i;
- for (i = 0; i < Elements(ctx->mapped_vs_tex); i++) {
+ for (i = 0; i < ARRAY_SIZE(ctx->mapped_vs_tex); i++) {
pipe_resource_reference(&ctx->mapped_vs_tex[i], NULL);
}
}
softpipe_cleanup_geometry_sampling(struct softpipe_context *ctx)
{
unsigned i;
- for (i = 0; i < Elements(ctx->mapped_gs_tex); i++) {
+ for (i = 0; i < ARRAY_SIZE(ctx->mapped_gs_tex); i++) {
pipe_resource_reference(&ctx->mapped_gs_tex[i], NULL);
}
}
tc = CALLOC_STRUCT( softpipe_tex_tile_cache );
if (tc) {
tc->pipe = pipe;
- for (pos = 0; pos < Elements(tc->entries); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) {
tc->entries[pos].addr.bits.invalid = 1;
}
tc->last_tile = &tc->entries[0]; /* any tile */
if (tc) {
uint pos;
- for (pos = 0; pos < Elements(tc->entries); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) {
/*assert(tc->entries[pos].x < 0);*/
}
if (tc->transfer) {
assert(tc);
assert(tc->texture);
- for (i = 0; i < Elements(tc->entries); i++) {
+ for (i = 0; i < ARRAY_SIZE(tc->entries); i++) {
tc->entries[i].addr.bits.invalid = 1;
}
}
/* mark as entries as invalid/empty */
/* XXX we should try to avoid this when the teximage hasn't changed */
- for (i = 0; i < Elements(tc->entries); i++) {
+ for (i = 0; i < ARRAY_SIZE(tc->entries); i++) {
tc->entries[i].addr.bits.invalid = 1;
}
if (tc->texture) {
/* caching a texture, mark all entries as empty */
- for (pos = 0; pos < Elements(tc->entries); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) {
tc->entries[pos].addr.bits.invalid = 1;
}
tc->tex_z = -1;
tc = CALLOC_STRUCT( softpipe_tile_cache );
if (tc) {
tc->pipe = pipe;
- for (pos = 0; pos < Elements(tc->tile_addrs); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->tile_addrs); pos++) {
tc->tile_addrs[pos].bits.invalid = 1;
}
tc->last_tile_addr.bits.invalid = 1;
if (tc) {
uint pos;
- for (pos = 0; pos < Elements(tc->entries); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) {
/*assert(tc->entries[pos].x < 0);*/
FREE( tc->entries[pos] );
}
int i;
if (tc->num_maps) {
/* caching a drawing transfer */
- for (pos = 0; pos < Elements(tc->entries); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); pos++) {
struct softpipe_cached_tile *tile = tc->entries[pos];
if (!tile)
{
if (!tc->tile)
{
unsigned pos;
- for (pos = 0; pos < Elements(tc->entries); ++pos) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->entries); ++pos) {
if (!tc->entries[pos])
continue;
/* set flags to indicate all the tiles are cleared */
memset(tc->clear_flags, 255, tc->clear_flags_size);
- for (pos = 0; pos < Elements(tc->tile_addrs); pos++) {
+ for (pos = 0; pos < ARRAY_SIZE(tc->tile_addrs); pos++) {
tc->tile_addrs[pos].bits.invalid = 1;
}
tc->last_tile_addr.bits.invalid = 1;