Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 54 ++++++++------------------------------ dlls/d3d10/tests/effect.c | 37 +++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 249d4ea384a..359c1f017f7 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -106,7 +106,7 @@ struct d3d10_effect_shader_signature struct d3d10_effect_shader_variable { struct d3d10_effect_shader_signature input_signature; - struct d3d10_effect_shader_signature output_signature; + ID3D10ShaderReflection *reflection; union { ID3D10VertexShader *vs; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 520f816098f..3f0916e60d5 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -599,16 +599,12 @@ static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag switch(tag) { case TAG_ISGN: - case TAG_OSGN: { /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */ UINT size = 44 + data_size; - struct d3d10_effect_shader_signature *sig; + struct d3d10_effect_shader_signature *sig = &s->input_signature; char *ptr;
- if (tag == TAG_ISGN) sig = &s->input_signature; - else sig = &s->output_signature; - if (!(sig->signature = heap_alloc_zero(size))) { ERR("Failed to allocate input signature data\n"); @@ -666,28 +662,22 @@ static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const struct d3d10_effect_shader_variable *sv = &v->u.shader; struct d3d10_effect_shader_resource *sr; D3D10_SHADER_INPUT_BIND_DESC bind_desc; - ID3D10ShaderReflection *reflection; struct d3d10_effect_variable *var; D3D10_SHADER_DESC desc; unsigned int i, y; - HRESULT hr; - - if (FAILED(hr = D3D10ReflectShader(data, data_size, &reflection))) - return hr;
- reflection->lpVtbl->GetDesc(reflection, &desc); + sv->reflection->lpVtbl->GetDesc(sv->reflection, &desc); sv->resource_count = desc.BoundResources;
if (!(sv->resources = heap_calloc(sv->resource_count, sizeof(*sv->resources)))) { ERR("Failed to allocate shader resource binding information memory.\n"); - reflection->lpVtbl->Release(reflection); return E_OUTOFMEMORY; }
for (i = 0; i < desc.BoundResources; ++i) { - reflection->lpVtbl->GetResourceBindingDesc(reflection, i, &bind_desc); + sv->reflection->lpVtbl->GetResourceBindingDesc(sv->reflection, i, &bind_desc); sr = &sv->resources[i];
sr->in_type = bind_desc.Type; @@ -731,7 +721,6 @@ static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const if (!sr->variable) { WARN("Failed to find shader resource.\n"); - reflection->lpVtbl->Release(reflection); return E_FAIL; } } @@ -774,6 +763,9 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse /* We got a shader VertexShader vs = NULL, so it is fine to skip this. */ if (!dxbc_size) return S_OK;
+ if (FAILED(hr = D3D10ReflectShader(ptr, dxbc_size, &v->u.shader.reflection))) + return hr; + if (FAILED(hr = get_fx10_shader_resources(v, ptr, dxbc_size))) return hr;
@@ -2747,8 +2739,9 @@ static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o) static void d3d10_effect_shader_variable_destroy(struct d3d10_effect_shader_variable *s, D3D10_SHADER_VARIABLE_TYPE type) { + if (s->reflection) + s->reflection->lpVtbl->Release(s->reflection); shader_free_signature(&s->input_signature); - shader_free_signature(&s->output_signature);
switch (type) { @@ -7068,7 +7061,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignature { struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(iface); struct d3d10_effect_shader_variable *s; - D3D10_SIGNATURE_PARAMETER_DESC *d;
TRACE("iface %p, shader_index %u, element_index %u, desc %p\n", iface, shader_index, element_index, desc); @@ -7087,35 +7079,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignature }
s = &v->effect->used_shaders[shader_index]->u.shader; - if (!s->output_signature.signature) - { - WARN("No shader signature\n"); - return D3DERR_INVALIDCALL; - } - - /* Check desc for NULL, this crashes on W7/DX10 */ - if (!desc) - { - WARN("This should crash on W7/DX10!\n"); - return E_FAIL; - } - - if (element_index >= s->output_signature.element_count) - { - WARN("Invalid element index specified\n"); - return E_INVALIDARG; - }
- d = &s->output_signature.elements[element_index]; - desc->SemanticName = d->SemanticName; - desc->SemanticIndex = d->SemanticIndex; - desc->SystemValueType = d->SystemValueType; - desc->ComponentType = d->ComponentType; - desc->Register = d->Register; - desc->ReadWriteMask = d->ReadWriteMask; - desc->Mask = d->Mask; + if (!s->reflection) + return D3DERR_INVALIDCALL;
- return S_OK; + return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc); }
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 9a217993e7e..df0d1a99ef4 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -23,6 +23,8 @@
#include <float.h>
+#define D3DERR_INVALIDCALL 0x8876086c + static ID3D10Device *create_device(void) { ID3D10Device *device; @@ -2796,8 +2798,9 @@ static void test_effect_local_shader(void) D3D10_EFFECT_TYPE_DESC typedesc; D3D10_EFFECT_DESC effect_desc; ID3D10EffectShaderVariable *null_shader, *null_anon_vs, *null_anon_ps, *null_anon_gs, - *p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs, *gs; + *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; ID3D10Device *device; ULONG refcount;
@@ -3648,6 +3651,38 @@ todo_wine shaderdesc.SODecl); }
+ /* Output signature description */ + v = effect->lpVtbl->GetVariableByName(effect, "p"); + ps = v->lpVtbl->AsShader(v); + + hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 0, 0, &sign); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName); + + v = effect->lpVtbl->GetVariableByName(effect, "v"); + vs = v->lpVtbl->AsShader(v); + + hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + + hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + + /* NULL shader variable */ + v = effect->lpVtbl->GetVariableByName(effect, "v0"); + vs = v->lpVtbl->AsShader(v); + + hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 52 ++++++++++++++++++++++++++++----------- dlls/d3d10/tests/effect.c | 26 +++++++++++++------- 2 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 3f0916e60d5..e261e5a7cd7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -6999,6 +6999,43 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader( return S_OK; }
+static HRESULT d3d10_get_shader_variable_signature(struct d3d10_effect_variable *v, + UINT shader_index, UINT element_index, BOOL output, D3D10_SIGNATURE_PARAMETER_DESC *desc) +{ + struct d3d10_effect_shader_variable *s; + unsigned int i; + + if (v->type->element_count) + v = &v->elements[0]; + + if (shader_index == 0) + { + s = &v->u.shader; + } + else + { + /* Index is used as an offset from this variable. */ + + for (i = 0; i < v->effect->used_shader_count; ++i) + { + if (v == v->effect->used_shaders[i]) break; + } + + if (i + shader_index >= v->effect->used_shader_count) + { + WARN("This should crash!\n"); + return E_FAIL; + } + + s = &v->effect->used_shaders[i + shader_index]->u.shader; + } + + if (!s->reflection) + return D3DERR_INVALIDCALL; + + return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc); +} + static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc( ID3D10EffectShaderVariable *iface, UINT shader_index, UINT element_index, D3D10_SIGNATURE_PARAMETER_DESC *desc) @@ -7060,7 +7097,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignature D3D10_SIGNATURE_PARAMETER_DESC *desc) { struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(iface); - struct d3d10_effect_shader_variable *s;
TRACE("iface %p, shader_index %u, element_index %u, desc %p\n", iface, shader_index, element_index, desc); @@ -7071,19 +7107,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignature return E_FAIL; }
- /* Check shader_index, this crashes on W7/DX10 */ - if (shader_index >= v->effect->used_shader_count) - { - WARN("This should crash on W7/DX10!\n"); - return E_FAIL; - } - - s = &v->effect->used_shaders[shader_index]->u.shader; - - if (!s->reflection) - return D3DERR_INVALIDCALL; - - return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc); + return d3d10_get_shader_variable_signature(v, shader_index, element_index, TRUE, desc); }
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index df0d1a99ef4..1b8e765a8e6 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -3656,25 +3656,23 @@ todo_wine ps = v->lpVtbl->AsShader(v);
hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 0, 0, &sign); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName); + ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName); + + hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 4, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
v = effect->lpVtbl->GetVariableByName(effect, "v"); vs = v->lpVtbl->AsShader(v);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
/* NULL shader variable */ v = effect->lpVtbl->GetVariableByName(effect, "v0"); @@ -3683,6 +3681,16 @@ todo_wine hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
+ hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + + hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 2, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + + hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 3, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Mon, Aug 23, 2021 at 10:23 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 52 ++++++++++++++++++++++++++++----------- dlls/d3d10/tests/effect.c | 26 +++++++++++++------- 2 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 3f0916e60d5..e261e5a7cd7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -6999,6 +6999,43 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader( return S_OK; }
+static HRESULT d3d10_get_shader_variable_signature(struct d3d10_effect_variable *v,
UINT shader_index, UINT element_index, BOOL output, D3D10_SIGNATURE_PARAMETER_DESC *desc)
+{
- struct d3d10_effect_shader_variable *s;
- unsigned int i;
- if (v->type->element_count)
v = &v->elements[0];
- if (shader_index == 0)
- {
s = &v->u.shader;
- }
- else
- {
/* Index is used as an offset from this variable. */
for (i = 0; i < v->effect->used_shader_count; ++i)
{
if (v == v->effect->used_shaders[i]) break;
}
if (i + shader_index >= v->effect->used_shader_count)
{
WARN("This should crash!\n");
return E_FAIL;
}
I know this follows the trend of existing WARN() messages in the DLL but I'd rather we print a more explicit and less excited message, like "Shader index out of range" or something along those lines.
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index df0d1a99ef4..1b8e765a8e6 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -3656,25 +3656,23 @@ todo_wine ps = v->lpVtbl->AsShader(v);
hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 0, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName);
hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 4, 0, &sign);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
v = effect->lpVtbl->GetVariableByName(effect, "v"); vs = v->lpVtbl->AsShader(v);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
/* NULL shader variable */ v = effect->lpVtbl->GetVariableByName(effect, "v0");
@@ -3683,6 +3681,16 @@ todo_wine hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign);
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 2, 0, &sign);
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 3, 0, &sign);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
BTW, that's some amazing behavior by native...
On 8/25/21 8:39 PM, Matteo Bruni wrote:
On Mon, Aug 23, 2021 at 10:23 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/effect.c | 52 ++++++++++++++++++++++++++++----------- dlls/d3d10/tests/effect.c | 26 +++++++++++++------- 2 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 3f0916e60d5..e261e5a7cd7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -6999,6 +6999,43 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetPixelShader( return S_OK; }
+static HRESULT d3d10_get_shader_variable_signature(struct d3d10_effect_variable *v,
UINT shader_index, UINT element_index, BOOL output, D3D10_SIGNATURE_PARAMETER_DESC *desc)
+{
- struct d3d10_effect_shader_variable *s;
- unsigned int i;
- if (v->type->element_count)
v = &v->elements[0];
- if (shader_index == 0)
- {
s = &v->u.shader;
- }
- else
- {
/* Index is used as an offset from this variable. */
for (i = 0; i < v->effect->used_shader_count; ++i)
{
if (v == v->effect->used_shaders[i]) break;
}
if (i + shader_index >= v->effect->used_shader_count)
{
WARN("This should crash!\n");
return E_FAIL;
}
I know this follows the trend of existing WARN() messages in the DLL but I'd rather we print a more explicit and less excited message, like "Shader index out of range" or something along those lines.
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index df0d1a99ef4..1b8e765a8e6 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -3656,25 +3656,23 @@ todo_wine ps = v->lpVtbl->AsShader(v);
hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 0, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName);
hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 4, 0, &sign);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
v = effect->lpVtbl->GetVariableByName(effect, "v"); vs = v->lpVtbl->AsShader(v);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign);
-todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
/* NULL shader variable */ v = effect->lpVtbl->GetVariableByName(effect, "v0");
@@ -3683,6 +3681,16 @@ todo_wine hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 0, 0, &sign); ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 1, 0, &sign);
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 2, 0, &sign);
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
hr = vs->lpVtbl->GetOutputSignatureElementDesc(vs, 3, 0, &sign);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
BTW, that's some amazing behavior by native...
It's likely a side effect of keeping variables in a single array.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 45 +++++---------------------------------- dlls/d3d10/tests/effect.c | 31 ++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 41 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index e261e5a7cd7..b3a027a5962 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -7033,7 +7033,10 @@ static HRESULT d3d10_get_shader_variable_signature(struct d3d10_effect_variable if (!s->reflection) return D3DERR_INVALIDCALL;
- return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc); + if (output) + return s->reflection->lpVtbl->GetOutputParameterDesc(s->reflection, element_index, desc); + else + return s->reflection->lpVtbl->GetInputParameterDesc(s->reflection, element_index, desc); }
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureElementDesc( @@ -7041,8 +7044,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureE D3D10_SIGNATURE_PARAMETER_DESC *desc) { struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(iface); - struct d3d10_effect_shader_variable *s; - D3D10_SIGNATURE_PARAMETER_DESC *d;
TRACE("iface %p, shader_index %u, element_index %u, desc %p\n", iface, shader_index, element_index, desc); @@ -7053,43 +7054,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetInputSignatureE return E_FAIL; }
- /* Check shader_index, this crashes on W7/DX10 */ - if (shader_index >= v->effect->used_shader_count) - { - WARN("This should crash on W7/DX10!\n"); - return E_FAIL; - } - - s = &v->effect->used_shaders[shader_index]->u.shader; - if (!s->input_signature.signature) - { - WARN("No shader signature\n"); - return D3DERR_INVALIDCALL; - } - - /* Check desc for NULL, this crashes on W7/DX10 */ - if (!desc) - { - WARN("This should crash on W7/DX10!\n"); - return E_FAIL; - } - - if (element_index >= s->input_signature.element_count) - { - WARN("Invalid element index specified\n"); - return E_INVALIDARG; - } - - d = &s->input_signature.elements[element_index]; - desc->SemanticName = d->SemanticName; - desc->SemanticIndex = d->SemanticIndex; - desc->SystemValueType = d->SystemValueType; - desc->ComponentType = d->ComponentType; - desc->Register = d->Register; - desc->ReadWriteMask = d->ReadWriteMask; - desc->Mask = d->Mask; - - return S_OK; + return d3d10_get_shader_variable_signature(v, shader_index, element_index, FALSE, desc); }
static HRESULT STDMETHODCALLTYPE d3d10_effect_shader_variable_GetOutputSignatureElementDesc( diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 1b8e765a8e6..3bcb0e80546 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -3651,7 +3651,7 @@ todo_wine shaderdesc.SODecl); }
- /* Output signature description */ + /* Signature description */ v = effect->lpVtbl->GetVariableByName(effect, "p"); ps = v->lpVtbl->AsShader(v);
@@ -3663,6 +3663,14 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
+ hr = ps->lpVtbl->GetInputSignatureElementDesc(ps, 0, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + + hr = ps->lpVtbl->GetInputSignatureElementDesc(ps, 4, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + v = effect->lpVtbl->GetVariableByName(effect, "v"); vs = v->lpVtbl->AsShader(v);
@@ -3674,6 +3682,14 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
+ hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 0, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + + hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 1, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + /* NULL shader variable */ v = effect->lpVtbl->GetVariableByName(effect, "v0"); vs = v->lpVtbl->AsShader(v); @@ -3691,6 +3707,19 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(!strcmp(sign.SemanticName, "SV_POSITION"), "Unexpected semantic %s.\n", sign.SemanticName);
+ hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 0, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + + hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 1, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + + hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 2, 0, &sign); + ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr); + + hr = vs->lpVtbl->GetInputSignatureElementDesc(vs, 3, 0, &sign); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(sign.SemanticName, "POSITION"), "Unexpected semantic %s.\n", sign.SemanticName); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 181 +++---------------------------------- dlls/d3d10/tests/effect.c | 7 ++ 3 files changed, 23 insertions(+), 167 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 359c1f017f7..751c39dc895 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -105,8 +105,8 @@ struct d3d10_effect_shader_signature
struct d3d10_effect_shader_variable { - struct d3d10_effect_shader_signature input_signature; ID3D10ShaderReflection *reflection; + ID3D10Blob *input_signature; union { ID3D10VertexShader *vs; diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index b3a027a5962..ae709b91759 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -320,12 +320,6 @@ static void read_dword(const char **ptr, DWORD *d) *ptr += sizeof(*d); }
-static void write_dword(char **ptr, DWORD d) -{ - memcpy(*ptr, &d, sizeof(d)); - *ptr += sizeof(d); -} - static BOOL require_space(size_t offset, size_t count, size_t size, size_t data_size) { return !count || (data_size - offset) / count >= size; @@ -344,12 +338,6 @@ static void skip_dword_unknown(const char *location, const char **ptr, unsigned } }
-static void write_dword_unknown(char **ptr, DWORD d) -{ - FIXME("Writing unknown DWORD 0x%08x\n", d); - write_dword(ptr, d); -} - static HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) { @@ -507,156 +495,6 @@ static BOOL copy_name(const char *ptr, char **name) return TRUE; }
-static const char *shader_get_string(const char *data, size_t data_size, DWORD offset) -{ - const char *s; - size_t l; - - if (!fx10_get_string(data, data_size, offset, &s, &l)) - return NULL; - - return l ? s : ""; -} - -static HRESULT shader_parse_signature(const char *data, DWORD data_size, struct d3d10_effect_shader_signature *s) -{ - D3D10_SIGNATURE_PARAMETER_DESC *e; - const char *ptr = data; - unsigned int i; - DWORD count; - - if (!require_space(0, 2, sizeof(DWORD), data_size)) - { - WARN("Invalid data size %#x.\n", data_size); - return E_INVALIDARG; - } - - read_dword(&ptr, &count); - TRACE("%u elements\n", count); - - skip_dword_unknown("shader signature", &ptr, 1); - - if (!require_space(ptr - data, count, 6 * sizeof(DWORD), data_size)) - { - WARN("Invalid count %#x (data size %#x).\n", count, data_size); - return E_INVALIDARG; - } - - if (!(e = heap_calloc(count, sizeof(*e)))) - { - ERR("Failed to allocate signature memory.\n"); - return E_OUTOFMEMORY; - } - - for (i = 0; i < count; ++i) - { - UINT name_offset; - UINT mask; - - read_dword(&ptr, &name_offset); - if (!(e[i].SemanticName = shader_get_string(data, data_size, name_offset))) - { - WARN("Invalid name offset %#x (data size %#x).\n", name_offset, data_size); - heap_free(e); - return E_INVALIDARG; - } - read_dword(&ptr, &e[i].SemanticIndex); - read_dword(&ptr, &e[i].SystemValueType); - read_dword(&ptr, &e[i].ComponentType); - read_dword(&ptr, &e[i].Register); - read_dword(&ptr, &mask); - - e[i].ReadWriteMask = mask >> 8; - e[i].Mask = mask & 0xff; - - TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, " - "type %u, register idx: %u, use_mask %#x, input_mask %#x\n", - debugstr_a(e[i].SemanticName), e[i].SemanticIndex, e[i].SystemValueType, - e[i].ComponentType, e[i].Register, e[i].Mask, e[i].ReadWriteMask); - } - - s->elements = e; - s->element_count = count; - - return S_OK; -} - -static void shader_free_signature(struct d3d10_effect_shader_signature *s) -{ - heap_free(s->signature); - heap_free(s->elements); -} - -static HRESULT shader_chunk_handler(const char *data, DWORD data_size, DWORD tag, void *ctx) -{ - struct d3d10_effect_shader_variable *s = ctx; - HRESULT hr; - - TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4)); - - TRACE("chunk size: %#x\n", data_size); - - switch(tag) - { - case TAG_ISGN: - { - /* 32 (DXBC header) + 1 * 4 (chunk index) + 2 * 4 (chunk header) + data_size (chunk data) */ - UINT size = 44 + data_size; - struct d3d10_effect_shader_signature *sig = &s->input_signature; - char *ptr; - - if (!(sig->signature = heap_alloc_zero(size))) - { - ERR("Failed to allocate input signature data\n"); - return E_OUTOFMEMORY; - } - sig->signature_size = size; - - ptr = sig->signature; - - write_dword(&ptr, TAG_DXBC); - - /* signature(?) */ - write_dword_unknown(&ptr, 0); - write_dword_unknown(&ptr, 0); - write_dword_unknown(&ptr, 0); - write_dword_unknown(&ptr, 0); - - /* seems to be always 1 */ - write_dword_unknown(&ptr, 1); - - /* DXBC size */ - write_dword(&ptr, size); - - /* chunk count */ - write_dword(&ptr, 1); - - /* chunk index */ - write_dword(&ptr, (ptr - sig->signature) + 4); - - /* chunk */ - write_dword(&ptr, tag); - write_dword(&ptr, data_size); - memcpy(ptr, data, data_size); - - hr = shader_parse_signature(ptr, data_size, sig); - if (FAILED(hr)) - { - ERR("Failed to parse shader, hr %#x\n", hr); - shader_free_signature(sig); - } - - break; - } - - default: - FIXME("Unhandled chunk %s.\n", debugstr_an((const char *)&tag, 4)); - break; - } - - return S_OK; -} - static HRESULT get_fx10_shader_resources(struct d3d10_effect_variable *v, const void *data, size_t data_size) { struct d3d10_effect_shader_variable *sv = &v->u.shader; @@ -766,6 +604,8 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse if (FAILED(hr = D3D10ReflectShader(ptr, dxbc_size, &v->u.shader.reflection))) return hr;
+ D3DGetInputSignatureBlob(ptr, dxbc_size, &v->u.shader.input_signature); + if (FAILED(hr = get_fx10_shader_resources(v, ptr, dxbc_size))) return hr;
@@ -793,7 +633,7 @@ static HRESULT parse_fx10_shader(const char *data, size_t data_size, DWORD offse return E_FAIL; }
- return parse_dxbc(ptr, dxbc_size, shader_chunk_handler, &v->u.shader); + return hr; }
static D3D10_SHADER_VARIABLE_CLASS d3d10_variable_class(DWORD c, BOOL is_column_major) @@ -2741,7 +2581,8 @@ static void d3d10_effect_shader_variable_destroy(struct d3d10_effect_shader_vari { if (s->reflection) s->reflection->lpVtbl->Release(s->reflection); - shader_free_signature(&s->input_signature); + if (s->input_signature) + ID3D10Blob_Release(s->input_signature);
switch (type) { @@ -3597,8 +3438,16 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa
desc->Name = pass->name; desc->Annotations = pass->annotation_count; - desc->pIAInputSignature = (BYTE *)s->input_signature.signature; - desc->IAInputSignatureSize = s->input_signature.signature_size; + if (s->input_signature) + { + desc->pIAInputSignature = ID3D10Blob_GetBufferPointer(s->input_signature); + desc->IAInputSignatureSize = ID3D10Blob_GetBufferSize(s->input_signature); + } + else + { + desc->pIAInputSignature = NULL; + desc->IAInputSignatureSize = 0; + } desc->StencilRef = pass->stencil_ref; desc->SampleMask = pass->sample_mask; memcpy(desc->BlendFactor, pass->blend_factor, 4 * sizeof(float)); diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3bcb0e80546..5fcece4695b 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5740,6 +5740,7 @@ static void test_effect_resource_variable(void) ID3D10EffectTechnique *technique; ID3D10Texture2D *tex0, *tex_a[2]; D3D10_EFFECT_DESC effect_desc; + D3D10_PASS_DESC pass_desc; ID3D10EffectVariable *var; ID3D10EffectPass *pass; ID3D10Device *device; @@ -5795,6 +5796,12 @@ static void test_effect_resource_variable(void) ok(!!technique, "Got unexpected technique %p.\n", technique); pass = technique->lpVtbl->GetPassByName(technique, "p0"); ok(!!pass, "Got unexpected pass %p.\n", pass); + hr = pass->lpVtbl->GetDesc(pass, &pass_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!!pass_desc.pIAInputSignature, "Unexpected input signature.\n"); + ok(pass_desc.IAInputSignatureSize == 88, "Unexpected input signature size %lu.\n", + pass_desc.IAInputSignatureSize); + hr = pass->lpVtbl->Apply(pass, 0); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
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 ae709b91759..3b3d48c50a8 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1408,7 +1408,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, const char **ptr, D3D_SHADER_VARIABLE_TYPE container_type, void *container) { const struct d3d10_effect_state_property_info *property_info; - UINT value_offset; + UINT value_offset, operation; unsigned int i; DWORD count; UINT idx; @@ -1421,7 +1421,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, { read_dword(ptr, &id); read_dword(ptr, &idx); - skip_dword_unknown("read property", ptr, 1); + read_dword(ptr, &operation); read_dword(ptr, &value_offset);
if (!(property_info = get_property_info(id)))
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
On Mon, Aug 23, 2021 at 10:24 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 ae709b91759..3b3d48c50a8 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1408,7 +1408,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, const char **ptr, D3D_SHADER_VARIABLE_TYPE container_type, void *container) { const struct d3d10_effect_state_property_info *property_info;
- UINT value_offset;
- UINT value_offset, operation; unsigned int i; DWORD count; UINT idx;
@@ -1421,7 +1421,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, { read_dword(ptr, &id); read_dword(ptr, &idx);
skip_dword_unknown("read property", ptr, 1);
read_dword(ptr, &operation); read_dword(ptr, &value_offset); if (!(property_info = get_property_info(id)))
Is it supposed to be used somehow, eventually?
On 8/25/21 8:39 PM, Matteo Bruni wrote:
On Mon, Aug 23, 2021 at 10:24 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 ae709b91759..3b3d48c50a8 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1408,7 +1408,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, const char **ptr, D3D_SHADER_VARIABLE_TYPE container_type, void *container) { const struct d3d10_effect_state_property_info *property_info;
- UINT value_offset;
- UINT value_offset, operation; unsigned int i; DWORD count; UINT idx;
@@ -1421,7 +1421,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, { read_dword(ptr, &id); read_dword(ptr, &idx);
skip_dword_unknown("read property", ptr, 1);
read_dword(ptr, &operation); read_dword(ptr, &value_offset); if (!(property_info = get_property_info(id)))
Is it supposed to be used somehow, eventually?
Yes, I believe it's the same EOO assignment type. For one thing I tried with fx_3 style of sampler states, was:
Texture tex[2];
sampler_state { ... Texture = tex[0] }
And that works both at compiler and effect creation level. I don't have more details right now, but I think assignment handling should be unified between state group and parse_object helpers.
On Wed, Aug 25, 2021 at 8:39 PM Nikolay Sivov nsivov@codeweavers.com wrote:
On 8/25/21 8:39 PM, Matteo Bruni wrote:
On Mon, Aug 23, 2021 at 10:24 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 ae709b91759..3b3d48c50a8 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1408,7 +1408,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, const char **ptr, D3D_SHADER_VARIABLE_TYPE container_type, void *container) { const struct d3d10_effect_state_property_info *property_info;
- UINT value_offset;
- UINT value_offset, operation; unsigned int i; DWORD count; UINT idx;
@@ -1421,7 +1421,7 @@ static BOOL parse_fx10_state_group(const char *data, size_t data_size, { read_dword(ptr, &id); read_dword(ptr, &idx);
skip_dword_unknown("read property", ptr, 1);
read_dword(ptr, &operation); read_dword(ptr, &value_offset); if (!(property_info = get_property_info(id)))
Is it supposed to be used somehow, eventually?
Yes, I believe it's the same EOO assignment type. For one thing I tried with fx_3 style of sampler states, was:
Texture tex[2];
sampler_state { ... Texture = tex[0] }
And that works both at compiler and effect creation level. I don't have more details right now, but I think assignment handling should be unified between state group and parse_object helpers.
Ahhh, gotcha. Yeah that sounds right, incidentally it would also match d3dx9.
On Mon, Aug 23, 2021 at 10:23 AM Nikolay Sivov nsivov@codeweavers.com wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10/effect.c | 54 ++++++++------------------------------ dlls/d3d10/tests/effect.c | 37 +++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 45 deletions(-)
Nice. Just one thing, below.
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 9a217993e7e..df0d1a99ef4 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -23,6 +23,8 @@
#include <float.h>
+#define D3DERR_INVALIDCALL 0x8876086c
static ID3D10Device *create_device(void) { ID3D10Device *device; @@ -2796,8 +2798,9 @@ static void test_effect_local_shader(void) D3D10_EFFECT_TYPE_DESC typedesc; D3D10_EFFECT_DESC effect_desc; ID3D10EffectShaderVariable *null_shader, *null_anon_vs, *null_anon_ps, *null_anon_gs,
*p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs, *gs;
D3D10_EFFECT_SHADER_DESC shaderdesc;*p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs, *gs, *ps, *vs;
- D3D10_SIGNATURE_PARAMETER_DESC sign; ID3D10Device *device; ULONG refcount;
@@ -3648,6 +3651,38 @@ todo_wine shaderdesc.SODecl); }
- /* Output signature description */
- v = effect->lpVtbl->GetVariableByName(effect, "p");
- ps = v->lpVtbl->AsShader(v);
- hr = ps->lpVtbl->GetOutputSignatureElementDesc(ps, 0, 0, &sign);
+todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- if (SUCCEEDED(hr))
ok(!strcmp(sign.SemanticName, "SV_Target"), "Unexpected semantic %s.\n", sign.SemanticName);
It would be interesting to test what happens for GetOutputSignatureElementDesc(ps, 0, 1, &sign); (answer is apparently supposed to be "returning E_INVALIDARG", which seems reasonable)