[Mesa-dev] [PATCH 3/3] st/mesa: don't allocate bitmap drawing state until needed
Brian Paul
brianp at vmware.com
Mon Feb 8 17:42:22 UTC 2016
On 02/08/2016 10:10 AM, Gustaw Smolarczyk wrote:
> 2016-02-08 18:07 GMT+01:00 Brian Paul <brianp at vmware.com>:
>> Most apps don't use glBitmap so don't allocate the bitmap cache or
>> gallium state objects/shaders/etc until the first call to st_Bitmap().
>> ---
>> src/mesa/state_tracker/st_cb_bitmap.c | 145 ++++++++++++++++++----------------
>> src/mesa/state_tracker/st_cb_bitmap.h | 3 -
>> src/mesa/state_tracker/st_context.c | 1 -
>> 3 files changed, 77 insertions(+), 72 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
>> index c26ee7f..ca1dfab 100644
>> --- a/src/mesa/state_tracker/st_cb_bitmap.c
>> +++ b/src/mesa/state_tracker/st_cb_bitmap.c
>> @@ -497,8 +497,9 @@ create_cache_trans(struct st_context *st)
>> void
>> st_flush_bitmap_cache(struct st_context *st)
>> {
>> - if (!st->bitmap.cache->empty) {
>> - struct bitmap_cache *cache = st->bitmap.cache;
>> + struct bitmap_cache *cache = st->bitmap.cache;
>> +
>> + if (cache && !st->bitmap.cache->empty) {
> Maybe do the following:
>
> if (cache && !cache->empty) {
>
Yes. Thanks.
-Brian
More information about the mesa-dev
mailing list