[PATCH 4/5] wined3d: Mask out writes to unused render targets.
Stefan Dösinger
stefandoesinger at gmx.at
Tue May 24 15:15:32 CDT 2011
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110524/a94971ba/attachment.pgp>
More information about the wine-devel
mailing list