[Mesa-dev] [PATCH 12/13] mesa: rework texture completeness testing

Brian Paul brianp at vmware.com
Tue Mar 20 06:41:17 PDT 2012


On 03/20/2012 01:05 AM, Eric Anholt wrote:
> On Sun, 18 Mar 2012 10:49:28 -0600, Brian Paul<brianp at vmware.com>  wrote:
>> -    * Do mipmap consistency checking
>> +    * Do mipmap consistency checking.
>> +    * Note: we don't care about the current texture sampler state here.
>> +    * To determine texture completeness we'll either look at _BaseComplete
>> +    * or _MipmapComplete depending on the current minification filter mode.
>>       */
>> -   if (t->Sampler.MinFilter != GL_NEAREST&&  t->Sampler.MinFilter != GL_LINEAR) {
>> -      /*
>> -       * Mipmapping: determine if we have a complete set of mipmaps
>> -       */
>> +   {
>>         GLint i;
>>         const GLint minLevel = baseLevel;
>>         const GLint maxLevel = t->_MaxLevel;
>>         GLuint width, height, depth, face, numFaces = 1;
>>
>>         if (minLevel>  maxLevel) {
>> -         incomplete(t, "minLevel>  maxLevel");
>> +         incomplete(t, 0, "minLevel>  maxLevel");
>>            return;
>>         }
>
> s/0/BASE/ here?

Yes.


>> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
>> index ea59ccf..f9c190a 100644
>> --- a/src/mesa/state_tracker/st_cb_texture.c
>> +++ b/src/mesa/state_tracker/st_cb_texture.c
>> @@ -1243,7 +1243,7 @@ st_finalize_texture(struct gl_context *ctx,
>>      enum pipe_format firstImageFormat;
>>      GLuint ptWidth, ptHeight, ptDepth, ptLayers;
>>
>> -   if (stObj->base._Complete) {
>> +   if (_mesa_is_texture_complete(tObj,&tObj->Sampler)) {
>>         /* The texture is complete and we know exactly how many mipmap levels
>>          * are present/needed.  This is conditional because we may be called
>>          * from the st_generate_mipmap() function when the texture object is
>
> Shouldn't this have conditionally used the sampler object from the unit,
> like the other blocks?

It should.  But this wasn't done properly before either.  If you look 
a few more lines below, we're using the texture object's min/mag 
filter state instead of the sampler object.  I've got a WIP patch 
that'll fix that and a few sampler object issues in the state tracker. 
  I'll post that after I finish testing it.


> Also, I think the change to the intel driver for _Complete replacement was missed.

Thanks for catching that.  I'll take a look.

-Brian


More information about the mesa-dev mailing list