Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 13 ------------ dlls/d3d10/effect.c | 42 ++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 35 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index e5659507eeb..11b3b4e9482 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -40,19 +40,6 @@ */ #define D3DERR_INVALIDCALL 0x8876086c
-enum d3d10_effect_object_type -{ - D3D10_EOT_RASTERIZER_STATE = 0x0, - D3D10_EOT_DEPTH_STENCIL_STATE = 0x1, - D3D10_EOT_BLEND_STATE = 0x2, - D3D10_EOT_VERTEXSHADER = 0x6, - D3D10_EOT_PIXELSHADER = 0x7, - D3D10_EOT_GEOMETRYSHADER = 0x8, - D3D10_EOT_STENCIL_REF = 0x9, - D3D10_EOT_BLEND_FACTOR = 0xa, - D3D10_EOT_SAMPLE_MASK = 0xb, -}; - enum d3d10_effect_object_type_flags { D3D10_EOT_FLAG_GS_SO = 0x1, diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 71ad3f64a05..bd104465222 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1485,36 +1485,34 @@ static HRESULT parse_fx10_annotations(const char *data, size_t data_size, const return hr; }
-static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s, - enum d3d10_effect_object_type otype) +static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, D3D_SHADER_VARIABLE_TYPE basetype, + struct d3d10_effect_anonymous_shader *s) { struct d3d10_effect_variable *v = &s->shader; struct d3d10_effect_type *t = &s->type; - const char *shader = NULL; + const char *name = NULL;
- switch (otype) + switch (basetype) { - case D3D10_EOT_VERTEXSHADER: - shader = "vertexshader"; - t->basetype = D3D10_SVT_VERTEXSHADER; + case D3D10_SVT_VERTEXSHADER: + name = "vertexshader"; break;
- case D3D10_EOT_PIXELSHADER: - shader = "pixelshader"; - t->basetype = D3D10_SVT_PIXELSHADER; + case D3D10_SVT_PIXELSHADER: + name = "pixelshader"; break;
- case D3D10_EOT_GEOMETRYSHADER: - shader = "geometryshader"; - t->basetype = D3D10_SVT_GEOMETRYSHADER; + case D3D10_SVT_GEOMETRYSHADER: + name = "geometryshader"; break;
default: - FIXME("Unhandled object type %#x.\n", otype); + WARN("Unhandled shader type %#x.\n", basetype); return E_FAIL; } + t->basetype = basetype;
- if (!copy_name(shader, &t->name)) + if (!copy_name(name, &t->name)) { ERR("Failed to copy name.\n"); return E_OUTOFMEMORY; @@ -1918,8 +1916,8 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
TRACE("Effect object starts at offset %#x.\n", value_offset);
- if (FAILED(hr = parse_fx10_anonymous_shader(effect, - &effect->anonymous_shaders[effect->anonymous_shader_current], property_info->id))) + if (FAILED(hr = parse_fx10_anonymous_shader(effect, property_info->type, + &effect->anonymous_shaders[effect->anonymous_shader_current]))) return hr;
variable = &effect->anonymous_shaders[effect->anonymous_shader_current].shader; @@ -1938,17 +1936,17 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size TRACE("Stream output declaration: %s.\n", debugstr_a(variable->u.shader.stream_output_declaration)); }
- switch (property_info->id) + switch (property_info->type) { - case D3D10_EOT_VERTEXSHADER: - case D3D10_EOT_PIXELSHADER: - case D3D10_EOT_GEOMETRYSHADER: + case D3D10_SVT_VERTEXSHADER: + case D3D10_SVT_PIXELSHADER: + case D3D10_SVT_GEOMETRYSHADER: if (FAILED(hr = parse_fx10_shader(data, data_size, value_offset, variable))) return hr; break;
default: - FIXME("Unhandled object type %#x\n", property_info->id); + WARN("Unexpected shader type %#x.\n", property_info->type); return E_FAIL; }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index bd104465222..a0bb859e535 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -8536,6 +8536,8 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl TRACE("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p.\n", data, data_size, flags, device, effect_pool, effect);
+ *effect = NULL; + if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool) return E_INVALIDARG;
@@ -8548,6 +8550,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object))) { WARN("Failed to create an effect, hr %#x.\n", hr); + return hr; }
*effect = &object->ID3D10Effect_iface; @@ -8598,6 +8601,8 @@ HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UIN TRACE("data %p, data_size %lu, fx_flags %#x, device %p, effect_pool %p.\n", data, data_size, fx_flags, device, effect_pool);
+ *effect_pool = NULL; + if (FAILED(hr = d3d10_create_effect(data, data_size, device, NULL, D3D10_EFFECT_IS_POOL, &object))) {
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index bd104465222..a0bb859e535 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -8536,6 +8536,8 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl TRACE("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p.\n", data, data_size, flags, device, effect_pool, effect);
- *effect = NULL;
- if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool) return E_INVALIDARG;
@@ -8548,6 +8550,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object))) { WARN("Failed to create an effect, hr %#x.\n", hr);
return hr;
}
*effect = &object->ID3D10Effect_iface;
@@ -8598,6 +8601,8 @@ HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UIN TRACE("data %p, data_size %lu, fx_flags %#x, device %p, effect_pool %p.\n", data, data_size, fx_flags, device, effect_pool);
- *effect_pool = NULL;
- if (FAILED(hr = d3d10_create_effect(data, data_size, device, NULL, D3D10_EFFECT_IS_POOL, &object))) {
Makes sense, sadly native seems to leave the pointer unchanged in those cases. We probably could use a few ok() calls in the tests checking for this.
I think we want the second hunk in any case.
On 10/15/21 12:46 PM, Matteo Bruni wrote:
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index bd104465222..a0bb859e535 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -8536,6 +8536,8 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl TRACE("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p.\n", data, data_size, flags, device, effect_pool, effect);
- *effect = NULL;
- if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool) return E_INVALIDARG;
@@ -8548,6 +8550,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl if (FAILED(hr = d3d10_create_effect(data, data_size, device, pool, 0, &object))) { WARN("Failed to create an effect, hr %#x.\n", hr);
return hr;
}
*effect = &object->ID3D10Effect_iface;
@@ -8598,6 +8601,8 @@ HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UIN TRACE("data %p, data_size %lu, fx_flags %#x, device %p, effect_pool %p.\n", data, data_size, fx_flags, device, effect_pool);
- *effect_pool = NULL;
- if (FAILED(hr = d3d10_create_effect(data, data_size, device, NULL, D3D10_EFFECT_IS_POOL, &object))) {
Makes sense, sadly native seems to leave the pointer unchanged in those cases. We probably could use a few ok() calls in the tests checking for this.
I think we want the second hunk in any case.
Right, all of it was for this missing return.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index a0bb859e535..c62c010f892 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -618,7 +618,7 @@ static struct d3d10_effect_variable * d3d10_effect_get_variable_by_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) +static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v) { struct d3d10_effect_shader_variable *sv = &v->u.shader; struct d3d10_effect_shader_resource *sr; @@ -846,7 +846,7 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse
memcpy(ID3D10Blob_GetBufferPointer(v->u.shader.bytecode), ptr, dxbc_size);
- if (FAILED(hr = get_fx10_shader_resources(v, ptr, dxbc_size))) + if (FAILED(hr = get_fx10_shader_resources(v))) return hr;
switch (v->type->basetype)
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index a0bb859e535..c62c010f892 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -618,7 +618,7 @@ static struct d3d10_effect_variable * d3d10_effect_get_variable_by_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) +static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v) { struct d3d10_effect_shader_variable *sv = &v->u.shader; struct d3d10_effect_shader_resource *sr; @@ -846,7 +846,7 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse
memcpy(ID3D10Blob_GetBufferPointer(v->u.shader.bytecode), ptr, dxbc_size);
- if (FAILED(hr = get_fx10_shader_resources(v, ptr, dxbc_size)))
if (FAILED(hr = get_fx10_shader_resources(v))) return hr;
switch (v->type->basetype)
Nice!
I couldn't help but notice that the function name has room for improvement. This isn't a "get" in the usual sense, what it does is looking up and storing info about the resources used by a shader. I don't have particularly inspired suggestions, but maybe something with find_ or init_ (or even set_, although it doesn't feel great) in place of get_ might work.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 48 ++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 29 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index c62c010f892..47e4a8daa56 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -142,6 +142,13 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderVariable return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface); }
+static struct d3d10_effect_variable * d3d10_array_get_element(struct d3d10_effect_variable *v, + unsigned int index) +{ + if (!v->type->element_count) return v; + return &v->elements[index]; +} + enum d3d10_effect_container_type { D3D10_C_NONE, @@ -2152,7 +2159,8 @@ static HRESULT create_state_object(struct d3d10_effect_variable *v) static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, const char **ptr, BOOL shared_type_desc, struct d3d10_effect_variable *v) { - unsigned int i, j; + struct d3d10_effect_variable *var; + unsigned int i, j, element_count; HRESULT hr; DWORD offset;
@@ -2175,6 +2183,8 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, /* Shared variable description contains only type information. */ if (shared_type_desc) return S_OK;
+ element_count = max(v->type->element_count, 1); + switch (v->type->basetype) { case D3D10_SVT_TEXTURE: @@ -2186,12 +2196,7 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, case D3D10_SVT_TEXTURE2DMSARRAY: case D3D10_SVT_TEXTURE3D: case D3D10_SVT_TEXTURECUBE: - if (!v->type->element_count) - i = 1; - else - i = v->type->element_count; - - if (!(v->u.resource.srv = heap_calloc(i, sizeof(*v->u.resource.srv)))) + if (!(v->u.resource.srv = heap_calloc(element_count, sizeof(*v->u.resource.srv)))) { ERR("Failed to allocate shader resource view array memory.\n"); return E_OUTOFMEMORY; @@ -2218,19 +2223,11 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, case D3D10_SVT_PIXELSHADER: case D3D10_SVT_GEOMETRYSHADER: TRACE("Shader type is %s\n", debug_d3d10_shader_variable_type(v->type->basetype)); - for (i = 0; i < max(v->type->element_count, 1); ++i) + for (i = 0; i < element_count; ++i) { DWORD shader_offset, sodecl_offset; - struct d3d10_effect_variable *var;
- if (!v->type->element_count) - { - var = v; - } - else - { - var = &v->elements[i]; - } + var = d3d10_array_get_element(v, i);
read_dword(ptr, &shader_offset); TRACE("Shader offset: %#x.\n", shader_offset); @@ -2261,7 +2258,6 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, case D3D10_SVT_SAMPLER: { const struct d3d10_effect_state_storage_info *storage_info; - unsigned int count = max(v->type->element_count, 1);
if (!(storage_info = get_storage_info(v->type->basetype))) { @@ -2276,15 +2272,11 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, return E_FAIL; }
- for (i = 0; i < count; ++i) + for (i = 0; i < element_count; ++i) { - struct d3d10_effect_variable *var; unsigned int prop_count;
- if (v->type->element_count) - var = &v->elements[i]; - else - var = v; + var = d3d10_array_get_element(v, i);
read_dword(ptr, &prop_count); TRACE("State object property count: %#x.\n", prop_count); @@ -3969,10 +3961,9 @@ static void d3d10_effect_pass_set_shader(struct d3d10_effect_pass *pass, const struct d3d10_effect_pass_shader_desc *shader_desc) { ID3D10Device *device = pass->technique->effect->device; - struct d3d10_effect_variable *v = shader_desc->shader; + struct d3d10_effect_variable *v;
- if (v->type->element_count) - v = &v->elements[shader_desc->index]; + v = d3d10_array_get_element(shader_desc->shader, shader_desc->index);
switch (v->type->basetype) { @@ -7081,8 +7072,7 @@ static HRESULT d3d10_get_shader_variable(struct d3d10_effect_variable *v, UINT s { unsigned int i;
- if (v->type->element_count) - v = &v->elements[0]; + v = d3d10_array_get_element(v, 0);
if (!shader_index) {
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 11 ++------ dlls/d3d10/tests/effect.c | 54 +++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 47e4a8daa56..4b2319e1529 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3979,6 +3979,8 @@ static void d3d10_effect_pass_set_shader(struct d3d10_effect_pass *pass, default: WARN("Unexpected shader type %u.\n", v->type->basetype); } + + apply_shader_resources(device, v); }
static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface, UINT flags) @@ -3991,20 +3993,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_Apply(ID3D10EffectPass *iface if (flags) FIXME("Ignoring flags (%#x)\n", flags);
if (pass->vs.shader != &null_shader_variable) - { d3d10_effect_pass_set_shader(pass, &pass->vs); - apply_shader_resources(device, pass->vs.shader); - } if (pass->gs.shader != &null_shader_variable) - { d3d10_effect_pass_set_shader(pass, &pass->gs); - apply_shader_resources(device, pass->gs.shader); - } if (pass->ps.shader != &null_shader_variable) - { d3d10_effect_pass_set_shader(pass, &pass->ps); - apply_shader_resources(device, pass->ps.shader); - } if (pass->rasterizer) ID3D10Device_RSSetState(device, pass->rasterizer->u.state.object.rasterizer); if (pass->depth_stencil) diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index dd16aab5aaa..93e82490eb0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5946,43 +5946,47 @@ float4 PS( float4 pos : SV_POSITION ) : SV_Target return t_a[1].Sample(s[1], float2(0, 0)); }
+PixelShader ps[1] = { CompileShader(ps_4_0, PS()) }; + technique10 rsrc_test { pass p0 { - SetPixelShader(CompileShader(ps_4_0, PS())); + SetPixelShader(ps[0]); } } #endif static DWORD fx_test_resource_variable2[] = { - 0x43425844, 0xb62313ac, 0x8116090b, 0xdc1d2951, 0xfc18ca42, 0x00000001, 0x0000035a, 0x00000001, - 0x00000024, 0x30315846, 0x0000032e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x0000028a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, - 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74786554, + 0x43425844, 0xecd43fcd, 0x0654927c, 0x71931f03, 0xf166cc09, 0x00000001, 0x0000039d, 0x00000001, + 0x00000024, 0x30315846, 0x00000371, 0xfeff1001, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x000002b5, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x74786554, 0x32657275, 0x00040044, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000, 0x5f740000, 0x61530061, 0x656c706d, 0x61745372, 0x2e006574, 0x02000000, 0x02000000, 0x00000000, - 0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x72737200, 0x65745f63, 0x70007473, 0x02180030, - 0x58440000, 0xb2424342, 0x3c889e83, 0xb8b8fc18, 0x749f2920, 0x0001877a, 0x02180000, 0x00050000, - 0x00340000, 0x00c80000, 0x00fc0000, 0x01300000, 0x019c0000, 0x44520000, 0x008c4645, 0x00000000, - 0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x0100ffff, 0x00620000, 0x005c0000, 0x00030000, - 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00020000, 0x00010000, 0x005e0000, 0x00020000, - 0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00020000, 0x000c0000, 0x00730000, 0x00615f74, - 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, - 0x31207265, 0x00312e30, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, - 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, - 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, - 0x000f0000, 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000, - 0x005a0000, 0x60000300, 0x00020010, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x00650000, - 0x20f20300, 0x00000010, 0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x60000000, 0x00020010, 0x003e0000, 0x54530100, - 0x00745441, 0x00020000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, - 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, + 0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x78695000, 0x68536c65, 0x72656461, 0x00005900, + 0x00000200, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000500, 0x00737000, 0x00000218, + 0x43425844, 0x9e83b242, 0xfc183c88, 0x2920b8b8, 0x877a749f, 0x00000001, 0x00000218, 0x00000005, + 0x00000034, 0x000000c8, 0x000000fc, 0x00000130, 0x0000019c, 0x46454452, 0x0000008c, 0x00000000, + 0x00000000, 0x00000002, 0x0000001c, 0xffff0400, 0x00000100, 0x00000062, 0x0000005c, 0x00000003, + 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000001, 0x0000005e, 0x00000002, + 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000002, 0x0000000c, 0x5f740073, 0x694d0061, + 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, + 0x2e303120, 0xabab0031, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, + 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000064, 0x00000040, 0x00000019, + 0x0300005a, 0x00106000, 0x00000002, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03000065, + 0x001020f2, 0x00000000, 0x0c000045, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000002, 0x0100003e, 0x54415453, + 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00660000, 0x00000000, - 0x002a0000, 0x000e0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00570000, 0x003b0000, 0x00000000, - 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000, 0x00590000, 0x00010000, 0x00000000, 0x00630000, - 0x00010000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x02820000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x63727372, 0x7365745f, + 0x30700074, 0x00008100, 0x00000000, 0x00002a00, 0x00000e00, 0x00000000, 0xffffff00, 0x000000ff, + 0x00005700, 0x00003b00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00000000, 0x00008100, + 0x00006500, 0x00000000, 0xffffff00, 0x000084ff, 0x00000000, 0x0002a000, 0x00000100, 0x00000000, + 0x0002aa00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000300, 0x0002ad00, 0x00000000, };
static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv,
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Those brackets in d3d10_effect_pass_Apply() didn't last long :)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
This is useful for render target views array, but is worth to do for all properties for consistency.
dlls/d3d10/effect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 4b2319e1529..9094e83efca 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1830,7 +1830,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size return E_FAIL; }
- *(void **)dst = variable; + ((void **)dst)[idx] = variable; } else { @@ -1888,11 +1888,11 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size case D3D10_SVT_VERTEXSHADER: case D3D10_SVT_PIXELSHADER: case D3D10_SVT_GEOMETRYSHADER: - *(void **)dst = variable; + ((void **)dst)[idx] = variable; *dst_index = variable_idx; break; default: - *(void **)dst = &variable->elements[variable_idx]; + ((void **)dst)[idx] = &variable->elements[variable_idx]; } } else @@ -1957,7 +1957,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size return E_FAIL; }
- *(void **)dst = variable; + ((void **)dst)[idx] = variable;
break;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
This is useful for render target views array, but is worth to do for all properties for consistency.
dlls/d3d10/effect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 4b2319e1529..9094e83efca 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1830,7 +1830,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size return E_FAIL; }
*(void **)dst = variable;
((void **)dst)[idx] = variable; } else {
@@ -1888,11 +1888,11 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size case D3D10_SVT_VERTEXSHADER: case D3D10_SVT_PIXELSHADER: case D3D10_SVT_GEOMETRYSHADER:
*(void **)dst = variable;
((void **)dst)[idx] = variable; *dst_index = variable_idx; break; default:
*(void **)dst = &variable->elements[variable_idx];
((void **)dst)[idx] = &variable->elements[variable_idx]; } } else
@@ -1957,7 +1957,7 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size return E_FAIL; }
*(void **)dst = variable;
((void **)dst)[idx] = variable; break;
Okay, I guess I see what you meant earlier. It does still seem a bit "crude", storing the variable pointers right in "dst", although I should probably wait for the rest of this to get a better picture of it.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 24 +++- dlls/d3d10/tests/effect.c | 245 +++++++++++++++++++++++--------------- 2 files changed, 171 insertions(+), 98 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 9094e83efca..5b72d31d41f 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -94,8 +94,6 @@ static struct d3d10_effect_variable null_matrix_variable = {{(const ID3D10Effect &null_local_buffer, &null_type}; static struct d3d10_effect_variable null_string_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl}, &null_local_buffer, &null_type}; -static struct d3d10_effect_variable null_shader_resource_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl}, - &null_local_buffer, &null_type}; static struct d3d10_effect_variable null_render_target_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl}, &null_local_buffer, &null_type}; static struct d3d10_effect_variable null_depth_stencil_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl}, @@ -111,6 +109,16 @@ static struct d3d10_effect_variable null_rasterizer_variable = {{(const ID3D10Ef static struct d3d10_effect_variable null_sampler_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl}, &null_local_buffer, &null_type};
+static ID3D10ShaderResourceView *null_srvs[D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT]; + +static struct d3d10_effect_variable null_shader_resource_variable = +{ + .ID3D10EffectVariable_iface.lpVtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl, + .buffer = &null_local_buffer, + .type = &null_type, + .u.resource.srv = null_srvs, +}; + /* anonymous_shader_type and anonymous_shader */ static char anonymous_name[] = "$Anonymous"; static char anonymous_vertexshader_name[] = "vertexshader"; @@ -1683,6 +1691,7 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset, break;
case D3D10_SVT_TEXTURE: + *(void **)out_data = &null_shader_resource_variable; break;
default: @@ -3909,8 +3918,17 @@ static void apply_shader_resources(ID3D10Device *device, struct d3d10_effect_var } break;
- case D3D10_SIT_TBUFFER: case D3D10_SIT_TEXTURE: + + if (rsrc_v->type->basetype == D3D10_SVT_SAMPLER) + { + TRACE("Using texture associated with sampler %s.\n", debugstr_a(rsrc_v->name)); + rsrc_v = rsrc_v->u.state.desc.sampler.texture; + } + + /* fallthrough */ + case D3D10_SIT_TBUFFER: + if (sr->in_type == D3D10_SIT_TBUFFER) { update_buffer(device, rsrc_v); diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 93e82490eb0..04cbcbc662b 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4166,6 +4166,13 @@ SamplerState sampler13 { Texture = t2dmsa_a[0]; }; SamplerState sampler14 { Texture = t3_a[1]; }; SamplerState sampler15 { Texture = tq_a[2]; };
+SamplerState ss { Texture = NULL; }; + +float4 PS() : COLOR +{ + return tex2D( ss, float2(0.0f, 0.0f) ); +} + technique10 tech0 { pass pass0 @@ -4174,14 +4181,18 @@ technique10 tech0 SetDepthStencilState(ds_state, 1.0f); SetRasterizerState(rast_state); } + pass pass1 + { + SetPixelShader( CompileShader(ps_4_0, PS()) ); + } }; #endif static DWORD fx_test_state_groups[] = { - 0x43425844, 0xad712d25, 0xfbcf4136, 0x61248434, 0xe6cabf4a, 0x00000001, 0x00000f79, 0x00000001, - 0x00000024, 0x30315846, 0x00000f4d, 0xfeff1001, 0x00000000, 0x00000000, 0x00000028, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x00000711, 0x00000000, 0x00000024, 0x00000001, 0x00000001, - 0x00000001, 0x00000013, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152, + 0x43425844, 0x61e5a938, 0x1d4228df, 0x536560dd, 0x76c777b2, 0x00000001, 0x000011ce, 0x00000001, + 0x00000024, 0x30315846, 0x000011a2, 0xfeff1001, 0x00000000, 0x00000000, 0x00000029, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x00000922, 0x00000000, 0x00000024, 0x00000001, 0x00000001, + 0x00000001, 0x00000014, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74736152, 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x02000000, 0xfc000000, @@ -4236,76 +4247,120 @@ static DWORD fx_test_state_groups[] = 0x00000005, 0x73000000, 0x6c706d61, 0x31317265, 0x00059900, 0x00000100, 0x6d617300, 0x72656c70, 0xbb003231, 0x02000005, 0x73000000, 0x6c706d61, 0x33317265, 0x0005df00, 0x00000000, 0x6d617300, 0x72656c70, 0x04003431, 0x01000006, 0x73000000, 0x6c706d61, 0x35317265, 0x00062500, 0x00000200, - 0x63657400, 0x70003068, 0x30737361, 0x00000400, 0x00000100, 0x00000000, 0x0000013f, 0x19999a00, - 0x0000013f, 0x33333300, 0x0000013f, 0x4ccccd00, 0x0000013f, 0x00000300, 0x00ffff00, 0x00000100, - 0x00000100, 0x80000000, 0x0000303f, 0x00001400, 0x00000000, 0xffffff00, 0x00000aff, 0x00000c00, - 0x00000000, 0x00000100, 0x00003b00, 0x00000d00, 0x00000000, 0x00000100, 0x00004700, 0x00000e00, - 0x00000000, 0x00000100, 0x00005300, 0x00000f00, 0x00000000, 0x00000100, 0x00005f00, 0x00001000, - 0x00000000, 0x00000100, 0x00006b00, 0x00001100, 0x00000000, 0x00000100, 0x00007700, 0x00001200, - 0x00000000, 0x00000100, 0x00008300, 0x00001300, 0x00000000, 0x00000100, 0x00008f00, 0x00001400, - 0x00000000, 0x00000100, 0x00009b00, 0x00001500, 0x00000000, 0x00000100, 0x0000a700, 0x00000000, - 0x0000e100, 0x0000c500, 0x00000000, 0xffffff00, 0x00000eff, 0x00001600, 0x00000000, 0x00000100, - 0x0000ea00, 0x00001700, 0x00000000, 0x00000100, 0x0000f600, 0x00001800, 0x00000000, 0x00000100, - 0x00010200, 0x00001900, 0x00000000, 0x00000100, 0x00010e00, 0x00001a00, 0x00000000, 0x00000100, - 0x00011a00, 0x00001b00, 0x00000000, 0x00000100, 0x00012600, 0x00001c00, 0x00000000, 0x00000100, - 0x00013200, 0x00001d00, 0x00000000, 0x00000100, 0x00013e00, 0x00001e00, 0x00000000, 0x00000100, - 0x00014a00, 0x00001f00, 0x00000000, 0x00000100, 0x00015600, 0x00002000, 0x00000000, 0x00000100, - 0x00016200, 0x00002100, 0x00000000, 0x00000100, 0x00016e00, 0x00002200, 0x00000000, 0x00000100, - 0x00017a00, 0x00002300, 0x00000000, 0x00000100, 0x00018600, 0x00000000, 0x0001b900, 0x00019d00, - 0x00000000, 0xffffff00, 0x00000bff, 0x00002400, 0x00000000, 0x00000100, 0x0001c500, 0x00002500, - 0x00000000, 0x00000100, 0x0001d100, 0x00002500, 0x00000700, 0x00000100, 0x0001dd00, 0x00002600, - 0x00000000, 0x00000100, 0x0001e900, 0x00002700, 0x00000000, 0x00000100, 0x0001f500, 0x00002800, - 0x00000000, 0x00000100, 0x00020100, 0x00002900, 0x00000000, 0x00000100, 0x00020d00, 0x00002a00, - 0x00000000, 0x00000100, 0x00021900, 0x00002b00, 0x00000000, 0x00000100, 0x00022500, 0x00002c00, - 0x00000000, 0x00000100, 0x00023100, 0x00002c00, 0x00000700, 0x00000100, 0x00023d00, 0x00000000, - 0x00027200, 0x00025600, 0x00000000, 0xffffff00, 0x00000bff, 0x00002d00, 0x00000000, 0x00000100, - 0x00027b00, 0x00002e00, 0x00000000, 0x00000100, 0x00028700, 0x00002f00, 0x00000000, 0x00000100, - 0x00029300, 0x00003000, 0x00000000, 0x00000100, 0x00029f00, 0x00003100, 0x00000000, 0x00000100, - 0x0002ab00, 0x00003200, 0x00000000, 0x00000100, 0x0002b700, 0x00003300, 0x00000000, 0x00000100, - 0x0002c300, 0x00003400, 0x00000000, 0x00000100, 0x0002cf00, 0x00003500, 0x00000000, 0x00000100, - 0x0002f300, 0x00003600, 0x00000000, 0x00000100, 0x0002ff00, 0x00003700, 0x00000000, 0x00000100, - 0x00030b00, 0x00000000, 0x00033b00, 0x00031f00, 0x00000000, 0xffffff00, 0x000000ff, 0x00036400, - 0x00034800, 0x00000000, 0xffffff00, 0x000000ff, 0x00039200, 0x00037600, 0x00000000, 0xffffff00, - 0x000000ff, 0x0003bc00, 0x0003a000, 0x00000000, 0xffffff00, 0x000000ff, 0x0003ea00, 0x0003ce00, - 0x00000000, 0xffffff00, 0x000000ff, 0x00041600, 0x0003fa00, 0x00000000, 0xffffff00, 0x000000ff, - 0x00044900, 0x00042d00, 0x00000000, 0xffffff00, 0x000000ff, 0x00047600, 0x00045a00, 0x00000000, - 0xffffff00, 0x000000ff, 0x0004a100, 0x00048500, 0x00000000, 0xffffff00, 0x000000ff, 0x0004a400, - 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x00033b00, - 0x00000000, 0x0004ad00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, - 0x00000200, 0x00036400, 0x00000000, 0x0004b600, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, - 0x00003700, 0x00000000, 0x00000200, 0x00039200, 0x00000000, 0x0004c000, 0x00025600, 0x00000000, - 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0003bc00, 0x00000000, 0x0004c900, - 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0003ea00, - 0x00000000, 0x0004d300, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, - 0x00000200, 0x00041600, 0x00000000, 0x0004dc00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, - 0x00003700, 0x00000000, 0x00000200, 0x00044900, 0x00000000, 0x0004e600, 0x00025600, 0x00000000, - 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x00047600, 0x00000000, 0x0004ef00, - 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0004a100, - 0x00000000, 0x00051400, 0x0004f800, 0x00000000, 0xffffff00, 0x000000ff, 0x00053500, 0x00051900, - 0x00000000, 0xffffff00, 0x000000ff, 0x00055600, 0x00053a00, 0x00000000, 0xffffff00, 0x000000ff, - 0x00057800, 0x00055c00, 0x00000000, 0xffffff00, 0x000000ff, 0x00059900, 0x00057d00, 0x00000000, - 0xffffff00, 0x000000ff, 0x0005bb00, 0x00059f00, 0x00000000, 0xffffff00, 0x000000ff, 0x0005df00, - 0x0005c300, 0x00000000, 0xffffff00, 0x000000ff, 0x00060400, 0x0005e800, 0x00000000, 0xffffff00, - 0x000000ff, 0x00062500, 0x00060900, 0x00000000, 0xffffff00, 0x000000ff, 0x00062a00, 0x00025600, - 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00063300, 0x00000000, - 0x00063b00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, - 0x00064400, 0x00000000, 0x00064c00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, - 0x00000000, 0x00000300, 0x00065500, 0x00000000, 0x00065d00, 0x00025600, 0x00000000, 0xffffff00, - 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00066700, 0x00000000, 0x00066f00, 0x00025600, - 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00067900, 0x00000000, - 0x00068100, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, - 0x00068b00, 0x00000000, 0x00069300, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, - 0x00000000, 0x00000300, 0x00069d00, 0x00000000, 0x0006a500, 0x00025600, 0x00000000, 0xffffff00, - 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006af00, 0x00000000, 0x0006b700, 0x00025600, - 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006c100, 0x00000000, - 0x0006c900, 0x00000100, 0x00000000, 0x0006cf00, 0x00000600, 0x00000000, 0x00000a00, 0x00000000, - 0x00000100, 0x0006d500, 0x00000b00, 0x00000000, 0x00000100, 0x0006f900, 0x00000200, 0x00000000, - 0x00000200, 0x0001b900, 0x00000900, 0x00000000, 0x00000100, 0x00070500, 0x00000100, 0x00000000, - 0x00000200, 0x0000e100, 0x00000000, 0x00000000, 0x00000200, 0x00003000, 0x00000000, + 0x00737300, 0x00000001, 0x00000002, 0x00000000, 0x68636574, 0x61700030, 0x00307373, 0x00000004, + 0x00000001, 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001, 0x3f333333, 0x00000001, 0x3f4ccccd, + 0x00000001, 0x00000003, 0x0000ffff, 0x00000001, 0x00000001, 0x3f800000, 0x73736170, 0x01f00031, + 0x58440000, 0x35034342, 0x3e91426d, 0x2799a172, 0x010d4956, 0x00016c60, 0x01f00000, 0x00050000, + 0x00340000, 0x00c40000, 0x00d40000, 0x01080000, 0x01740000, 0x44520000, 0x00884645, 0x00000000, + 0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x1100ffff, 0x005f0000, 0x005c0000, 0x00030000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x005c0000, 0x00020000, + 0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00010000, 0x000c0000, 0x73730000, 0x63694d00, + 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, + 0x312e3031, 0x5349ab00, 0x00084e47, 0x00000000, 0x00080000, 0x534f0000, 0x002c4e47, 0x00010000, + 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, + 0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000, 0x005a0000, 0x60000300, + 0x00000010, 0x18580000, 0x70000400, 0x00000010, 0x55550000, 0x00650000, 0x20f20300, 0x00000010, + 0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x7e460000, 0x00000010, 0x60000000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000, + 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07260000, 0x00000000, 0x00300000, 0x00140000, + 0x00000000, 0xffff0000, 0x000affff, 0x000c0000, 0x00000000, 0x00010000, 0x003b0000, 0x000d0000, + 0x00000000, 0x00010000, 0x00470000, 0x000e0000, 0x00000000, 0x00010000, 0x00530000, 0x000f0000, + 0x00000000, 0x00010000, 0x005f0000, 0x00100000, 0x00000000, 0x00010000, 0x006b0000, 0x00110000, + 0x00000000, 0x00010000, 0x00770000, 0x00120000, 0x00000000, 0x00010000, 0x00830000, 0x00130000, + 0x00000000, 0x00010000, 0x008f0000, 0x00140000, 0x00000000, 0x00010000, 0x009b0000, 0x00150000, + 0x00000000, 0x00010000, 0x00a70000, 0x00000000, 0x00e10000, 0x00c50000, 0x00000000, 0xffff0000, + 0x000effff, 0x00160000, 0x00000000, 0x00010000, 0x00ea0000, 0x00170000, 0x00000000, 0x00010000, + 0x00f60000, 0x00180000, 0x00000000, 0x00010000, 0x01020000, 0x00190000, 0x00000000, 0x00010000, + 0x010e0000, 0x001a0000, 0x00000000, 0x00010000, 0x011a0000, 0x001b0000, 0x00000000, 0x00010000, + 0x01260000, 0x001c0000, 0x00000000, 0x00010000, 0x01320000, 0x001d0000, 0x00000000, 0x00010000, + 0x013e0000, 0x001e0000, 0x00000000, 0x00010000, 0x014a0000, 0x001f0000, 0x00000000, 0x00010000, + 0x01560000, 0x00200000, 0x00000000, 0x00010000, 0x01620000, 0x00210000, 0x00000000, 0x00010000, + 0x016e0000, 0x00220000, 0x00000000, 0x00010000, 0x017a0000, 0x00230000, 0x00000000, 0x00010000, + 0x01860000, 0x00000000, 0x01b90000, 0x019d0000, 0x00000000, 0xffff0000, 0x000bffff, 0x00240000, + 0x00000000, 0x00010000, 0x01c50000, 0x00250000, 0x00000000, 0x00010000, 0x01d10000, 0x00250000, + 0x00070000, 0x00010000, 0x01dd0000, 0x00260000, 0x00000000, 0x00010000, 0x01e90000, 0x00270000, + 0x00000000, 0x00010000, 0x01f50000, 0x00280000, 0x00000000, 0x00010000, 0x02010000, 0x00290000, + 0x00000000, 0x00010000, 0x020d0000, 0x002a0000, 0x00000000, 0x00010000, 0x02190000, 0x002b0000, + 0x00000000, 0x00010000, 0x02250000, 0x002c0000, 0x00000000, 0x00010000, 0x02310000, 0x002c0000, + 0x00070000, 0x00010000, 0x023d0000, 0x00000000, 0x02720000, 0x02560000, 0x00000000, 0xffff0000, + 0x000bffff, 0x002d0000, 0x00000000, 0x00010000, 0x027b0000, 0x002e0000, 0x00000000, 0x00010000, + 0x02870000, 0x002f0000, 0x00000000, 0x00010000, 0x02930000, 0x00300000, 0x00000000, 0x00010000, + 0x029f0000, 0x00310000, 0x00000000, 0x00010000, 0x02ab0000, 0x00320000, 0x00000000, 0x00010000, + 0x02b70000, 0x00330000, 0x00000000, 0x00010000, 0x02c30000, 0x00340000, 0x00000000, 0x00010000, + 0x02cf0000, 0x00350000, 0x00000000, 0x00010000, 0x02f30000, 0x00360000, 0x00000000, 0x00010000, + 0x02ff0000, 0x00370000, 0x00000000, 0x00010000, 0x030b0000, 0x00000000, 0x033b0000, 0x031f0000, + 0x00000000, 0xffff0000, 0x0000ffff, 0x03640000, 0x03480000, 0x00000000, 0xffff0000, 0x0000ffff, + 0x03920000, 0x03760000, 0x00000000, 0xffff0000, 0x0000ffff, 0x03bc0000, 0x03a00000, 0x00000000, + 0xffff0000, 0x0000ffff, 0x03ea0000, 0x03ce0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04160000, + 0x03fa0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04490000, 0x042d0000, 0x00000000, 0xffff0000, + 0x0000ffff, 0x04760000, 0x045a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04a10000, 0x04850000, + 0x00000000, 0xffff0000, 0x0000ffff, 0x04a40000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, + 0x00370000, 0x00000000, 0x00020000, 0x033b0000, 0x00000000, 0x04ad0000, 0x02560000, 0x00000000, + 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03640000, 0x00000000, 0x04b60000, + 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03920000, + 0x00000000, 0x04c00000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, + 0x00020000, 0x03bc0000, 0x00000000, 0x04c90000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, + 0x00370000, 0x00000000, 0x00020000, 0x03ea0000, 0x00000000, 0x04d30000, 0x02560000, 0x00000000, + 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04160000, 0x00000000, 0x04dc0000, + 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04490000, + 0x00000000, 0x04e60000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, + 0x00020000, 0x04760000, 0x00000000, 0x04ef0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, + 0x00370000, 0x00000000, 0x00020000, 0x04a10000, 0x00000000, 0x05140000, 0x04f80000, 0x00000000, + 0xffff0000, 0x0000ffff, 0x05350000, 0x05190000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05560000, + 0x053a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05780000, 0x055c0000, 0x00000000, 0xffff0000, + 0x0000ffff, 0x05990000, 0x057d0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05bb0000, 0x059f0000, + 0x00000000, 0xffff0000, 0x0000ffff, 0x05df0000, 0x05c30000, 0x00000000, 0xffff0000, 0x0000ffff, + 0x06040000, 0x05e80000, 0x00000000, 0xffff0000, 0x0000ffff, 0x06250000, 0x06090000, 0x00000000, + 0xffff0000, 0x0000ffff, 0x062a0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, + 0x00000000, 0x00030000, 0x06330000, 0x00000000, 0x063b0000, 0x02560000, 0x00000000, 0xffff0000, + 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06440000, 0x00000000, 0x064c0000, 0x02560000, + 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06550000, 0x00000000, + 0x065d0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, + 0x06670000, 0x00000000, 0x066f0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, + 0x00000000, 0x00030000, 0x06790000, 0x00000000, 0x06810000, 0x02560000, 0x00000000, 0xffff0000, + 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x068b0000, 0x00000000, 0x06930000, 0x02560000, + 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x069d0000, 0x00000000, + 0x06a50000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, + 0x06af0000, 0x00000000, 0x06b70000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, + 0x00000000, 0x00030000, 0x06c10000, 0x00000000, 0x06c90000, 0x02560000, 0x00000000, 0xffff0000, + 0x0001ffff, 0x00370000, 0x00000000, 0x00010000, 0x06cc0000, 0x00000000, 0x06d80000, 0x00020000, + 0x00000000, 0x06de0000, 0x00060000, 0x00000000, 0x000a0000, 0x00000000, 0x00010000, 0x06e40000, + 0x000b0000, 0x00000000, 0x00010000, 0x07080000, 0x00020000, 0x00000000, 0x00020000, 0x01b90000, + 0x00090000, 0x00000000, 0x00010000, 0x07140000, 0x00010000, 0x00000000, 0x00020000, 0x00e10000, + 0x00000000, 0x00000000, 0x00020000, 0x00300000, 0x07200000, 0x00010000, 0x00000000, 0x00070000, + 0x00000000, 0x00070000, 0x091a0000, 0x00000000, };
+static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv, + ID3D10Texture2D **tex) +{ + D3D10_TEXTURE2D_DESC tex_desc; + HRESULT hr; + + tex_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + tex_desc.Width = 8; + tex_desc.Height = 8; + tex_desc.ArraySize = 1; + tex_desc.MipLevels = 0; + tex_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; + tex_desc.Usage = D3D10_USAGE_DEFAULT; + tex_desc.CPUAccessFlags = 0; + tex_desc.SampleDesc.Count = 1; + tex_desc.SampleDesc.Quality = 0; + tex_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateTexture2D(device, &tex_desc, NULL, tex); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)*tex, NULL, srv); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); +} + static void test_effect_state_groups(void) { + ID3D10ShaderResourceView *srv0, *srv1; ID3D10EffectDepthStencilVariable *d; ID3D10EffectRasterizerVariable *r; ID3D10DepthStencilState *ds_state; @@ -4325,6 +4380,7 @@ static void test_effect_state_groups(void) ID3D10EffectVariable *v; ID3D10EffectPass *pass; float blend_factor[4]; + ID3D10Texture2D *tex0; ID3D10Effect *effect; ID3D10Device *device; ULONG refcount; @@ -4347,7 +4403,7 @@ static void test_effect_state_groups(void) effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); - ok(effect_desc.GlobalVariables == 40, "Unexpected global variables count %u.\n", + ok(effect_desc.GlobalVariables == 41, "Unexpected global variables count %u.\n", effect_desc.GlobalVariables); ok(effect_desc.SharedGlobalVariables == 0, "Unexpected shared global variables count %u.\n", effect_desc.SharedGlobalVariables); @@ -4535,6 +4591,29 @@ static void test_effect_state_groups(void) ID3D10RasterizerState_Release(rast_state); ID3D10DepthStencilState_Release(ds_state); ID3D10BlendState_Release(blend_state); + + /* pass 1 - uses SamplerState.Texture = NULL, resource slot is reset. */ + pass = technique->lpVtbl->GetPassByName(technique, "pass1"); + ok(pass->lpVtbl->IsValid(pass), "Failed to get pass.\n"); + + create_effect_texture_resource(device, &srv0, &tex0); + + hr = D3D10StateBlockMaskDisableAll(&mask); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = pass->lpVtbl->ComputeStateBlockMask(pass, &mask); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_VS_SHADER_RESOURCES, 0); + ok(!ret, "Unexpected mask.\n"); + + ID3D10Device_PSSetShaderResources(device, 0, 1, &srv0); + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ID3D10Device_PSGetShaderResources(device, 0, 1, &srv1); + ok(!srv1, "Unexpected resource pointer.\n"); + + ID3D10ShaderResourceView_Release(srv0); + ID3D10Texture2D_Release(tex0); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device); @@ -5989,30 +6068,6 @@ static DWORD fx_test_resource_variable2[] = 0x0002aa00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000300, 0x0002ad00, 0x00000000, };
-static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv, - ID3D10Texture2D **tex) -{ - D3D10_TEXTURE2D_DESC tex_desc; - HRESULT hr; - - tex_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - tex_desc.Width = 8; - tex_desc.Height = 8; - tex_desc.ArraySize = 1; - tex_desc.MipLevels = 0; - tex_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; - tex_desc.Usage = D3D10_USAGE_DEFAULT; - tex_desc.CPUAccessFlags = 0; - tex_desc.SampleDesc.Count = 1; - tex_desc.SampleDesc.Quality = 0; - tex_desc.MiscFlags = 0; - - hr = ID3D10Device_CreateTexture2D(device, &tex_desc, NULL, tex); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); - hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)*tex, NULL, srv); - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); -} - #define get_effect_shader_resource_variable(a) get_effect_shader_resource_variable_(__LINE__, a) static ID3D10EffectShaderResourceVariable *get_effect_shader_resource_variable_(unsigned int line, ID3D10EffectVariable *var)
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 5b72d31d41f..9410bf049e3 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -2326,7 +2326,7 @@ static HRESULT parse_fx10_object_variable(const char *data, size_t data_size, return S_OK; }
-static HRESULT create_variable_buffer(struct d3d10_effect_variable *v, D3D10_CBUFFER_TYPE type) +static HRESULT create_variable_buffer(struct d3d10_effect_variable *v) { D3D10_BUFFER_DESC buffer_desc; D3D10_SUBRESOURCE_DATA subresource_data; @@ -2344,7 +2344,7 @@ static HRESULT create_variable_buffer(struct d3d10_effect_variable *v, D3D10_CBU buffer_desc.Usage = D3D10_USAGE_DEFAULT; buffer_desc.CPUAccessFlags = 0; buffer_desc.MiscFlags = 0; - if (type == D3D10_CT_CBUFFER) + if (v->type->basetype == D3D10_SVT_CBUFFER) buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; else buffer_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; @@ -2356,7 +2356,7 @@ static HRESULT create_variable_buffer(struct d3d10_effect_variable *v, D3D10_CBU if (FAILED(hr = ID3D10Device_CreateBuffer(device, &buffer_desc, &subresource_data, &v->u.buffer.buffer))) return hr;
- if (type == D3D10_CT_TBUFFER) + if (v->type->basetype == D3D10_SVT_TBUFFER) { srv_desc.Format = DXGI_FORMAT_R32G32B32A32_UINT; srv_desc.ViewDimension = D3D_SRV_DIMENSION_BUFFER; @@ -2561,7 +2561,7 @@ static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char
if (local && l->type->size_unpacked) { - if (FAILED(hr = create_variable_buffer(l, d3d10_cbuffer_type))) + if (FAILED(hr = create_variable_buffer(l))) return hr; }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 12 +++++++----- dlls/d3d10/tests/effect.c | 7 +++++++ 2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 9410bf049e3..892256644f7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3710,7 +3710,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa D3D10_PASS_DESC *desc) { struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface); - struct d3d10_effect_shader_variable *s; + struct d3d10_effect_variable *vs; + ID3D10Blob *input_signature;
TRACE("iface %p, desc %p.\n", iface, desc);
@@ -3726,14 +3727,15 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa return E_INVALIDARG; }
- s = &pass->vs.shader->u.shader; + vs = d3d10_array_get_element(pass->vs.shader, pass->vs.index); + input_signature = vs->u.shader.input_signature;
desc->Name = pass->name; desc->Annotations = pass->annotations.count; - if (s->input_signature) + if (input_signature) { - desc->pIAInputSignature = ID3D10Blob_GetBufferPointer(s->input_signature); - desc->IAInputSignatureSize = ID3D10Blob_GetBufferSize(s->input_signature); + desc->pIAInputSignature = ID3D10Blob_GetBufferPointer(input_signature); + desc->IAInputSignatureSize = ID3D10Blob_GetBufferSize(input_signature); } else { diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 04cbcbc662b..76beb682fea 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -2913,6 +2913,7 @@ static void test_effect_local_shader(void) D3D10_EFFECT_SHADER_DESC shaderdesc; D3D10_SIGNATURE_PARAMETER_DESC sign; D3D10_STATE_BLOCK_MASK mask; + D3D10_PASS_DESC pass_desc; ID3D10Device *device; ULONG refcount;
@@ -3611,6 +3612,12 @@ 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);
+ /* Get input signature from vertex shader set from array element. */ + hr = p->lpVtbl->GetDesc(p, &pass_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!!pass_desc.pIAInputSignature, "Expected input signature.\n"); + ok(pass_desc.IAInputSignatureSize == 88, "Unexpected input signature size.\n"); + /* pass 6 pixelshader */ hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc); ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Thu, Oct 14, 2021 at 8:42 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 12 +++++++----- dlls/d3d10/tests/effect.c | 7 +++++++ 2 files changed, 14 insertions(+), 5 deletions(-)
@@ -3611,6 +3612,12 @@ 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);
- /* Get input signature from vertex shader set from array element. */
- hr = p->lpVtbl->GetDesc(p, &pass_desc);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!!pass_desc.pIAInputSignature, "Expected input signature.\n");
- ok(pass_desc.IAInputSignatureSize == 88, "Unexpected input signature size.\n");
It would be nice to extend this test to make sure that the correct array element was returned (probably by using reflection).
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/tests/effect.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 76beb682fea..bd5392fcd16 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4499,9 +4499,9 @@ static void test_effect_state_groups(void) rast_desc.AntialiasedLineEnable);
technique = effect->lpVtbl->GetTechniqueByName(effect, "tech0"); - ok(!!technique, "Failed to get technique.\n"); + ok(technique->lpVtbl->IsValid(technique), "Expected valid technique.\n"); pass = technique->lpVtbl->GetPassByName(technique, "pass0"); - ok(!!pass, "Failed to get pass.\n"); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); hr = pass->lpVtbl->GetDesc(pass, &pass_desc); ok(SUCCEEDED(hr), "Failed to get pass desc, hr %#x.\n", hr); ok(!strcmp(pass_desc.Name, "pass0"), "Got unexpected Name "%s".\n", pass_desc.Name); @@ -4789,9 +4789,9 @@ static void test_effect_state_group_defaults(void) rast_desc.AntialiasedLineEnable);
technique = effect->lpVtbl->GetTechniqueByName(effect, "tech0"); - ok(!!technique, "Failed to get technique.\n"); + ok(technique->lpVtbl->IsValid(technique), "Expected valid technique.\n"); pass = technique->lpVtbl->GetPassByName(technique, "pass0"); - ok(!!pass, "Failed to get pass.\n"); + ok(pass->lpVtbl->IsValid(pass), "Failed to get pass.\n"); hr = pass->lpVtbl->GetDesc(pass, &pass_desc); ok(SUCCEEDED(hr), "Failed to get pass desc, hr %#x.\n", hr); ok(!strcmp(pass_desc.Name, "pass0"), "Got unexpected Name "%s".\n", pass_desc.Name); @@ -6155,9 +6155,9 @@ static void test_effect_resource_variable(void)
/* Apply the pass to bind the resource to the shader. */ technique = effect->lpVtbl->GetTechniqueByName(effect, "rsrc_test"); - ok(!!technique, "Got unexpected technique %p.\n", technique); + ok(technique->lpVtbl->IsValid(technique), "Expected valid technique.\n"); pass = technique->lpVtbl->GetPassByName(technique, "p0"); - ok(!!pass, "Got unexpected pass %p.\n", pass); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n"); hr = pass->lpVtbl->GetDesc(pass, &pass_desc); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!!pass_desc.pIAInputSignature, "Unexpected input signature.\n"); @@ -6227,9 +6227,9 @@ static void test_effect_resource_variable(void) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
technique = effect->lpVtbl->GetTechniqueByName(effect, "rsrc_test"); - ok(!!technique, "Got unexpected technique %p.\n", technique); + ok(technique->lpVtbl->IsValid(technique), "Expected valid technique.\n"); pass = technique->lpVtbl->GetPassByName(technique, "p0"); - ok(!!pass, "Got unexpected pass %p.\n", pass); + ok(pass->lpVtbl->IsValid(pass), "Expected valid pass.\n");
var = effect->lpVtbl->GetVariableByName(effect, "s"); ok(var->lpVtbl->IsValid(var), "Expected valid variable.\n");
Signed-off-by: Matteo Bruni mbruni@codeweavers.com