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

d3d11: Prefer D3D11 interfaces.

parent 9d911a57
...@@ -126,9 +126,9 @@ struct d3d_texture2d ...@@ -126,9 +126,9 @@ struct d3d_texture2d
ID3D11Device *device; ID3D11Device *device;
}; };
static inline struct d3d_texture2d *impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) static inline struct d3d_texture2d *impl_from_ID3D11Texture2D(ID3D11Texture2D *iface)
{ {
return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D10Texture2D_iface); return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D11Texture2D_iface);
} }
HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DESC *desc, HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DESC *desc,
......
...@@ -5767,8 +5767,8 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic ...@@ -5767,8 +5767,8 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic
{ {
struct d3d_device *device = device_from_wined3d_device_parent(device_parent); struct d3d_device *device = device_from_wined3d_device_parent(device_parent);
struct d3d_texture2d *texture; struct d3d_texture2d *texture;
ID3D10Texture2D *texture_iface; ID3D11Texture2D *texture_iface;
D3D10_TEXTURE2D_DESC desc; D3D11_TEXTURE2D_DESC desc;
HRESULT hr; HRESULT hr;
FIXME("device_parent %p, container_parent %p, wined3d_desc %p, texture flags %#x, " FIXME("device_parent %p, container_parent %p, wined3d_desc %p, texture flags %#x, "
...@@ -5784,32 +5784,32 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic ...@@ -5784,32 +5784,32 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic
desc.Format = dxgi_format_from_wined3dformat(wined3d_desc->format); desc.Format = dxgi_format_from_wined3dformat(wined3d_desc->format);
desc.SampleDesc.Count = wined3d_desc->multisample_type ? wined3d_desc->multisample_type : 1; desc.SampleDesc.Count = wined3d_desc->multisample_type ? wined3d_desc->multisample_type : 1;
desc.SampleDesc.Quality = wined3d_desc->multisample_quality; desc.SampleDesc.Quality = wined3d_desc->multisample_quality;
desc.Usage = D3D10_USAGE_DEFAULT; desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D10_BIND_RENDER_TARGET; desc.BindFlags = D3D11_BIND_RENDER_TARGET;
desc.CPUAccessFlags = 0; desc.CPUAccessFlags = 0;
desc.MiscFlags = 0; desc.MiscFlags = 0;
if (texture_flags & WINED3D_TEXTURE_CREATE_GET_DC) if (texture_flags & WINED3D_TEXTURE_CREATE_GET_DC)
{ {
desc.MiscFlags |= D3D10_RESOURCE_MISC_GDI_COMPATIBLE; desc.MiscFlags |= D3D11_RESOURCE_MISC_GDI_COMPATIBLE;
texture_flags &= ~WINED3D_TEXTURE_CREATE_GET_DC; texture_flags &= ~WINED3D_TEXTURE_CREATE_GET_DC;
} }
if (texture_flags) if (texture_flags)
FIXME("Unhandled flags %#x.\n", texture_flags); FIXME("Unhandled flags %#x.\n", texture_flags);
if (FAILED(hr = d3d10_device_CreateTexture2D(&device->ID3D10Device1_iface, if (FAILED(hr = d3d11_device_CreateTexture2D(&device->ID3D11Device_iface,
&desc, NULL, &texture_iface))) &desc, NULL, &texture_iface)))
{ {
WARN("CreateTexture2D failed, returning %#x.\n", hr); WARN("Failed to create 2D texture, hr %#x.\n", hr);
return hr; return hr;
} }
texture = impl_from_ID3D10Texture2D(texture_iface); texture = impl_from_ID3D11Texture2D(texture_iface);
*wined3d_texture = texture->wined3d_texture; *wined3d_texture = texture->wined3d_texture;
wined3d_texture_incref(*wined3d_texture); wined3d_texture_incref(*wined3d_texture);
ID3D10Texture2D_Release(&texture->ID3D10Texture2D_iface); ID3D11Texture2D_Release(&texture->ID3D11Texture2D_iface);
return S_OK; return S_OK;
} }
...@@ -5823,7 +5823,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent ...@@ -5823,7 +5823,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
TRACE("device_parent %p, desc %p, swapchain %p.\n", device_parent, desc, swapchain); TRACE("device_parent %p, desc %p, swapchain %p.\n", device_parent, desc, swapchain);
if (FAILED(hr = d3d10_device_QueryInterface(&device->ID3D10Device1_iface, if (FAILED(hr = d3d11_device_QueryInterface(&device->ID3D11Device_iface,
&IID_IWineDXGIDevice, (void **)&wine_device))) &IID_IWineDXGIDevice, (void **)&wine_device)))
{ {
ERR("Device should implement IWineDXGIDevice.\n"); ERR("Device should implement IWineDXGIDevice.\n");
......
...@@ -27,11 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); ...@@ -27,11 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11);
/* ID3D11Texture2D methods */ /* ID3D11Texture2D methods */
static inline struct d3d_texture2d *impl_from_ID3D11Texture2D(ID3D11Texture2D *iface)
{
return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D11Texture2D_iface);
}
static HRESULT STDMETHODCALLTYPE d3d11_texture2d_QueryInterface(ID3D11Texture2D *iface, REFIID riid, void **object) static HRESULT STDMETHODCALLTYPE d3d11_texture2d_QueryInterface(ID3D11Texture2D *iface, REFIID riid, void **object)
{ {
struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface);
...@@ -251,6 +246,11 @@ struct d3d_texture2d *unsafe_impl_from_ID3D11Texture2D(ID3D11Texture2D *iface) ...@@ -251,6 +246,11 @@ struct d3d_texture2d *unsafe_impl_from_ID3D11Texture2D(ID3D11Texture2D *iface)
/* IUnknown methods */ /* IUnknown methods */
static inline struct d3d_texture2d *impl_from_ID3D10Texture2D(ID3D10Texture2D *iface)
{
return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D10Texture2D_iface);
}
static HRESULT STDMETHODCALLTYPE d3d10_texture2d_QueryInterface(ID3D10Texture2D *iface, REFIID riid, void **object) static HRESULT STDMETHODCALLTYPE d3d10_texture2d_QueryInterface(ID3D10Texture2D *iface, REFIID riid, void **object)
{ {
struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface);
......
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