[Mesa-dev] [PATCH 2/2] st/mesa: release GLSL IR in LinkShader after it's not needed

Marek Olšák maraeo at gmail.com
Fri Feb 5 20:49:14 UTC 2016


On Fri, Feb 5, 2016 at 8:46 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/30/2016 06:48 AM, Marek Olšák wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> index d98627f..8a194c0 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> @@ -5692,6 +5692,10 @@ get_mesa_program(struct gl_context *ctx,
>>                               prog->OutputsWritten, 0ULL, prog->PatchOutputsWritten);
>>     count_resources(v, prog);
>>
>> +   /* The GLSL IR won't be needed anymore. */
>> +   ralloc_free(shader->ir);
>> +   shader->ir = NULL;
>> +
>>     /* This must be done before the uniform storage is associated. */
>>     if (shader->Type == GL_FRAGMENT_SHADER &&
>>         (prog->InputsRead & VARYING_BIT_POS ||
>>
>
> After the call to get_mesa_program is a call to
> st_dump_program_for_shader_db.  Will that try to use the IR?

No, that only dumps the source code string.

Marek


More information about the mesa-dev mailing list