Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 81 +++++++++++++++++++++++++++++++++++--- dlls/d3d10/tests/effect.c | 34 ++++++++++------ 3 files changed, 99 insertions(+), 18 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 21530b3d30c..7f64e811e9f 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -270,7 +270,7 @@ struct d3d10_effect DWORD variable_count; DWORD local_variable_count; DWORD sharedbuffers_count; - DWORD sharedobjects_count; + DWORD shared_object_count; DWORD technique_count; DWORD index_offset; DWORD texture_count; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 71bc8161c76..1913d621ecc 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -50,6 +50,7 @@ static inline struct d3d10_effect *impl_from_ID3D10EffectPool(ID3D10EffectPool * }
static const struct ID3D10EffectVtbl d3d10_effect_pool_effect_vtbl; +static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v);
static const struct ID3D10EffectTechniqueVtbl d3d10_effect_technique_vtbl; static const struct ID3D10EffectPassVtbl d3d10_effect_pass_vtbl; @@ -2096,8 +2097,8 @@ static HRESULT create_state_object(struct d3d10_effect_variable *v) return S_OK; }
-static HRESULT parse_fx10_local_variable(const char *data, size_t data_size, - const char **ptr, struct d3d10_effect_variable *v) +static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, + const char **ptr, BOOL shared_type_desc, struct d3d10_effect_variable *v) { unsigned int i; HRESULT hr; @@ -2119,6 +2120,9 @@ static HRESULT parse_fx10_local_variable(const char *data, size_t data_size, read_dword(ptr, &v->explicit_bind_point); TRACE("Variable explicit bind point %#x.\n", v->explicit_bind_point);
+ /* Shared variable description contains only type information. */ + if (shared_type_desc) return S_OK; + switch (v->type->basetype) { case D3D10_SVT_TEXTURE: @@ -2534,6 +2538,50 @@ static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context heap_free(t); }
+static BOOL d3d10_effect_types_match(const struct d3d10_effect_type *t1, + const struct d3d10_effect_type *t2) +{ + unsigned int i; + + if (strcmp(t1->name, t2->name)) return FALSE; + if (t1->basetype != t2->basetype) return FALSE; + if (t1->type_class != t2->type_class) return FALSE; + if (t1->element_count != t2->element_count) return FALSE; + if (t1->element_count) return d3d10_effect_types_match(t1->elementtype, t2->elementtype); + if (t1->member_count != t2->member_count) return FALSE; + if (t1->column_count != t2->column_count) return FALSE; + if (t1->row_count != t2->row_count) return FALSE; + + for (i = 0; i < t1->member_count; ++i) + { + if (strcmp(t1->members[i].name, t2->members[i].name)) return FALSE; + if (t1->members[i].buffer_offset != t2->members[i].buffer_offset) return FALSE; + if (!d3d10_effect_types_match(t1->members[i].type, t2->members[i].type)) return FALSE; + } + + return TRUE; +} + +static HRESULT d3d10_effect_validate_shared_variable(const struct d3d10_effect *effect, + const struct d3d10_effect_variable *v) +{ + ID3D10EffectVariable *sv = effect->pool->lpVtbl->GetVariableByName(effect->pool, v->name); + + if (!sv->lpVtbl->IsValid(sv)) + { + WARN("Variable %s wasn't found in the pool.\n", debugstr_a(v->name)); + return E_INVALIDARG; + } + + if (!d3d10_effect_types_match(impl_from_ID3D10EffectVariable(sv)->type, v->type)) + { + WARN("Variable %s type does not match pool type.\n", debugstr_a(v->name)); + return E_INVALIDARG; + } + + return S_OK; +} + static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size) { const char *ptr; @@ -2596,10 +2644,27 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d v->ID3D10EffectVariable_iface.lpVtbl = &d3d10_effect_variable_vtbl; v->buffer = &null_local_buffer;
- if (FAILED(hr = parse_fx10_local_variable(data, data_size, &ptr, v))) + if (FAILED(hr = parse_fx10_object_variable(data, data_size, &ptr, FALSE, v))) return hr; }
+ for (i = 0; i < e->shared_object_count; ++i) + { + struct d3d10_effect_variable o = { 0 }; + + o.effect = e; + + if (FAILED(hr = parse_fx10_object_variable(data, data_size, &ptr, TRUE, &o))) + { + d3d10_effect_variable_destroy(&o); + return hr; + } + + hr = d3d10_effect_validate_shared_variable(e, &o); + d3d10_effect_variable_destroy(&o); + if (FAILED(hr)) return hr; + } + for (i = 0; i < e->technique_count; ++i) { struct d3d10_effect_technique *t = &e->techniques[i]; @@ -2644,8 +2709,8 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s read_dword(&ptr, &unused); TRACE("Pool variable count: %u\n", unused);
- read_dword(&ptr, &e->sharedobjects_count); - TRACE("Pool objects count: %u\n", e->sharedobjects_count); + read_dword(&ptr, &e->shared_object_count); + TRACE("Pool objects count: %u\n", e->shared_object_count);
read_dword(&ptr, &e->technique_count); TRACE("Technique count: %u\n", e->technique_count); @@ -2683,6 +2748,12 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s read_dword(&ptr, &e->anonymous_shader_count); TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
+ if (!e->pool && e->shared_object_count) + { + WARN("Effect requires a pool to load.\n"); + return E_FAIL; + } + return parse_fx10_body(e, ptr, data_size - (ptr - data)); }
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 9daf3faf8d0..5e54925abb2 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6335,11 +6335,15 @@ cbuffer l_cb2 float f3; };
+shared BlendState s_blendstate; +shared Texture s_texture; +shared PixelShader ps; + technique10 tech_child { pass P0 { - SetPixelShader(NULL); + SetPixelShader(ps); SetVertexShader(NULL); SetGeometryShader(NULL); } @@ -6347,19 +6351,25 @@ technique10 tech_child #endif static DWORD fx_test_pool_child[] = { - 0x43425844, 0x5addae59, 0x62b6f327, 0x0ca7b6a5, 0x61338a81, 0x00000001, 0x00000198, 0x00000001, - 0x00000024, 0x30315846, 0x0000016c, 0xfeff1001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x43425844, 0x22800afa, 0xe318151b, 0xcb3e7d52, 0x186ecbe3, 0x00000001, 0x00000249, 0x00000001, + 0x00000024, 0x30315846, 0x0000021d, 0xfeff1001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000003, 0x00000001, 0x000000f1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x62635f6c, 0x6f6c6600, 0x09007461, 0x01000000, 0x00000000, 0x04000000, 0x10000000, 0x04000000, 0x09000000, - 0x66000009, 0x4f430030, 0x30524f4c, 0x635f6c00, 0x66003262, 0x65740033, 0x635f6863, 0x646c6968, - 0x00305000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, - 0x00000002, 0x00000000, 0x00000004, 0x00000010, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, - 0x0000002b, 0x0000000f, 0x0000002e, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000035, - 0x00000010, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x0000003b, 0x0000000f, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000003e, 0x00000001, 0x00000000, 0x00000049, - 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000001, 0x0000004c, 0x00000006, 0x00000000, - 0x00000001, 0x00000058, 0x00000008, 0x00000000, 0x00000001, 0x00000064, + 0x66000009, 0x4f430030, 0x30524f4c, 0x635f6c00, 0x66003262, 0x6c420033, 0x53646e65, 0x65746174, + 0x00003e00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x625f7300, + 0x646e656c, 0x74617473, 0x65740065, 0x72757478, 0x00720065, 0x00020000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00090000, 0x5f730000, 0x74786574, 0x00657275, 0x65786950, 0x6168536c, + 0x00726564, 0x000000a0, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000005, + 0x74007370, 0x5f686365, 0x6c696863, 0x30500064, 0x00000100, 0x00000200, 0x00000000, 0x00000100, + 0x00000200, 0x00000000, 0x00000400, 0x00001000, 0x00000000, 0x00000100, 0xffffff00, 0x000000ff, + 0x00002b00, 0x00000f00, 0x00002e00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00003500, + 0x00001000, 0x00000000, 0x00000100, 0xffffff00, 0x000000ff, 0x00003b00, 0x00000f00, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00006500, 0x00004900, 0x00000000, 0xffffff00, + 0x000096ff, 0x00007a00, 0x00000000, 0xffffff00, 0x0000c8ff, 0x0000ac00, 0x00000000, 0xffffff00, + 0x0000cbff, 0x00000100, 0x00000000, 0x0000d600, 0x00000300, 0x00000000, 0x00000700, 0x00000000, + 0x00000200, 0x0000c800, 0x00000600, 0x00000000, 0x00000100, 0x0000d900, 0x00000800, 0x00000000, + 0x00000100, 0x0000e500, 0x00000000, };
static void test_effect_pool(void)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 101 +++++++++++++++++++++++++------------ dlls/d3d10/tests/effect.c | 42 ++++++++------- 3 files changed, 94 insertions(+), 51 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 7f64e811e9f..3c3c6fa7f58 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -269,7 +269,7 @@ struct d3d10_effect DWORD local_buffer_count; DWORD variable_count; DWORD local_variable_count; - DWORD sharedbuffers_count; + DWORD shared_buffer_count; DWORD shared_object_count; DWORD technique_count; DWORD index_offset; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 1913d621ecc..8246f288369 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -2013,7 +2013,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, struct d3d10_effect_variable *v) + const char **ptr, BOOL local, struct d3d10_effect_variable *v) { DWORD offset, default_value_offset; HRESULT hr; @@ -2039,17 +2039,20 @@ static HRESULT parse_fx10_numeric_variable(const char *data, size_t data_size, read_dword(ptr, &v->flag); TRACE("Variable flag: %#x.\n", v->flag);
- if (default_value_offset) - FIXME("Set default variable value.\n"); + if (local) + { + if (default_value_offset) + FIXME("Set default variable value.\n");
- read_dword(ptr, &v->annotation_count); - TRACE("Variable has %u annotations.\n", v->annotation_count); + read_dword(ptr, &v->annotation_count); + TRACE("Variable has %u annotations.\n", v->annotation_count);
- if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, v->effect, - v->annotation_count, &v->annotations))) - { - ERR("Failed to parse variable annotations, hr %#x.\n", hr); - return hr; + if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, v->effect, + v->annotation_count, &v->annotations))) + { + ERR("Failed to parse variable annotations, hr %#x.\n", hr); + return hr; + } }
if (v->flag & D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT) @@ -2313,9 +2316,10 @@ static HRESULT create_variable_buffer(struct d3d10_effect_variable *v, D3D10_CBU return S_OK; }
-static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, - const char **ptr, struct d3d10_effect_variable *l) +static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char **ptr, + BOOL local, struct d3d10_effect_variable *l) { + const char *prefix = local ? "Local" : "Shared"; unsigned int i; DWORD offset; D3D10_CBUFFER_TYPE d3d10_cbuffer_type; @@ -2333,20 +2337,20 @@ static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, l->type->effect = l->effect;
read_dword(ptr, &offset); - TRACE("Local buffer name at offset %#x.\n", offset); + TRACE("%s buffer name at offset %#x.\n", prefix, offset);
if (!fx10_copy_string(data, data_size, offset, &l->name)) { ERR("Failed to copy name.\n"); return E_OUTOFMEMORY; } - TRACE("Local buffer name: %s.\n", debugstr_a(l->name)); + TRACE("%s buffer name: %s.\n", prefix, debugstr_a(l->name));
read_dword(ptr, &l->data_size); - TRACE("Local buffer data size: %#x.\n", l->data_size); + TRACE("%s buffer data size: %#x.\n", prefix, l->data_size);
read_dword(ptr, &d3d10_cbuffer_type); - TRACE("Local buffer type: %#x.\n", d3d10_cbuffer_type); + TRACE("%s buffer type: %#x.\n", prefix, d3d10_cbuffer_type);
switch(d3d10_cbuffer_type) { @@ -2374,19 +2378,22 @@ static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, }
read_dword(ptr, &l->type->member_count); - TRACE("Local buffer member count: %#x.\n", l->type->member_count); + TRACE("%s buffer member count: %#x.\n", prefix, l->type->member_count);
read_dword(ptr, &l->explicit_bind_point); - TRACE("Local buffer explicit bind point: %#x.\n", l->explicit_bind_point); - - read_dword(ptr, &l->annotation_count); - TRACE("Local buffer has %u annotations.\n", l->annotation_count); + TRACE("%s buffer explicit bind point: %#x.\n", prefix, l->explicit_bind_point);
- if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, l->effect, - l->annotation_count, &l->annotations))) + if (local) { - ERR("Failed to parse buffer annotations, hr %#x.\n", hr); - return hr; + read_dword(ptr, &l->annotation_count); + TRACE("Local buffer has %u annotations.\n", l->annotation_count); + + if (FAILED(hr = parse_fx10_annotations(data, data_size, ptr, l->effect, + l->annotation_count, &l->annotations))) + { + ERR("Failed to parse buffer annotations, hr %#x.\n", hr); + return hr; + } }
if (!(l->members = heap_calloc(l->type->member_count, sizeof(*l->members)))) @@ -2409,7 +2416,7 @@ static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, v->buffer = l; v->effect = l->effect;
- if (FAILED(hr = parse_fx10_numeric_variable(data, data_size, ptr, v))) + if (FAILED(hr = parse_fx10_numeric_variable(data, data_size, ptr, local, v))) return hr;
/* @@ -2480,7 +2487,7 @@ static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, } l->type->stride = l->type->size_unpacked = (stride + 0xf) & ~0xf;
- TRACE("Constant buffer:\n"); + TRACE("%s constant buffer:\n", prefix); TRACE("\tType name: %s.\n", debugstr_a(l->type->name)); TRACE("\tElement count: %u.\n", l->type->element_count); TRACE("\tMember count: %u.\n", l->type->member_count); @@ -2490,7 +2497,7 @@ static HRESULT parse_fx10_local_buffer(const char *data, size_t data_size, TRACE("\tBasetype: %s.\n", debug_d3d10_shader_variable_type(l->type->basetype)); TRACE("\tTypeclass: %s.\n", debug_d3d10_shader_variable_class(l->type->type_class));
- if (l->type->size_unpacked) + if (local && l->type->size_unpacked) { if (FAILED(hr = create_variable_buffer(l, d3d10_cbuffer_type))) return hr; @@ -2565,7 +2572,18 @@ static BOOL d3d10_effect_types_match(const struct d3d10_effect_type *t1, static HRESULT d3d10_effect_validate_shared_variable(const struct d3d10_effect *effect, const struct d3d10_effect_variable *v) { - ID3D10EffectVariable *sv = effect->pool->lpVtbl->GetVariableByName(effect->pool, v->name); + ID3D10EffectVariable *sv; + + switch (v->type->basetype) + { + case D3D10_SVT_CBUFFER: + case D3D10_SVT_TBUFFER: + sv = (ID3D10EffectVariable *)effect->pool->lpVtbl->GetConstantBufferByName( + effect->pool, v->name); + break; + default: + sv = effect->pool->lpVtbl->GetVariableByName(effect->pool, v->name); + }
if (!sv->lpVtbl->IsValid(sv)) { @@ -2632,7 +2650,7 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d l->effect = e; l->buffer = &null_local_buffer;
- if (FAILED(hr = parse_fx10_local_buffer(data, data_size, &ptr, l))) + if (FAILED(hr = parse_fx10_buffer(data, data_size, &ptr, TRUE, l))) return hr; }
@@ -2648,6 +2666,23 @@ static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD d return hr; }
+ for (i = 0; i < e->shared_buffer_count; ++i) + { + struct d3d10_effect_variable b = { 0 }; + + b.effect = e; + + if (FAILED(hr = parse_fx10_buffer(data, data_size, &ptr, FALSE, &b))) + { + d3d10_effect_variable_destroy(&b); + return hr; + } + + hr = d3d10_effect_validate_shared_variable(e, &b); + d3d10_effect_variable_destroy(&b); + if (FAILED(hr)) return hr; + } + for (i = 0; i < e->shared_object_count; ++i) { struct d3d10_effect_variable o = { 0 }; @@ -2703,8 +2738,8 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s read_dword(&ptr, &e->local_variable_count); TRACE("Object count: %u\n", e->local_variable_count);
- read_dword(&ptr, &e->sharedbuffers_count); - TRACE("Pool buffer count: %u\n", e->sharedbuffers_count); + read_dword(&ptr, &e->shared_buffer_count); + TRACE("Pool buffer count: %u\n", e->shared_buffer_count);
read_dword(&ptr, &unused); TRACE("Pool variable count: %u\n", unused); @@ -2748,7 +2783,7 @@ static HRESULT parse_fx10(struct d3d10_effect *e, const char *data, DWORD data_s read_dword(&ptr, &e->anonymous_shader_count); TRACE("Anonymous shader count: %u\n", e->anonymous_shader_count);
- if (!e->pool && e->shared_object_count) + if (!e->pool && (e->shared_object_count || e->shared_buffer_count)) { WARN("Effect requires a pool to load.\n"); return E_FAIL; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 5e54925abb2..29773fc4582 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6330,6 +6330,12 @@ cbuffer l_cb float f0 : COLOR0; };
+shared cbuffer s_cb +{ + float f1 : COLOR0; + float f2 : COLOR1; +}; + cbuffer l_cb2 { float f3; @@ -6351,25 +6357,27 @@ technique10 tech_child #endif static DWORD fx_test_pool_child[] = { - 0x43425844, 0x22800afa, 0xe318151b, 0xcb3e7d52, 0x186ecbe3, 0x00000001, 0x00000249, 0x00000001, - 0x00000024, 0x30315846, 0x0000021d, 0xfeff1001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, - 0x00000000, 0x00000003, 0x00000001, 0x000000f1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x43425844, 0xa11d7cb2, 0x41f20697, 0x14a62983, 0x43b9f39c, 0x00000001, 0x0000029f, 0x00000001, + 0x00000024, 0x30315846, 0x00000273, 0xfeff1001, 0x00000002, 0x00000002, 0x00000000, 0x00000001, + 0x00000002, 0x00000003, 0x00000001, 0x00000103, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x62635f6c, 0x6f6c6600, 0x09007461, 0x01000000, 0x00000000, 0x04000000, 0x10000000, 0x04000000, 0x09000000, - 0x66000009, 0x4f430030, 0x30524f4c, 0x635f6c00, 0x66003262, 0x6c420033, 0x53646e65, 0x65746174, - 0x00003e00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x625f7300, - 0x646e656c, 0x74617473, 0x65740065, 0x72757478, 0x00720065, 0x00020000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00090000, 0x5f730000, 0x74786574, 0x00657275, 0x65786950, 0x6168536c, - 0x00726564, 0x000000a0, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000005, - 0x74007370, 0x5f686365, 0x6c696863, 0x30500064, 0x00000100, 0x00000200, 0x00000000, 0x00000100, - 0x00000200, 0x00000000, 0x00000400, 0x00001000, 0x00000000, 0x00000100, 0xffffff00, 0x000000ff, - 0x00002b00, 0x00000f00, 0x00002e00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00003500, - 0x00001000, 0x00000000, 0x00000100, 0xffffff00, 0x000000ff, 0x00003b00, 0x00000f00, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00006500, 0x00004900, 0x00000000, 0xffffff00, - 0x000096ff, 0x00007a00, 0x00000000, 0xffffff00, 0x0000c8ff, 0x0000ac00, 0x00000000, 0xffffff00, - 0x0000cbff, 0x00000100, 0x00000000, 0x0000d600, 0x00000300, 0x00000000, 0x00000700, 0x00000000, - 0x00000200, 0x0000c800, 0x00000600, 0x00000000, 0x00000100, 0x0000d900, 0x00000800, 0x00000000, - 0x00000100, 0x0000e500, 0x00000000, + 0x66000009, 0x4f430030, 0x30524f4c, 0x635f6c00, 0x66003262, 0x5f730033, 0x66006263, 0x32660031, + 0x4c4f4300, 0x0031524f, 0x6e656c42, 0x61745364, 0x50006574, 0x02000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x02000000, 0x73000000, 0x656c625f, 0x7473646e, 0x00657461, 0x74786574, + 0x00657275, 0x00000084, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000009, + 0x65745f73, 0x72757478, 0x69500065, 0x536c6578, 0x65646168, 0x00b20072, 0x00020000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00050000, 0x73700000, 0x63657400, 0x68635f68, 0x00646c69, + 0x01003050, 0x02000000, 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x04000000, 0x10000000, + 0x00000000, 0x01000000, 0xff000000, 0x00ffffff, 0x2b000000, 0x0f000000, 0x2e000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x35000000, 0x10000000, 0x00000000, 0x01000000, 0xff000000, + 0x00ffffff, 0x3b000000, 0x0f000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x3e000000, 0x10000000, 0x00000000, 0x02000000, 0xff000000, 0x43ffffff, 0x0f000000, 0x2e000000, + 0x00000000, 0x00000000, 0x00000000, 0x46000000, 0x0f000000, 0x49000000, 0x04000000, 0x00000000, + 0x00000000, 0x77000000, 0x5b000000, 0x00000000, 0xff000000, 0xa8ffffff, 0x8c000000, 0x00000000, + 0xff000000, 0xdaffffff, 0xbe000000, 0x00000000, 0xff000000, 0xddffffff, 0x01000000, 0x00000000, + 0xe8000000, 0x03000000, 0x00000000, 0x07000000, 0x00000000, 0x02000000, 0xda000000, 0x06000000, + 0x00000000, 0x01000000, 0xeb000000, 0x08000000, 0x00000000, 0x01000000, 0xf7000000, 0x00000000, };
static void test_effect_pool(void)
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Fri, Sep 24, 2021 at 7:10 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 101 +++++++++++++++++++++++++------------ dlls/d3d10/tests/effect.c | 42 ++++++++------- 3 files changed, 94 insertions(+), 51 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 7f64e811e9f..3c3c6fa7f58 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -269,7 +269,7 @@ struct d3d10_effect DWORD local_buffer_count; DWORD variable_count; DWORD local_variable_count;
- DWORD sharedbuffers_count;
- DWORD shared_buffer_count; DWORD shared_object_count; DWORD technique_count; DWORD index_offset;
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 1913d621ecc..8246f288369 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -2013,7 +2013,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, struct d3d10_effect_variable *v)
const char **ptr, BOOL local, struct d3d10_effect_variable *v)
It's slightly confusing to have a "shared" parameter for parse_fx10_object_variable() and "local" (its opposite) here. OTOH it does look a tiny bit nicer not needing to negate it in either function.
I guess it's fine...
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 6 ++++++ dlls/d3d10/effect.c | 11 +++++++++-- dlls/d3d10/tests/effect.c | 11 +++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 3c3c6fa7f58..e7ecfb73a64 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -256,6 +256,11 @@ struct d3d10_effect_anonymous_shader struct d3d10_effect_type type; };
+enum d3d10_effect_flags +{ + D3D10_EFFECT_OPTIMIZED = 0x1, +}; + /* ID3D10Effect */ struct d3d10_effect { @@ -282,6 +287,7 @@ struct d3d10_effect DWORD depthstencilview_count; DWORD used_shader_count; DWORD anonymous_shader_count; + DWORD flags;
DWORD used_shader_current; DWORD anonymous_shader_current; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 8246f288369..8aed914c909 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3531,6 +3531,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
FIXME("iface %p semi-stub!\n", iface);
+ if (effect->flags & D3D10_EFFECT_OPTIMIZED) + return S_OK; + for (i = 0; i < effect->used_shader_count; ++i) { v = effect->used_shaders[i]; @@ -3561,14 +3564,18 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface) effect->techniques[i].name = NULL; }
+ effect->flags |= D3D10_EFFECT_OPTIMIZED; + return S_OK; }
static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface) { - FIXME("iface %p stub!\n", iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
- return FALSE; + TRACE("iface %p.\n", iface); + + return !!(effect->flags & D3D10_EFFECT_OPTIMIZED); }
const struct ID3D10EffectVtbl d3d10_effect_vtbl = diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 29773fc4582..9f377e80b17 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6017,6 +6017,7 @@ static void test_effect_optimize(void) ID3D10Device *device; ULONG refcount; HRESULT hr; + BOOL ret;
if (!(device = create_device())) { @@ -6051,9 +6052,15 @@ static void test_effect_optimize(void) ok(!!shaderdesc.NumInputSignatureEntries, "Unexpected input signature count.\n"); ok(!!shaderdesc.NumOutputSignatureEntries, "Unexpected output signature count.\n");
+ ret = effect->lpVtbl->IsOptimized(effect); + ok(!ret, "Unexpected return value.\n"); + hr = effect->lpVtbl->Optimize(effect); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ret = effect->lpVtbl->IsOptimized(effect); + ok(ret, "Unexpected return value.\n"); + hr = gs->lpVtbl->GetShaderDesc(gs, 0, &shaderdesc); ok(hr == S_OK, "Failed to get shader description, hr %#x.\n", hr); ok(!!shaderdesc.pInputSignature, "Expected input signature.\n"); @@ -6081,6 +6088,10 @@ static void test_effect_optimize(void) tech = effect->lpVtbl->GetTechniqueByName(effect, "Render"); ok(!tech->lpVtbl->IsValid(tech), "Unexpected valid technique.\n");
+ /* Already optimized */ + hr = effect->lpVtbl->Optimize(effect); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
This is triggered by recompiled effect in patch 4/5.
dlls/d3d10/effect.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 8aed914c909..668efcda666 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1503,6 +1503,10 @@ static BOOL read_float_value(DWORD value, D3D_SHADER_VARIABLE_TYPE in_type, floa out_data[idx] = (INT)value; return TRUE;
+ case D3D10_SVT_UINT: + out_data[idx] = value; + return TRUE; + default: FIXME("Unhandled in_type %#x.\n", in_type); return FALSE;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Fri, Sep 24, 2021 at 7:10 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
This is triggered by recompiled effect in patch 4/5.
Presumably you meant patch 5/5 ;)
Nice incidental bug fix though.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Current compiler complains about deprecated naming for MipMapLODBias field, which is possible to suppress with compat mode switch. However that will generate value 0 for it.
dlls/d3d10/tests/effect.c | 186 +++++++++++++------------------------- 1 file changed, 62 insertions(+), 124 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 9f377e80b17..e833fc09799 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4069,7 +4069,7 @@ SamplerState sampler0 AddressU = wrap; /* 0x2e */ AddressV = mirror; /* 0x2f */ AddressW = clamp; /* 0x30 */ - MipMapLODBias = -1; /* 0x31 */ + MipLODBias = -1; /* 0x31 */ MaxAnisotropy = 4u; /* 0x32 */ ComparisonFunc = always; /* 0x33 */ BorderColor = float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */ @@ -4089,128 +4089,66 @@ technique10 tech0 #endif static DWORD fx_test_state_groups[] = { - 0x43425844, 0xbf7e3418, 0xd2838ea5, 0x8012c315, - 0x7dd76ca7, 0x00000001, 0x00000794, 0x00000001, - 0x00000024, 0x30315846, 0x00000768, 0xfeff1001, - 0x00000001, 0x00000000, 0x00000004, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x0000035c, - 0x00000000, 0x00000000, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, - 0x736c6162, 0x73615200, 0x69726574, 0x5372657a, - 0x65746174, 0x00000d00, 0x00000200, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000400, - 0x73617200, 0x74735f74, 0x00657461, 0x00000001, - 0x00000002, 0x00000002, 0x00000001, 0x00000002, - 0x00000002, 0x00000001, 0x00000004, 0x00000001, - 0x00000001, 0x00000002, 0xfffffffc, 0x00000001, - 0x00000001, 0x3f000000, 0x00000001, 0x00000001, - 0x3e800000, 0x00000001, 0x00000004, 0x00000000, - 0x00000001, 0x00000004, 0x00000001, 0x00000001, - 0x00000004, 0x00000001, 0x00000001, 0x00000004, - 0x00000001, 0x74706544, 0x65745368, 0x6c69636e, - 0x74617453, 0x00bc0065, 0x00020000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00030000, - 0x73640000, 0x6174735f, 0x01006574, 0x04000000, - 0x01000000, 0x01000000, 0x02000000, 0x00000000, - 0x01000000, 0x02000000, 0x03000000, 0x01000000, - 0x04000000, 0x01000000, 0x01000000, 0x02000000, - 0x04000000, 0x01000000, 0x02000000, 0x05000000, - 0x01000000, 0x02000000, 0x06000000, 0x01000000, - 0x02000000, 0x07000000, 0x01000000, 0x02000000, - 0x08000000, 0x01000000, 0x02000000, 0x04000000, - 0x01000000, 0x02000000, 0x03000000, 0x01000000, - 0x02000000, 0x04000000, 0x01000000, 0x02000000, - 0x05000000, 0x01000000, 0x02000000, 0x07000000, - 0x42000000, 0x646e656c, 0x74617453, 0x019b0065, - 0x00020000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65, - 0x74617473, 0x00010065, 0x00040000, 0x00000000, - 0x00010000, 0x00040000, 0x00010000, 0x00010000, - 0x00040000, 0x00000000, 0x00010000, 0x00020000, - 0x00020000, 0x00010000, 0x00020000, 0x00030000, - 0x00010000, 0x00020000, 0x00040000, 0x00010000, - 0x00020000, 0x00050000, 0x00010000, 0x00020000, - 0x00060000, 0x00010000, 0x00020000, 0x00050000, - 0x00010000, 0x00020000, 0x00080000, 0x00010000, - 0x00020000, 0x00070000, 0x61530000, 0x656c706d, - 0x61745372, 0x52006574, 0x02000002, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x15000000, - 0x73000000, 0x6c706d61, 0x00307265, 0x00000001, - 0x00000002, 0x00000015, 0x00000001, 0x00000002, - 0x00000001, 0x00000001, 0x00000002, 0x00000002, - 0x00000001, 0x00000002, 0x00000003, 0x00000001, - 0x00000002, 0xffffffff, 0x00000001, 0x00000002, - 0x00000004, 0x00000001, 0x00000002, 0x00000008, - 0x00000004, 0x00000001, 0x3f800000, 0x00000001, - 0x40000000, 0x00000001, 0x40400000, 0x00000001, - 0x40800000, 0x00000001, 0x00000002, 0x00000006, - 0x00000001, 0x00000002, 0x00000005, 0x68636574, - 0x61700030, 0x00307373, 0x00000004, 0x00000001, - 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001, - 0x3f333333, 0x00000001, 0x3f4ccccd, 0x00000001, - 0x00000002, 0x0000ffff, 0x00000001, 0x00000001, - 0x3f800000, 0x00000004, 0x00000000, 0x00000000, - 0x00000000, 0xffffffff, 0x00000000, 0x00000039, - 0x0000001d, 0x00000000, 0xffffffff, 0x0000000a, - 0x0000000c, 0x00000000, 0x00000001, 0x00000044, - 0x0000000d, 0x00000000, 0x00000001, 0x00000050, - 0x0000000e, 0x00000000, 0x00000001, 0x0000005c, - 0x0000000f, 0x00000000, 0x00000001, 0x00000068, - 0x00000010, 0x00000000, 0x00000001, 0x00000074, - 0x00000011, 0x00000000, 0x00000001, 0x00000080, - 0x00000012, 0x00000000, 0x00000001, 0x0000008c, - 0x00000013, 0x00000000, 0x00000001, 0x00000098, - 0x00000014, 0x00000000, 0x00000001, 0x000000a4, - 0x00000015, 0x00000000, 0x00000001, 0x000000b0, - 0x00000000, 0x000000ea, 0x000000ce, 0x00000000, - 0xffffffff, 0x0000000e, 0x00000016, 0x00000000, - 0x00000001, 0x000000f3, 0x00000017, 0x00000000, - 0x00000001, 0x000000ff, 0x00000018, 0x00000000, - 0x00000001, 0x0000010b, 0x00000019, 0x00000000, - 0x00000001, 0x00000117, 0x0000001a, 0x00000000, - 0x00000001, 0x00000123, 0x0000001b, 0x00000000, - 0x00000001, 0x0000012f, 0x0000001c, 0x00000000, - 0x00000001, 0x0000013b, 0x0000001d, 0x00000000, - 0x00000001, 0x00000147, 0x0000001e, 0x00000000, - 0x00000001, 0x00000153, 0x0000001f, 0x00000000, - 0x00000001, 0x0000015f, 0x00000020, 0x00000000, - 0x00000001, 0x0000016b, 0x00000021, 0x00000000, - 0x00000001, 0x00000177, 0x00000022, 0x00000000, - 0x00000001, 0x00000183, 0x00000023, 0x00000000, - 0x00000001, 0x0000018f, 0x00000000, 0x000001c2, - 0x000001a6, 0x00000000, 0xffffffff, 0x0000000b, - 0x00000024, 0x00000000, 0x00000001, 0x000001ce, - 0x00000025, 0x00000000, 0x00000001, 0x000001da, - 0x00000025, 0x00000007, 0x00000001, 0x000001e6, - 0x00000026, 0x00000000, 0x00000001, 0x000001f2, - 0x00000027, 0x00000000, 0x00000001, 0x000001fe, - 0x00000028, 0x00000000, 0x00000001, 0x0000020a, - 0x00000029, 0x00000000, 0x00000001, 0x00000216, - 0x0000002a, 0x00000000, 0x00000001, 0x00000222, - 0x0000002b, 0x00000000, 0x00000001, 0x0000022e, - 0x0000002c, 0x00000000, 0x00000001, 0x0000023a, - 0x0000002c, 0x00000007, 0x00000001, 0x00000246, - 0x00000000, 0x0000027b, 0x0000025f, 0x00000000, - 0xffffffff, 0x0000000a, 0x0000002d, 0x00000000, - 0x00000001, 0x00000284, 0x0000002e, 0x00000000, - 0x00000001, 0x00000290, 0x0000002f, 0x00000000, - 0x00000001, 0x0000029c, 0x00000030, 0x00000000, - 0x00000001, 0x000002a8, 0x00000031, 0x00000000, - 0x00000001, 0x000002b4, 0x00000032, 0x00000000, - 0x00000001, 0x000002c0, 0x00000033, 0x00000000, - 0x00000001, 0x000002cc, 0x00000034, 0x00000000, - 0x00000001, 0x000002d8, 0x00000035, 0x00000000, - 0x00000001, 0x000002fc, 0x00000036, 0x00000000, - 0x00000001, 0x00000308, 0x00000000, 0x00000314, - 0x00000001, 0x00000000, 0x0000031a, 0x00000006, - 0x00000000, 0x0000000a, 0x00000000, 0x00000001, - 0x00000320, 0x0000000b, 0x00000000, 0x00000001, - 0x00000344, 0x00000002, 0x00000000, 0x00000002, - 0x000001c2, 0x00000009, 0x00000000, 0x00000001, - 0x00000350, 0x00000001, 0x00000000, 0x00000002, - 0x000000ea, 0x00000000, 0x00000000, 0x00000002, - 0x00000039, + 0x43425844, 0xacdae4ef, 0x5046a276, 0xda953136, 0x0b78e818, 0x00000001, 0x00000773, 0x00000001, + 0x00000024, 0x30315846, 0x00000747, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000353, 0x00000000, 0x00000000, 0x00000001, 0x00000001, + 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152, + 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000, + 0x02000000, 0x02000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x02000000, 0xfc000000, + 0x01ffffff, 0x01000000, 0x00000000, 0x013f0000, 0x01000000, 0x00000000, 0x013e8000, 0x04000000, + 0x00000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, + 0x04000000, 0x01000000, 0x44000000, 0x68747065, 0x6e657453, 0x536c6963, 0x65746174, 0x0000b300, + 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000300, 0x5f736400, 0x74617473, + 0x00010065, 0x00040000, 0x00010000, 0x00010000, 0x00020000, 0x00000000, 0x00010000, 0x00020000, + 0x00030000, 0x00010000, 0x00040000, 0x00010000, 0x00010000, 0x00030000, 0x00040000, 0x00010000, + 0x00030000, 0x00050000, 0x00010000, 0x00020000, 0x00060000, 0x00010000, 0x00020000, 0x00070000, + 0x00010000, 0x00020000, 0x00080000, 0x00010000, 0x00020000, 0x00040000, 0x00010000, 0x00020000, + 0x00030000, 0x00010000, 0x00020000, 0x00040000, 0x00010000, 0x00020000, 0x00050000, 0x00010000, + 0x00020000, 0x00070000, 0x6c420000, 0x53646e65, 0x65746174, 0x00019200, 0x00000200, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x656c6200, 0x735f646e, 0x65746174, 0x00000100, + 0x00000400, 0x00000000, 0x00000100, 0x00000400, 0x00000100, 0x00000100, 0x00000400, 0x00000000, + 0x00000100, 0x00000200, 0x00000200, 0x00000100, 0x00000200, 0x00000300, 0x00000100, 0x00000200, + 0x00000400, 0x00000100, 0x00000200, 0x00000500, 0x00000100, 0x00000200, 0x00000600, 0x00000100, + 0x00000200, 0x00000500, 0x00000100, 0x00000300, 0x00000800, 0x00000100, 0x00000300, 0x00000700, + 0x6d615300, 0x72656c70, 0x74617453, 0x02490065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00150000, 0x61730000, 0x656c706d, 0x01003072, 0x02000000, 0x15000000, 0x01000000, + 0x02000000, 0x01000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x03000000, + 0x01000000, 0x02000000, 0xff000000, 0x01ffffff, 0x03000000, 0x04000000, 0x01000000, 0x02000000, + 0x08000000, 0x04000000, 0x01000000, 0x00000000, 0x013f8000, 0x00000000, 0x01400000, 0x00000000, + 0x01404000, 0x00000000, 0x01408000, 0x03000000, 0x06000000, 0x01000000, 0x03000000, 0x05000000, + 0x74000000, 0x30686365, 0x73617000, 0x04003073, 0x01000000, 0x00000000, 0x013f0000, 0x9a000000, + 0x013f1999, 0x33000000, 0x013f3333, 0xcd000000, 0x013f4ccc, 0x03000000, 0xff000000, 0x010000ff, + 0x01000000, 0x00000000, 0x303f8000, 0x14000000, 0x00000000, 0xff000000, 0x0affffff, 0x0c000000, + 0x00000000, 0x01000000, 0x3b000000, 0x0d000000, 0x00000000, 0x01000000, 0x47000000, 0x0e000000, + 0x00000000, 0x01000000, 0x53000000, 0x0f000000, 0x00000000, 0x01000000, 0x5f000000, 0x10000000, + 0x00000000, 0x01000000, 0x6b000000, 0x11000000, 0x00000000, 0x01000000, 0x77000000, 0x12000000, + 0x00000000, 0x01000000, 0x83000000, 0x13000000, 0x00000000, 0x01000000, 0x8f000000, 0x14000000, + 0x00000000, 0x01000000, 0x9b000000, 0x15000000, 0x00000000, 0x01000000, 0xa7000000, 0x00000000, + 0xe1000000, 0xc5000000, 0x00000000, 0xff000000, 0x0effffff, 0x16000000, 0x00000000, 0x01000000, + 0xea000000, 0x17000000, 0x00000000, 0x01000000, 0xf6000000, 0x18000000, 0x00000000, 0x01000000, + 0x02000000, 0x19000001, 0x00000000, 0x01000000, 0x0e000000, 0x1a000001, 0x00000000, 0x01000000, + 0x1a000000, 0x1b000001, 0x00000000, 0x01000000, 0x26000000, 0x1c000001, 0x00000000, 0x01000000, + 0x32000000, 0x1d000001, 0x00000000, 0x01000000, 0x3e000000, 0x1e000001, 0x00000000, 0x01000000, + 0x4a000000, 0x1f000001, 0x00000000, 0x01000000, 0x56000000, 0x20000001, 0x00000000, 0x01000000, + 0x62000000, 0x21000001, 0x00000000, 0x01000000, 0x6e000000, 0x22000001, 0x00000000, 0x01000000, + 0x7a000000, 0x23000001, 0x00000000, 0x01000000, 0x86000000, 0x00000001, 0xb9000000, 0x9d000001, + 0x00000001, 0xff000000, 0x0bffffff, 0x24000000, 0x00000000, 0x01000000, 0xc5000000, 0x25000001, + 0x00000000, 0x01000000, 0xd1000000, 0x25000001, 0x07000000, 0x01000000, 0xdd000000, 0x26000001, + 0x00000000, 0x01000000, 0xe9000000, 0x27000001, 0x00000000, 0x01000000, 0xf5000000, 0x28000001, + 0x00000000, 0x01000000, 0x01000000, 0x29000002, 0x00000000, 0x01000000, 0x0d000000, 0x2a000002, + 0x00000000, 0x01000000, 0x19000000, 0x2b000002, 0x00000000, 0x01000000, 0x25000000, 0x2c000002, + 0x00000000, 0x01000000, 0x31000000, 0x2c000002, 0x07000000, 0x01000000, 0x3d000000, 0x00000002, + 0x72000000, 0x56000002, 0x00000002, 0xff000000, 0x0affffff, 0x2d000000, 0x00000000, 0x01000000, + 0x7b000000, 0x2e000002, 0x00000000, 0x01000000, 0x87000000, 0x2f000002, 0x00000000, 0x01000000, + 0x93000000, 0x30000002, 0x00000000, 0x01000000, 0x9f000000, 0x31000002, 0x00000000, 0x01000000, + 0xab000000, 0x32000002, 0x00000000, 0x01000000, 0xb7000000, 0x33000002, 0x00000000, 0x01000000, + 0xc3000000, 0x34000002, 0x00000000, 0x01000000, 0xcf000000, 0x35000002, 0x00000000, 0x01000000, + 0xf3000000, 0x36000002, 0x00000000, 0x01000000, 0xff000000, 0x00000002, 0x0b000000, 0x01000003, + 0x00000000, 0x11000000, 0x06000003, 0x00000000, 0x0a000000, 0x00000000, 0x01000000, 0x17000000, + 0x0b000003, 0x00000000, 0x01000000, 0x3b000000, 0x02000003, 0x00000000, 0x02000000, 0xb9000000, + 0x09000001, 0x00000000, 0x01000000, 0x47000000, 0x01000003, 0x00000000, 0x02000000, 0xe1000000, + 0x00000000, 0x00000000, 0x02000000, 0x30000000, 0x00000000, };
static void test_effect_state_groups(void) @@ -4250,7 +4188,7 @@ static void test_effect_state_groups(void) hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(SUCCEEDED(hr), "Failed to get effect description, hr %#x.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(!effect_desc.ConstantBuffers, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com