Commit 63ee26f2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Use shader variable directly from pass structure on Apply().

parent 8257d1ef
......@@ -73,19 +73,6 @@ struct d3d10_matrix
float m[4][4];
};
struct d3d10_effect_object
{
struct d3d10_effect_pass *pass;
enum d3d10_effect_object_type type;
union
{
ID3D10VertexShader *vs;
ID3D10PixelShader *ps;
ID3D10GeometryShader *gs;
IUnknown *object;
} object;
};
struct d3d10_effect_shader_resource
{
D3D10_SHADER_INPUT_TYPE in_type;
......@@ -236,9 +223,7 @@ struct d3d10_effect_pass
struct d3d10_effect_technique *technique;
char *name;
DWORD object_count;
DWORD annotation_count;
struct d3d10_effect_object *objects;
struct d3d10_effect_variable *annotations;
struct d3d10_effect_pass_shader_desc vs;
......
......@@ -2909,6 +2909,7 @@ static void test_effect_local_shader(void)
D3D10_EFFECT_DESC effect_desc;
ID3D10EffectShaderVariable *null_shader, *null_anon_vs, *null_anon_ps, *null_anon_gs,
*p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs, *gs, *ps, *vs;
ID3D10PixelShader *ps_d3d, *ps_d3d_2;
D3D10_EFFECT_SHADER_DESC shaderdesc;
D3D10_SIGNATURE_PARAMETER_DESC sign;
D3D10_STATE_BLOCK_MASK mask;
......@@ -3005,6 +3006,12 @@ if (0)
hr = p->lpVtbl->GetGeometryShaderDesc(p, NULL);
ok(hr == E_INVALIDARG, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
v = effect->lpVtbl->GetVariableByName(effect, "p");
ps = v->lpVtbl->AsShader(v);
hr = ps->lpVtbl->GetPixelShader(ps, 0, &ps_d3d);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
/* get the null_shader_variable */
v = effect->lpVtbl->GetVariableByIndex(effect, 10000);
null_shader = v->lpVtbl->AsShader(v);
......@@ -3024,6 +3031,13 @@ if (0)
ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_GS, 0);
ok(!ret, "Unexpected mask.\n");
ID3D10Device_PSSetShader(device, ps_d3d);
hr = p->lpVtbl->Apply(p, 0);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ID3D10Device_PSGetShader(device, &ps_d3d_2);
ok(ps_d3d_2 == ps_d3d, "Unexpected shader object.\n");
ID3D10PixelShader_Release(ps_d3d_2);
hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
......@@ -3051,6 +3065,12 @@ if (0)
/* pass 1 */
p = t->lpVtbl->GetPassByIndex(t, 1);
ID3D10Device_PSSetShader(device, ps_d3d);
hr = p->lpVtbl->Apply(p, 0);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ID3D10Device_PSGetShader(device, &ps_d3d_2);
ok(!ps_d3d_2, "Unexpected shader object.\n");
/* pass 1 vertexshader */
hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
......@@ -3881,6 +3901,8 @@ todo_wine
effect->lpVtbl->Release(effect);
ID3D10PixelShader_Release(ps_d3d);
refcount = ID3D10Device_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}
......
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