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

d3d11: Add ID3D11Device2 stub.

parent ce12b091
......@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_AddRef(ID3D11Query *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(query->device);
ID3D11Device2_AddRef(query->device);
wined3d_mutex_lock();
wined3d_query_incref(query->wined3d_query);
wined3d_mutex_unlock();
......@@ -92,13 +92,13 @@ static ULONG STDMETHODCALLTYPE d3d11_query_Release(ID3D11Query *iface)
if (!refcount)
{
ID3D11Device1 *device = query->device;
ID3D11Device2 *device = query->device;
wined3d_mutex_lock();
wined3d_query_decref(query->wined3d_query);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -254,7 +254,7 @@ static void STDMETHODCALLTYPE d3d10_query_GetDevice(ID3D10Query *iface, ID3D10De
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(query->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(query->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_query_GetPrivateData(ID3D10Query *iface,
......@@ -470,8 +470,7 @@ static HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device
wined3d_mutex_unlock();
query->predicate = predicate;
query->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(query->device);
ID3D11Device2_AddRef(query->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
......@@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(buffer->device);
ID3D11Device2_AddRef(buffer->device);
wined3d_mutex_lock();
wined3d_buffer_incref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
......@@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
if (!refcount)
{
ID3D11Device1 *device = buffer->device;
ID3D11Device2 *device = buffer->device;
wined3d_mutex_lock();
wined3d_buffer_decref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -242,7 +242,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
......@@ -470,8 +470,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
}
wined3d_mutex_unlock();
buffer->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(buffer->device);
ID3D11Device2_AddRef(buffer->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
......@@ -125,7 +125,7 @@ struct d3d_texture1d
IUnknown *dxgi_surface;
struct wined3d_texture *wined3d_texture;
D3D11_TEXTURE1D_DESC desc;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DESC *desc,
......@@ -144,7 +144,7 @@ struct d3d_texture2d
IUnknown *dxgi_surface;
struct wined3d_texture *wined3d_texture;
D3D11_TEXTURE2D_DESC desc;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
static inline struct d3d_texture2d *impl_from_ID3D11Texture2D(ID3D11Texture2D *iface)
......@@ -167,7 +167,7 @@ struct d3d_texture3d
struct wined3d_private_store private_store;
struct wined3d_texture *wined3d_texture;
D3D11_TEXTURE3D_DESC desc;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DESC *desc,
......@@ -185,7 +185,7 @@ struct d3d_buffer
struct wined3d_private_store private_store;
struct wined3d_buffer *wined3d_buffer;
D3D11_BUFFER_DESC desc;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_buffer_create(struct d3d_device *device, const D3D11_BUFFER_DESC *desc,
......@@ -204,7 +204,7 @@ struct d3d_depthstencil_view
struct wined3d_rendertarget_view *wined3d_view;
D3D11_DEPTH_STENCIL_VIEW_DESC desc;
ID3D11Resource *resource;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_depthstencil_view_create(struct d3d_device *device, ID3D11Resource *resource,
......@@ -223,7 +223,7 @@ struct d3d_rendertarget_view
struct wined3d_rendertarget_view *wined3d_view;
D3D11_RENDER_TARGET_VIEW_DESC desc;
ID3D11Resource *resource;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource,
......@@ -242,7 +242,7 @@ struct d3d_shader_resource_view
struct wined3d_shader_resource_view *wined3d_view;
D3D11_SHADER_RESOURCE_VIEW_DESC desc;
ID3D11Resource *resource;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_shader_resource_view_create(struct d3d_device *device, ID3D11Resource *resource,
......@@ -262,7 +262,7 @@ struct d3d11_unordered_access_view
struct wined3d_unordered_access_view *wined3d_view;
D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
ID3D11Resource *resource;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Resource *resource,
......@@ -279,7 +279,7 @@ struct d3d_input_layout
struct wined3d_private_store private_store;
struct wined3d_vertex_declaration *wined3d_decl;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_input_layout_create(struct d3d_device *device,
......@@ -298,7 +298,7 @@ struct d3d_vertex_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_vertex_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -314,7 +314,7 @@ struct d3d11_hull_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -329,7 +329,7 @@ struct d3d11_domain_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d11_domain_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -345,7 +345,7 @@ struct d3d_geometry_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -364,7 +364,7 @@ struct d3d_pixel_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_pixel_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -380,7 +380,7 @@ struct d3d11_compute_shader
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d11_compute_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length,
......@@ -400,7 +400,7 @@ struct d3d11_class_linkage
LONG refcount;
struct wined3d_private_store private_store;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d11_class_linkage_create(struct d3d_device *device,
......@@ -417,7 +417,7 @@ struct d3d_blend_state
struct wined3d_blend_state *wined3d_state;
D3D11_BLEND_DESC desc;
struct wine_rb_entry entry;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
static inline struct d3d_blend_state *impl_from_ID3D11BlendState(ID3D11BlendState *iface)
......@@ -440,7 +440,7 @@ struct d3d_depthstencil_state
struct wined3d_private_store private_store;
D3D11_DEPTH_STENCIL_DESC desc;
struct wine_rb_entry entry;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
static inline struct d3d_depthstencil_state *impl_from_ID3D11DepthStencilState(ID3D11DepthStencilState *iface)
......@@ -466,7 +466,7 @@ struct d3d_rasterizer_state
struct wined3d_rasterizer_state *wined3d_state;
D3D11_RASTERIZER_DESC desc;
struct wine_rb_entry entry;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_rasterizer_state_create(struct d3d_device *device, const D3D11_RASTERIZER_DESC *desc,
......@@ -485,7 +485,7 @@ struct d3d_sampler_state
struct wined3d_sampler *wined3d_sampler;
D3D11_SAMPLER_DESC desc;
struct wine_rb_entry entry;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_DESC *desc,
......@@ -504,7 +504,7 @@ struct d3d_query
struct wined3d_query *wined3d_query;
BOOL predicate;
D3D11_QUERY_DESC desc;
ID3D11Device1 *device;
ID3D11Device2 *device;
};
HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate,
......@@ -526,7 +526,7 @@ struct d3d11_immediate_context
struct d3d_device
{
IUnknown IUnknown_inner;
ID3D11Device1 ID3D11Device1_iface;
ID3D11Device2 ID3D11Device2_iface;
ID3D10Device1 ID3D10Device1_iface;
ID3D10Multithread ID3D10Multithread_iface;
IWineDXGIDeviceParent IWineDXGIDeviceParent_iface;
......@@ -550,9 +550,9 @@ struct d3d_device
UINT stencil_ref;
};
static inline struct d3d_device *impl_from_ID3D11Device1(ID3D11Device1 *iface)
static inline struct d3d_device *impl_from_ID3D11Device2(ID3D11Device2 *iface)
{
return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device1_iface);
return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device2_iface);
}
static inline struct d3d_device *impl_from_ID3D10Device(ID3D10Device1 *iface)
......
......@@ -134,7 +134,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_AddRef(ID3D11InputLayout *ifac
if (refcount == 1)
{
ID3D11Device1_AddRef(layout->device);
ID3D11Device2_AddRef(layout->device);
wined3d_mutex_lock();
wined3d_vertex_declaration_incref(layout->wined3d_decl);
wined3d_mutex_unlock();
......@@ -152,13 +152,13 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa
if (!refcount)
{
ID3D11Device1 *device = layout->device;
ID3D11Device2 *device = layout->device;
wined3d_mutex_lock();
wined3d_vertex_declaration_decref(layout->wined3d_decl);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -262,7 +262,7 @@ static void STDMETHODCALLTYPE d3d10_input_layout_GetDevice(ID3D10InputLayout *if
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(layout->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(layout->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_input_layout_GetPrivateData(ID3D10InputLayout *iface,
......@@ -357,7 +357,7 @@ static HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d
}
wined3d_mutex_unlock();
ID3D11Device1_AddRef(layout->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(layout->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
......@@ -330,7 +330,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *if
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -348,14 +348,14 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *i
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -460,7 +460,7 @@ static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData(ID3D10VertexShader *iface,
......@@ -575,8 +575,7 @@ static HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d
}
wined3d_mutex_unlock();
shader->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -657,7 +656,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -675,7 +674,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
......@@ -683,7 +682,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -788,8 +787,7 @@ static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d
}
wined3d_mutex_unlock();
shader->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -860,7 +858,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *if
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -878,7 +876,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
......@@ -886,7 +884,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -991,8 +989,7 @@ static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, stru
}
wined3d_mutex_unlock();
shader->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1073,7 +1070,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -1091,7 +1088,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
......@@ -1099,7 +1096,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1204,7 +1201,7 @@ static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShad
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface,
......@@ -1530,8 +1527,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader,
}
wined3d_mutex_unlock();
shader->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1625,7 +1621,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *ifac
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -1643,14 +1639,14 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *ifa
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1755,7 +1751,7 @@ static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice(ID3D10PixelShader *if
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelShader *iface,
......@@ -1849,8 +1845,7 @@ static HRESULT d3d_pixel_shader_init(struct d3d_pixel_shader *shader, struct d3d
}
wined3d_mutex_unlock();
shader->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1930,7 +1925,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader *
if (refcount == 1)
{
ID3D11Device1_AddRef(shader->device);
ID3D11Device2_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
......@@ -1948,7 +1943,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader
if (!refcount)
{
ID3D11Device1 *device = shader->device;
ID3D11Device2 *device = shader->device;
wined3d_mutex_lock();
wined3d_shader_decref(shader->wined3d_shader);
......@@ -1956,7 +1951,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -2060,7 +2055,7 @@ static HRESULT d3d11_compute_shader_init(struct d3d11_compute_shader *shader, st
}
wined3d_mutex_unlock();
ID3D11Device1_AddRef(shader->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(shader->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -2140,12 +2135,12 @@ static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *i
if (!refcount)
{
ID3D11Device1 *device = class_linkage->device;
ID3D11Device2 *device = class_linkage->device;
wined3d_private_store_cleanup(&class_linkage->private_store);
heap_free(class_linkage);
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -2239,7 +2234,7 @@ HRESULT d3d11_class_linkage_create(struct d3d_device *device, struct d3d11_class
object->refcount = 1;
wined3d_private_store_init(&object->private_store);
ID3D11Device1_AddRef(object->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
TRACE("Created class linkage %p.\n", object);
*class_linkage = object;
......
......@@ -66,7 +66,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(state->device);
ID3D11Device2_AddRef(state->device);
wined3d_mutex_lock();
wined3d_blend_state_incref(state->wined3d_state);
wined3d_mutex_unlock();
......@@ -84,13 +84,13 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface
if (!refcount)
{
ID3D11Device1 *device = state->device;
ID3D11Device2 *device = state->device;
wined3d_mutex_lock();
wined3d_blend_state_decref(state->wined3d_state);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -206,7 +206,7 @@ static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *ifa
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState1 *iface,
......@@ -294,7 +294,7 @@ static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl =
static void STDMETHODCALLTYPE d3d_blend_state_wined3d_object_destroyed(void *parent)
{
struct d3d_blend_state *state = parent;
struct d3d_device *device = impl_from_ID3D11Device1(state->device);
struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->blend_states, &state->entry);
wined3d_private_store_cleanup(&state->private_store);
......@@ -395,7 +395,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
}
wined3d_mutex_unlock();
ID3D11Device1_AddRef(object->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(object->device = &device->ID3D11Device2_iface);
TRACE("Created blend state %p.\n", object);
*state = object;
......@@ -466,7 +466,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStenci
static void d3d_depthstencil_state_cleanup(struct d3d_depthstencil_state *state)
{
wined3d_private_store_cleanup(&state->private_store);
ID3D11Device1_Release(state->device);
ID3D11Device2_Release(state->device);
}
static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStencilState *iface)
......@@ -478,7 +478,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStenc
if (!refcount)
{
struct d3d_device *device = impl_from_ID3D11Device1(state->device);
struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wined3d_mutex_lock();
wine_rb_remove(&device->depthstencil_states, &state->entry);
d3d_depthstencil_state_cleanup(state);
......@@ -600,7 +600,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthSten
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface,
......@@ -671,8 +671,7 @@ static HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state,
wined3d_private_store_init(&state->private_store);
state->desc = *desc;
state->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(state->device);
ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -831,7 +830,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerSta
if (refcount == 1)
{
ID3D11Device1_AddRef(state->device);
ID3D11Device2_AddRef(state->device);
wined3d_mutex_lock();
wined3d_rasterizer_state_incref(state->wined3d_state);
wined3d_mutex_unlock();
......@@ -849,13 +848,13 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerSt
if (!refcount)
{
ID3D11Device1 *device = state->device;
ID3D11Device2 *device = state->device;
wined3d_mutex_lock();
wined3d_rasterizer_state_decref(state->wined3d_state);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -972,7 +971,7 @@ static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerS
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface,
......@@ -1037,7 +1036,7 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
static void STDMETHODCALLTYPE d3d_rasterizer_state_wined3d_object_destroyed(void *parent)
{
struct d3d_rasterizer_state *state = parent;
struct d3d_device *device = impl_from_ID3D11Device1(state->device);
struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->rasterizer_states, &state->entry);
wined3d_private_store_cleanup(&state->private_store);
......@@ -1081,7 +1080,7 @@ static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, str
return hr;
}
ID3D11Device1_AddRef(state->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1194,7 +1193,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *if
if (refcount == 1)
{
ID3D11Device1_AddRef(state->device);
ID3D11Device2_AddRef(state->device);
wined3d_mutex_lock();
wined3d_sampler_incref(state->wined3d_sampler);
wined3d_mutex_unlock();
......@@ -1212,13 +1211,13 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *i
if (!refcount)
{
ID3D11Device1 *device = state->device;
ID3D11Device2 *device = state->device;
wined3d_mutex_lock();
wined3d_sampler_decref(state->wined3d_sampler);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1335,7 +1334,7 @@ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface,
......@@ -1400,7 +1399,7 @@ static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
static void STDMETHODCALLTYPE d3d_sampler_wined3d_object_destroyed(void *parent)
{
struct d3d_sampler_state *state = parent;
struct d3d_device *device = impl_from_ID3D11Device1(state->device);
struct d3d_device *device = impl_from_ID3D11Device2(state->device);
wine_rb_remove(&device->sampler_states, &state->entry);
wined3d_private_store_cleanup(&state->private_store);
......@@ -1494,8 +1493,7 @@ static HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3
return hr;
}
state->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(state->device);
ID3D11Device2_AddRef(state->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
......@@ -1236,10 +1236,6 @@ static BOOL is_d3d11_2_runtime(ID3D11Device *device)
ID3D11Device2 *device2;
HRESULT hr;
/* FIXME: Wine doesn't implement required interfaces yet, but we want to test new behavior. */
if (!strcmp(winetest_platform, "wine"))
return TRUE;
hr = ID3D11Device_QueryInterface(device, &IID_ID3D11Device2, (void **)&device2);
if (SUCCEEDED(hr))
ID3D11Device2_Release(device2);
......@@ -78,7 +78,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(texture->device);
ID3D11Device2_AddRef(texture->device);
wined3d_mutex_lock();
wined3d_texture_incref(texture->wined3d_texture);
wined3d_mutex_unlock();
......@@ -96,14 +96,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface)
if (!refcount)
{
ID3D11Device1 *device = texture->device;
ID3D11Device2 *device = texture->device;
wined3d_mutex_lock();
wined3d_texture_decref(texture->wined3d_texture);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -287,7 +287,7 @@ static void STDMETHODCALLTYPE d3d10_texture1d_GetDevice(ID3D10Texture1D *iface,
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_texture1d_GetPrivateData(ID3D10Texture1D *iface,
......@@ -510,8 +510,7 @@ HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DE
}
wined3d_mutex_unlock();
texture->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(texture->device);
ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
TRACE("Created texture %p.\n", texture);
*out = texture;
......@@ -566,7 +565,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(texture->device);
ID3D11Device2_AddRef(texture->device);
wined3d_mutex_lock();
wined3d_texture_incref(texture->wined3d_texture);
wined3d_mutex_unlock();
......@@ -584,14 +583,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface)
if (!refcount)
{
ID3D11Device1 *device = texture->device;
ID3D11Device2 *device = texture->device;
wined3d_mutex_lock();
wined3d_texture_decref(texture->wined3d_texture);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -789,7 +788,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_GetDevice(ID3D10Texture2D *iface,
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_texture2d_GetPrivateData(ID3D10Texture2D *iface,
......@@ -1066,7 +1065,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
}
wined3d_mutex_unlock();
ID3D11Device1_AddRef(texture->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
TRACE("Created texture %p.\n", texture);
*out = texture;
......@@ -1120,7 +1119,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_AddRef(ID3D11Texture3D *iface)
if (refcount == 1)
{
ID3D11Device1_AddRef(texture->device);
ID3D11Device2_AddRef(texture->device);
wined3d_mutex_lock();
wined3d_texture_incref(texture->wined3d_texture);
wined3d_mutex_unlock();
......@@ -1146,14 +1145,14 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_Release(ID3D11Texture3D *iface)
if (!refcount)
{
ID3D11Device1 *device = texture->device;
ID3D11Device2 *device = texture->device;
wined3d_mutex_lock();
wined3d_texture_decref(texture->wined3d_texture);
wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1287,7 +1286,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_GetDevice(ID3D10Texture3D *iface,
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_texture3d_GetPrivateData(ID3D10Texture3D *iface,
......@@ -1495,8 +1494,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
wined3d_mutex_unlock();
texture->desc.MipLevels = levels;
texture->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(texture->device);
ID3D11Device2_AddRef(texture->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
......@@ -1006,7 +1006,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_AddRef(ID3D11DepthStencil
if (refcount == 1)
{
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device);
wined3d_mutex_lock();
wined3d_rendertarget_view_incref(view->wined3d_view);
wined3d_mutex_unlock();
......@@ -1024,13 +1024,13 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
if (!refcount)
{
ID3D11Device1 *device = view->device;
ID3D11Device2 *device = view->device;
wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1160,7 +1160,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetDevice(ID3D10DepthStenc
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_GetPrivateData(ID3D10DepthStencilView *iface,
......@@ -1355,8 +1355,7 @@ static HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, st
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
view->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1449,7 +1448,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_AddRef(ID3D11RenderTarget
if (refcount == 1)
{
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device);
wined3d_mutex_lock();
wined3d_rendertarget_view_incref(view->wined3d_view);
wined3d_mutex_unlock();
......@@ -1467,13 +1466,13 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
if (!refcount)
{
ID3D11Device1 *device = view->device;
ID3D11Device2 *device = view->device;
wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -1603,7 +1602,7 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetDevice(ID3D10RenderTarg
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView *iface,
......@@ -1803,8 +1802,7 @@ static HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, st
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
view->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -1898,7 +1896,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_AddRef(ID3D11ShaderRes
if (refcount == 1)
{
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device);
wined3d_mutex_lock();
wined3d_shader_resource_view_incref(view->wined3d_view);
wined3d_mutex_unlock();
......@@ -1916,13 +1914,13 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderRe
if (!refcount)
{
ID3D11Device1 *device = view->device;
ID3D11Device2 *device = view->device;
wined3d_mutex_lock();
wined3d_shader_resource_view_decref(view->wined3d_view);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -2053,7 +2051,7 @@ static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDevice(ID3D10ShaderR
TRACE("iface %p, device %p.\n", iface, device);
ID3D11Device1_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
ID3D11Device2_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_GetPrivateData(ID3D10ShaderResourceView1 *iface,
......@@ -2304,8 +2302,7 @@ static HRESULT d3d_shader_resource_view_init(struct d3d_shader_resource_view *vi
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
view->device = &device->ID3D11Device1_iface;
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK;
}
......@@ -2384,7 +2381,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_AddRef(ID3D11Unordere
if (refcount == 1)
{
ID3D11Device1_AddRef(view->device);
ID3D11Device2_AddRef(view->device);
wined3d_mutex_lock();
wined3d_unordered_access_view_incref(view->wined3d_view);
wined3d_mutex_unlock();
......@@ -2402,13 +2399,13 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_Release(ID3D11Unorder
if (!refcount)
{
ID3D11Device1 *device = view->device;
ID3D11Device2 *device = view->device;
wined3d_mutex_lock();
wined3d_unordered_access_view_decref(view->wined3d_view);
wined3d_mutex_unlock();
ID3D11Device1_Release(device);
ID3D11Device2_Release(device);
}
return refcount;
......@@ -2614,7 +2611,7 @@ static HRESULT d3d11_unordered_access_view_init(struct d3d11_unordered_access_vi
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
ID3D11Device1_AddRef(view->device = &device->ID3D11Device1_iface);
ID3D11Device2_AddRef(view->device = &device->ID3D11Device2_iface);
return S_OK;
}
......
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