[PATCH 06/10] d3d9: use wined3d_rendertarget_view_create instead of wined3d_rendertarget_view_create_from_surface in d3d9_surface_get_rendertarget_view

Riccardo Bortolato rikyz619 at gmail.com
Tue Oct 20 14:13:54 CDT 2015

Well if instead of

+    resource = wined3d_texture_get_resource(surface->wined3d_texture);

I call wined3d_texture_get_sub_resource() then once control goes back
to wined3d we can know texture_level and texture_layer for that
particular surface (casting the surface from the subresource e.g. in

The sub_resource_idx "hack" would still be in place (maybe we can
mitigate it with some inline comment) but the potential issue you
pointed out could be easily solved then?


2015-10-20 19:26 GMT+02:00 Henri Verbeet <hverbeet at gmail.com>:
> On 20 October 2015 at 18:05, Riccardo Bortolato <rikyz619 at gmail.com> wrote:
>> But d3d9_surface->sub_resource_idx is layer * container->level_count +
>> level so view->sub_resource_idx would still be ok,
> That's what I said. :)
> But at some point we'll need to create actual OpenGL texture views,
> and then we'll need to correct level and layer indices instead of just
> the sub-resource index. (See also
> https://www.opengl.org/registry/specs/ARB/texture_view.txt for
> reference.)

More information about the wine-devel mailing list