On Tuesday 24 May 2011 21:18:53 Henri Verbeet wrote:

> @@ -1999,19 +1999,22 @@ static void context_apply_draw_buffers(struct
> wined3d_context *context, UINT rt_ if
> (wined3d_settings.offscreen_rendering_mode == ORM_FBO) {
>              const struct wined3d_gl_info *gl_info = context->gl_info;
> -            unsigned int i;
> +            unsigned int i = 0;
> 
> -            for (i = 0; i < rt_count; ++i)
> +            while (rt_mask)
>              {
>                  if (rts[i] && rts[i]->resource.format->id !=
> WINED3DFMT_NULL) context->draw_buffers[i] = GL_COLOR_ATTACHMENT0 + i;
>                  else
>                      context->draw_buffers[i] = GL_NONE;
> +
> +                rt_mask >>= 1;
> +                ++i;
>              }
Shouldn't you also check if the lowest bit of rt_mask? Otherwise you'll miss 
situations where oC0 is written, oC1 isn't and oC2 is written.

context->draw_buffer_dirty also has to be dirtified somewhere when the pixel 
shader is changed, their rt masks are different and a target is bound to one of 
the changed indices.

Attachment: signature.asc
Description: This is a digitally signed message part.



Reply via email to