use an explicit reserved field, rather than magic number in bound
authorKeith Whitwell <keith@tungstengraphics.com>
Thu, 8 Sep 2005 21:40:10 +0000 (21:40 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Thu, 8 Sep 2005 21:40:10 +0000 (21:40 +0000)
src/mesa/drivers/dri/common/texmem.c
src/mesa/drivers/dri/common/texmem.h

index 5bc27e449362aa412688872c0baf58026b0823f2..3dd807c326509fdbca7a2ad4ac5a11d5edabfd35 100644 (file)
@@ -414,7 +414,7 @@ static void driTexturesGone( driTexHeap * heap, int offset, int size,
       }
       t->heap = heap;
       if (in_use) 
-        t->bound = 0; /* bound to no tex units */
+        t->reserved = 1; 
       insert_at_head( & heap->texture_objects, t );
    }
 }
@@ -572,7 +572,7 @@ driAllocateTexture( driTexHeap * const * heap_array, unsigned nr_heaps,
            /* The the LRU element.  If the texture is bound to one of
             * the texture units, then we cannot kick it out.
             */
-           if ( cursor->bound /* || cursor->reserved */ ) {
+           if ( cursor->bound || cursor->reserved ) {
               continue;
            }
 
index 486cb0dab941b958b1f708d52f015fb67de19d77..5c1fc323843ee6968e243fe2abe0a3be60f9f3d9 100644 (file)
@@ -67,6 +67,9 @@ struct dri_texture_object {
                                         * A placeholder should have a heap and a memBlock.
                                         */
        PMemBlock   memBlock;           /**< Memory block containing texture */
+
+        unsigned    reserved;          /**< Cannot be swapped out by user contexts.  */
+
        unsigned    bound;              /**< Bitmask indicating which tex units
                                         * this texture object is bound to.
                                         * Bit 0 = unit 0, Bit 1 = unit 1, etc