It's definitely not complete, but it's not a stub.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 5a5f9f37e6d..c135c76811d 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -8631,7 +8631,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl ID3D10Effect *pool = NULL; HRESULT hr;
- FIXME("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p stub!\n", + TRACE("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p.\n", data, data_size, flags, device, effect_pool, effect);
if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index c135c76811d..de236ca2513 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -659,6 +659,12 @@ static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const { case D3D10_SIT_CBUFFER: case D3D10_SIT_TBUFFER: + if (sr->bind_count != 1) + { + WARN("Unexpected bind count %u for a buffer %s.\n", bind_desc.BindCount, + debugstr_a(bind_desc.Name)); + return E_UNEXPECTED; + } sr->variable = d3d10_effect_get_buffer_by_name(v->effect, bind_desc.Name); break;
@@ -4019,17 +4025,17 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad switch (v->type->basetype) { case D3D10_SVT_VERTEXSHADER: - ID3D10Device_VSSetConstantBuffers(device, sr->bind_point, sr->bind_count, + ID3D10Device_VSSetConstantBuffers(device, sr->bind_point, 1, &rsrc_v->u.buffer.buffer); break;
case D3D10_SVT_PIXELSHADER: - ID3D10Device_PSSetConstantBuffers(device, sr->bind_point, sr->bind_count, + ID3D10Device_PSSetConstantBuffers(device, sr->bind_point, 1, &rsrc_v->u.buffer.buffer); break;
case D3D10_SVT_GEOMETRYSHADER: - ID3D10Device_GSSetConstantBuffers(device, sr->bind_point, sr->bind_count, + ID3D10Device_GSSetConstantBuffers(device, sr->bind_point, 1, &rsrc_v->u.buffer.buffer); break;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index de236ca2513..38bde6ef83c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -968,9 +968,8 @@ static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object, D
static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, struct d3d10_effect_type *t) { - DWORD typeinfo, type_flags; + DWORD typeinfo, type_flags, type_kind; const char *ptr; - DWORD unknown0; unsigned int i;
if (offset >= data_size || !require_space(offset, 6, sizeof(DWORD), data_size)) @@ -990,8 +989,8 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, } TRACE("Type name: %s.\n", debugstr_a(t->name));
- read_dword(&ptr, &unknown0); - TRACE("Unknown 0: %u.\n", unknown0); + read_dword(&ptr, &type_kind); + TRACE("Kind: %u.\n", type_kind);
read_dword(&ptr, &t->element_count); TRACE("Element count: %u.\n", t->element_count); @@ -1005,9 +1004,11 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, read_dword(&ptr, &t->size_packed); TRACE("Packed size %#x.\n", t->size_packed);
- switch (unknown0) + switch (type_kind) { case 1: + TRACE("Type is numeric.\n"); + if (!require_space(ptr - data, 1, sizeof(typeinfo), data_size)) { WARN("Invalid offset %#x (data size %#lx).\n", offset, (long)data_size); @@ -1122,7 +1123,7 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, break;
default: - FIXME("Unhandled case %#x.\n", unknown0); + FIXME("Unhandled type kind %#x.\n", type_kind); return E_FAIL; }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index de236ca2513..38bde6ef83c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -968,9 +968,8 @@ static D3D10_SHADER_VARIABLE_TYPE d3d10_variable_type(DWORD t, BOOL is_object, D
static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, struct d3d10_effect_type *t) {
- DWORD typeinfo, type_flags;
- DWORD typeinfo, type_flags, type_kind; const char *ptr;
DWORD unknown0; unsigned int i;
if (offset >= data_size || !require_space(offset, 6, sizeof(DWORD), data_size))
@@ -990,8 +989,8 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, } TRACE("Type name: %s.\n", debugstr_a(t->name));
- read_dword(&ptr, &unknown0);
- TRACE("Unknown 0: %u.\n", unknown0);
read_dword(&ptr, &type_kind);
TRACE("Kind: %u.\n", type_kind);
read_dword(&ptr, &t->element_count); TRACE("Element count: %u.\n", t->element_count);
@@ -1005,9 +1004,11 @@ static HRESULT parse_fx10_type(const char *data, size_t data_size, DWORD offset, read_dword(&ptr, &t->size_packed); TRACE("Packed size %#x.\n", t->size_packed);
- switch (unknown0)
- switch (type_kind) { case 1:
TRACE("Type is numeric.\n");
if (!require_space(ptr - data, 1, sizeof(typeinfo), data_size)) { WARN("Invalid offset %#x (data size %#lx).\n", offset, (long)data_size);
If you feel fancy you could introduce an enum. Not required by any means.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 260 +++++++++++++++++-------------------- 2 files changed, 120 insertions(+), 142 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 3fd17c7400d..31e38713c5f 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -273,7 +273,7 @@ struct d3d10_effect LONG refcount;
ID3D10Device *device; - ID3D10Effect *pool; + struct d3d10_effect *pool; DWORD version; DWORD local_buffer_count; DWORD variable_count; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 38bde6ef83c..ff6e6de1e76 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -49,6 +49,14 @@ static inline struct d3d10_effect *impl_from_ID3D10EffectPool(ID3D10EffectPool * return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10EffectPool_iface); }
+const struct ID3D10EffectPoolVtbl d3d10_effect_pool_vtbl; +static inline struct d3d10_effect *unsafe_impl_from_ID3D10EffectPool(ID3D10EffectPool *iface) +{ + if (!iface || iface->lpVtbl != &d3d10_effect_pool_vtbl) + return NULL; + return CONTAINING_RECORD(iface, struct d3d10_effect, ID3D10EffectPool_iface); +} + static const struct ID3D10EffectVtbl d3d10_effect_pool_effect_vtbl; static void d3d10_effect_variable_destroy(struct d3d10_effect_variable *v);
@@ -550,83 +558,42 @@ static BOOL copy_name(const char *ptr, char **name) static struct d3d10_effect_variable * d3d10_effect_get_buffer_by_name(struct d3d10_effect *effect, const char *name) { - ID3D10EffectVariable *v; unsigned int i;
for (i = 0; i < effect->local_buffer_count; ++i) { struct d3d10_effect_variable *l = &effect->local_buffers[i]; if (l->name && !strcmp(l->name, name)) - { - TRACE("Found local buffer %s.\n", debugstr_a(name)); return l; - } }
- if (effect->pool) - { - if ((v = (ID3D10EffectVariable *)effect->pool->lpVtbl->GetConstantBufferByName(effect->pool, name)) - && v->lpVtbl->IsValid(v)) - { - TRACE("Found shared buffer %s.\n", debugstr_a(name)); - return impl_from_ID3D10EffectVariable(v); - } - } - - return NULL; + return effect->pool ? d3d10_effect_get_buffer_by_name(effect->pool, name) : NULL; }
-static struct d3d10_effect_variable * d3d10_effect_get_variable_by_name(const struct d3d10_effect *effect, - const char *name) +static struct d3d10_effect_variable * d3d10_effect_get_variable_by_name( + const struct d3d10_effect *effect, const char *name) { - ID3D10EffectVariable *v; - unsigned int i; + struct d3d10_effect_variable *v; + unsigned int i, j;
for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &effect->local_buffers[i]; - unsigned int j; - - for (j = 0; j < l->type->member_count; ++j) + for (j = 0; j < effect->local_buffers[i].type->member_count; ++j) { - struct d3d10_effect_variable *v = &l->members[j]; - + v = &effect->local_buffers[i].members[j]; if (v->name && !strcmp(v->name, name)) - { - TRACE("Returning local buffer member variable %s.\n", debugstr_a(name)); return v; - } } }
for (i = 0; i < effect->local_variable_count; ++i) { struct d3d10_effect_variable *v = &effect->local_variables[i]; - if (v->name && !strcmp(v->name, name)) - { - TRACE("Returning local variable %s.\n", debugstr_a(name)); return v; - } }
- if (effect->pool) - { - if ((v = (ID3D10EffectVariable *)effect->pool->lpVtbl->GetVariableByName(effect->pool, name)) - && v->lpVtbl->IsValid(v)) - { - TRACE("Found shared variable %s.\n", debugstr_a(name)); - return impl_from_ID3D10EffectVariable(v); - } - } - - return NULL; -} - -static struct d3d10_effect_variable * d3d10_effect_get_shader_resource_variable_by_name( - const struct d3d10_effect *effect, const char *name) -{ - return d3d10_effect_get_variable_by_name(effect, name); + return effect->pool ? d3d10_effect_get_variable_by_name(effect->pool, name) : NULL; }
static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const void *data, size_t data_size) @@ -670,8 +637,7 @@ static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const
case D3D10_SIT_SAMPLER: case D3D10_SIT_TEXTURE: - sr->variable = d3d10_effect_get_shader_resource_variable_by_name(v->effect, - bind_desc.Name); + sr->variable = d3d10_effect_get_variable_by_name(v->effect, bind_desc.Name); break;
default: @@ -2681,26 +2647,25 @@ 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; + struct d3d10_effect_variable *sv;
switch (v->type->basetype) { case D3D10_SVT_CBUFFER: case D3D10_SVT_TBUFFER: - sv = (ID3D10EffectVariable *)effect->pool->lpVtbl->GetConstantBufferByName( - effect->pool, v->name); + sv = d3d10_effect_get_buffer_by_name(effect->pool, v->name); break; default: - sv = effect->pool->lpVtbl->GetVariableByName(effect->pool, v->name); + sv = d3d10_effect_get_variable_by_name(effect->pool, v->name); }
- if (!sv->lpVtbl->IsValid(sv)) + if (!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)) + if (!d3d10_effect_types_match(sv->type, v->type)) { WARN("Variable %s type does not match pool type.\n", debugstr_a(v->name)); return E_INVALIDARG; @@ -3288,7 +3253,7 @@ static ULONG STDMETHODCALLTYPE d3d10_effect_Release(ID3D10Effect *iface) wine_rb_destroy(&This->types, d3d10_effect_type_destroy, NULL);
if (This->pool) - This->pool->lpVtbl->Release(This->pool); + IUnknown_Release(&This->pool->ID3D10Effect_iface); ID3D10Device_Release(This->device); heap_free(This); } @@ -3326,59 +3291,72 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDevice(ID3D10Effect *iface, ID3 return S_OK; }
+static void d3d10_effect_get_desc(const struct d3d10_effect *effect, D3D10_EFFECT_DESC *desc) +{ + unsigned int i; + + desc->IsChildEffect = !!effect->pool; + desc->ConstantBuffers = effect->local_buffer_count; + desc->SharedConstantBuffers = 0; + desc->GlobalVariables = effect->local_variable_count; + for (i = 0; i < effect->local_buffer_count; ++i) + { + desc->GlobalVariables += effect->local_buffers[i].type->member_count; + } + desc->SharedGlobalVariables = 0; + desc->Techniques = effect->technique_count; +} + static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10_EFFECT_DESC *desc) { struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); D3D10_EFFECT_DESC pool_desc = { 0 }; - unsigned int i; - HRESULT hr;
TRACE("iface %p, desc %p.\n", iface, desc);
if (!desc) return E_INVALIDARG;
- if (effect->pool && FAILED(hr = effect->pool->lpVtbl->GetDesc(effect->pool, &pool_desc))) - { - WARN("Failed to get pool description, hr %#x.\n", hr); - return hr; - } + if (effect->pool) + d3d10_effect_get_desc(effect->pool, &pool_desc); + + d3d10_effect_get_desc(effect, desc);
- desc->IsChildEffect = !!effect->pool; - desc->ConstantBuffers = effect->local_buffer_count; desc->SharedConstantBuffers = pool_desc.ConstantBuffers; - desc->GlobalVariables = effect->local_variable_count; - for (i = 0; i < effect->local_buffer_count; ++i) - { - struct d3d10_effect_variable *l = &effect->local_buffers[i]; - desc->GlobalVariables += l->type->member_count; - } desc->SharedGlobalVariables = pool_desc.GlobalVariables; - desc->Techniques = effect->technique_count;
return S_OK; }
+static struct d3d10_effect_variable * d3d10_effect_get_buffer_by_index(struct d3d10_effect *effect, + unsigned int index) +{ + if (index < effect->local_buffer_count) + return &effect->local_buffers[index]; + index -= effect->local_buffer_count; + + return effect->pool ? d3d10_effect_get_buffer_by_index(effect->pool, index) : NULL; +} + +static BOOL is_var_shared(const struct d3d10_effect_variable *v) +{ + return !!(v->flag & D3D10_EFFECT_VARIABLE_POOLED); +} + static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface, UINT index) { struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); - struct d3d10_effect_variable *l; + struct d3d10_effect_variable *v;
TRACE("iface %p, index %u\n", iface, index);
- if (index < effect->local_buffer_count) + if ((v = d3d10_effect_get_buffer_by_index(effect, index))) { - l = &effect->local_buffers[index]; - - TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name)); - - return (ID3D10EffectConstantBuffer *)&l->ID3D10EffectVariable_iface; + TRACE("Returning %sbuffer %p, name %s.\n", is_var_shared(v) ? "shared " : "", v, + debugstr_a(v->name)); + return (ID3D10EffectConstantBuffer *)&v->ID3D10EffectVariable_iface; } - index -= effect->local_buffer_count; - - if (effect->pool) - return effect->pool->lpVtbl->GetConstantBufferByIndex(effect->pool, index);
WARN("Invalid index specified\n");
@@ -3395,7 +3373,7 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon
if ((v = d3d10_effect_get_buffer_by_name(effect, name))) { - TRACE("Returning buffer %p.\n", v); + TRACE("Returning %sbuffer %p.\n", is_var_shared(v) ? "shared " : "", v); return (ID3D10EffectConstantBuffer *)&v->ID3D10EffectVariable_iface; }
@@ -3404,38 +3382,38 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface; }
-static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index) +static struct d3d10_effect_variable * d3d10_effect_get_variable_by_index( + const struct d3d10_effect *effect, unsigned int index) { - struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
- TRACE("iface %p, index %u\n", iface, index); - for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &effect->local_buffers[i]; - - if (index < l->type->member_count) - { - struct d3d10_effect_variable *v = &l->members[index]; - - TRACE("Returning variable %p.\n", v); - return &v->ID3D10EffectVariable_iface; - } - index -= l->type->member_count; + struct d3d10_effect_variable *v = &effect->local_buffers[i]; + if (index < v->type->member_count) + return &v->members[index]; + index -= v->type->member_count; }
if (index < effect->local_variable_count) - { - struct d3d10_effect_variable *v = &effect->local_variables[index]; + return &effect->local_variables[index]; + index -= effect->local_variable_count; + + return effect->pool ? d3d10_effect_get_variable_by_index(effect->pool, index) : NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index) +{ + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); + struct d3d10_effect_variable *v;
- TRACE("Returning variable %p.\n", v); + TRACE("iface %p, index %u\n", iface, index); + + if ((v = d3d10_effect_get_variable_by_index(effect, index))) + { + TRACE("Returning %svariable %s.\n", is_var_shared(v) ? "shared " : NULL, debugstr_a(v->name)); return &v->ID3D10EffectVariable_iface; } - index -= effect->local_variable_count; - - if (effect->pool) - return effect->pool->lpVtbl->GetVariableByIndex(effect->pool, index);
WARN("Invalid index specified\n");
@@ -3458,7 +3436,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB
if ((v = d3d10_effect_get_variable_by_name(effect, name))) { - TRACE("Returning variable %p.\n", v); + TRACE("Returning %svariable %p.\n", is_var_shared(v) ? "shared " : "", v); return &v->ID3D10EffectVariable_iface; }
@@ -3467,20 +3445,11 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB return &null_variable.ID3D10EffectVariable_iface; }
-static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface, - const char *semantic) +static struct d3d10_effect_variable * d3d10_effect_get_variable_by_semantic( + const struct d3d10_effect *effect, const char *semantic) { - struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
- TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic)); - - if (!semantic) - { - WARN("Invalid semantic specified\n"); - return &null_variable.ID3D10EffectVariable_iface; - } - for (i = 0; i < effect->local_buffer_count; ++i) { struct d3d10_effect_variable *l = &effect->local_buffers[i]; @@ -3491,10 +3460,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB struct d3d10_effect_variable *v = &l->members[j];
if (v->semantic && !stricmp(v->semantic, semantic)) - { - TRACE("Returning variable %p.\n", v); - return &v->ID3D10EffectVariable_iface; - } + return v; } }
@@ -3503,14 +3469,31 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB struct d3d10_effect_variable *v = &effect->local_variables[i];
if (v->semantic && !stricmp(v->semantic, semantic)) - { - TRACE("Returning variable %p.\n", v); - return &v->ID3D10EffectVariable_iface; - } + return v; }
- if (effect->pool) - return effect->pool->lpVtbl->GetVariableBySemantic(effect->pool, semantic); + return effect->pool ? d3d10_effect_get_variable_by_semantic(effect->pool, semantic) : NULL; +} + +static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface, + const char *semantic) +{ + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); + struct d3d10_effect_variable *v; + + TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic)); + + if (!semantic) + { + WARN("Invalid semantic specified\n"); + return &null_variable.ID3D10EffectVariable_iface; + } + + if ((v = d3d10_effect_get_variable_by_semantic(effect, semantic))) + { + TRACE("Returning %svariable %s.\n", is_var_shared(v) ? "shared " : "", debugstr_a(v->name)); + return &v->ID3D10EffectVariable_iface; + }
WARN("Invalid semantic specified\n");
@@ -3622,7 +3605,7 @@ static BOOL STDMETHODCALLTYPE d3d10_effect_IsOptimized(ID3D10Effect *iface) return !!(effect->flags & D3D10_EFFECT_OPTIMIZED); }
-const struct ID3D10EffectVtbl d3d10_effect_vtbl = +static const struct ID3D10EffectVtbl d3d10_effect_vtbl = { /* IUnknown methods */ d3d10_effect_QueryInterface, @@ -8599,7 +8582,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, unsigned int flags, struct d3d10_effect **effect) + struct d3d10_effect *pool, unsigned int flags, struct d3d10_effect **effect) { struct d3d10_effect *object; HRESULT hr; @@ -8616,7 +8599,7 @@ static HRESULT d3d10_create_effect(void *data, SIZE_T data_size, ID3D10Device *d object->device = device; object->pool = pool; object->flags = flags; - if (pool) pool->lpVtbl->AddRef(pool); + if (pool) IUnknown_AddRef(&pool->ID3D10Effect_iface);
hr = d3d10_effect_parse(object, data, data_size); if (FAILED(hr)) @@ -8634,8 +8617,7 @@ static HRESULT d3d10_create_effect(void *data, SIZE_T data_size, ID3D10Device *d HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags, ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect) { - struct d3d10_effect *object; - ID3D10Effect *pool = NULL; + struct d3d10_effect *object, *pool = NULL; HRESULT hr;
TRACE("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p.\n", @@ -8644,14 +8626,10 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool) return E_INVALIDARG;
- if (effect_pool) + if (effect_pool && !(pool = unsafe_impl_from_ID3D10EffectPool(effect_pool))) { - pool = effect_pool->lpVtbl->AsEffect(effect_pool); - if (pool->lpVtbl != &d3d10_effect_pool_effect_vtbl) - { - WARN("External pool implementations are not supported.\n"); - return E_INVALIDARG; - } + WARN("External pool implementations are not supported.\n"); + return E_INVALIDARG; }
if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object)))
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 8 +++++++- dlls/d3d10/effect.c | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 31e38713c5f..1ebbbd11ea3 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -124,6 +124,12 @@ struct d3d10_effect_shader_variable unsigned int isinline : 1; };
+struct d3d10_effect_sampler_desc +{ + D3D10_SAMPLER_DESC desc; + struct d3d10_effect_variable *texture; +}; + struct d3d10_effect_state_object_variable { union @@ -131,7 +137,7 @@ struct d3d10_effect_state_object_variable D3D10_RASTERIZER_DESC rasterizer; D3D10_DEPTH_STENCIL_DESC depth_stencil; D3D10_BLEND_DESC blend; - D3D10_SAMPLER_DESC sampler; + struct d3d10_effect_sampler_desc sampler; } desc; union { diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index ff6e6de1e76..e1b004a82e4 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -209,16 +209,16 @@ static const struct d3d10_effect_state_property_info property_info[] = {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) }, + {0x2d, "SamplerState.Filter", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.Filter) }, + {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) }, + {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) }, + {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) }, + {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) }, + {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) }, + {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) }, + {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) }, + {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) }, + {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) }, };
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -2159,7 +2159,7 @@ static HRESULT create_state_object(struct d3d10_effect_variable *v)
case D3D10_SVT_SAMPLER: if (FAILED(hr = ID3D10Device_CreateSamplerState(device, - &v->u.state.desc.sampler, &v->u.state.object.sampler))) + &v->u.state.desc.sampler.desc, &v->u.state.object.sampler))) return hr; break;
@@ -8302,7 +8302,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_sampler_variable_GetBackingStore(I return E_FAIL; }
- *desc = v->u.state.desc.sampler; + *desc = v->u.state.desc.sampler.desc;
return S_OK; }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 90 ++++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 72 ++++++++++++++++--------------- 2 files changed, 84 insertions(+), 78 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e1b004a82e4..9eead8d5179 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -176,49 +176,50 @@ struct d3d10_effect_state_property_info
static const struct d3d10_effect_state_property_info property_info[] = { - {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(struct d3d10_effect_sampler_desc, desc.Filter) }, - {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) }, - {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) }, - {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) }, - {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) }, - {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) }, - {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) }, - {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) }, - {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) }, - {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, 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(struct d3d10_effect_sampler_desc, desc.Filter) }, + {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) }, + {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) }, + {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) }, + {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) }, + {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) }, + {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) }, + {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) }, + {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) }, + {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) }, + {0x37, "SamplerState.Texture", D3D10_SVT_TEXTURE, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, texture) }, };
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -1657,6 +1658,9 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, return FALSE; break;
+ case D3D10_SVT_TEXTURE: + break; + default: FIXME("Unhandled out_type %#x.\n", out_type); return FALSE; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 2cef4d425f3..3561e99f338 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4075,6 +4075,7 @@ SamplerState sampler0 BorderColor = float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */ MinLOD = 6u; /* 0x35 */ MaxLOD = 5u; /* 0x36 */ + Texture = NULL; /* 0x37 */ };
technique10 tech0 @@ -4089,9 +4090,9 @@ technique10 tech0 #endif static DWORD fx_test_state_groups[] = { - 0x43425844, 0xacdae4ef, 0x5046a276, 0xda953136, 0x0b78e818, 0x00000001, 0x00000773, 0x00000001, - 0x00000024, 0x30315846, 0x00000747, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00000353, 0x00000000, 0x00000000, 0x00000001, 0x00000001, + 0x43425844, 0xf231bc81, 0x3edcd6f4, 0x932fe6e0, 0x86fbdec1, 0x00000001, 0x0000078f, 0x00000001, + 0x00000024, 0x30315846, 0x00000763, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x0000035f, 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, @@ -4117,38 +4118,39 @@ static DWORD fx_test_state_groups[] = 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, + 0x01000000, 0x02000000, 0x00000000, 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, 0x0bffffff, + 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, + 0x37000002, 0x00000000, 0x01000000, 0x0b000000, 0x00000003, 0x17000000, 0x01000003, 0x00000000, + 0x1d000000, 0x06000003, 0x00000000, 0x0a000000, 0x00000000, 0x01000000, 0x23000000, 0x0b000003, + 0x00000000, 0x01000000, 0x47000000, 0x02000003, 0x00000000, 0x02000000, 0xb9000000, 0x09000001, + 0x00000000, 0x01000000, 0x53000000, 0x01000003, 0x00000000, 0x02000000, 0xe1000000, 0x00000000, + 0x00000000, 0x02000000, 0x30000000, 0x00000000, };
static void test_effect_state_groups(void)
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 90 ++++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 72 ++++++++++++++++--------------- 2 files changed, 84 insertions(+), 78 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e1b004a82e4..9eead8d5179 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -176,49 +176,50 @@ struct d3d10_effect_state_property_info
static const struct d3d10_effect_state_property_info property_info[] = {
- {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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, 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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) },
- {0x37, "SamplerState.Texture", D3D10_SVT_TEXTURE, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, texture) },
};
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -1657,6 +1658,9 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, return FALSE; break;
case D3D10_SVT_TEXTURE:
break;
default: FIXME("Unhandled out_type %#x.\n", out_type); return FALSE;
At least for the test below, NULL texture is encoded as D3D10_SVT_INT 0. What happens for a non-NULL texture?
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 2cef4d425f3..3561e99f338 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4075,6 +4075,7 @@ SamplerState sampler0 BorderColor = float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */ MinLOD = 6u; /* 0x35 */ MaxLOD = 5u; /* 0x36 */
- Texture = NULL; /* 0x37 */
};
technique10 tech0 @@ -4089,9 +4090,9 @@ technique10 tech0 #endif static DWORD fx_test_state_groups[] = {
- 0x43425844, 0xacdae4ef, 0x5046a276, 0xda953136, 0x0b78e818, 0x00000001, 0x00000773, 0x00000001,
- 0x00000024, 0x30315846, 0x00000747, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
- 0x00000000, 0x00000000, 0x00000001, 0x00000353, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
- 0x43425844, 0xf231bc81, 0x3edcd6f4, 0x932fe6e0, 0x86fbdec1, 0x00000001, 0x0000078f, 0x00000001,
- 0x00000024, 0x30315846, 0x00000763, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
- 0x00000000, 0x00000000, 0x00000001, 0x0000035f, 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,
@@ -4117,38 +4118,39 @@ static DWORD fx_test_state_groups[] = 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,
- 0x01000000, 0x02000000, 0x00000000, 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, 0x0bffffff,
- 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,
- 0x37000002, 0x00000000, 0x01000000, 0x0b000000, 0x00000003, 0x17000000, 0x01000003, 0x00000000,
- 0x1d000000, 0x06000003, 0x00000000, 0x0a000000, 0x00000000, 0x01000000, 0x23000000, 0x0b000003,
- 0x00000000, 0x01000000, 0x47000000, 0x02000003, 0x00000000, 0x02000000, 0xb9000000, 0x09000001,
- 0x00000000, 0x01000000, 0x53000000, 0x01000003, 0x00000000, 0x02000000, 0xe1000000, 0x00000000,
- 0x00000000, 0x02000000, 0x30000000, 0x00000000,
};
static void test_effect_state_groups(void)
2.33.0
On 10/5/21 11:20 AM, Matteo Bruni wrote:
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 90 ++++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 72 ++++++++++++++++--------------- 2 files changed, 84 insertions(+), 78 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e1b004a82e4..9eead8d5179 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -176,49 +176,50 @@ struct d3d10_effect_state_property_info
static const struct d3d10_effect_state_property_info property_info[] = {
- {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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, 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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) },
- {0x37, "SamplerState.Texture", D3D10_SVT_TEXTURE, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, texture) },
};
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -1657,6 +1658,9 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, return FALSE; break;
case D3D10_SVT_TEXTURE:
break;
default: FIXME("Unhandled out_type %#x.\n", out_type); return FALSE;
At least for the test below, NULL texture is encoded as D3D10_SVT_INT 0. What happens for a non-NULL texture?
If it's non-NULL, it would be D3D10_EOO_VAR. Now, we could of course validate SVT_INT(0) constants for object fields, but I thought that could wait. You won't get such records from successful compilation.
On Tue, Oct 5, 2021 at 10:27 AM Nikolay Sivov nsivov@codeweavers.com wrote:
On 10/5/21 11:20 AM, Matteo Bruni wrote:
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 90 ++++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 72 ++++++++++++++++--------------- 2 files changed, 84 insertions(+), 78 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e1b004a82e4..9eead8d5179 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -176,49 +176,50 @@ struct d3d10_effect_state_property_info
static const struct d3d10_effect_state_property_info property_info[] = {
- {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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, 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(struct d3d10_effect_sampler_desc, desc.Filter) },
- {0x2e, "SamplerState.AddressU", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressU) },
- {0x2f, "SamplerState.AddressV", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressV) },
- {0x30, "SamplerState.AddressW", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.AddressW) },
- {0x31, "SamplerState.MipLODBias", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MipLODBias) },
- {0x32, "SamplerState.MaxAnisotropy", D3D10_SVT_UINT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxAnisotropy) },
- {0x33, "SamplerState.ComparisonFunc", D3D10_SVT_INT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.ComparisonFunc) },
- {0x34, "SamplerState.BorderColor", D3D10_SVT_FLOAT, 4, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.BorderColor) },
- {0x35, "SamplerState.MinLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MinLOD) },
- {0x36, "SamplerState.MaxLOD", D3D10_SVT_FLOAT, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, desc.MaxLOD) },
- {0x37, "SamplerState.Texture", D3D10_SVT_TEXTURE, 1, 1, D3D10_C_SAMPLER, FIELD_OFFSET(struct d3d10_effect_sampler_desc, texture) },
};
static const D3D10_RASTERIZER_DESC default_rasterizer_desc = @@ -1657,6 +1658,9 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, return FALSE; break;
case D3D10_SVT_TEXTURE:
break;
default: FIXME("Unhandled out_type %#x.\n", out_type); return FALSE;
At least for the test below, NULL texture is encoded as D3D10_SVT_INT 0. What happens for a non-NULL texture?
If it's non-NULL, it would be D3D10_EOO_VAR. Now, we could of course validate SVT_INT(0) constants for object fields, but I thought that could wait. You won't get such records from successful compilation.
Thanks. Yes, seems fine.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 9 +++-- dlls/d3d10/effect.c | 74 +++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 28 +++++++++++++++ 3 files changed, 72 insertions(+), 39 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 1ebbbd11ea3..216a5ae82a2 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -238,9 +238,12 @@ struct d3d10_effect_pass struct d3d10_effect_object *objects; struct d3d10_effect_variable *annotations;
- D3D10_PASS_SHADER_DESC vs; - D3D10_PASS_SHADER_DESC ps; - D3D10_PASS_SHADER_DESC gs; + struct d3d10_effect_variable *vs; + struct d3d10_effect_variable *ps; + struct d3d10_effect_variable *gs; + unsigned int vs_index; + unsigned int ps_index; + unsigned int gs_index; UINT stencil_ref; UINT sample_mask; float blend_factor[4]; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 9eead8d5179..b01b3d5d4a2 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1944,8 +1944,8 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size, ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable); if (FAILED(hr = sv->lpVtbl->GetVertexShader(sv, variable_idx, &o->object.vs))) return hr; - o->pass->vs.pShaderVariable = sv; - o->pass->vs.ShaderIndex = variable_idx; + o->pass->vs = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)sv); + o->pass->vs_index = variable_idx; break; }
@@ -1954,8 +1954,8 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size, ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable); if (FAILED(hr = sv->lpVtbl->GetPixelShader(sv, variable_idx, &o->object.ps))) return hr; - o->pass->ps.pShaderVariable = sv; - o->pass->ps.ShaderIndex = variable_idx; + o->pass->ps = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)sv); + o->pass->ps_index = variable_idx; break; }
@@ -1964,8 +1964,8 @@ static HRESULT parse_fx10_object(const char *data, size_t data_size, ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable); if (FAILED(hr = sv->lpVtbl->GetGeometryShader(sv, variable_idx, &o->object.gs))) return hr; - o->pass->gs.pShaderVariable = sv; - o->pass->gs.ShaderIndex = variable_idx; + o->pass->gs = impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)sv); + o->pass->gs_index = variable_idx; break; }
@@ -2018,9 +2018,9 @@ static HRESULT parse_fx10_pass(const char *data, size_t data_size, return E_OUTOFMEMORY; }
- p->vs.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface; - p->ps.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface; - p->gs.pShaderVariable = (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface; + p->vs = &null_shader_variable; + p->ps = &null_shader_variable; + p->gs = &null_shader_variable;
for (i = 0; i < p->object_count; ++i) { @@ -3819,7 +3819,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa return E_INVALIDARG; }
- s = &impl_from_ID3D10EffectShaderVariable(pass->vs.pShaderVariable)->u.shader; + s = &pass->vs->u.shader;
desc->Name = pass->name; desc->Annotations = pass->annotation_count; @@ -3843,23 +3843,24 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc) { - struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface); + struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface);
- TRACE("iface %p, desc %p\n", iface, desc); + TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_pass) + if (pass == &null_pass) { - WARN("Null pass specified\n"); + WARN("Null pass specified.\n"); return E_FAIL; }
if (!desc) { - WARN("Invalid argument specified\n"); + WARN("Invalid argument specified.\n"); return E_INVALIDARG; }
- *desc = This->vs; + desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->vs->ID3D10EffectVariable_iface; + desc->ShaderIndex = pass->vs_index;
return S_OK; } @@ -3867,23 +3868,24 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetVertexShaderDesc(ID3D10Eff static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc) { - struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface); + struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface);
- TRACE("iface %p, desc %p\n", iface, desc); + TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_pass) + if (pass == &null_pass) { - WARN("Null pass specified\n"); + WARN("Null pass specified.\n"); return E_FAIL; }
if (!desc) { - WARN("Invalid argument specified\n"); + WARN("Invalid argument specified.\n"); return E_INVALIDARG; }
- *desc = This->gs; + desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->gs->ID3D10EffectVariable_iface; + desc->ShaderIndex = pass->gs_index;
return S_OK; } @@ -3891,23 +3893,24 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetGeometryShaderDesc(ID3D10E static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetPixelShaderDesc(ID3D10EffectPass *iface, D3D10_PASS_SHADER_DESC *desc) { - struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface); + struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface);
- TRACE("iface %p, desc %p\n", iface, desc); + TRACE("iface %p, desc %p.\n", iface, desc);
- if (This == &null_pass) + if (pass == &null_pass) { - WARN("Null pass specified\n"); + WARN("Null pass specified.\n"); return E_FAIL; }
if (!desc) { - WARN("Invalid argument specified\n"); + WARN("Invalid argument specified.\n"); return E_INVALIDARG; }
- *desc = This->ps; + desc->pShaderVariable = (ID3D10EffectShaderVariable *)&pass->ps->ID3D10EffectVariable_iface; + desc->ShaderIndex = pass->ps_index;
return S_OK; } @@ -3992,9 +3995,8 @@ static void set_sampler(ID3D10Device *device, D3D10_SHADER_VARIABLE_TYPE shader_ } }
-static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShaderVariable *variable) +static void apply_shader_resources(ID3D10Device *device, struct d3d10_effect_variable *v) { - struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(variable); struct d3d10_effect_shader_variable *sv = &v->u.shader; struct d3d10_effect_shader_resource *sr; struct d3d10_effect_variable *rsrc_v; @@ -4092,12 +4094,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface
if (flags) FIXME("Ignoring flags (%#x)\n", flags);
- if (pass->vs.pShaderVariable != (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface) - apply_shader_resources(device, pass->vs.pShaderVariable); - if (pass->gs.pShaderVariable != (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface) - apply_shader_resources(device, pass->gs.pShaderVariable); - if (pass->ps.pShaderVariable != (ID3D10EffectShaderVariable *)&null_shader_variable.ID3D10EffectVariable_iface) - apply_shader_resources(device, pass->ps.pShaderVariable); + if (pass->vs != &null_shader_variable) + apply_shader_resources(device, pass->vs); + if (pass->gs != &null_shader_variable) + apply_shader_resources(device, pass->gs); + if (pass->ps != &null_shader_variable) + apply_shader_resources(device, pass->ps);
for (i = 0; i < pass->object_count; ++i) { diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3561e99f338..06c5aa68776 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -2911,6 +2911,7 @@ static void test_effect_local_shader(void) *p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs, *gs, *ps, *vs; D3D10_EFFECT_SHADER_DESC shaderdesc; D3D10_SIGNATURE_PARAMETER_DESC sign; + D3D10_STATE_BLOCK_MASK mask; ID3D10Device *device; ULONG refcount;
@@ -3010,6 +3011,20 @@ if (0)
/* pass 0 */ p = t->lpVtbl->GetPassByIndex(t, 0); + + /* Pass without Set*Shader() instructions */ + hr = D3D10StateBlockMaskDisableAll(&mask); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = p->lpVtbl->ComputeStateBlockMask(p, &mask); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_VS, 0); + ok(!ret, "Unexpected mask.\n"); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_PS, 0); + ok(!ret, "Unexpected mask.\n"); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_GS, 0); + ok(!ret, "Unexpected mask.\n"); + hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc); ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK); ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader); @@ -3145,6 +3160,19 @@ if (0) ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize); ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
+ /* Pass is using Set*Shader(NULL) */ + hr = D3D10StateBlockMaskDisableAll(&mask); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = p->lpVtbl->ComputeStateBlockMask(p, &mask); +todo_wine { + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_VS, 0); + ok(ret, "Unexpected mask.\n"); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_PS, 0); + ok(ret, "Unexpected mask.\n"); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_GS, 0); + ok(ret, "Unexpected mask.\n"); +} /* pass 2 */ p = t->lpVtbl->GetPassByIndex(t, 2);
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 9 +++-- dlls/d3d10/effect.c | 74 +++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 28 +++++++++++++++ 3 files changed, 72 insertions(+), 39 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 1ebbbd11ea3..216a5ae82a2 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -238,9 +238,12 @@ struct d3d10_effect_pass struct d3d10_effect_object *objects; struct d3d10_effect_variable *annotations;
- D3D10_PASS_SHADER_DESC vs;
- D3D10_PASS_SHADER_DESC ps;
- D3D10_PASS_SHADER_DESC gs;
- struct d3d10_effect_variable *vs;
- struct d3d10_effect_variable *ps;
- struct d3d10_effect_variable *gs;
- unsigned int vs_index;
- unsigned int ps_index;
- unsigned int gs_index; UINT stencil_ref; UINT sample_mask; float blend_factor[4];
I think It would be a bit nicer to introduce our own struct to store both the variable pointer and the index, mirroring D3D10_PASS_SHADER_DESC.
On 10/5/21 11:20 AM, Matteo Bruni wrote:
On Mon, Oct 4, 2021 at 1:49 PM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 9 +++-- dlls/d3d10/effect.c | 74 +++++++++++++++++++------------------- dlls/d3d10/tests/effect.c | 28 +++++++++++++++ 3 files changed, 72 insertions(+), 39 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 1ebbbd11ea3..216a5ae82a2 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -238,9 +238,12 @@ struct d3d10_effect_pass struct d3d10_effect_object *objects; struct d3d10_effect_variable *annotations;
- D3D10_PASS_SHADER_DESC vs;
- D3D10_PASS_SHADER_DESC ps;
- D3D10_PASS_SHADER_DESC gs;
- struct d3d10_effect_variable *vs;
- struct d3d10_effect_variable *ps;
- struct d3d10_effect_variable *gs;
- unsigned int vs_index;
- unsigned int ps_index;
- unsigned int gs_index; UINT stencil_ref; UINT sample_mask; float blend_factor[4];
I think It would be a bit nicer to introduce our own struct to store both the variable pointer and the index, mirroring D3D10_PASS_SHADER_DESC.
Sure, no harm in that, I'll resend 7/7 with next batch then. Thanks for the review.