tc = CALLOC_STRUCT( softpipe_tex_tile_cache );
if (tc) {
tc->pipe = pipe;
- for (pos = 0; pos < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(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 < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(tc->entries); pos++) {
/*assert(tc->entries[pos].x < 0);*/
}
if (tc->transfer) {
assert(tc);
assert(tc->texture);
- for (i = 0; i < NUM_ENTRIES; i++) {
+ for (i = 0; i < Elements(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 < NUM_ENTRIES; i++) {
+ for (i = 0; i < Elements(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 < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(tc->entries); pos++) {
tc->entries[pos].addr.bits.invalid = 1;
}
tc->tex_face = -1;
addr.bits.face +
addr.bits.level * 7);
- return entry % NUM_ENTRIES;
+ return entry % NUM_TEX_TILE_ENTRIES;
}
/**
} data;
};
-#define NUM_ENTRIES 4
+#define NUM_TEX_TILE_ENTRIES 4
struct softpipe_tex_tile_cache
{
struct pipe_resource *texture; /**< if caching a texture */
unsigned timestamp;
- struct softpipe_tex_cached_tile entries[NUM_ENTRIES];
+ struct softpipe_tex_cached_tile entries[NUM_TEX_TILE_ENTRIES];
struct pipe_transfer *tex_trans;
void *tex_trans_map;
tc = CALLOC_STRUCT( softpipe_tile_cache );
if (tc) {
tc->pipe = pipe;
- for (pos = 0; pos < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(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 < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(tc->entries); pos++) {
/*assert(tc->entries[pos].x < 0);*/
FREE( tc->entries[pos] );
}
if (pt) {
/* caching a drawing transfer */
- for (pos = 0; pos < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(tc->entries); pos++) {
struct softpipe_cached_tile *tile = tc->entries[pos];
if (!tile)
{
if (!tc->tile)
{
unsigned pos;
- for (pos = 0; pos < NUM_ENTRIES; ++pos) {
+ for (pos = 0; pos < Elements(tc->entries); ++pos) {
if (!tc->entries[pos])
continue;
/* set flags to indicate all the tiles are cleared */
memset(tc->clear_flags, 255, sizeof(tc->clear_flags));
- for (pos = 0; pos < NUM_ENTRIES; pos++) {
+ for (pos = 0; pos < Elements(tc->tile_addrs); pos++) {
tc->tile_addrs[pos].bits.invalid = 1;
}
tc->last_tile_addr.bits.invalid = 1;