[Mesa-dev] [Mesa-stable] [PATCH] mesa: update fbo state in glTexStorage

Tapani Pälli tapani.palli at intel.com
Thu Aug 20 21:23:33 PDT 2015



On 08/21/2015 02:20 AM, Anuj Phogat wrote:
> On Thu, Aug 20, 2015 at 12:52 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
>> We have to re-validate FBOs rendering to the texture like is done
>> with TexImage and CopyTexImage.
>>
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91673
>> Cc: "10.6" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/mesa/main/texstorage.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
>> index db2b63d..51f49b3 100644
>> --- a/src/mesa/main/texstorage.c
>> +++ b/src/mesa/main/texstorage.c
>> @@ -189,6 +189,20 @@ clear_texture_fields(struct gl_context *ctx,
>>   }
>>
>>
>> +/**
>> + * Update/re-validate framebuffer object.
>> + */
>> +static void
>> +update_fbo_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
>> +{
>> +   const unsigned numFaces = _mesa_num_tex_faces(texObj->Target);
>> +   for (int level = 0; level < ARRAY_SIZE(texObj->Image[0]); level++) {
>> +      for (unsigned face = 0; face < numFaces; face++)
>> +         _mesa_update_fbo_texture(ctx, texObj, face, level);
>> +   }
>> +}
>> +
>> +
>>   GLboolean
>>   _mesa_is_legal_tex_storage_format(struct gl_context *ctx, GLenum internalformat)
>>   {
>> @@ -446,6 +460,7 @@ _mesa_texture_storage(struct gl_context *ctx, GLuint dims,
>>
>>         _mesa_set_texture_view_state(ctx, texObj, target, levels);
>>
>> +      update_fbo_texture(ctx, texObj);
>>      }
>>   }
>>
>> --
>> 2.1.0
>>
>> _______________________________________________
>> mesa-stable mailing list
>> mesa-stable at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
>
> LGTM. It'll be nice to have a piglit test for this bug.
> Assuming no piglit regressions with the patch:

Yes, I'll write one based on the test program in the bug.

> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

Thanks!

// Tapani


More information about the mesa-dev mailing list