summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:40:05 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:40:05 +0000
commit21ab4c9f31674b113c24177398ed39f29b7cd8e6 (patch)
tree8be392d7a792d9663c2586396be77bfd506f5164 /lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c
parenta8f0a7916e26e550dd2a26e7188835c481978004 (diff)
Import Mesa 13.0.2
Diffstat (limited to 'lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c')
-rw-r--r--lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c b/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c
index 9cc8ac125..351736ee4 100644
--- a/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/lib/mesa/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -92,21 +92,22 @@ sp_create_tile_cache( struct pipe_context *pipe )
{
struct softpipe_tile_cache *tc;
uint pos;
- int maxLevels, maxTexSize;
+ MAYBE_UNUSED int maxTexSize;
+ int maxLevels;
/* sanity checking: max sure MAX_WIDTH/HEIGHT >= largest texture image */
maxLevels = pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
maxTexSize = 1 << (maxLevels - 1);
assert(MAX_WIDTH >= maxTexSize);
- assert(sizeof(union tile_address) == 4);
+ STATIC_ASSERT(sizeof(union tile_address) == 4);
- assert((TILE_SIZE << TILE_ADDR_BITS) >= MAX_WIDTH);
+ STATIC_ASSERT((TILE_SIZE << TILE_ADDR_BITS) >= MAX_WIDTH);
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;
@@ -141,7 +142,7 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
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] );
}
@@ -447,7 +448,7 @@ sp_flush_tile_cache(struct softpipe_tile_cache *tc)
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)
{
@@ -484,7 +485,7 @@ sp_alloc_tile(struct softpipe_tile_cache *tc)
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;
@@ -644,7 +645,7 @@ sp_tile_cache_clear(struct softpipe_tile_cache *tc,
/* 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;