d3d10core: Implement d3d10_rasterizer_state_GetDesc().

This commit is contained in:
Henri Verbeet 2013-01-02 12:07:26 +01:00 committed by Alexandre Julliard
parent 8f32358b0d
commit 4f9814c536
3 changed files with 15 additions and 5 deletions

View File

@ -247,9 +247,12 @@ struct d3d10_rasterizer_state
{ {
ID3D10RasterizerState ID3D10RasterizerState_iface; ID3D10RasterizerState ID3D10RasterizerState_iface;
LONG refcount; LONG refcount;
D3D10_RASTERIZER_DESC desc;
}; };
HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state) DECLSPEC_HIDDEN; HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state,
const D3D10_RASTERIZER_DESC *desc) DECLSPEC_HIDDEN;
struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN; struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN;
/* ID3D10SamplerState */ /* ID3D10SamplerState */

View File

@ -1480,6 +1480,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device
TRACE("iface %p, desc %p, rasterizer_state %p.\n", iface, desc, rasterizer_state); TRACE("iface %p, desc %p, rasterizer_state %p.\n", iface, desc, rasterizer_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)
{ {
@ -1487,8 +1490,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
hr = d3d10_rasterizer_state_init(object); if (FAILED(hr = d3d10_rasterizer_state_init(object, desc)))
if (FAILED(hr))
{ {
WARN("Failed to initialize rasterizer state, hr %#x.\n", hr); WARN("Failed to initialize rasterizer state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);

View File

@ -392,7 +392,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateDataInterface(
static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface, static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface,
D3D10_RASTERIZER_DESC *desc) D3D10_RASTERIZER_DESC *desc)
{ {
FIXME("iface %p, desc %p stub!\n", iface, desc); struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
*desc = state->desc;
} }
static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl = static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
@ -410,10 +414,11 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
d3d10_rasterizer_state_GetDesc, d3d10_rasterizer_state_GetDesc,
}; };
HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state) HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state, const D3D10_RASTERIZER_DESC *desc)
{ {
state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl; state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl;
state->refcount = 1; state->refcount = 1;
state->desc = *desc;
return S_OK; return S_OK;
} }