wined3d: Prepare all layers for render target views.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9ffacc434e
commit
481999ce44
|
@ -512,7 +512,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
|||
}
|
||||
else
|
||||
{
|
||||
wined3d_texture_prepare_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
|
||||
wined3d_rendertarget_view_prepare_location(rtv, context, rtv->resource->draw_binding);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -524,12 +524,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
|||
* depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
|
||||
* that we never copy the stencil data.*/
|
||||
DWORD location = context->render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
|
||||
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(dsv);
|
||||
|
||||
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
|
||||
wined3d_rendertarget_view_load_location(dsv, context, location);
|
||||
else
|
||||
wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location);
|
||||
wined3d_rendertarget_view_prepare_location(dsv, context, location);
|
||||
}
|
||||
|
||||
if (!context_apply_draw_state(context, device, state))
|
||||
|
|
|
@ -398,6 +398,25 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg
|
|||
}
|
||||
}
|
||||
|
||||
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
struct wined3d_resource *resource = view->resource;
|
||||
unsigned int i, sub_resource_idx;
|
||||
struct wined3d_texture *texture;
|
||||
|
||||
if (resource->type == WINED3D_RTYPE_BUFFER)
|
||||
{
|
||||
FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
|
||||
return;
|
||||
}
|
||||
|
||||
texture = texture_from_resource(resource);
|
||||
sub_resource_idx = view->sub_resource_idx;
|
||||
for (i = 0; i < view->layer_count; ++i, sub_resource_idx += texture->level_count)
|
||||
wined3d_texture_prepare_location(texture, sub_resource_idx, context, location);
|
||||
}
|
||||
|
||||
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_context *context, DWORD location)
|
||||
{
|
||||
|
|
|
@ -3460,6 +3460,8 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg
|
|||
const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
|
||||
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view,
|
||||
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
|
||||
|
||||
struct wined3d_shader_resource_view
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue