[Mesa-dev] [PATCH] meta: Generate and compile shaders everytime in setup_glsl_generate_mipmap()

Anuj Phogat anuj.phogat at gmail.com
Wed Sep 19 12:48:25 PDT 2012


On Wed, Sep 19, 2012 at 11:28 AM, Brian Paul <brianp at vmware.com> wrote:
> On 09/19/2012 12:00 PM, Anuj Phogat wrote:
>>
>> On Wed, Sep 19, 2012 at 2:13 AM, Eric Anholt<eric at anholt.net>  wrote:
>>>
>>>
>>> Anuj Phogat<anuj.phogat at gmail.com>  writes:
>>>
>>>> Fixes float-texture(mipmap.manual):
>>>> See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296
>>>
>>>
>>> Can you explain why this is necessary?
>>
>>
>> _mesa_meta_GenerateMipmap()->setup_glsl_generate_mipmap()
>>   generates fragment shader programs based on the texture target
>>   used in glGenerateMipmap(target). target can be GL_TEXTURE_{1, 2, 3}D,
>>   GL_TEXTURE_{1, 2}D_ARRAY, or GL_TEXTURE_CUBE_MAP. An
>> application is free to call glGenerateMipmap() multiple times with
>> different
>> texture targets. This makes it necessary to generate and compile shader
>> programs on every call to glGenerateMipmap().
>
>
> Wouldn't it be better to compile per-target shaders on demand and save them
> for the next call?  Some apps might auto-generate quite a few mipmapped
> textures.
>
> -Brian
Yeah, this sounds better. I'll define few per target shader program variables to
save the compiled programs.


More information about the mesa-dev mailing list