[Mesa-dev] [Mesa-stable] [PATCH 2/2] meta: Write color values in to 'out' variables for all the draw buffers

Anuj Phogat anuj.phogat at gmail.com
Mon May 19 15:22:36 PDT 2014


On Mon, May 19, 2014 at 3:12 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> On Tue, May 20, 2014 at 8:20 AM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>> @@ -247,7 +247,8 @@ _mesa_meta_setup_blit_shader(struct gl_context *ctx,
>>     struct blit_shader *shader = choose_blit_shader(target, table);
>>     const char *vs_input, *vs_output, *fs_input, *fs_output;
>>     const char *vs_preprocess = "", *fs_preprocess = "";
>> -   const char *fs_output_decl = "";
>> +   const char *fs_output_decl = "", *for_loop = "";
>> +   const int draw_buf_count = ctx->DrawBuffer->_NumColorDrawBuffers;
>
> You can't depend on the number of bound draw buffers here. These
> shaders get generated on first use, and cached for the life of the
> context.
Nice catch. I'll add a condition to recompile the shader if number of
draw buffers change.


More information about the mesa-dev mailing list