Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 50 ++++++++++++--------- dlls/d3d10/tests/effect.c | 91 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 70a99601eea..8ff7ed53963 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3973,6 +3973,29 @@ static void update_buffer(ID3D10Device *device, struct d3d10_effect_variable *v) b->changed = FALSE; }
+static void set_sampler(ID3D10Device *device, D3D10_SHADER_VARIABLE_TYPE shader_type, + struct d3d10_effect_variable *v, unsigned int bind_point) +{ + switch (shader_type) + { + case D3D10_SVT_VERTEXSHADER: + ID3D10Device_VSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + case D3D10_SVT_PIXELSHADER: + ID3D10Device_PSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + case D3D10_SVT_GEOMETRYSHADER: + ID3D10Device_GSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + default: + WARN("Incorrect shader type to bind sampler.\n"); + break; + } +} + static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShaderVariable *variable) { struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(variable); @@ -3980,7 +4003,7 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad struct d3d10_effect_shader_resource *sr; struct d3d10_effect_variable *rsrc_v; ID3D10ShaderResourceView **srv; - unsigned int i; + unsigned int i, j;
for (i = 0; i < sv->resource_count; ++i) { @@ -4045,27 +4068,14 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad break;
case D3D10_SIT_SAMPLER: - switch (v->type->basetype) + if (!rsrc_v->type->element_count) { - case D3D10_SVT_VERTEXSHADER: - ID3D10Device_VSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - case D3D10_SVT_PIXELSHADER: - ID3D10Device_PSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - case D3D10_SVT_GEOMETRYSHADER: - ID3D10Device_GSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - default: - WARN("Incorrect shader type to bind sampler.\n"); - break; + set_sampler(device, v->type->basetype, rsrc_v, sr->bind_point); + break; } + + for (j = 0; j < sr->bind_count; ++j) + set_sampler(device, v->type->basetype, &rsrc_v->elements[j], sr->bind_point + j); break;
default: diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 60be8186f8b..f7b536b2fb0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5769,6 +5769,55 @@ static DWORD fx_test_resource_variable[] = 0x00070000, 0x02120000, 0x00070000, 0x00000000, 0x00070000, 0x057a0000, 0x00000000, };
+#if 0 +Texture2D t_a[2]; + +SamplerState s[2] : register(s1); + +float4 PS( float4 pos : SV_POSITION ) : SV_Target +{ + return t_a[1].Sample(s[1], float2(0, 0)); +} + +technique10 rsrc_test +{ + pass p0 + { + SetPixelShader(CompileShader(ps_4_0, PS())); + } +} +#endif +static DWORD fx_test_resource_variable2[] = +{ + 0x43425844, 0xb62313ac, 0x8116090b, 0xdc1d2951, 0xfc18ca42, 0x00000001, 0x0000035a, 0x00000001, + 0x00000024, 0x30315846, 0x0000032e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x0000028a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74786554, + 0x32657275, 0x00040044, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000, + 0x5f740000, 0x61530061, 0x656c706d, 0x61745372, 0x2e006574, 0x02000000, 0x02000000, 0x00000000, + 0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x72737200, 0x65745f63, 0x70007473, 0x02180030, + 0x58440000, 0xb2424342, 0x3c889e83, 0xb8b8fc18, 0x749f2920, 0x0001877a, 0x02180000, 0x00050000, + 0x00340000, 0x00c80000, 0x00fc0000, 0x01300000, 0x019c0000, 0x44520000, 0x008c4645, 0x00000000, + 0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x0100ffff, 0x00620000, 0x005c0000, 0x00030000, + 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00020000, 0x00010000, 0x005e0000, 0x00020000, + 0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00020000, 0x000c0000, 0x00730000, 0x00615f74, + 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, + 0x31207265, 0x00312e30, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, + 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, + 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, + 0x000f0000, 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000, + 0x005a0000, 0x60000300, 0x00020010, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x00650000, + 0x20f20300, 0x00000010, 0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x60000000, 0x00020010, 0x003e0000, 0x54530100, + 0x00745441, 0x00020000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00660000, 0x00000000, + 0x002a0000, 0x000e0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00570000, 0x003b0000, 0x00000000, + 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000, 0x00590000, 0x00010000, 0x00000000, 0x00630000, + 0x00010000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x02820000, 0x00000000, +}; + static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv, ID3D10Texture2D **tex) { @@ -5812,10 +5861,13 @@ static ID3D10EffectShaderResourceVariable *get_effect_shader_resource_variable_(
static void test_effect_resource_variable(void) { + ID3D10SamplerState *samplers[D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT]; ID3D10ShaderResourceView *srv0, *srv_a[2], *srv_tmp[2]; ID3D10EffectShaderResourceVariable *t0, *t_a, *t_a_0; ID3D10EffectTechnique *technique; ID3D10Texture2D *tex0, *tex_a[2]; + ID3D10EffectSamplerVariable *s; + ID3D10SamplerState *sampler[2]; D3D10_EFFECT_DESC effect_desc; D3D10_PASS_DESC pass_desc; ID3D10EffectVariable *var; @@ -5938,6 +5990,45 @@ static void test_effect_resource_variable(void)
effect->lpVtbl->Release(effect);
+ hr = create_effect(fx_test_resource_variable2, 0, device, NULL, &effect); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + technique = effect->lpVtbl->GetTechniqueByName(effect, "rsrc_test"); + ok(!!technique, "Got unexpected technique %p.\n", technique); + pass = technique->lpVtbl->GetPassByName(technique, "p0"); + ok(!!pass, "Got unexpected pass %p.\n", pass); + + var = effect->lpVtbl->GetVariableByName(effect, "s"); + ok(var->lpVtbl->IsValid(var), "Expected valid variable.\n"); + + s = var->lpVtbl->AsSampler(var); + ok(s->lpVtbl->IsValid(s), "Expected valid sample variable.\n"); + + hr = s->lpVtbl->GetSampler(s, 0, &sampler[0]); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = s->lpVtbl->GetSampler(s, 1, &sampler[1]); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ID3D10Device_PSGetSamplers(device, 0, ARRAY_SIZE(samplers), samplers); + for (i = 0; i < ARRAY_SIZE(samplers); ++i) + { + if (i == 1 || i == 2) + { + ok(samplers[i] == sampler[i - 1], "Unexpected sampler at %u.\n", i); + } + else + ok(!samplers[i], "Unexpected sampler at %u.\n", i); + if (samplers[i]) + ID3D10SamplerState_Release(samplers[i]); + } + for (i = 0; i < ARRAY_SIZE(sampler); ++i) + ID3D10SamplerState_Release(sampler[i]); + + effect->lpVtbl->Release(effect); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 1 + dlls/d3d10/effect.c | 26 +++++++--- dlls/d3d10/tests/effect.c | 100 +++++++++++++++++++++++++------------ 3 files changed, 88 insertions(+), 39 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index e7ecfb73a64..38733862753 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -259,6 +259,7 @@ struct d3d10_effect_anonymous_shader enum d3d10_effect_flags { D3D10_EFFECT_OPTIMIZED = 0x1, + D3D10_EFFECT_IS_POOL = 0x2, };
/* ID3D10Effect */ diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 8ff7ed53963..3cd69192f4c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1405,6 +1405,9 @@ static HRESULT parse_fx10_variable_head(const char *data, size_t data_size,
v->explicit_bind_point = ~0u;
+ if (v->effect->flags & D3D10_EFFECT_IS_POOL) + v->flag |= D3D10_EFFECT_VARIABLE_POOLED; + return copy_variableinfo_from_type(v); }
@@ -1435,7 +1438,7 @@ static HRESULT parse_fx10_annotation(const char *data, size_t data_size, }
/* mark the variable as annotation */ - a->flag = D3D10_EFFECT_VARIABLE_ANNOTATION; + a->flag |= D3D10_EFFECT_VARIABLE_ANNOTATION;
return S_OK; } @@ -2083,7 +2086,7 @@ static HRESULT parse_fx10_technique(const char *data, size_t data_size, static HRESULT parse_fx10_numeric_variable(const char *data, size_t data_size, const char **ptr, BOOL local, struct d3d10_effect_variable *v) { - DWORD offset, default_value_offset; + DWORD offset, flags, default_value_offset; HRESULT hr;
if (FAILED(hr = parse_fx10_variable_head(data, data_size, ptr, v))) @@ -2104,8 +2107,10 @@ static HRESULT parse_fx10_numeric_variable(const char *data, size_t data_size,
read_dword(ptr, &default_value_offset);
- read_dword(ptr, &v->flag); - TRACE("Variable flag: %#x.\n", v->flag); + read_dword(ptr, &flags); + TRACE("Variable flags: %#x.\n", flags); + + v->flag |= flags;
if (local) { @@ -2451,6 +2456,9 @@ static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char read_dword(ptr, &l->explicit_bind_point); TRACE("%s buffer explicit bind point: %#x.\n", prefix, l->explicit_bind_point);
+ if (l->effect->flags & D3D10_EFFECT_IS_POOL) + l->flag |= D3D10_EFFECT_VARIABLE_POOLED; + if (local) { read_dword(ptr, &l->annotation_count); @@ -8590,7 +8598,7 @@ static int d3d10_effect_type_compare(const void *key, const struct wine_rb_entry }
static HRESULT d3d10_create_effect(void *data, SIZE_T data_size, ID3D10Device *device, - ID3D10Effect *pool, const ID3D10EffectVtbl *vtbl, struct d3d10_effect **effect) + ID3D10Effect *pool, unsigned int flags, struct d3d10_effect **effect) { struct d3d10_effect *object; HRESULT hr; @@ -8599,12 +8607,14 @@ static HRESULT d3d10_create_effect(void *data, SIZE_T data_size, ID3D10Device *d return E_OUTOFMEMORY;
wine_rb_init(&object->types, d3d10_effect_type_compare); - object->ID3D10Effect_iface.lpVtbl = vtbl; + object->ID3D10Effect_iface.lpVtbl = flags & D3D10_EFFECT_IS_POOL ? + &d3d10_effect_pool_effect_vtbl : &d3d10_effect_vtbl; object->ID3D10EffectPool_iface.lpVtbl = &d3d10_effect_pool_vtbl; object->refcount = 1; ID3D10Device_AddRef(device); object->device = device; object->pool = pool; + object->flags = flags; if (pool) pool->lpVtbl->AddRef(pool);
hr = d3d10_effect_parse(object, data, data_size); @@ -8643,7 +8653,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl } }
- if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, &d3d10_effect_vtbl, &object))) + if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object))) { WARN("Failed to create an effect, hr %#x.\n", hr); } @@ -8697,7 +8707,7 @@ HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UIN data, data_size, fx_flags, device, effect_pool);
if (FAILED(hr = d3d10_create_effect(data, data_size, device, NULL, - &d3d10_effect_pool_effect_vtbl, &object))) + D3D10_EFFECT_IS_POOL, &object))) { WARN("Failed to create an effect, hr %#x.\n", hr); return hr; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index f7b536b2fb0..2cef4d425f3 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -1519,7 +1519,7 @@ static void test_effect_variable_type_class(void)
ok(strcmp(vd.Name, "s") == 0, "Name is "%s", expected "s"\n", vd.Name); ok(vd.Semantic == NULL, "Semantic is "%s", expected NULL\n", vd.Semantic); - ok(vd.Flags == 2, "Flags is %u, expected 2\n", vd.Flags); + ok(vd.Flags == D3D10_EFFECT_VARIABLE_ANNOTATION, "Unexpected flags %#x.\n", vd.Flags); ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations); ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset); ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint); @@ -6321,7 +6321,7 @@ static void test_effect_shader_object(void) }
#if 0 -cbuffer s_cb +cbuffer s_cb <String s = "value"; > { float f1 : COLOR0; float f2 : COLOR1; @@ -6331,6 +6331,11 @@ BlendState s_blendstate; Texture2D s_texture; PixelShader ps;
+float4 VS( float4 pos : POSITION ) : SV_POSITION +{ + return f1.xxxx; +} + technique10 tech { pass P0 @@ -6339,29 +6344,54 @@ technique10 tech SetVertexShader(NULL); SetGeometryShader(NULL); } + + pass P1 + { + SetVertexShader(CompileShader(vs_4_0, VS())); + } }; #endif static DWORD fx_test_pool[] = { - 0x43425844, 0x92a09896, 0xbc72ed33, 0x77194b8a, 0xb1132991, 0x00000001, 0x00000242, 0x00000001, - 0x00000024, 0x30315846, 0x00000216, 0xfeff1001, 0x00000001, 0x00000002, 0x00000003, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000000ee, 0x00000000, 0x00000001, 0x00000000, 0x00000001, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x62635f73, - 0x6f6c6600, 0x09007461, 0x01000000, 0x00000000, 0x04000000, 0x10000000, 0x04000000, 0x09000000, - 0x66000009, 0x4f430031, 0x30524f4c, 0x00326600, 0x4f4c4f43, 0x42003152, 0x646e656c, 0x74617453, - 0x003f0065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x5f730000, - 0x6e656c62, 0x61747364, 0x54006574, 0x75747865, 0x44326572, 0x00007300, 0x00000200, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000c00, 0x745f7300, 0x75747865, 0x50006572, 0x6c657869, - 0x64616853, 0xa3007265, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x05000000, - 0x70000000, 0x65740073, 0x50006863, 0x00010030, 0x00020000, 0x00000000, 0x00010000, 0x00020000, - 0x00000000, 0x00040000, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x002b0000, - 0x000f0000, 0x002e0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00350000, 0x000f0000, - 0x00380000, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00660000, 0x004a0000, 0x00000000, - 0xffff0000, 0x0000ffff, 0x00000000, 0x00990000, 0x007d0000, 0x00000000, 0xffff0000, 0x0000ffff, - 0x00cb0000, 0x00af0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00ce0000, 0x00010000, - 0x00000000, 0x00d30000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x00cb0000, - 0x00060000, 0x00000000, 0x00010000, 0x00d60000, 0x00080000, 0x00000000, 0x00010000, 0x00e20000, - 0x00000000, + 0x43425844, 0x5a29c5ce, 0xa6970df1, 0x3b2ae8f2, 0x7b225509, 0x00000001, 0x000004dc, 0x00000001, + 0x00000024, 0x30315846, 0x000004b0, 0xfeff1001, 0x00000001, 0x00000002, 0x00000003, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000360, 0x00000000, 0x00000001, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x62635f73, + 0x72745300, 0x00676e69, 0x00000009, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x61760073, 0x0065756c, 0x616f6c66, 0x00340074, 0x00010000, 0x00000000, 0x00040000, + 0x00100000, 0x00040000, 0x09090000, 0x31660000, 0x4c4f4300, 0x0030524f, 0x43003266, 0x524f4c4f, + 0x6c420031, 0x53646e65, 0x65746174, 0x00006a00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000200, 0x625f7300, 0x646e656c, 0x74617473, 0x65540065, 0x72757478, 0x00443265, + 0x0000009e, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x65745f73, + 0x72757478, 0x69500065, 0x536c6578, 0x65646168, 0x00ce0072, 0x00020000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00050000, 0x73700000, 0x63657400, 0x30500068, 0x00000100, 0x00000200, + 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00315000, 0x00000238, 0x43425844, 0x37b3f12d, + 0x2579b942, 0x27ed5925, 0x4a80132c, 0x00000001, 0x00000238, 0x00000005, 0x00000034, 0x00000108, + 0x0000013c, 0x00000170, 0x000001bc, 0x46454452, 0x000000cc, 0x00000001, 0x00000044, 0x00000001, + 0x0000001c, 0xfffe0400, 0x00000100, 0x000000a3, 0x0000003c, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x62635f73, 0xababab00, 0x0000003c, 0x00000002, + 0x0000005c, 0x00000010, 0x00000000, 0x00000000, 0x0000008c, 0x00000000, 0x00000004, 0x00000002, + 0x00000090, 0x00000000, 0x000000a0, 0x00000004, 0x00000004, 0x00000000, 0x00000090, 0x00000000, + 0xab003166, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x4d003266, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, + 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x49534f50, 0x4e4f4954, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, + 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, + 0x5449534f, 0x004e4f49, 0x52444853, 0x00000044, 0x00010040, 0x00000011, 0x04000059, 0x00208e46, + 0x00000000, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x06000036, 0x001020f2, + 0x00000000, 0x00208006, 0x00000000, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000011c, 0x00000000, 0x00000004, 0x00000010, + 0x00000000, 0x00000002, 0xffffffff, 0x00000001, 0x0000002c, 0x00000010, 0x0000002e, 0x00000056, + 0x0000003a, 0x00000059, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000060, 0x0000003a, + 0x00000063, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000091, 0x00000075, 0x00000000, + 0xffffffff, 0x00000000, 0x00000000, 0x000000c4, 0x000000a8, 0x00000000, 0xffffffff, 0x00000000, + 0x000000f6, 0x000000da, 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x000000f9, 0x00000002, + 0x00000000, 0x000000fe, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000002, 0x000000f6, + 0x00000006, 0x00000000, 0x00000001, 0x00000101, 0x00000008, 0x00000000, 0x00000001, 0x0000010d, + 0x00000119, 0x00000001, 0x00000000, 0x00000006, 0x00000000, 0x00000007, 0x00000358, };
/* Compiled as a child with /Gch (D3DCOMPILE_EFFECT_CHILD_EFFECT) */ @@ -6476,8 +6506,8 @@ static void test_effect_pool(void) ID3D10EffectPool *pool, *pool2; ID3D10EffectConstantBuffer *cb; ID3D10EffectShaderVariable *sv; + ID3D10EffectVariable *v, *a; ID3D10EffectTechnique *t; - ID3D10EffectVariable *v; ID3D10EffectPass *pass; D3D10_EFFECT_DESC desc; ID3D10Buffer *buffer; @@ -6555,28 +6585,41 @@ todo_wine hr = cb->lpVtbl->GetDesc(cb, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); + a = cb->lpVtbl->GetAnnotationByIndex(cb, 0); + ok(a->lpVtbl->IsValid(a), "Expected valid annotation.\n"); + hr = a->lpVtbl->GetDesc(a, &var_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(var_desc.Name, "s"), "Unexpected name %s.\n", var_desc.Name); + ok(var_desc.Flags == (D3D10_EFFECT_VARIABLE_POOLED | D3D10_EFFECT_VARIABLE_ANNOTATION), + "Unexpected flags %#x.\n", var_desc.Flags); + + t = effect->lpVtbl->GetTechniqueByIndex(effect, 0); + pass = t->lpVtbl->GetPassByName(t, "P1"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); + hr = pass->lpVtbl->GetVertexShaderDesc(pass, &shader_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = shader_desc.pShaderVariable->lpVtbl->GetDesc(shader_desc.pShaderVariable, &var_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(var_desc.Name, "$Anonymous"), "Unexpected name %s.\n", var_desc.Name); + ok(!var_desc.Flags, "Unexpected flags %#x.\n", var_desc.Flags);
v = effect->lpVtbl->GetVariableByName(effect, "s_blendstate"); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "s_blendstate"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = effect->lpVtbl->GetVariableByName(effect, "s_texture"); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = effect->lpVtbl->GetVariableByName(effect, "ps"); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "ps"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
t = effect->lpVtbl->GetTechniqueByIndex(effect, 0); @@ -6716,7 +6759,6 @@ todo_wine hr = cb->lpVtbl->GetDesc(cb, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
/* Pool techniques are not accessible */ @@ -6749,21 +6791,18 @@ todo_wine hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "f1"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableByIndex(child_effect, 4); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableByName(child_effect, "s_texture"); hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableBySemantic(child_effect, "COLOR0"); @@ -6776,7 +6815,6 @@ todo_wine hr = v->lpVtbl->GetDesc(v, &var_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); -todo_wine ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
child_effect->lpVtbl->Release(child_effect);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 38733862753..648a7b0240a 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -223,7 +223,6 @@ struct d3d10_effect_pass
struct d3d10_effect_technique *technique; char *name; - DWORD start; DWORD object_count; DWORD annotation_count; struct d3d10_effect_object *objects;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 ++ dlls/d3d10/effect.c | 40 ++++---------------------------------- 2 files changed, 6 insertions(+), 36 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 648a7b0240a..f980007427f 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -83,6 +83,7 @@ struct d3d10_effect_object ID3D10VertexShader *vs; ID3D10PixelShader *ps; ID3D10GeometryShader *gs; + IUnknown *object; } object; };
@@ -136,6 +137,7 @@ struct d3d10_effect_state_object_variable ID3D10DepthStencilState *depth_stencil; ID3D10BlendState *blend; ID3D10SamplerState *sampler; + IUnknown *object; } object; };
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 3cd69192f4c..26634895ce1 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3017,23 +3017,11 @@ static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v) break;
case D3D10_SVT_DEPTHSTENCIL: - if (v->u.state.object.depth_stencil) - ID3D10DepthStencilState_Release(v->u.state.object.depth_stencil); - break; - case D3D10_SVT_BLEND: - if (v->u.state.object.blend) - ID3D10BlendState_Release(v->u.state.object.blend); - break; - case D3D10_SVT_RASTERIZER: - if (v->u.state.object.rasterizer) - ID3D10RasterizerState_Release(v->u.state.object.rasterizer); - break; - case D3D10_SVT_SAMPLER: - if (v->u.state.object.sampler) - ID3D10SamplerState_Release(v->u.state.object.sampler); + if (v->u.state.object.object) + IUnknown_Release(v->u.state.object.object); break;
case D3D10_SVT_TEXTURE1D: @@ -3076,33 +3064,13 @@ static void d3d10_effect_object_destroy(struct d3d10_effect_object *o) switch (o->type) { case D3D10_EOT_RASTERIZER_STATE: - if (o->object.rs) - ID3D10RasterizerState_Release(o->object.rs); - break; - case D3D10_EOT_DEPTH_STENCIL_STATE: - if (o->object.ds) - 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); - break; - case D3D10_EOT_PIXELSHADER: - if (o->object.ps) - ID3D10PixelShader_Release(o->object.ps); - break; - case D3D10_EOT_GEOMETRYSHADER: - if (o->object.gs) - ID3D10GeometryShader_Release(o->object.gs); + if (o->object.object) + IUnknown_Release(o->object.object); break;
default:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
The point is to have pass fields later in same property description data, and passes are not shader objects, with no corresponding SVT type.
dlls/d3d10/effect.c | 114 ++++++++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 46 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 26634895ce1..5d5db4eea6c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -134,6 +134,27 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderVariable return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface); }
+enum d3d10_effect_container_type +{ + D3D10_C_NONE, + D3D10_C_RASTERIZER, + D3D10_C_DEPTHSTENCIL, + D3D10_C_BLEND, + D3D10_C_SAMPLER, +}; + +static enum d3d10_effect_container_type get_var_container_type(const struct d3d10_effect_variable *v) +{ + switch (v->type->basetype) + { + case D3D10_SVT_DEPTHSTENCIL: return D3D10_C_DEPTHSTENCIL; + case D3D10_SVT_BLEND: return D3D10_C_BLEND; + case D3D10_SVT_RASTERIZER: return D3D10_C_RASTERIZER; + case D3D10_SVT_SAMPLER: return D3D10_C_SAMPLER; + default: return D3D10_C_NONE; + } +} + struct d3d10_effect_state_property_info { UINT id; @@ -141,55 +162,55 @@ struct d3d10_effect_state_property_info D3D_SHADER_VARIABLE_TYPE type; UINT size; UINT count; - D3D_SHADER_VARIABLE_TYPE container_type; + enum d3d10_effect_container_type container_type; LONG offset; };
static const struct d3d10_effect_state_property_info property_info[] = { - {0x0c, "RasterizerState.FillMode", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FillMode) }, - {0x0d, "RasterizerState.CullMode", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, CullMode) }, - {0x0e, "RasterizerState.FrontCounterClockwise", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FrontCounterClockwise) }, - {0x0f, "RasterizerState.DepthBias", D3D10_SVT_INT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBias) }, - {0x10, "RasterizerState.DepthBiasClamp", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBiasClamp) }, - {0x11, "RasterizerState.SlopeScaledDepthBias", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, SlopeScaledDepthBias) }, - {0x12, "RasterizerState.DepthClipEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthClipEnable) }, - {0x13, "RasterizerState.ScissorEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, ScissorEnable) }, - {0x14, "RasterizerState.MultisampleEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, MultisampleEnable) }, - {0x15, "RasterizerState.AntialiasedLineEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, AntialiasedLineEnable) }, - {0x16, "DepthStencilState.DepthEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthEnable) }, - {0x17, "DepthStencilState.DepthWriteMask", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthWriteMask) }, - {0x18, "DepthStencilState.DepthFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthFunc) }, - {0x19, "DepthStencilState.StencilEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilEnable) }, - {0x1a, "DepthStencilState.StencilReadMask", D3D10_SVT_UINT8, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilReadMask) }, - {0x1b, "DepthStencilState.StencilWriteMask", D3D10_SVT_UINT8, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilWriteMask) }, - {0x1c, "DepthStencilState.FrontFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFailOp) }, - {0x1d, "DepthStencilState.FrontFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilDepthFailOp)}, - {0x1e, "DepthStencilState.FrontFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilPassOp) }, - {0x1f, "DepthStencilState.FrontFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFunc) }, - {0x20, "DepthStencilState.BackFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFailOp) }, - {0x21, "DepthStencilState.BackFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilDepthFailOp) }, - {0x22, "DepthStencilState.BackFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilPassOp) }, - {0x23, "DepthStencilState.BackFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFunc) }, - {0x24, "BlendState.AlphaToCoverageEnable", D3D10_SVT_BOOL, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, AlphaToCoverageEnable) }, - {0x25, "BlendState.BlendEnable", D3D10_SVT_BOOL, 1, 8, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendEnable) }, - {0x26, "BlendState.SrcBlend", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlend) }, - {0x27, "BlendState.DestBlend", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlend) }, - {0x28, "BlendState.BlendOp", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOp) }, - {0x29, "BlendState.SrcBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlendAlpha) }, - {0x2a, "BlendState.DestBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlendAlpha) }, - {0x2b, "BlendState.BlendOpAlpha", D3D10_SVT_INT, 1, 1, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOpAlpha) }, - {0x2c, "BlendState.RenderTargetWriteMask", D3D10_SVT_UINT8, 1, 8, D3D10_SVT_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, RenderTargetWriteMask) }, - {0x2d, "SamplerState.Filter", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, Filter) }, - {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressU) }, - {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressV) }, - {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressW) }, - {0x31, "SamplerState.MipMapLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MipLODBias) }, - {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxAnisotropy) }, - {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, ComparisonFunc) }, - {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, BorderColor) }, - {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MinLOD) }, - {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_SVT_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxLOD) }, + {0x0c, "RasterizerState.FillMode", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FillMode) }, + {0x0d, "RasterizerState.CullMode", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, CullMode) }, + {0x0e, "RasterizerState.FrontCounterClockwise", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, FrontCounterClockwise) }, + {0x0f, "RasterizerState.DepthBias", D3D10_SVT_INT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBias) }, + {0x10, "RasterizerState.DepthBiasClamp", D3D10_SVT_FLOAT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthBiasClamp) }, + {0x11, "RasterizerState.SlopeScaledDepthBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, SlopeScaledDepthBias) }, + {0x12, "RasterizerState.DepthClipEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, DepthClipEnable) }, + {0x13, "RasterizerState.ScissorEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, ScissorEnable) }, + {0x14, "RasterizerState.MultisampleEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, MultisampleEnable) }, + {0x15, "RasterizerState.AntialiasedLineEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_RASTERIZER, FIELD_OFFSET(D3D10_RASTERIZER_DESC, AntialiasedLineEnable) }, + {0x16, "DepthStencilState.DepthEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthEnable) }, + {0x17, "DepthStencilState.DepthWriteMask", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthWriteMask) }, + {0x18, "DepthStencilState.DepthFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, DepthFunc) }, + {0x19, "DepthStencilState.StencilEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilEnable) }, + {0x1a, "DepthStencilState.StencilReadMask", D3D10_SVT_UINT8, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilReadMask) }, + {0x1b, "DepthStencilState.StencilWriteMask", D3D10_SVT_UINT8, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, StencilWriteMask) }, + {0x1c, "DepthStencilState.FrontFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFailOp) }, + {0x1d, "DepthStencilState.FrontFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilDepthFailOp)}, + {0x1e, "DepthStencilState.FrontFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilPassOp) }, + {0x1f, "DepthStencilState.FrontFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, FrontFace.StencilFunc) }, + {0x20, "DepthStencilState.BackFaceStencilFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFailOp) }, + {0x21, "DepthStencilState.BackFaceStencilDepthFail", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilDepthFailOp) }, + {0x22, "DepthStencilState.BackFaceStencilPass", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilPassOp) }, + {0x23, "DepthStencilState.BackFaceStencilFunc", D3D10_SVT_INT, 1, 1, D3D10_C_DEPTHSTENCIL, FIELD_OFFSET(D3D10_DEPTH_STENCIL_DESC, BackFace.StencilFunc) }, + {0x24, "BlendState.AlphaToCoverageEnable", D3D10_SVT_BOOL, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, AlphaToCoverageEnable) }, + {0x25, "BlendState.BlendEnable", D3D10_SVT_BOOL, 1, 8, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendEnable) }, + {0x26, "BlendState.SrcBlend", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlend) }, + {0x27, "BlendState.DestBlend", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlend) }, + {0x28, "BlendState.BlendOp", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOp) }, + {0x29, "BlendState.SrcBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, SrcBlendAlpha) }, + {0x2a, "BlendState.DestBlendAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, DestBlendAlpha) }, + {0x2b, "BlendState.BlendOpAlpha", D3D10_SVT_INT, 1, 1, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, BlendOpAlpha) }, + {0x2c, "BlendState.RenderTargetWriteMask", D3D10_SVT_UINT8, 1, 8, D3D10_C_BLEND, FIELD_OFFSET(D3D10_BLEND_DESC, RenderTargetWriteMask) }, + {0x2d, "SamplerState.Filter", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, Filter) }, + {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressU) }, + {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressV) }, + {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, AddressW) }, + {0x31, "SamplerState.MipMapLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MipLODBias) }, + {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxAnisotropy) }, + {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, ComparisonFunc) }, + {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, BorderColor) }, + {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MinLOD) }, + {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(D3D10_SAMPLER_DESC, MaxLOD) }, };
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -1680,7 +1701,7 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, }
static BOOL parse_fx10_state_group(const char *data, size_t data_size, - const char **ptr, D3D_SHADER_VARIABLE_TYPE container_type, void *container) + const char **ptr, enum d3d10_effect_container_type container_type, void *container) { const struct d3d10_effect_state_property_info *property_info; UINT value_offset, operation; @@ -2310,7 +2331,8 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, var = v;
memcpy(&var->u.state.desc, storage_info->default_state, storage_info->size); - if (!parse_fx10_state_group(data, data_size, ptr, var->type->basetype, &var->u.state.desc)) + if (!parse_fx10_state_group(data, data_size, ptr, get_var_container_type(var), + &var->u.state.desc)) { ERR("Failed to read property list.\n"); return E_FAIL;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
The point is to have pass fields later in same property description data, and passes are not shader objects, with no corresponding SVT type.
Any examples of those properties?
On 10/1/21 11:06 PM, Matteo Bruni wrote:
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
The point is to have pass fields later in same property description data, and passes are not shader objects, with no corresponding SVT type.
Any examples of those properties?
Numerical ones are stencil_ref, blend_factor, sample_mask fields as they are called now. The rest is objects, to be represented with variable pointers.
All of that could be dynamic, e.g. you can set SetBlendState(var1, var2, var3) and have that updated when necessary.
On 10/1/21 11:06 PM, Matteo Bruni wrote:
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
The point is to have pass fields later in same property description data, and passes are not shader objects, with no corresponding SVT type.
Any examples of those properties?
I have to mention in case it's not obvious, values we have in d3d10_effect_object_type enum is how property_info table starts, it's numbered sequentially for all possible fields of all object types, with no gaps. So once you know the index is in bounds, you don't need to search for it.
E.g. one of the missing fields from d3d9 style effects is samplerstate.texture, that has value 0x37, going right at the end.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 8 +++++--- dlls/d3d10/effect.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f980007427f..3fd17c7400d 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -60,9 +60,11 @@ enum d3d10_effect_object_type_flags
enum d3d10_effect_object_operation { - D3D10_EOO_VALUE = 1, - D3D10_EOO_PARSED_OBJECT = 2, - D3D10_EOO_PARSED_OBJECT_INDEX = 3, + D3D10_EOO_CONST = 1, + D3D10_EOO_VAR = 2, + D3D10_EOO_CONST_INDEX = 3, + D3D10_EOO_VAR_INDEX = 4, + D3D10_EOO_INDEX_EXPRESSION = 5, D3D10_EOO_ANONYMOUS_SHADER = 7, };
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 5d5db4eea6c..1823ffdc04b 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1741,11 +1741,22 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, return FALSE; }
- if (!read_value_list(data, data_size, value_offset, property_info->type, idx, - property_info->size, (char *)container + property_info->offset)) + switch (operation) { - ERR("Failed to read values for property %#x.\n", id); - return FALSE; + case D3D10_EOO_CONST: + + /* Constant values output directly to backing store. */ + if (!read_value_list(data, data_size, value_offset, property_info->type, idx, + property_info->size, (char *)container + property_info->offset)) + { + ERR("Failed to read values for property %#x.\n", id); + return FALSE; + } + break; + + default: + FIXME("Unhandled operation %#x.\n", operation); + return E_FAIL; } }
@@ -1787,7 +1798,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size,
switch(operation) { - case D3D10_EOO_VALUE: + case D3D10_EOO_CONST: TRACE("Copy variable values\n");
switch (o->type) @@ -1837,7 +1848,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size, } break;
- case D3D10_EOO_PARSED_OBJECT: + case D3D10_EOO_VAR: /* This is a local object, we've parsed in parse_fx10_local_object. */ if (!fx10_get_string(data, data_size, offset, &name, &name_len)) { @@ -1849,7 +1860,7 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size, variable = e->lpVtbl->GetVariableByName(e, name); break;
- case D3D10_EOO_PARSED_OBJECT_INDEX: + case D3D10_EOO_CONST_INDEX: /* This is a local object, we've parsed in parse_fx10_local_object, which has an array index. */ if (offset >= data_size || !require_space(offset, 2, sizeof(DWORD), data_size)) {
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 8 +++++--- dlls/d3d10/effect.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f980007427f..3fd17c7400d 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -60,9 +60,11 @@ enum d3d10_effect_object_type_flags
enum d3d10_effect_object_operation {
- D3D10_EOO_VALUE = 1,
- D3D10_EOO_PARSED_OBJECT = 2,
- D3D10_EOO_PARSED_OBJECT_INDEX = 3,
- D3D10_EOO_CONST = 1,
- D3D10_EOO_VAR = 2,
- D3D10_EOO_CONST_INDEX = 3,
- D3D10_EOO_VAR_INDEX = 4,
- D3D10_EOO_INDEX_EXPRESSION = 5, D3D10_EOO_ANONYMOUS_SHADER = 7,
};
I like the changes, although now D3D10_EOO_ANONYMOUS_SHADER sticks out like a sore thumb (it's still more of a "what it is" rather than "how is the state computed"). How does that fit D3D10_EOO_ANONYMOUS_SHADER in that? Related question, what is the value used for FXLVM-computed states?
On Fri, Oct 1, 2021 at 10:07 PM Matteo Bruni matteo.mystral@gmail.com wrote:
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 8 +++++--- dlls/d3d10/effect.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f980007427f..3fd17c7400d 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -60,9 +60,11 @@ enum d3d10_effect_object_type_flags
enum d3d10_effect_object_operation {
- D3D10_EOO_VALUE = 1,
- D3D10_EOO_PARSED_OBJECT = 2,
- D3D10_EOO_PARSED_OBJECT_INDEX = 3,
- D3D10_EOO_CONST = 1,
- D3D10_EOO_VAR = 2,
- D3D10_EOO_CONST_INDEX = 3,
- D3D10_EOO_VAR_INDEX = 4,
- D3D10_EOO_INDEX_EXPRESSION = 5, D3D10_EOO_ANONYMOUS_SHADER = 7,
};
I like the changes, although now D3D10_EOO_ANONYMOUS_SHADER sticks out like a sore thumb (it's still more of a "what it is" rather than "how is the state computed"). How does that fit D3D10_EOO_ANONYMOUS_SHADER in that?
Last minute change broke the sentence :/ The question was supposed to be: how does D3D10_EOO_ANONYMOUS_SHADER fit in that?
Related question, what is the value used for FXLVM-computed states?
On 10/1/21 11:08 PM, Matteo Bruni wrote:
On Fri, Oct 1, 2021 at 10:07 PM Matteo Bruni matteo.mystral@gmail.com wrote:
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 8 +++++--- dlls/d3d10/effect.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f980007427f..3fd17c7400d 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -60,9 +60,11 @@ enum d3d10_effect_object_type_flags
enum d3d10_effect_object_operation {
- D3D10_EOO_VALUE = 1,
- D3D10_EOO_PARSED_OBJECT = 2,
- D3D10_EOO_PARSED_OBJECT_INDEX = 3,
- D3D10_EOO_CONST = 1,
- D3D10_EOO_VAR = 2,
- D3D10_EOO_CONST_INDEX = 3,
- D3D10_EOO_VAR_INDEX = 4,
- D3D10_EOO_INDEX_EXPRESSION = 5, D3D10_EOO_ANONYMOUS_SHADER = 7,
};
I like the changes, although now D3D10_EOO_ANONYMOUS_SHADER sticks out like a sore thumb (it's still more of a "what it is" rather than "how is the state computed"). How does that fit D3D10_EOO_ANONYMOUS_SHADER in that?
Last minute change broke the sentence :/ The question was supposed to be: how does D3D10_EOO_ANONYMOUS_SHADER fit in that?
I'm not sure if I see exactly what you mean. Is it purely naming that is concerning?
I can explain motivation of the ones I did change. VALUE is too generic, because all of them specify how destination value changes, PARSED_OBJECT is inaccurate in a sense that we call parsed objects things like state objects, when in fact assignment 2 applies to any variable, you can have AddressU = floatvar1; and that would use type 2. Same for existing name for type 3.
Type 7 is used exclusively for Set*Shader( CompileShader() ) construct, not even for Set*Shader(NULL), because it does not reference any existing object (aka how the state is computed), but instead defines anonymous shader itself, as well as assigning it. Being anonymous you obviously can't switch it later, or reuse it anywhere. So in a way it is a sore thumb, closest to CONST case probably.
Related question, what is the value used for FXLVM-computed states?
It's 5 for sure, and most likely 6. Five represents a[<expression that resolves to an index>]. I have an actual case when 5 is used in a game, but I haven't found non-index one yet, nor have I tried to compile one myself.
On Fri, Oct 1, 2021 at 10:28 PM Nikolay Sivov nsivov@codeweavers.com wrote:
On 10/1/21 11:08 PM, Matteo Bruni wrote:
On Fri, Oct 1, 2021 at 10:07 PM Matteo Bruni matteo.mystral@gmail.com wrote:
On Fri, Oct 1, 2021 at 8:14 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 8 +++++--- dlls/d3d10/effect.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f980007427f..3fd17c7400d 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -60,9 +60,11 @@ enum d3d10_effect_object_type_flags
enum d3d10_effect_object_operation {
- D3D10_EOO_VALUE = 1,
- D3D10_EOO_PARSED_OBJECT = 2,
- D3D10_EOO_PARSED_OBJECT_INDEX = 3,
- D3D10_EOO_CONST = 1,
- D3D10_EOO_VAR = 2,
- D3D10_EOO_CONST_INDEX = 3,
- D3D10_EOO_VAR_INDEX = 4,
- D3D10_EOO_INDEX_EXPRESSION = 5, D3D10_EOO_ANONYMOUS_SHADER = 7,
};
I like the changes, although now D3D10_EOO_ANONYMOUS_SHADER sticks out like a sore thumb (it's still more of a "what it is" rather than "how is the state computed"). How does that fit D3D10_EOO_ANONYMOUS_SHADER in that?
Last minute change broke the sentence :/ The question was supposed to be: how does D3D10_EOO_ANONYMOUS_SHADER fit in that?
I'm not sure if I see exactly what you mean. Is it purely naming that is concerning?
I can explain motivation of the ones I did change. VALUE is too generic, because all of them specify how destination value changes, PARSED_OBJECT is inaccurate in a sense that we call parsed objects things like state objects, when in fact assignment 2 applies to any variable, you can have AddressU = floatvar1; and that would use type 2. Same for existing name for type 3.
Type 7 is used exclusively for Set*Shader( CompileShader() ) construct, not even for Set*Shader(NULL), because it does not reference any existing object (aka how the state is computed), but instead defines anonymous shader itself, as well as assigning it. Being anonymous you obviously can't switch it later, or reuse it anywhere. So in a way it is a sore thumb, closest to CONST case probably.
Right. Yes, that was my question / concern basically. The old names referred to specific entities while the enum seems to be more about how the value to be assigned to the variable is generated. The new names go in that direction and, thinking about it, D3D10_EOO_ANONYMOUS_SHADER could be seen as a D3D10_EOO_CONST_SHADER of sorts.
Thanks for indulging me in this digression :D
Related question, what is the value used for FXLVM-computed states?
It's 5 for sure, and most likely 6. Five represents a[<expression that resolves to an index>]. I have an actual case when 5 is used in a game, but I haven't found non-index one yet, nor have I tried to compile one myself.
If it works in any way like d3dx9, 6 might be for precomputing some constant buffer values that depend solely on effect variables (e.g. sin(angle * pi/6) is used in the vertex shader, that computation is moved out of the shader proper and put into an FXLVM program).
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 1823ffdc04b..5a5f9f37e6d 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1543,13 +1543,6 @@ static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_ } TRACE("Variable name: %s.\n", debugstr_a(v->name));
- if (!copy_name(NULL, &v->semantic)) - { - ERR("Failed to copy semantic.\n"); - return E_OUTOFMEMORY; - } - TRACE("Variable semantic: %s.\n", debugstr_a(v->semantic)); - return S_OK; }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com