d3d10: Handle blend state in d3d10_effect_object_apply().
This commit is contained in:
parent
cf799f5852
commit
eda5c39335
|
@ -76,6 +76,7 @@ struct d3d10_effect_object
|
|||
{
|
||||
ID3D10RasterizerState *rs;
|
||||
ID3D10DepthStencilState *ds;
|
||||
ID3D10BlendState *bs;
|
||||
ID3D10VertexShader *vs;
|
||||
ID3D10PixelShader *ps;
|
||||
ID3D10GeometryShader *gs;
|
||||
|
|
|
@ -1355,6 +1355,14 @@ static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr
|
|||
break;
|
||||
}
|
||||
|
||||
case D3D10_EOT_BLEND_STATE:
|
||||
{
|
||||
ID3D10EffectBlendVariable *bv = variable->lpVtbl->AsBlend(variable);
|
||||
if (FAILED(hr = bv->lpVtbl->GetBlendState(bv, variable_idx, &o->object.bs)))
|
||||
return hr;
|
||||
break;
|
||||
}
|
||||
|
||||
case D3D10_EOT_VERTEXSHADER:
|
||||
{
|
||||
ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable);
|
||||
|
@ -1385,7 +1393,6 @@ static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr
|
|||
break;
|
||||
}
|
||||
|
||||
case D3D10_EOT_BLEND_STATE:
|
||||
case D3D10_EOT_STENCIL_REF:
|
||||
case D3D10_EOT_BLEND_FACTOR:
|
||||
case D3D10_EOT_SAMPLE_MASK:
|
||||
|
@ -2181,6 +2188,10 @@ static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
|
|||
ID3D10Device_OMSetDepthStencilState(device, o->object.ds, o->pass->stencil_ref);
|
||||
return S_OK;
|
||||
|
||||
case D3D10_EOT_BLEND_STATE:
|
||||
ID3D10Device_OMSetBlendState(device, o->object.bs, o->pass->blend_factor, o->pass->sample_mask);
|
||||
return S_OK;
|
||||
|
||||
case D3D10_EOT_VERTEXSHADER:
|
||||
ID3D10Device_VSSetShader(device, o->object.vs);
|
||||
return S_OK;
|
||||
|
@ -2194,6 +2205,8 @@ static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
|
|||
return S_OK;
|
||||
|
||||
case D3D10_EOT_STENCIL_REF:
|
||||
case D3D10_EOT_BLEND_FACTOR:
|
||||
case D3D10_EOT_SAMPLE_MASK:
|
||||
return S_OK;
|
||||
|
||||
default:
|
||||
|
@ -2293,6 +2306,11 @@ static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
|
|||
ID3D10DepthStencilState_Release(o->object.ds);
|
||||
break;
|
||||
|
||||
case D3D10_EOT_BLEND_STATE:
|
||||
if (o->object.bs)
|
||||
ID3D10BlendState_Release(o->object.bs);
|
||||
break;
|
||||
|
||||
case D3D10_EOT_VERTEXSHADER:
|
||||
if (o->object.vs)
|
||||
ID3D10VertexShader_Release(o->object.vs);
|
||||
|
|
|
@ -3922,12 +3922,7 @@ static void test_effect_state_groups(ID3D10Device *device)
|
|||
ok(pass_desc.BlendFactor[2] == 0.7f, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc.BlendFactor[2]);
|
||||
ok(pass_desc.BlendFactor[3] == 0.8f, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc.BlendFactor[3]);
|
||||
hr = pass->lpVtbl->Apply(pass, 0);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to apply pass, hr %#x.\n", hr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
effect->lpVtbl->Release(effect);
|
||||
return;
|
||||
}
|
||||
ok(SUCCEEDED(hr), "Failed to apply pass, hr %#x.\n", hr);
|
||||
|
||||
ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
|
||||
ID3D10BlendState_GetDesc(blend_state, &blend_desc);
|
||||
|
@ -3958,7 +3953,7 @@ static void test_effect_state_groups(ID3D10Device *device)
|
|||
ok(!ds_desc.DepthEnable, "Got unexpected DepthEnable %#x.\n", ds_desc.DepthEnable);
|
||||
ok(ds_desc.DepthWriteMask == D3D10_DEPTH_WRITE_MASK_ZERO, "Got unexpected DepthWriteMask %#x.\n",
|
||||
ds_desc.DepthWriteMask);
|
||||
ok(ds_desc.DepthFunc == D3D10_COMPARISON_NEVER, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
|
||||
todo_wine ok(ds_desc.DepthFunc == D3D10_COMPARISON_NEVER, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
|
||||
ok(ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
|
||||
ok(ds_desc.StencilReadMask == 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc.StencilReadMask);
|
||||
ok(ds_desc.StencilWriteMask == 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc.StencilWriteMask);
|
||||
|
|
Loading…
Reference in New Issue