Commit 9ffacc43 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Load all layers for render target views.

For layered rendering to array textures. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 95a936d8
...@@ -507,7 +507,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s ...@@ -507,7 +507,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
rt = wined3d_texture_from_resource(rtv->resource); rt = wined3d_texture_from_resource(rtv->resource);
if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
{ {
wined3d_texture_load_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding); wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
wined3d_texture_invalidate_location(rt, rtv->sub_resource_idx, ~rtv->resource->draw_binding); wined3d_texture_invalidate_location(rt, rtv->sub_resource_idx, ~rtv->resource->draw_binding);
} }
else else
...@@ -527,7 +527,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s ...@@ -527,7 +527,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(dsv); struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(dsv);
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE]) if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
wined3d_texture_load_location(ds->container, dsv->sub_resource_idx, context, location); wined3d_rendertarget_view_load_location(dsv, context, location);
else else
wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location); wined3d_texture_prepare_location(ds->container, dsv->sub_resource_idx, context, location);
} }
......
...@@ -398,6 +398,25 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg ...@@ -398,6 +398,25 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg
} }
} }
void wined3d_rendertarget_view_load_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)
{
wined3d_buffer_load_location(buffer_from_resource(resource), context, location);
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_load_location(texture, sub_resource_idx, context, location);
}
static void wined3d_render_target_view_cs_init(void *object) static void wined3d_render_target_view_cs_init(void *object)
{ {
struct wined3d_rendertarget_view *view = object; struct wined3d_rendertarget_view *view = object;
......
...@@ -3458,6 +3458,8 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( ...@@ -3458,6 +3458,8 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface(
void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view,
const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; 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;
struct wined3d_shader_resource_view struct wined3d_shader_resource_view
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment