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

d3d11: Rename d3d10_sampler_state to d3d_sampler_state.

parent 1d8aa726
...@@ -328,7 +328,7 @@ HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d ...@@ -328,7 +328,7 @@ HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d
struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN; struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN;
/* ID3D10SamplerState */ /* ID3D10SamplerState */
struct d3d10_sampler_state struct d3d_sampler_state
{ {
ID3D10SamplerState ID3D10SamplerState_iface; ID3D10SamplerState ID3D10SamplerState_iface;
LONG refcount; LONG refcount;
...@@ -340,9 +340,9 @@ struct d3d10_sampler_state ...@@ -340,9 +340,9 @@ struct d3d10_sampler_state
ID3D10Device1 *device; ID3D10Device1 *device;
}; };
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_device *device, HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device,
const D3D10_SAMPLER_DESC *desc) DECLSPEC_HIDDEN; const D3D10_SAMPLER_DESC *desc) DECLSPEC_HIDDEN;
struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN; struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN;
/* ID3D10Query */ /* ID3D10Query */
struct d3d10_query struct d3d10_query
......
...@@ -1837,7 +1837,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface, ...@@ -1837,7 +1837,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i, wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i,
sampler ? sampler->wined3d_sampler : NULL); sampler ? sampler->wined3d_sampler : NULL);
...@@ -2066,7 +2066,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface, ...@@ -2066,7 +2066,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
wined3d_device_set_vs_sampler(device->wined3d_device, start_slot + i, wined3d_device_set_vs_sampler(device->wined3d_device, start_slot + i,
sampler ? sampler->wined3d_sampler : NULL); sampler ? sampler->wined3d_sampler : NULL);
...@@ -2119,7 +2119,7 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device1 *iface, ...@@ -2119,7 +2119,7 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
wined3d_device_set_gs_sampler(device->wined3d_device, start_slot + i, wined3d_device_set_gs_sampler(device->wined3d_device, start_slot + i,
sampler ? sampler->wined3d_sampler : NULL); sampler ? sampler->wined3d_sampler : NULL);
...@@ -2541,7 +2541,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface, ...@@ -2541,7 +2541,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i)))
...@@ -2790,7 +2790,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface, ...@@ -2790,7 +2790,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i)))
...@@ -2869,7 +2869,7 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface, ...@@ -2869,7 +2869,7 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
for (i = 0; i < sampler_count; ++i) for (i = 0; i < sampler_count; ++i)
{ {
struct d3d10_sampler_state *sampler_impl; struct d3d_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler; struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i)))
...@@ -3540,7 +3540,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 * ...@@ -3540,7 +3540,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *
const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state) const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state)
{ {
struct d3d_device *device = impl_from_ID3D10Device(iface); struct d3d_device *device = impl_from_ID3D10Device(iface);
struct d3d10_sampler_state *object; struct d3d_sampler_state *object;
struct wine_rb_entry *entry; struct wine_rb_entry *entry;
HRESULT hr; HRESULT hr;
...@@ -3552,7 +3552,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 * ...@@ -3552,7 +3552,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *
wined3d_mutex_lock(); wined3d_mutex_lock();
if ((entry = wine_rb_get(&device->sampler_states, desc))) if ((entry = wine_rb_get(&device->sampler_states, desc)))
{ {
object = WINE_RB_ENTRY_VALUE(entry, struct d3d10_sampler_state, entry); object = WINE_RB_ENTRY_VALUE(entry, struct d3d_sampler_state, entry);
TRACE("Returning existing sampler state %p.\n", object); TRACE("Returning existing sampler state %p.\n", object);
*sampler_state = &object->ID3D10SamplerState_iface; *sampler_state = &object->ID3D10SamplerState_iface;
...@@ -3567,7 +3567,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 * ...@@ -3567,7 +3567,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *
if (!object) if (!object)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (FAILED(hr = d3d10_sampler_state_init(object, device, desc))) if (FAILED(hr = d3d_sampler_state_init(object, device, desc)))
{ {
WARN("Failed to initialize sampler state, hr %#x.\n", hr); WARN("Failed to initialize sampler state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
...@@ -4110,20 +4110,20 @@ static void d3d_rb_free(void *ptr) ...@@ -4110,20 +4110,20 @@ static void d3d_rb_free(void *ptr)
HeapFree(GetProcessHeap(), 0, ptr); HeapFree(GetProcessHeap(), 0, ptr);
} }
static int d3d10_sampler_state_compare(const void *key, const struct wine_rb_entry *entry) static int d3d_sampler_state_compare(const void *key, const struct wine_rb_entry *entry)
{ {
const D3D10_SAMPLER_DESC *ka = key; const D3D10_SAMPLER_DESC *ka = key;
const D3D10_SAMPLER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d10_sampler_state, entry)->desc; const D3D10_SAMPLER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d_sampler_state, entry)->desc;
return memcmp(ka, kb, sizeof(*ka)); return memcmp(ka, kb, sizeof(*ka));
} }
static const struct wine_rb_functions d3d10_sampler_state_rb_ops = static const struct wine_rb_functions d3d_sampler_state_rb_ops =
{ {
d3d_rb_alloc, d3d_rb_alloc,
d3d_rb_realloc, d3d_rb_realloc,
d3d_rb_free, d3d_rb_free,
d3d10_sampler_state_compare, d3d_sampler_state_compare,
}; };
static int d3d_blend_state_compare(const void *key, const struct wine_rb_entry *entry) static int d3d_blend_state_compare(const void *key, const struct wine_rb_entry *entry)
...@@ -4219,7 +4219,7 @@ HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown) ...@@ -4219,7 +4219,7 @@ HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown)
return E_FAIL; return E_FAIL;
} }
if (wine_rb_init(&device->sampler_states, &d3d10_sampler_state_rb_ops) == -1) if (wine_rb_init(&device->sampler_states, &d3d_sampler_state_rb_ops) == -1)
{ {
WARN("Failed to initialize sampler state rbtree.\n"); WARN("Failed to initialize sampler state rbtree.\n");
wine_rb_destroy(&device->rasterizer_states, NULL, NULL); wine_rb_destroy(&device->rasterizer_states, NULL, NULL);
......
...@@ -867,9 +867,9 @@ struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10Raster ...@@ -867,9 +867,9 @@ struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10Raster
return impl_from_ID3D10RasterizerState(iface); return impl_from_ID3D10RasterizerState(iface);
} }
static inline struct d3d10_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) static inline struct d3d_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface)
{ {
return CONTAINING_RECORD(iface, struct d3d10_sampler_state, ID3D10SamplerState_iface); return CONTAINING_RECORD(iface, struct d3d_sampler_state, ID3D10SamplerState_iface);
} }
/* IUnknown methods */ /* IUnknown methods */
...@@ -896,7 +896,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10Sample ...@@ -896,7 +896,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10Sample
static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface) static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface)
{ {
struct d3d10_sampler_state *This = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *This = impl_from_ID3D10SamplerState(iface);
ULONG refcount = InterlockedIncrement(&This->refcount); ULONG refcount = InterlockedIncrement(&This->refcount);
TRACE("%p increasing refcount to %u.\n", This, refcount); TRACE("%p increasing refcount to %u.\n", This, refcount);
...@@ -906,7 +906,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *if ...@@ -906,7 +906,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *if
static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface) static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
ULONG refcount = InterlockedDecrement(&state->refcount); ULONG refcount = InterlockedDecrement(&state->refcount);
TRACE("%p decreasing refcount to %u.\n", state, refcount); TRACE("%p decreasing refcount to %u.\n", state, refcount);
...@@ -931,7 +931,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *i ...@@ -931,7 +931,7 @@ static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *i
static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device) static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, device %p.\n", iface, device); TRACE("iface %p, device %p.\n", iface, device);
...@@ -942,7 +942,7 @@ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState * ...@@ -942,7 +942,7 @@ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface, static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface,
REFGUID guid, UINT *data_size, void *data) REFGUID guid, UINT *data_size, void *data)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", TRACE("iface %p, guid %s, data_size %p, data %p.\n",
iface, debugstr_guid(guid), data_size, data); iface, debugstr_guid(guid), data_size, data);
...@@ -953,7 +953,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10Sample ...@@ -953,7 +953,7 @@ 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)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", 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);
...@@ -964,7 +964,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10Sample ...@@ -964,7 +964,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10Sample
static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface, static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface,
REFGUID guid, const IUnknown *data) REFGUID guid, const IUnknown *data)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
...@@ -976,7 +976,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3 ...@@ -976,7 +976,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3
static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface, static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface,
D3D10_SAMPLER_DESC *desc) D3D10_SAMPLER_DESC *desc)
{ {
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface);
TRACE("iface %p, desc %p.\n", iface, desc); TRACE("iface %p, desc %p.\n", iface, desc);
...@@ -1034,7 +1034,7 @@ static enum wined3d_cmp_func wined3d_cmp_func_from_d3d10core(D3D10_COMPARISON_FU ...@@ -1034,7 +1034,7 @@ static enum wined3d_cmp_func wined3d_cmp_func_from_d3d10core(D3D10_COMPARISON_FU
return (enum wined3d_cmp_func)f; return (enum wined3d_cmp_func)f;
} }
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_device *device, HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device,
const D3D10_SAMPLER_DESC *desc) const D3D10_SAMPLER_DESC *desc)
{ {
struct wined3d_sampler_desc wined3d_desc; struct wined3d_sampler_desc wined3d_desc;
...@@ -1085,7 +1085,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_d ...@@ -1085,7 +1085,7 @@ HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_d
return S_OK; return S_OK;
} }
struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface)
{ {
if (!iface) if (!iface)
return NULL; return NULL;
......
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