Re: [PATCH 6/8] wined3d: replace wined3d_surface_preload with wined3d_texture_preload
On 9 September 2015 at 12:23, Riccardo Bortolato <rikyz619(a)gmail.com> wrote:
static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); + struct d3d9_texture *texture = surface->texture;
TRACE("iface %p.\n", iface);
+ /* Standalone surfaces can't be in D3DPOOL_MANAGED */ + if (!texture) + return; + wined3d_mutex_lock(); - wined3d_surface_preload(surface->wined3d_surface); + wined3d_texture_preload(texture->wined3d_texture); wined3d_mutex_unlock(); }
This isn't necessarily wrong, but it may be too complicated. In particular, at some point we'll have to do maps for e.g. off-screen plain surfaces as well, and then you can't avoid getting the wined3d texture from somewhere. That probably means either creating an implicit d3d9 texture for those surfaces, or just storing a pointer to the wined3d texture in the d3d9 surface. So I'd like to see map()/unmap() before preload().
I already have some patches for (un)map which rely on storing the wined3d_texture (and the sub level) in the d3dX_surface, I'll add this to the queue then. Ciao, Riccardo 2015-09-10 13:09 GMT+02:00 Henri Verbeet <hverbeet(a)gmail.com>:
On 9 September 2015 at 12:23, Riccardo Bortolato <rikyz619(a)gmail.com> wrote:
static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); + struct d3d9_texture *texture = surface->texture;
TRACE("iface %p.\n", iface);
+ /* Standalone surfaces can't be in D3DPOOL_MANAGED */ + if (!texture) + return; + wined3d_mutex_lock(); - wined3d_surface_preload(surface->wined3d_surface); + wined3d_texture_preload(texture->wined3d_texture); wined3d_mutex_unlock(); }
This isn't necessarily wrong, but it may be too complicated. In particular, at some point we'll have to do maps for e.g. off-screen plain surfaces as well, and then you can't avoid getting the wined3d texture from somewhere. That probably means either creating an implicit d3d9 texture for those surfaces, or just storing a pointer to the wined3d texture in the d3d9 surface. So I'd like to see map()/unmap() before preload().
participants (2)
-
Henri Verbeet -
Riccardo Bortolato