d3d11: Removed no longer needed wine_rb_init error handling.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-08-30 21:31:23 +02:00 committed by Alexandre Julliard
parent 0f418a698c
commit c0fa655d9e
3 changed files with 7 additions and 39 deletions

View File

@ -75,7 +75,6 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba
void *device_object, REFIID riid, void **device_layer)
{
struct d3d_device *object;
HRESULT hr;
TRACE("id %#x, layer_base %p, unknown0 %#x, device_object %p, riid %s, device_layer %p\n",
id, layer_base, unknown0, device_object, debugstr_guid(riid), device_layer);
@ -88,12 +87,7 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba
}
object = *layer_base;
if (FAILED(hr = d3d_device_init(object, device_object)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
*device_layer = NULL;
return hr;
}
d3d_device_init(object, device_object);
*device_layer = &object->IUnknown_inner;
TRACE("Created d3d10 device at %p\n", object);

View File

@ -518,7 +518,7 @@ static inline struct d3d_device *impl_from_ID3D10Device(ID3D10Device1 *iface)
return CONTAINING_RECORD(iface, struct d3d_device, ID3D10Device1_iface);
}
HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown) DECLSPEC_HIDDEN;
void d3d_device_init(struct d3d_device *device, void *outer_unknown) DECLSPEC_HIDDEN;
/* Layered device */
enum dxgi_device_layer_id

View File

@ -5351,7 +5351,7 @@ static const struct wine_rb_functions d3d_rasterizer_state_rb_ops =
d3d_rasterizer_state_compare,
};
HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown)
void d3d_device_init(struct d3d_device *device, void *outer_unknown)
{
device->IUnknown_inner.lpVtbl = &d3d_device_inner_unknown_vtbl;
device->ID3D11Device_iface.lpVtbl = &d3d11_device_vtbl;
@ -5366,39 +5366,13 @@ HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown)
d3d11_immediate_context_init(&device->immediate_context, device);
ID3D11DeviceContext_Release(&device->immediate_context.ID3D11DeviceContext_iface);
if (wine_rb_init(&device->blend_states, &d3d_blend_state_rb_ops) == -1)
{
WARN("Failed to initialize blend state rbtree.\n");
return E_FAIL;
}
device->blend_factor[0] = 1.0f;
device->blend_factor[1] = 1.0f;
device->blend_factor[2] = 1.0f;
device->blend_factor[3] = 1.0f;
if (wine_rb_init(&device->depthstencil_states, &d3d_depthstencil_state_rb_ops) == -1)
{
WARN("Failed to initialize depthstencil state rbtree.\n");
wine_rb_destroy(&device->blend_states, NULL, NULL);
return E_FAIL;
}
if (wine_rb_init(&device->rasterizer_states, &d3d_rasterizer_state_rb_ops) == -1)
{
WARN("Failed to initialize rasterizer state rbtree.\n");
wine_rb_destroy(&device->depthstencil_states, NULL, NULL);
wine_rb_destroy(&device->blend_states, NULL, NULL);
return E_FAIL;
}
if (wine_rb_init(&device->sampler_states, &d3d_sampler_state_rb_ops) == -1)
{
WARN("Failed to initialize sampler state rbtree.\n");
wine_rb_destroy(&device->rasterizer_states, NULL, NULL);
wine_rb_destroy(&device->depthstencil_states, NULL, NULL);
wine_rb_destroy(&device->blend_states, NULL, NULL);
return E_FAIL;
}
return S_OK;
wine_rb_init(&device->blend_states, &d3d_blend_state_rb_ops);
wine_rb_init(&device->depthstencil_states, &d3d_depthstencil_state_rb_ops);
wine_rb_init(&device->rasterizer_states, &d3d_rasterizer_state_rb_ops);
wine_rb_init(&device->sampler_states, &d3d_sampler_state_rb_ops);
}