Commit fb2dac96 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10: Implement d3d10_effect_blend_variable_GetBlendState().

parent 13c00a9d
...@@ -109,6 +109,10 @@ struct d3d10_effect_state_object_variable ...@@ -109,6 +109,10 @@ struct d3d10_effect_state_object_variable
D3D10_BLEND_DESC blend; D3D10_BLEND_DESC blend;
D3D10_SAMPLER_DESC sampler; D3D10_SAMPLER_DESC sampler;
} desc; } desc;
union
{
ID3D10BlendState *blend;
} object;
}; };
/* ID3D10EffectType */ /* ID3D10EffectType */
......
...@@ -1561,6 +1561,32 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char * ...@@ -1561,6 +1561,32 @@ static HRESULT parse_fx10_variable(struct d3d10_effect_variable *v, const char *
return S_OK; return S_OK;
} }
static HRESULT create_state_object(struct d3d10_effect_variable *v)
{
ID3D10Device *device = v->effect->device;
HRESULT hr;
switch (v->type->basetype)
{
case D3D10_SVT_BLEND:
if (FAILED(hr = ID3D10Device_CreateBlendState(device,
&v->u.state.desc.blend, &v->u.state.object.blend)))
return hr;
break;
case D3D10_SVT_DEPTHSTENCIL:
case D3D10_SVT_RASTERIZER:
case D3D10_SVT_SAMPLER:
break;
default:
ERR("Unhandled variable type %s.\n", debug_d3d10_shader_variable_type(v->type->basetype));
return E_FAIL;
}
return S_OK;
}
static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data) static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const char **ptr, const char *data)
{ {
unsigned int i; unsigned int i;
...@@ -1660,6 +1686,9 @@ static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const ...@@ -1660,6 +1686,9 @@ static HRESULT parse_fx10_local_variable(struct d3d10_effect_variable *v, const
ERR("Failed to read property list.\n"); ERR("Failed to read property list.\n");
return E_FAIL; return E_FAIL;
} }
if (FAILED(hr = create_state_object(v)))
return hr;
} }
} }
break; break;
...@@ -5984,9 +6013,25 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10E ...@@ -5984,9 +6013,25 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetRawValue(ID3D10E
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface, static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBlendState(ID3D10EffectBlendVariable *iface,
UINT index, ID3D10BlendState **blend_state) UINT index, ID3D10BlendState **blend_state)
{ {
FIXME("iface %p, index %u, blend_state %p stub!\n", iface, index, blend_state); struct d3d10_effect_variable *v = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)iface);
return E_NOTIMPL; TRACE("iface %p, index %u, blend_state %p.\n", iface, index, blend_state);
if (v->type->element_count)
v = impl_from_ID3D10EffectVariable(iface->lpVtbl->GetElement(iface, index));
else if (index)
return E_FAIL;
if (v->type->basetype != D3D10_SVT_BLEND)
{
WARN("Variable is not a blend state.\n");
return E_FAIL;
}
if ((*blend_state = v->u.state.object.blend))
ID3D10BlendState_AddRef(*blend_state);
return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface, static HRESULT STDMETHODCALLTYPE d3d10_effect_blend_variable_GetBackingStore(ID3D10EffectBlendVariable *iface,
......
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