d3d10core: Implement d3d10_sampler_state_GetDesc().
This commit is contained in:
parent
99dcfdf0ce
commit
14eadb71bc
|
@ -248,9 +248,10 @@ struct d3d10_sampler_state
|
||||||
LONG refcount;
|
LONG refcount;
|
||||||
|
|
||||||
struct wined3d_sampler *wined3d_sampler;
|
struct wined3d_sampler *wined3d_sampler;
|
||||||
|
D3D10_SAMPLER_DESC desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state) DECLSPEC_HIDDEN;
|
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, const D3D10_SAMPLER_DESC *desc) DECLSPEC_HIDDEN;
|
||||||
struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN;
|
struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
/* ID3D10Query */
|
/* ID3D10Query */
|
||||||
|
|
|
@ -1476,6 +1476,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *i
|
||||||
|
|
||||||
TRACE("iface %p, desc %p, sampler_state %p.\n", iface, desc, sampler_state);
|
TRACE("iface %p, desc %p, sampler_state %p.\n", iface, desc, sampler_state);
|
||||||
|
|
||||||
|
if (!desc)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
{
|
||||||
|
@ -1483,8 +1486,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *i
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = d3d10_sampler_state_init(object);
|
if (FAILED(hr = d3d10_sampler_state_init(object, desc)))
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
|
|
@ -490,7 +490,11 @@ 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)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, desc %p stub!\n", iface, desc);
|
struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface);
|
||||||
|
|
||||||
|
TRACE("iface %p, desc %p.\n", iface, desc);
|
||||||
|
|
||||||
|
*desc = state->desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
|
static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
|
||||||
|
@ -508,12 +512,13 @@ static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
|
||||||
d3d10_sampler_state_GetDesc,
|
d3d10_sampler_state_GetDesc,
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state)
|
HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, const D3D10_SAMPLER_DESC *desc)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
|
state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
|
||||||
state->refcount = 1;
|
state->refcount = 1;
|
||||||
|
state->desc = *desc;
|
||||||
|
|
||||||
if (FAILED(hr = wined3d_sampler_create(state, &state->wined3d_sampler)))
|
if (FAILED(hr = wined3d_sampler_create(state, &state->wined3d_sampler)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue