Commit 16a20955 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dxgi: Use texture pointer instead of resource pointer for DXGI surface.

parent b12ab05f
......@@ -499,8 +499,8 @@ static HRESULT d3d_texture2d_init(struct d3d_texture2d *texture, struct d3d_devi
return E_FAIL;
}
hr = IWineDXGIDevice_create_surface(wine_device, wined3d_texture_get_resource(texture->wined3d_texture),
0, NULL, (IUnknown *)&texture->ID3D10Texture2D_iface, (void **)&texture->dxgi_surface);
hr = IWineDXGIDevice_create_surface(wine_device, texture->wined3d_texture, 0, NULL,
(IUnknown *)&texture->ID3D10Texture2D_iface, (void **)&texture->dxgi_surface);
IWineDXGIDevice_Release(wine_device);
if (FAILED(hr))
{
......
......@@ -279,14 +279,14 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetMaximumFrameLatency(IWineDXGIDev
/* IWineDXGIDevice methods */
static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *iface,
struct wined3d_resource *wined3d_resource, DXGI_USAGE usage,
struct wined3d_texture *wined3d_texture, DXGI_USAGE usage,
const DXGI_SHARED_RESOURCE *shared_resource, IUnknown *outer, void **surface)
{
struct dxgi_surface *object;
HRESULT hr;
TRACE("iface %p, wined3d_resource %p, usage %#x, shared_resource %p, outer %p, surface %p.\n",
iface, wined3d_resource, usage, shared_resource, outer, surface);
TRACE("iface %p, wined3d_texture %p, usage %#x, shared_resource %p, outer %p, surface %p.\n",
iface, wined3d_texture, usage, shared_resource, outer, surface);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
{
......@@ -294,7 +294,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
return E_OUTOFMEMORY;
}
if (FAILED(hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer, wined3d_resource)))
if (FAILED(hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer, wined3d_texture)))
{
WARN("Failed to initialize surface, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
......
......@@ -183,11 +183,11 @@ struct dxgi_surface
LONG refcount;
struct wined3d_private_store private_store;
IDXGIDevice *device;
struct wined3d_resource *wined3d_resource;
struct wined3d_texture *wined3d_texture;
};
HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
IUnknown *outer, struct wined3d_resource *wined3d_resource) DECLSPEC_HIDDEN;
IUnknown *outer, struct wined3d_texture *wined3d_texture) DECLSPEC_HIDDEN;
D3D_FEATURE_LEVEL dxgi_check_feature_level_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter,
const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count) DECLSPEC_HIDDEN;
......
......@@ -170,7 +170,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface1 *iface, DXGI
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
wined3d_resource_get_desc(surface->wined3d_resource, &wined3d_desc);
wined3d_resource_get_desc(wined3d_texture_get_resource(surface->wined3d_texture), &wined3d_desc);
wined3d_mutex_unlock();
desc->Width = wined3d_desc.width;
desc->Height = wined3d_desc.height;
......@@ -240,7 +240,7 @@ static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl =
};
HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
IUnknown *outer, struct wined3d_resource *wined3d_resource)
IUnknown *outer, struct wined3d_texture *wined3d_texture)
{
surface->IDXGISurface1_iface.lpVtbl = &dxgi_surface_vtbl;
surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl;
......@@ -248,7 +248,7 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
wined3d_private_store_init(&surface->private_store);
surface->outer_unknown = outer ? outer : &surface->IUnknown_iface;
surface->device = device;
surface->wined3d_resource = wined3d_resource;
surface->wined3d_texture = wined3d_texture;
return S_OK;
}
......@@ -28,7 +28,7 @@ import "dxgi.idl";
interface IWineDXGIDevice : IDXGIDevice1
{
HRESULT create_surface(
[in] struct wined3d_resource *wined3d_resource,
[in] struct wined3d_texture *wined3d_texture,
[in] DXGI_USAGE usage,
[in] const DXGI_SHARED_RESOURCE *shared_resource,
[in] IUnknown *outer,
......
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