Commit 21d94883 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core: Implement d3d10_sampler_state_SetPrivateData().

parent 3b2c28d8
...@@ -296,6 +296,7 @@ struct d3d10_sampler_state ...@@ -296,6 +296,7 @@ struct d3d10_sampler_state
ID3D10SamplerState ID3D10SamplerState_iface; ID3D10SamplerState ID3D10SamplerState_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
D3D10_SAMPLER_DESC desc; D3D10_SAMPLER_DESC desc;
struct wine_rb_entry entry; struct wine_rb_entry entry;
......
...@@ -552,6 +552,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *i ...@@ -552,6 +552,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *i
wined3d_sampler_decref(state->wined3d_sampler); wined3d_sampler_decref(state->wined3d_sampler);
wine_rb_remove(&device->sampler_states, &state->desc); wine_rb_remove(&device->sampler_states, &state->desc);
ID3D10Device1_Release(state->device); ID3D10Device1_Release(state->device);
wined3d_private_store_cleanup(&state->private_store);
HeapFree(GetProcessHeap(), 0, state); HeapFree(GetProcessHeap(), 0, state);
} }
...@@ -582,10 +583,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10Sample ...@@ -582,10 +583,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10Sample
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface, static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface,
REFGUID guid, UINT data_size, const void *data) REFGUID guid, UINT data_size, const void *data)
{ {
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n",
iface, debugstr_guid(guid), data_size, data); iface, debugstr_guid(guid), data_size, data);
return E_NOTIMPL; return d3d10_set_private_data(&state->private_store, guid, data_size, data);
} }
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface, static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface,
...@@ -667,6 +670,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10 ...@@ -667,6 +670,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10
state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl; state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
state->refcount = 1; state->refcount = 1;
wined3d_private_store_init(&state->private_store);
state->desc = *desc; state->desc = *desc;
wined3d_desc.address_u = wined3d_texture_address_from_d3d10core(desc->AddressU); wined3d_desc.address_u = wined3d_texture_address_from_d3d10core(desc->AddressU);
...@@ -687,6 +691,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10 ...@@ -687,6 +691,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10
if (FAILED(hr = wined3d_sampler_create(device->wined3d_device, &wined3d_desc, state, &state->wined3d_sampler))) if (FAILED(hr = wined3d_sampler_create(device->wined3d_device, &wined3d_desc, state, &state->wined3d_sampler)))
{ {
WARN("Failed to create wined3d sampler, hr %#x.\n", hr); WARN("Failed to create wined3d sampler, hr %#x.\n", hr);
wined3d_private_store_cleanup(&state->private_store);
return hr; return hr;
} }
...@@ -694,6 +699,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10 ...@@ -694,6 +699,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d10
{ {
ERR("Failed to insert sampler state entry.\n"); ERR("Failed to insert sampler state entry.\n");
wined3d_sampler_decref(state->wined3d_sampler); wined3d_sampler_decref(state->wined3d_sampler);
wined3d_private_store_cleanup(&state->private_store);
return E_FAIL; return E_FAIL;
} }
......
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