[Mesa-dev] [Mesa-stable] [PATCH] meta: Always bind the texture

Ian Romanick idr at freedesktop.org
Thu Sep 10 11:28:17 PDT 2015


On 09/10/2015 11:12 AM, Neil Roberts wrote:
> Make sense.
> 
> Is this the only use of the currentTexUnitSave variable? Could be good
> to remove it if so.

It is.  Good catch.  I'll remove that before pushing.  Thanks.

> Reviewed-by: Neil Roberts <neil at linux.intel.com>
> 
> - Neil
> 
> Ian Romanick <idr at freedesktop.org> writes:
> 
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> We may have been called from glGenerateTextureMipmap with CurrentUnit
>> still set to 0, so we don't know when we can skip binding the texture.
>> Assume that _mesa_BindTexture will be fast if we're rebinding the same
>> texture.
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91847
>> Cc: "11.0" <mesa-stable at lists.freedesktop.org>
>> ---
>> This patch seems to resolve the problems seen in the apitrace attached
>> to the bug.  I'm working on a piglit test.
>>
>>  src/mesa/drivers/common/meta_generate_mipmap.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c
>> index 0655f05..6731478 100644
>> --- a/src/mesa/drivers/common/meta_generate_mipmap.c
>> +++ b/src/mesa/drivers/common/meta_generate_mipmap.c
>> @@ -202,8 +202,12 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
>>     samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?
>>        ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;
>>  
>> -   if (currentTexUnitSave != 0)
>> -      _mesa_BindTexture(target, texObj->Name);
>> +   /* We may have been called from glGenerateTextureMipmap with CurrentUnit
>> +    * still set to 0, so we don't know when we can skip binding the texture.
>> +    * Assume that _mesa_BindTexture will be fast if we're rebinding the same
>> +    * texture.
>> +    */
>> +   _mesa_BindTexture(target, texObj->Name);
>>  
>>     if (!mipmap->Sampler) {
>>        _mesa_GenSamplers(1, &mipmap->Sampler);
>> -- 
>> 2.1.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
> 



More information about the mesa-dev mailing list