[PATCH 1/5] d3d10/effect: Use shader reflection to return output signature description.
Matteo Bruni
matteo.mystral at gmail.com
Wed Aug 25 12:38:32 CDT 2021
On Mon, Aug 23, 2021 at 10:23 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
> Signed-off-by: Nikolay Sivov <nsivov at 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;
> + *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);
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)
More information about the wine-devel
mailing list