[PATCH 1/4] wined3d: Allow specifying a different depth stencil location.

Henri Verbeet hverbeet at gmail.com
Thu Apr 30 04:09:03 CDT 2015


On 30 April 2015 at 00:00, Stefan Dösinger <stefan at codeweavers.com> wrote:
> @@ -2342,12 +2352,14 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
>                      ++i;
>                  }
>                  context_apply_fbo_state(context, GL_FRAMEBUFFER, context->blit_targets,
> -                        wined3d_rendertarget_view_get_surface(fb->depth_stencil),
> -                        rt_count ? rts[0]->resource->draw_binding : WINED3D_LOCATION_TEXTURE_RGB);
> +                        wined3d_rendertarget_view_get_surface(dsv),
> +                        rt_count ? rts[0]->resource->draw_binding : WINED3D_LOCATION_TEXTURE_RGB,
> +                        dsv ? dsv->resource->draw_binding : WINED3D_LOCATION_TEXTURE_RGB);
>              }
This works because we mostly just care that the color location isn't
WINED3D_LOCATION_DRAWABLE if there's no attachment. (In particular for
the case where the application is doing depth only rendering.)
Strictly speaking though, it's probably more correct to use the color
location if there's no depth/stencil attachment, to avoid silliness
like the color attachment being in WINED3D_LOCATION_DRAWABLE and the
depth/stencil attachment in WINED3D_LOCATION_TEXTURE_RGB. In fact, now
that the color and depth/stencil locations are separate, you can
probably just pass 0.



More information about the wine-devel mailing list