mssign32: Add a trailing '\n' to a few FIXME() messages.
[wine/multimedia.git] / dlls / d3dcompiler_43 / tests / reflection.c
blob70c062e6548d5bcf1faa5d6acd4dd055bb693b74
1 /*
2 * Copyright 2010 Rico Schüller
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 * Nearly all compiler functions need the shader blob and the size. The size
21 * is always located at DWORD #6 in the shader blob (blob[6]).
22 * The functions are e.g.: D3DGet*SignatureBlob, D3DReflect
25 #define COBJMACROS
26 #include "initguid.h"
27 #include "d3dcompiler.h"
28 #include "wine/test.h"
30 /* includes for older reflection interfaces */
31 #include "d3d10.h"
32 #include "d3d10_1shader.h"
35 * This doesn't belong here, but for some functions it is possible to return that value,
36 * see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
37 * The original definition is in D3DX10core.h.
39 #define D3DERR_INVALIDCALL 0x8876086c
41 /* Creator string for comparison - Version 9.29.952.3111 (43) */
42 static DWORD shader_creator[] = {
43 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d,
44 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00,
48 * fxc.exe /E VS /Tvs_4_0 /Fx
50 #if 0
51 float4 VS(float4 position : POSITION, float4 pos : SV_POSITION) : SV_POSITION
53 return position;
55 #endif
56 static DWORD test_reflection_blob[] = {
57 0x43425844, 0x77c6324f, 0xfd27948a, 0xe6958d31, 0x53361cba, 0x00000001, 0x000001d8, 0x00000005,
58 0x00000034, 0x0000008c, 0x000000e4, 0x00000118, 0x0000015c, 0x46454452, 0x00000050, 0x00000000,
59 0x00000000, 0x00000000, 0x0000001c, 0xfffe0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
60 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
61 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038,
62 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000,
63 0x00000003, 0x00000001, 0x0000000f, 0x49534f50, 0x4e4f4954, 0x5f565300, 0x49534f50, 0x4e4f4954,
64 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001,
65 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c,
66 0x00010040, 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000,
67 0x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, 0x54415453,
68 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
69 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
70 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
71 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
74 static void test_reflection_references(void)
76 HRESULT hr;
77 ULONG count;
78 ID3D11ShaderReflection *ref11, *ref11_test;
79 ID3D10ShaderReflection *ref10;
80 ID3D10ShaderReflection1 *ref10_1;
82 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
83 ok(hr == S_OK, "D3DReflect failed, got %x, expected %x\n", hr, S_OK);
85 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D11ShaderReflection, (void **)&ref11_test);
86 ok(hr == S_OK, "QueryInterface failed, got %x, expected %x\n", hr, S_OK);
88 count = ref11_test->lpVtbl->Release(ref11_test);
89 ok(count == 1, "Release failed %u\n", count);
91 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection, (void **)&ref10);
92 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x\n", hr, E_NOINTERFACE);
94 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
95 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x\n", hr, E_NOINTERFACE);
97 count = ref11->lpVtbl->Release(ref11);
98 ok(count == 0, "Release failed %u\n", count);
100 /* check invalid cases */
101 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection, (void **)&ref10);
102 ok(hr == E_NOINTERFACE, "D3DReflect failed, got %x, expected %x\n", hr, E_NOINTERFACE);
104 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
105 ok(hr == E_NOINTERFACE, "D3DReflect failed, got %x, expected %x\n", hr, E_NOINTERFACE);
107 hr = D3DReflect(NULL, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
108 ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
110 hr = D3DReflect(NULL, test_reflection_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
111 ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
113 /* returns different errors with different sizes */
114 hr = D3DReflect(test_reflection_blob, 31, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
115 ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
117 hr = D3DReflect(test_reflection_blob, 32, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
118 ok(hr == E_FAIL, "D3DReflect failed, got %x, expected %x\n", hr, E_FAIL);
120 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6]-1, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
121 ok(hr == E_FAIL, "D3DReflect failed, got %x, expected %x\n", hr, E_FAIL);
123 hr = D3DReflect(test_reflection_blob, 31, &IID_ID3D11ShaderReflection, (void **)&ref11);
124 ok(hr == D3DERR_INVALIDCALL, "D3DReflect failed, got %x, expected %x\n", hr, D3DERR_INVALIDCALL);
126 hr = D3DReflect(test_reflection_blob, 32, &IID_ID3D11ShaderReflection, (void **)&ref11);
127 ok(hr == E_FAIL, "D3DReflect failed, got %x, expected %x\n", hr, E_FAIL);
129 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6]-1, &IID_ID3D11ShaderReflection, (void **)&ref11);
130 ok(hr == E_FAIL, "D3DReflect failed, got %x, expected %x\n", hr, E_FAIL);
134 * fxc.exe /E VS /Tvs_4_1 /Fx
136 #if 0
137 struct vsin
139 float4 x : SV_position;
140 float4 a : BINORMAL;
141 uint b : BLENDINDICES;
142 float c : BLENDWEIGHT;
143 float4 d : COLOR;
144 float4 d1 : COLOR1;
145 float4 e : NORMAL;
146 float4 f : POSITION;
147 float4 g : POSITIONT;
148 float h : PSIZE;
149 float4 i : TANGENT;
150 float4 j : TEXCOORD;
151 uint k : SV_VertexID;
152 uint l : SV_InstanceID;
153 float m : testin;
155 struct vsout
157 float4 x : SV_position;
158 float4 a : COLOR0;
159 float b : FOG;
160 float4 c : POSITION0;
161 float d : PSIZE;
162 float e : TESSFACTOR0;
163 float4 f : TEXCOORD0;
164 float g : SV_ClipDistance0;
165 float h : SV_CullDistance0;
166 uint i : SV_InstanceID;
167 float j : testout;
169 vsout VS(vsin x)
171 vsout s;
172 s.x = float4(1.6f, 0.3f, 0.1f, 0.0f);
173 int y = 1;
174 int p[5] = {1, 2, 3, 5, 4};
175 y = y << (int) x.x.x & 0xf;
176 s.x.x = p[y];
177 s.a = x.d;
178 s.b = x.c;
179 s.c = x.f;
180 s.d = x.h;
181 s.e = x.h;
182 s.f = x.j;
183 s.g = 1.0f;
184 s.h = 1.0f;
185 s.i = 2;
186 s.j = x.m;
187 return s;
189 #endif
190 static DWORD test_reflection_desc_vs_blob[] = {
191 0x43425844, 0xb65955ac, 0xcea1cb75, 0x06c5a1ad, 0x8a555fa1, 0x00000001, 0x0000076c, 0x00000005,
192 0x00000034, 0x0000008c, 0x0000028c, 0x00000414, 0x000006f0, 0x46454452, 0x00000050, 0x00000000,
193 0x00000000, 0x00000000, 0x0000001c, 0xfffe0401, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
194 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
195 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x000001f8, 0x0000000f, 0x00000008, 0x00000170,
196 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000010f, 0x0000017c, 0x00000000, 0x00000000,
197 0x00000003, 0x00000001, 0x0000000f, 0x00000185, 0x00000000, 0x00000000, 0x00000001, 0x00000002,
198 0x00000001, 0x00000192, 0x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000101, 0x0000019e,
199 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000f0f, 0x0000019e, 0x00000001, 0x00000000,
200 0x00000003, 0x00000005, 0x0000000f, 0x000001a4, 0x00000000, 0x00000000, 0x00000003, 0x00000006,
201 0x0000000f, 0x000001ab, 0x00000000, 0x00000000, 0x00000003, 0x00000007, 0x00000f0f, 0x000001b4,
202 0x00000000, 0x00000000, 0x00000003, 0x00000008, 0x0000000f, 0x000001be, 0x00000000, 0x00000000,
203 0x00000003, 0x00000009, 0x00000101, 0x000001c4, 0x00000000, 0x00000000, 0x00000003, 0x0000000a,
204 0x0000000f, 0x000001cc, 0x00000000, 0x00000000, 0x00000003, 0x0000000b, 0x00000f0f, 0x000001d5,
205 0x00000000, 0x00000006, 0x00000001, 0x0000000c, 0x00000001, 0x000001e1, 0x00000000, 0x00000008,
206 0x00000001, 0x0000000d, 0x00000001, 0x000001ef, 0x00000000, 0x00000000, 0x00000003, 0x0000000e,
207 0x00000101, 0x705f5653, 0x7469736f, 0x006e6f69, 0x4f4e4942, 0x4c414d52, 0x454c4200, 0x4e49444e,
208 0x45434944, 0x4c420053, 0x57444e45, 0x48474945, 0x4f430054, 0x00524f4c, 0x4d524f4e, 0x50004c41,
209 0x5449534f, 0x004e4f49, 0x49534f50, 0x4e4f4954, 0x53500054, 0x00455a49, 0x474e4154, 0x00544e45,
210 0x43584554, 0x44524f4f, 0x5f565300, 0x74726556, 0x44497865, 0x5f565300, 0x74736e49, 0x65636e61,
211 0x74004449, 0x69747365, 0xabab006e, 0x4e47534f, 0x00000180, 0x0000000b, 0x00000008, 0x00000110,
212 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000011c, 0x00000000, 0x00000000,
213 0x00000003, 0x00000001, 0x0000000f, 0x00000122, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
214 0x00000e01, 0x00000126, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000d02, 0x0000012c,
215 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000b04, 0x00000137, 0x00000000, 0x00000000,
216 0x00000003, 0x00000002, 0x00000708, 0x0000013f, 0x00000000, 0x00000000, 0x00000003, 0x00000003,
217 0x0000000f, 0x00000148, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x0000000f, 0x00000151,
218 0x00000000, 0x00000002, 0x00000003, 0x00000005, 0x00000e01, 0x00000161, 0x00000000, 0x00000003,
219 0x00000003, 0x00000005, 0x00000d02, 0x00000171, 0x00000000, 0x00000000, 0x00000001, 0x00000006,
220 0x00000e01, 0x705f5653, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0x4f460052, 0x53500047, 0x00455a49,
221 0x53534554, 0x54434146, 0x7400524f, 0x6f747365, 0x50007475, 0x5449534f, 0x004e4f49, 0x43584554,
222 0x44524f4f, 0x5f565300, 0x70696c43, 0x74736944, 0x65636e61, 0x5f565300, 0x6c6c7543, 0x74736944,
223 0x65636e61, 0x5f565300, 0x74736e49, 0x65636e61, 0xab004449, 0x52444853, 0x000002d4, 0x00010041,
224 0x000000b5, 0x0100086a, 0x0300005f, 0x00101012, 0x00000000, 0x0300005f, 0x00101012, 0x00000003,
225 0x0300005f, 0x001010f2, 0x00000004, 0x0300005f, 0x001010f2, 0x00000007, 0x0300005f, 0x00101012,
226 0x00000009, 0x0300005f, 0x001010f2, 0x0000000b, 0x0300005f, 0x00101012, 0x0000000e, 0x04000067,
227 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x03000065, 0x00102012,
228 0x00000002, 0x03000065, 0x00102022, 0x00000002, 0x03000065, 0x00102042, 0x00000002, 0x03000065,
229 0x00102082, 0x00000002, 0x03000065, 0x001020f2, 0x00000003, 0x03000065, 0x001020f2, 0x00000004,
230 0x04000067, 0x00102012, 0x00000005, 0x00000002, 0x04000067, 0x00102022, 0x00000005, 0x00000003,
231 0x03000065, 0x00102012, 0x00000006, 0x02000068, 0x00000001, 0x04000069, 0x00000000, 0x00000005,
232 0x00000004, 0x06000036, 0x00203012, 0x00000000, 0x00000000, 0x00004001, 0x00000001, 0x06000036,
233 0x00203012, 0x00000000, 0x00000001, 0x00004001, 0x00000002, 0x06000036, 0x00203012, 0x00000000,
234 0x00000002, 0x00004001, 0x00000003, 0x06000036, 0x00203012, 0x00000000, 0x00000003, 0x00004001,
235 0x00000005, 0x06000036, 0x00203012, 0x00000000, 0x00000004, 0x00004001, 0x00000004, 0x0500001b,
236 0x00100012, 0x00000000, 0x0010100a, 0x00000000, 0x07000029, 0x00100012, 0x00000000, 0x00004001,
237 0x00000001, 0x0010000a, 0x00000000, 0x07000001, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
238 0x00004001, 0x0000000f, 0x07000036, 0x00100012, 0x00000000, 0x0420300a, 0x00000000, 0x0010000a,
239 0x00000000, 0x0500002b, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x08000036, 0x001020e2,
240 0x00000000, 0x00004002, 0x00000000, 0x3e99999a, 0x3dcccccd, 0x00000000, 0x05000036, 0x001020f2,
241 0x00000001, 0x00101e46, 0x00000004, 0x05000036, 0x00102012, 0x00000002, 0x0010100a, 0x00000003,
242 0x05000036, 0x00102062, 0x00000002, 0x00101006, 0x00000009, 0x05000036, 0x00102082, 0x00000002,
243 0x0010100a, 0x0000000e, 0x05000036, 0x001020f2, 0x00000003, 0x00101e46, 0x00000007, 0x05000036,
244 0x001020f2, 0x00000004, 0x00101e46, 0x0000000b, 0x05000036, 0x00102012, 0x00000005, 0x00004001,
245 0x3f800000, 0x05000036, 0x00102022, 0x00000005, 0x00004001, 0x3f800000, 0x05000036, 0x00102012,
246 0x00000006, 0x00004001, 0x00000002, 0x0100003e, 0x54415453, 0x00000074, 0x00000015, 0x00000001,
247 0x00000000, 0x00000012, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000000,
248 0x00000005, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
249 0x00000000, 0x0000000a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
250 0x00000000, 0x00000000, 0x00000000,
253 static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_vs_resultin[] =
255 {"SV_position", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x1, 0},
256 {"BINORMAL", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
257 {"BLENDINDICES", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
258 {"BLENDWEIGHT", 0, 3, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
259 {"COLOR", 0, 4, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
260 {"COLOR", 1, 5, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
261 {"NORMAL", 0, 6, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
262 {"POSITION", 0, 7, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
263 {"POSITIONT", 0, 8, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
264 {"PSIZE", 0, 9, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
265 {"TANGENT", 0, 10, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
266 {"TEXCOORD", 0, 11, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
267 {"SV_VertexID", 0, 12, D3D_NAME_VERTEX_ID, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
268 {"SV_InstanceID", 0, 13, D3D_NAME_INSTANCE_ID, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
269 {"testin", 0, 14, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
272 static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_vs_resultout[] =
274 {"SV_position", 0, 0, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
275 {"COLOR", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
276 {"FOG", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
277 {"PSIZE", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x2, 0xd, 0},
278 {"TESSFACTOR", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x4, 0xb, 0},
279 {"testout", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x8, 0x7, 0},
280 {"POSITION", 0, 3, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
281 {"TEXCOORD", 0, 4, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
282 {"SV_ClipDistance", 0, 5, D3D_NAME_CLIP_DISTANCE, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
283 {"SV_CullDistance", 0, 5, D3D_NAME_CULL_DISTANCE, D3D_REGISTER_COMPONENT_FLOAT32, 0x2, 0xd, 0},
284 {"SV_InstanceID", 0, 6, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0},
287 static void test_reflection_desc_vs(void)
289 HRESULT hr;
290 ULONG count;
291 ID3D11ShaderReflection *ref11;
292 D3D11_SHADER_DESC sdesc11 = {0};
293 D3D11_SIGNATURE_PARAMETER_DESC desc = {0};
294 const D3D11_SIGNATURE_PARAMETER_DESC *pdesc;
295 UINT ret;
296 unsigned int i;
298 hr = D3DReflect(test_reflection_desc_vs_blob, test_reflection_desc_vs_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
299 ok(hr == S_OK, "D3DReflect failed %x\n", hr);
301 hr = ref11->lpVtbl->GetDesc(ref11, NULL);
302 ok(hr == E_FAIL, "GetDesc failed %x\n", hr);
304 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
305 ok(hr == S_OK, "GetDesc failed %x\n", hr);
307 ok(sdesc11.Version == 65601, "GetDesc failed, got %u, expected %u\n", sdesc11.Version, 65601);
308 ok(strcmp(sdesc11.Creator, (char*) shader_creator) == 0, "GetDesc failed, got \"%s\", expected \"%s\"\n", sdesc11.Creator, (char*)shader_creator);
309 ok(sdesc11.Flags == 256, "GetDesc failed, got %u, expected %u\n", sdesc11.Flags, 256);
310 ok(sdesc11.ConstantBuffers == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ConstantBuffers, 0);
311 ok(sdesc11.BoundResources == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.BoundResources, 0);
312 ok(sdesc11.InputParameters == 15, "GetDesc failed, got %u, expected %u\n", sdesc11.InputParameters, 15);
313 ok(sdesc11.OutputParameters == 11, "GetDesc failed, got %u, expected %u\n", sdesc11.OutputParameters, 11);
314 ok(sdesc11.InstructionCount == 21, "GetDesc failed, got %u, expected %u\n", sdesc11.InstructionCount, 21);
315 ok(sdesc11.TempRegisterCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.TempRegisterCount, 1);
316 ok(sdesc11.TempArrayCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.TempArrayCount, 5);
317 ok(sdesc11.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DefCount, 0);
318 ok(sdesc11.DclCount == 18, "GetDesc failed, got %u, expected %u\n", sdesc11.DclCount, 18);
319 ok(sdesc11.TextureNormalInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureNormalInstructions, 0);
320 ok(sdesc11.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureLoadInstructions, 0);
321 ok(sdesc11.TextureCompInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureCompInstructions, 0);
322 ok(sdesc11.TextureBiasInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureBiasInstructions, 0);
323 ok(sdesc11.TextureGradientInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureGradientInstructions, 0);
324 ok(sdesc11.FloatInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.FloatInstructionCount, 0);
325 ok(sdesc11.IntInstructionCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.IntInstructionCount, 1);
326 ok(sdesc11.UintInstructionCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.UintInstructionCount, 1);
327 ok(sdesc11.StaticFlowControlCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.StaticFlowControlCount, 1);
328 ok(sdesc11.DynamicFlowControlCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DynamicFlowControlCount, 0);
329 ok(sdesc11.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.MacroInstructionCount, 0);
330 ok(sdesc11.ArrayInstructionCount == 6, "GetDesc failed, got %u, expected %u\n", sdesc11.ArrayInstructionCount, 6);
331 ok(sdesc11.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.CutInstructionCount, 0);
332 ok(sdesc11.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.EmitInstructionCount, 0);
333 ok(sdesc11.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.GSOutputTopology, 0);
334 ok(sdesc11.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.GSMaxOutputVertexCount, 0);
335 ok(sdesc11.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.InputPrimitive, 0);
336 ok(sdesc11.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.PatchConstantParameters, 0);
337 ok(sdesc11.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cGSInstanceCount, 0);
338 ok(sdesc11.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cControlPoints, 0);
339 ok(sdesc11.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSOutputPrimitive, 0);
340 ok(sdesc11.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSPartitioning, 0);
341 ok(sdesc11.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.TessellatorDomain, 0);
342 ok(sdesc11.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cBarrierInstructions, 0);
343 ok(sdesc11.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cInterlockedInstructions, 0);
344 ok(sdesc11.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cTextureStoreInstructions, 0);
346 ret = ref11->lpVtbl->GetBitwiseInstructionCount(ref11);
347 ok(ret == 0, "GetBitwiseInstructionCount failed, got %u, expected %u\n", ret, 0);
349 ret = ref11->lpVtbl->GetConversionInstructionCount(ref11);
350 ok(ret == 2, "GetConversionInstructionCount failed, got %u, expected %u\n", ret, 2);
352 ret = ref11->lpVtbl->GetMovInstructionCount(ref11);
353 ok(ret == 10, "GetMovInstructionCount failed, got %u, expected %u\n", ret, 10);
355 ret = ref11->lpVtbl->GetMovcInstructionCount(ref11);
356 ok(ret == 0, "GetMovcInstructionCount failed, got %u, expected %u\n", ret, 0);
358 /* GetIn/OutputParameterDesc */
359 for (i = 0; i < sizeof(test_reflection_desc_vs_resultin)/sizeof(*test_reflection_desc_vs_resultin); ++i)
361 pdesc = &test_reflection_desc_vs_resultin[i];
363 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc);
364 ok(hr == S_OK, "GetInputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
366 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetInputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
367 i, desc.SemanticName, pdesc->SemanticName);
368 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetInputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
369 i, desc.SemanticIndex, pdesc->SemanticIndex);
370 ok(desc.Register == pdesc->Register, "GetInputParameterDesc(%u) Register failed, got %u, expected %u\n",
371 i, desc.Register, pdesc->Register);
372 ok(desc.SystemValueType == pdesc->SystemValueType, "GetInputParameterDesc(%u) SystemValueType failed, got %x, expected %x\n",
373 i, desc.SystemValueType, pdesc->SystemValueType);
374 ok(desc.ComponentType == pdesc->ComponentType, "GetInputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
375 i, desc.ComponentType, pdesc->ComponentType);
376 ok(desc.Mask == pdesc->Mask, "GetInputParameterDesc(%u) Mask failed, got %x, expected %x\n",
377 i, desc.Mask, pdesc->Mask);
378 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetInputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
379 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
380 ok(desc.Stream == pdesc->Stream, "GetInputParameterDesc(%u) Stream failed, got %u, expected %u\n",
381 i, desc.Stream, pdesc->ReadWriteMask);
384 for (i = 0; i < sizeof(test_reflection_desc_vs_resultout)/sizeof(*test_reflection_desc_vs_resultout); ++i)
386 pdesc = &test_reflection_desc_vs_resultout[i];
388 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc);
389 ok(hr == S_OK, "GetOutputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
391 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetOutputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
392 i, desc.SemanticName, pdesc->SemanticName);
393 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetOutputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
394 i, desc.SemanticIndex, pdesc->SemanticIndex);
395 ok(desc.Register == pdesc->Register, "GetOutputParameterDesc(%u) Register failed, got %u, expected %u\n",
396 i, desc.Register, pdesc->Register);
397 ok(desc.SystemValueType == pdesc->SystemValueType, "GetOutputParameterDesc(%u) SystemValueType failed, got %x, expected %x\n",
398 i, desc.SystemValueType, pdesc->SystemValueType);
399 ok(desc.ComponentType == pdesc->ComponentType, "GetOutputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
400 i, desc.ComponentType, pdesc->ComponentType);
401 ok(desc.Mask == pdesc->Mask, "GetOutputParameterDesc(%u) Mask failed, got %x, expected %x\n",
402 i, desc.Mask, pdesc->Mask);
403 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetOutputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
404 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
405 ok(desc.Stream == pdesc->Stream, "GetOutputParameterDesc(%u) Stream failed, got %u, expected %u\n",
406 i, desc.Stream, pdesc->ReadWriteMask);
409 count = ref11->lpVtbl->Release(ref11);
410 ok(count == 0, "Release failed %u\n", count);
414 * fxc.exe /E PS /Tps_4_1 /Fx
416 #if 0
417 Texture2D tex1;
418 Texture2D tex2;
419 SamplerState sam
421 Filter = MIN_MAG_MIP_LINEAR;
422 AddressU = Wrap;
423 AddressV = Wrap;
425 SamplerComparisonState samc
427 Filter = MIN_MAG_MIP_LINEAR;
428 AddressU = w1;
429 AddressV = Wrap;
430 ComparisonFunc = LESS;
432 struct psin
434 uint f : SV_RenderTargetArrayIndex;
435 uint g : SV_InstanceID;
436 uint h : SV_PrimitiveID;
437 float2 uv : TEXCOORD;
438 float4 a : COLOR3;
439 float b : VFACE;
440 float4 c : SV_position;
441 bool d : SV_Coverage;
442 bool e : SV_IsFrontFace;
444 struct psout
446 float a : SV_Target1;
447 float b : SV_Depth;
448 float x : SV_Target;
449 bool c : SV_Coverage;
451 psout PS(psin p)
453 psout a;
454 float4 x = tex1.Sample(sam, p.uv);
455 x += tex1.SampleCmp(samc, p.uv, 0.3f);
456 if (x.y < 0.1f)
457 x += tex2.SampleCmp(samc, p.uv, 0.4f);
458 else if (x.y < 0.2f)
459 x += tex2.SampleCmp(samc, p.uv, 0.1f);
460 else if (x.y < 0.3f)
461 x += tex2.SampleBias(sam, p.uv, 0.1f);
462 else if (x.y < 0.4f)
463 x += tex2.SampleBias(sam, p.uv, 0.2f);
464 else if (x.y < 0.5f)
465 x += tex2.SampleBias(sam, p.uv, 0.3f);
466 else
467 x += tex2.SampleBias(sam, p.uv, 0.4f);
468 x += tex2.SampleGrad(sam, p.uv, x.xy, x.xy);
469 x += tex2.SampleGrad(sam, p.uv, x.xz, x.xz);
470 x += tex2.SampleGrad(sam, p.uv, x.xz, x.zy);
471 x += tex2.SampleGrad(sam, p.uv, x.xz, x.zw);
472 x += tex2.SampleGrad(sam, p.uv, x.xz, x.wz);
473 a.a = x.y;
474 a.b = x.x;
475 a.x = x.x;
476 a.c = true;
477 return a;
479 #endif
480 static DWORD test_reflection_desc_ps_blob[] = {
481 0x43425844, 0x19e2f325, 0xf1ec39a3, 0x3c5a8b53, 0x5bd5fb65, 0x00000001, 0x000008d0, 0x00000005,
482 0x00000034, 0x0000011c, 0x00000254, 0x000002e4, 0x00000854, 0x46454452, 0x000000e0, 0x00000000,
483 0x00000000, 0x00000004, 0x0000001c, 0xffff0401, 0x00000100, 0x000000af, 0x0000009c, 0x00000003,
484 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000a0, 0x00000003,
485 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000a5, 0x00000002,
486 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000c, 0x000000aa, 0x00000002,
487 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000c, 0x006d6173, 0x636d6173,
488 0x78657400, 0x65740031, 0x4d003278, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
489 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349,
490 0x00000130, 0x00000008, 0x00000008, 0x000000c8, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
491 0x00000001, 0x000000e2, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0x000000f0,
492 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000004, 0x000000ff, 0x00000000, 0x00000009,
493 0x00000001, 0x00000000, 0x00000008, 0x0000010e, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
494 0x00000303, 0x00000117, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000004, 0x0000011d,
495 0x00000003, 0x00000000, 0x00000003, 0x00000002, 0x0000000f, 0x00000123, 0x00000000, 0x00000001,
496 0x00000003, 0x00000003, 0x0000000f, 0x525f5653, 0x65646e65, 0x72615472, 0x41746567, 0x79617272,
497 0x65646e49, 0x56530078, 0x736e495f, 0x636e6174, 0x00444965, 0x505f5653, 0x696d6972, 0x65766974,
498 0x53004449, 0x73495f56, 0x6e6f7246, 0x63614674, 0x45540065, 0x4f4f4358, 0x56004452, 0x45434146,
499 0x4c4f4300, 0x5300524f, 0x6f705f56, 0x69746973, 0xab006e6f, 0x4e47534f, 0x00000088, 0x00000004,
500 0x00000008, 0x00000068, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000e01, 0x00000068,
501 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x00000e01, 0x00000072, 0x00000000, 0x00000000,
502 0x00000001, 0xffffffff, 0x00000e01, 0x0000007e, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
503 0x00000e01, 0x545f5653, 0x65677261, 0x56530074, 0x766f435f, 0x67617265, 0x56530065, 0x7065445f,
504 0xab006874, 0x52444853, 0x00000568, 0x00000041, 0x0000015a, 0x0100086a, 0x0300005a, 0x00106000,
505 0x00000000, 0x0300085a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555,
506 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065,
507 0x00102012, 0x00000000, 0x03000065, 0x00102012, 0x00000001, 0x02000065, 0x0000f000, 0x02000065,
508 0x0000c001, 0x02000068, 0x00000003, 0x09000045, 0x001000f2, 0x00000000, 0x00101046, 0x00000001,
509 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0b000046, 0x00100012, 0x00000001, 0x00101046,
510 0x00000001, 0x00107006, 0x00000000, 0x00106000, 0x00000001, 0x00004001, 0x3e99999a, 0x07000000,
511 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, 0x00000001, 0x07000031, 0x00100012,
512 0x00000001, 0x0010001a, 0x00000000, 0x00004001, 0x3dcccccd, 0x0304001f, 0x0010000a, 0x00000001,
513 0x0b000046, 0x00100012, 0x00000001, 0x00101046, 0x00000001, 0x00107006, 0x00000001, 0x00106000,
514 0x00000001, 0x00004001, 0x3ecccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000,
515 0x00100006, 0x00000001, 0x01000012, 0x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000,
516 0x00004001, 0x3e4ccccd, 0x0304001f, 0x0010000a, 0x00000002, 0x0b000046, 0x00100012, 0x00000002,
517 0x00101046, 0x00000001, 0x00107006, 0x00000001, 0x00106000, 0x00000001, 0x00004001, 0x3dcccccd,
518 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100006, 0x00000002, 0x01000012,
519 0x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000, 0x00004001, 0x3e99999a, 0x0304001f,
520 0x0010000a, 0x00000002, 0x0b00004a, 0x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46,
521 0x00000001, 0x00106000, 0x00000000, 0x00004001, 0x3dcccccd, 0x07000000, 0x001000f2, 0x00000001,
522 0x00100e46, 0x00000000, 0x00100e46, 0x00000002, 0x01000012, 0x07000031, 0x00100012, 0x00000002,
523 0x0010001a, 0x00000000, 0x00004001, 0x3ecccccd, 0x0304001f, 0x0010000a, 0x00000002, 0x0b00004a,
524 0x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000,
525 0x00004001, 0x3e4ccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46,
526 0x00000002, 0x01000012, 0x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000, 0x00004001,
527 0x3f000000, 0x0304001f, 0x0010000a, 0x00000002, 0x0b00004a, 0x001000f2, 0x00000002, 0x00101046,
528 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00004001, 0x3e99999a, 0x07000000,
529 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46, 0x00000002, 0x01000012, 0x0b00004a,
530 0x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000,
531 0x00004001, 0x3ecccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46,
532 0x00000002, 0x01000015, 0x01000015, 0x01000015, 0x01000015, 0x01000015, 0x0d000049, 0x001000f2,
533 0x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00100046,
534 0x00000001, 0x00100046, 0x00000001, 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000,
535 0x00100e46, 0x00000001, 0x0d000049, 0x001000f2, 0x00000001, 0x00101046, 0x00000001, 0x00107e46,
536 0x00000001, 0x00106000, 0x00000000, 0x00100086, 0x00000000, 0x00100086, 0x00000000, 0x07000000,
537 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0d000049, 0x001000f2,
538 0x00000001, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00100086,
539 0x00000000, 0x00100a66, 0x00000000, 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000,
540 0x00100e46, 0x00000001, 0x0d000049, 0x001000f2, 0x00000001, 0x00101046, 0x00000001, 0x00107e46,
541 0x00000001, 0x00106000, 0x00000000, 0x00100086, 0x00000000, 0x00100ae6, 0x00000000, 0x07000000,
542 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0d000049, 0x001000c2,
543 0x00000000, 0x00101046, 0x00000001, 0x001074e6, 0x00000001, 0x00106000, 0x00000000, 0x00100086,
544 0x00000000, 0x00100fb6, 0x00000000, 0x07000000, 0x00100032, 0x00000000, 0x00100ae6, 0x00000000,
545 0x00100046, 0x00000000, 0x05000036, 0x00102012, 0x00000001, 0x0010001a, 0x00000000, 0x04000036,
546 0x0000c001, 0x0010000a, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000,
547 0x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e, 0x54415453, 0x00000074, 0x00000032,
548 0x00000003, 0x00000000, 0x00000005, 0x00000011, 0x00000000, 0x00000000, 0x00000006, 0x00000005,
549 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000003,
550 0x00000004, 0x00000005, 0x00000018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
551 0x00000000, 0x00000000, 0x00000000, 0x00000000,
554 static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_ps_resultin[] =
556 {"SV_RenderTargetArrayIndex", 0, 0, D3D_NAME_RENDER_TARGET_ARRAY_INDEX, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
557 {"SV_InstanceID", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x2, 0x0, 0},
558 {"SV_PrimitiveID", 0, 0, D3D_NAME_PRIMITIVE_ID, D3D_REGISTER_COMPONENT_UINT32, 0x4, 0x0, 0},
559 {"SV_IsFrontFace", 0, 0, D3D_NAME_IS_FRONT_FACE, D3D_REGISTER_COMPONENT_UINT32, 0x8, 0x0, 0},
560 {"TEXCOORD", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x3, 0x3, 0},
561 {"VFACE", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x4, 0x0, 0},
562 {"COLOR", 3, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
563 {"SV_position", 0, 3, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
566 static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_ps_resultout[] =
568 {"SV_Target", 0, 0, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
569 {"SV_Target", 1, 1, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
570 {"SV_Coverage", 0, 0xffffffff, D3D_NAME_COVERAGE, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0},
571 {"SV_Depth", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
574 static void test_reflection_desc_ps(void)
576 HRESULT hr;
577 ULONG count;
578 ID3D11ShaderReflection *ref11;
579 D3D11_SHADER_DESC sdesc11 = {0};
580 D3D11_SIGNATURE_PARAMETER_DESC desc = {0};
581 const D3D11_SIGNATURE_PARAMETER_DESC *pdesc;
582 UINT ret;
583 unsigned int i;
585 hr = D3DReflect(test_reflection_desc_ps_blob, test_reflection_desc_ps_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
586 ok(hr == S_OK, "D3DReflect failed %x\n", hr);
588 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
589 ok(hr == S_OK, "GetDesc failed %x\n", hr);
591 ok(sdesc11.Version == 65, "GetDesc failed, got %u, expected %u\n", sdesc11.Version, 65);
592 ok(strcmp(sdesc11.Creator, (char*) shader_creator) == 0, "GetDesc failed, got \"%s\", expected \"%s\"\n", sdesc11.Creator, (char*)shader_creator);
593 ok(sdesc11.Flags == 256, "GetDesc failed, got %u, expected %u\n", sdesc11.Flags, 256);
594 ok(sdesc11.ConstantBuffers == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ConstantBuffers, 0);
595 ok(sdesc11.BoundResources == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.BoundResources, 4);
596 ok(sdesc11.InputParameters == 8, "GetDesc failed, got %u, expected %u\n", sdesc11.InputParameters, 8);
597 ok(sdesc11.OutputParameters == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.OutputParameters, 4);
598 ok(sdesc11.InstructionCount == 50, "GetDesc failed, got %u, expected %u\n", sdesc11.InstructionCount, 50);
599 ok(sdesc11.TempRegisterCount == 3, "GetDesc failed, got %u, expected %u\n", sdesc11.TempRegisterCount, 3);
600 ok(sdesc11.TempArrayCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TempArrayCount, 0);
601 ok(sdesc11.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DefCount, 0);
602 ok(sdesc11.DclCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.DclCount, 5);
603 ok(sdesc11.TextureNormalInstructions == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureNormalInstructions, 1);
604 ok(sdesc11.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureLoadInstructions, 0);
605 ok(sdesc11.TextureCompInstructions == 3, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureCompInstructions, 3);
606 ok(sdesc11.TextureBiasInstructions == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureBiasInstructions, 4);
607 ok(sdesc11.TextureGradientInstructions == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureGradientInstructions, 5);
608 ok(sdesc11.FloatInstructionCount == 17, "GetDesc failed, got %u, expected %u\n", sdesc11.FloatInstructionCount, 17);
609 ok(sdesc11.IntInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.IntInstructionCount, 0);
610 ok(sdesc11.UintInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.UintInstructionCount, 0);
611 ok(sdesc11.StaticFlowControlCount == 6, "GetDesc failed, got %u, expected %u\n", sdesc11.StaticFlowControlCount, 6);
612 ok(sdesc11.DynamicFlowControlCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.DynamicFlowControlCount, 5);
613 ok(sdesc11.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.MacroInstructionCount, 0);
614 ok(sdesc11.ArrayInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ArrayInstructionCount, 0);
615 ok(sdesc11.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.CutInstructionCount, 0);
616 ok(sdesc11.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.EmitInstructionCount, 0);
617 ok(sdesc11.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.GSOutputTopology, 0);
618 ok(sdesc11.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.GSMaxOutputVertexCount, 0);
619 ok(sdesc11.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.InputPrimitive, 0);
620 ok(sdesc11.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.PatchConstantParameters, 0);
621 ok(sdesc11.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cGSInstanceCount, 0);
622 ok(sdesc11.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cControlPoints, 0);
623 ok(sdesc11.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSOutputPrimitive, 0);
624 ok(sdesc11.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSPartitioning, 0);
625 ok(sdesc11.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.TessellatorDomain, 0);
626 ok(sdesc11.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cBarrierInstructions, 0);
627 ok(sdesc11.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cInterlockedInstructions, 0);
628 ok(sdesc11.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cTextureStoreInstructions, 0);
630 ret = ref11->lpVtbl->GetBitwiseInstructionCount(ref11);
631 ok(ret == 0, "GetBitwiseInstructionCount failed, got %u, expected %u\n", ret, 0);
633 ret = ref11->lpVtbl->GetConversionInstructionCount(ref11);
634 ok(ret == 0, "GetConversionInstructionCount failed, got %u, expected %u\n", ret, 0);
636 ret = ref11->lpVtbl->GetMovInstructionCount(ref11);
637 ok(ret == 24, "GetMovInstructionCount failed, got %u, expected %u\n", ret, 24);
639 ret = ref11->lpVtbl->GetMovcInstructionCount(ref11);
640 ok(ret == 0, "GetMovcInstructionCount failed, got %u, expected %u\n", ret, 0);
642 /* check invalid Get*ParameterDesc cases*/
643 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0, NULL);
644 ok(hr == E_INVALIDARG, "GetInputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
646 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0xffffffff, &desc);
647 ok(hr == E_INVALIDARG, "GetInputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
649 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, NULL);
650 ok(hr == E_INVALIDARG, "GetOutputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
652 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0xffffffff, &desc);
653 ok(hr == E_INVALIDARG, "GetOutputParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
655 hr = ref11->lpVtbl->GetPatchConstantParameterDesc(ref11, 0, &desc);
656 ok(hr == E_INVALIDARG, "GetPatchConstantParameterDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
658 /* GetIn/OutputParameterDesc */
659 for (i = 0; i < sizeof(test_reflection_desc_ps_resultin)/sizeof(*test_reflection_desc_ps_resultin); ++i)
661 pdesc = &test_reflection_desc_ps_resultin[i];
663 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc);
664 ok(hr == S_OK, "GetInputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
666 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetInputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
667 i, desc.SemanticName, pdesc->SemanticName);
668 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetInputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
669 i, desc.SemanticIndex, pdesc->SemanticIndex);
670 ok(desc.Register == pdesc->Register, "GetInputParameterDesc(%u) Register failed, got %u, expected %u\n",
671 i, desc.Register, pdesc->Register);
672 ok(desc.SystemValueType == pdesc->SystemValueType, "GetInputParameterDesc(%u) SystemValueType failed, got %x, expected %x\n",
673 i, desc.SystemValueType, pdesc->SystemValueType);
674 ok(desc.ComponentType == pdesc->ComponentType, "GetInputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
675 i, desc.ComponentType, pdesc->ComponentType);
676 ok(desc.Mask == pdesc->Mask, "GetInputParameterDesc(%u) Mask failed, got %x, expected %x\n",
677 i, desc.Mask, pdesc->Mask);
678 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetInputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
679 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
680 ok(desc.Stream == pdesc->Stream, "GetInputParameterDesc(%u) Stream failed, got %u, expected %u\n",
681 i, desc.Stream, pdesc->ReadWriteMask);
684 for (i = 0; i < sizeof(test_reflection_desc_ps_resultout)/sizeof(*test_reflection_desc_ps_resultout); ++i)
686 pdesc = &test_reflection_desc_ps_resultout[i];
688 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc);
689 ok(hr == S_OK, "GetOutputParameterDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
691 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetOutputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
692 i, desc.SemanticName, pdesc->SemanticName);
693 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetOutputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
694 i, desc.SemanticIndex, pdesc->SemanticIndex);
695 ok(desc.Register == pdesc->Register, "GetOutputParameterDesc(%u) Register failed, got %u, expected %u\n",
696 i, desc.Register, pdesc->Register);
697 ok(desc.SystemValueType == pdesc->SystemValueType, "GetOutputParameterDesc(%u) SystemValueType failed, got %x, expected %x\n",
698 i, desc.SystemValueType, pdesc->SystemValueType);
699 ok(desc.ComponentType == pdesc->ComponentType, "GetOutputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
700 i, desc.ComponentType, pdesc->ComponentType);
701 ok(desc.Mask == pdesc->Mask, "GetOutputParameterDesc(%u) Mask failed, got %x, expected %x\n",
702 i, desc.Mask, pdesc->Mask);
703 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetOutputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
704 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
705 ok(desc.Stream == pdesc->Stream, "GetOutputParameterDesc(%u) Stream failed, got %u, expected %u\n",
706 i, desc.Stream, pdesc->ReadWriteMask);
709 count = ref11->lpVtbl->Release(ref11);
710 ok(count == 0, "Release failed %u\n", count);
714 * fxc.exe /E PS /Tps_5_0 /Fx
716 #if 0
717 float4 PS() : SV_Target3
719 float4 a = float4(1.2f, 1.0f, 0.2f, 0.0f);
720 return a;
722 #endif
723 static const DWORD test_reflection_desc_ps_output_blob_0[] = {
724 0x43425844, 0x3e7b77e6, 0xe4e920b7, 0x9cad0533, 0x240117cc, 0x00000001, 0x0000018c, 0x00000005,
725 0x00000034, 0x0000008c, 0x0000009c, 0x000000d0, 0x00000110, 0x46454452, 0x00000050, 0x00000000,
726 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
727 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
728 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
729 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000003, 0x00000000, 0x00000003, 0x00000003,
730 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e,
731 0x03000065, 0x001020f2, 0x00000003, 0x08000036, 0x001020f2, 0x00000003, 0x00004002, 0x3f99999a,
732 0x3f800000, 0x3e4ccccd, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, 0x00000000,
733 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
734 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
735 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
736 0x00000000, 0x00000000, 0x00000000
740 * fxc.exe /E PS /Tps_5_0 /Fx
742 #if 0
743 float PS() : SV_DepthLessEqual
745 float a = 1.2f;
746 return a;
748 #endif
749 static const DWORD test_reflection_desc_ps_output_blob_1[] = {
750 0x43425844, 0xd8ead3ec, 0x61276ada, 0x70cdaa9e, 0x2cfd7f4c, 0x00000001, 0x000001c4, 0x00000005,
751 0x00000034, 0x000000ac, 0x000000bc, 0x000000f8, 0x00000128, 0x46454452, 0x00000070, 0x00000000,
752 0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
753 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
754 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
755 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
756 0x00000034, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
757 0x00000e01, 0x445f5653, 0x68747065, 0x7373654c, 0x61757145, 0xabab006c, 0x58454853, 0x00000028,
758 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00027001, 0x04000036, 0x00027001, 0x00004001,
759 0x3f99999a, 0x0100003e, 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
760 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
761 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
762 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
763 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
764 0x00000000,
768 * fxc.exe /E PS /Tps_5_0 /Fx
770 #if 0
771 float PS() : SV_DepthGreaterEqual
773 float a = 1.2f;
774 return a;
776 #endif
777 static const DWORD test_reflection_desc_ps_output_blob_2[] = {
778 0x43425844, 0x9f61c8df, 0x612cbb1f, 0x9e1d039e, 0xf925a074, 0x00000001, 0x000001c8, 0x00000005,
779 0x00000034, 0x000000ac, 0x000000bc, 0x000000fc, 0x0000012c, 0x46454452, 0x00000070, 0x00000000,
780 0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
781 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
782 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
783 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
784 0x00000038, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
785 0x00000e01, 0x445f5653, 0x68747065, 0x61657247, 0x45726574, 0x6c617571, 0xababab00, 0x58454853,
786 0x00000028, 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00026001, 0x04000036, 0x00026001,
787 0x00004001, 0x3f99999a, 0x0100003e, 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000,
788 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
789 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
790 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
791 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
792 0x00000000, 0x00000000,
796 * fxc.exe /E PS /Tps_5_0 /Fx
798 #if 0
799 float PS() : sV_DePtH
801 float a = 1.2f;
802 return a;
804 #endif
805 static const DWORD test_reflection_desc_ps_output_blob_3[] = {
806 0x43425844, 0x32cec0e6, 0x3873ed32, 0x2e86ffd0, 0x21bb00e8, 0x00000001, 0x000001bc, 0x00000005,
807 0x00000034, 0x000000ac, 0x000000bc, 0x000000f0, 0x00000120, 0x46454452, 0x00000070, 0x00000000,
808 0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
809 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
810 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
811 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
812 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
813 0x00000e01, 0x445f5673, 0x48745065, 0xababab00, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
814 0x0100086a, 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
815 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
816 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
817 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
818 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
819 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
823 * fxc.exe /E PS /Tps_4_0 /Fx
825 #if 0
826 float PS() : SV_Depth
828 float a = 1.2f;
829 return a;
831 #endif
832 static const DWORD test_reflection_desc_ps_output_blob_4[] = {
833 0x43425844, 0x7af34874, 0x975f09ad, 0xf6e50764, 0xdfb1255f, 0x00000001, 0x00000178, 0x00000005,
834 0x00000034, 0x0000008c, 0x0000009c, 0x000000d0, 0x000000fc, 0x46454452, 0x00000050, 0x00000000,
835 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
836 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
837 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
838 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
839 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000024, 0x00000040, 0x00000009,
840 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e, 0x54415453,
841 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
842 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
843 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
844 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
848 * fxc.exe /E PS /Tps_4_0 /Fx
850 #if 0
851 bool PS() : SV_COVERAGE
853 bool a = true;
854 return a;
856 #endif
857 static const DWORD test_reflection_desc_ps_output_blob_5[] = {
858 0x43425844, 0x40ae32a7, 0xe944bb1c, 0x1a2b1923, 0xea25962d, 0x00000001, 0x000001bc, 0x00000005,
859 0x00000034, 0x000000ac, 0x000000bc, 0x000000f0, 0x00000120, 0x46454452, 0x00000070, 0x00000000,
860 0x00000000, 0x00000000, 0x0000003c, 0xffff0500, 0x00000100, 0x0000003c, 0x31314452, 0x0000003c,
861 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
862 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
863 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
864 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0xffffffff,
865 0x00000e01, 0x435f5653, 0x5245564f, 0x00454741, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
866 0x0100086a, 0x02000065, 0x0000f000, 0x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e,
867 0x54415453, 0x00000094, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
868 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
869 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
870 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
871 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
874 static const DWORD *test_reflection_desc_ps_output_blob[] = {
875 test_reflection_desc_ps_output_blob_0,
876 test_reflection_desc_ps_output_blob_1,
877 test_reflection_desc_ps_output_blob_2,
878 test_reflection_desc_ps_output_blob_3,
879 test_reflection_desc_ps_output_blob_4,
880 test_reflection_desc_ps_output_blob_5,
883 static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_ps_output_result[] =
885 {"SV_Target", 3, 3, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0, 0},
886 {"SV_DepthLessEqual", 0, 0xffffffff, D3D_NAME_DEPTH_LESS_EQUAL, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
887 {"SV_DepthGreaterEqual", 0, 0xffffffff, D3D11_NAME_DEPTH_GREATER_EQUAL, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
888 {"sV_DePtH", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
889 {"SV_Depth", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
890 {"SV_COVERAGE", 0, 0xffffffff, D3D_NAME_COVERAGE, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0},
893 static void test_reflection_desc_ps_output(void)
895 HRESULT hr;
896 ULONG count;
897 ID3D11ShaderReflection *ref11;
898 D3D11_SIGNATURE_PARAMETER_DESC desc = {0};
899 const D3D11_SIGNATURE_PARAMETER_DESC *pdesc;
900 unsigned int i;
902 for (i = 0; i < sizeof(test_reflection_desc_ps_output_result)/sizeof(*test_reflection_desc_ps_output_result); ++i)
904 hr = D3DReflect(test_reflection_desc_ps_output_blob[i], test_reflection_desc_ps_output_blob[i][6], &IID_ID3D11ShaderReflection, (void **)&ref11);
905 ok(hr == S_OK, "(%u): D3DReflect failed %x\n", i, hr);
907 pdesc = &test_reflection_desc_ps_output_result[i];
909 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, &desc);
910 ok(hr == S_OK, "(%u): GetOutputParameterDesc failed, got %x, expected %x\n", i, hr, S_OK);
912 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "(%u): GetOutputParameterDesc SemanticName failed, got \"%s\", expected \"%s\"\n",
913 i, desc.SemanticName, pdesc->SemanticName);
914 ok(desc.SemanticIndex == pdesc->SemanticIndex, "(%u): GetOutputParameterDesc SemanticIndex failed, got %u, expected %u\n",
915 i, desc.SemanticIndex, pdesc->SemanticIndex);
916 ok(desc.Register == pdesc->Register, "(%u): GetOutputParameterDesc Register failed, got %u, expected %u\n",
917 i, desc.Register, pdesc->Register);
918 ok(desc.SystemValueType == pdesc->SystemValueType, "(%u): GetOutputParameterDesc SystemValueType failed, got %x, expected %x\n",
919 i, desc.SystemValueType, pdesc->SystemValueType);
920 ok(desc.ComponentType == pdesc->ComponentType, "(%u): GetOutputParameterDesc ComponentType failed, got %x, expected %x\n",
921 i, desc.ComponentType, pdesc->ComponentType);
922 ok(desc.Mask == pdesc->Mask, "(%u): GetOutputParameterDesc Mask failed, got %x, expected %x\n",
923 i, desc.Mask, pdesc->Mask);
924 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "(%u): GetOutputParameterDesc ReadWriteMask failed, got %x, expected %x\n",
925 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
926 ok(desc.Stream == pdesc->Stream, "(%u): GetOutputParameterDesc Stream failed, got %u, expected %u\n",
927 i, desc.Stream, pdesc->ReadWriteMask);
929 count = ref11->lpVtbl->Release(ref11);
930 ok(count == 0, "(%u): Release failed %u\n", i, count);
935 * fxc.exe /E PS /Tps_4_0 /Fx
937 #if 0
938 Texture2D tex1;
939 SamplerState sam
941 Filter = MIN_MAG_MIP_LINEAR;
942 AddressU = Wrap;
943 AddressV = Wrap;
945 cbuffer c1
947 float x;
948 float y[2];
949 int z;
951 cbuffer c2
953 float t;
956 float4 PS(float2 uv : TEXCOORD0) : sv_target
958 float4 q = tex1.Sample(sam, uv);
959 q.x = q.x + x;
960 q.w = q.w + y[0] + y[1] + t;
961 return q;
963 #endif
964 static DWORD test_reflection_bound_resources_blob[] = {
965 0x43425844, 0xe4af0279, 0x690268fc, 0x76bf6a72, 0xe5aff43b, 0x00000001, 0x000003f4, 0x00000005,
966 0x00000034, 0x000001e8, 0x0000021c, 0x00000250, 0x00000378, 0x46454452, 0x000001ac, 0x00000002,
967 0x000000ac, 0x00000004, 0x0000001c, 0xffff0400, 0x00000100, 0x0000017a, 0x0000009c, 0x00000003,
968 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000a0, 0x00000002,
969 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000c, 0x000000a5, 0x00000000,
970 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000a8, 0x00000000,
971 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x006d6173, 0x31786574,
972 0x00316300, 0xab003263, 0x000000a5, 0x00000003, 0x000000dc, 0x00000030, 0x00000000, 0x00000000,
973 0x000000a8, 0x00000001, 0x00000160, 0x00000010, 0x00000000, 0x00000000, 0x00000124, 0x00000000,
974 0x00000004, 0x00000002, 0x00000128, 0x00000000, 0x00000138, 0x00000010, 0x00000014, 0x00000002,
975 0x0000013c, 0x00000000, 0x0000014c, 0x00000024, 0x00000004, 0x00000000, 0x00000150, 0x00000000,
976 0xabab0078, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0xabab0079, 0x00030000, 0x00010001,
977 0x00000002, 0x00000000, 0xabab007a, 0x00020000, 0x00010001, 0x00000000, 0x00000000, 0x00000178,
978 0x00000000, 0x00000004, 0x00000002, 0x00000128, 0x00000000, 0x694d0074, 0x736f7263, 0x2074666f,
979 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39,
980 0x31332e32, 0xab003131, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000,
981 0x00000000, 0x00000003, 0x00000000, 0x00000303, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f,
982 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
983 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x00000120, 0x00000040, 0x00000048,
984 0x04000059, 0x00208e46, 0x00000000, 0x00000003, 0x04000059, 0x00208e46, 0x00000001, 0x00000001,
985 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x03001062,
986 0x00101032, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x09000045,
987 0x001000f2, 0x00000000, 0x00101046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000,
988 0x08000000, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000000, 0x00000001,
989 0x08000000, 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000000, 0x00000002,
990 0x08000000, 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000001, 0x00000000,
991 0x08000000, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, 0x00000000,
992 0x05000036, 0x00102062, 0x00000000, 0x00100656, 0x00000000, 0x0100003e, 0x54415453, 0x00000074,
993 0x00000007, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000000, 0x00000001,
994 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
995 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
996 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
999 static const D3D11_SHADER_INPUT_BIND_DESC test_reflection_bound_resources_result[] =
1001 {"sam", D3D_SIT_SAMPLER, 0, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
1002 {"tex1", D3D_SIT_TEXTURE, 0, 1, 12, D3D_RETURN_TYPE_FLOAT, D3D_SRV_DIMENSION_TEXTURE2D, 0xffffffff},
1003 {"c1", D3D_SIT_CBUFFER, 0, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
1004 {"c2", D3D_SIT_CBUFFER, 1, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
1007 static void test_reflection_bound_resources(void)
1009 HRESULT hr;
1010 ULONG count;
1011 ID3D11ShaderReflection *ref11;
1012 D3D11_SHADER_INPUT_BIND_DESC desc;
1013 const D3D11_SHADER_INPUT_BIND_DESC *pdesc;
1014 unsigned int i;
1016 hr = D3DReflect(test_reflection_bound_resources_blob, test_reflection_bound_resources_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1017 ok(hr == S_OK, "D3DReflect failed %x\n", hr);
1019 /* check invalid cases */
1020 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0, NULL);
1021 ok(hr == E_INVALIDARG, "GetResourceBindingDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
1023 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0xffffffff, &desc);
1024 ok(hr == E_INVALIDARG, "GetResourceBindingDesc failed, got %x, expected %x\n", hr, E_INVALIDARG);
1026 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, NULL, &desc);
1027 ok(hr == E_INVALIDARG, "GetResourceBindingDescByName failed, got %x, expected %x\n", hr, E_INVALIDARG);
1029 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "sam", NULL);
1030 ok(hr == E_INVALIDARG, "GetResourceBindingDescByName failed, got %x, expected %x\n", hr, E_INVALIDARG);
1032 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", NULL);
1033 ok(hr == E_INVALIDARG, "GetResourceBindingDescByName failed, got %x, expected %x\n", hr, E_INVALIDARG);
1035 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", &desc);
1036 ok(hr == E_INVALIDARG, "GetResourceBindingDescByName failed, got %x, expected %x\n", hr, E_INVALIDARG);
1038 /* GetResourceBindingDesc */
1039 for (i = 0; i < sizeof(test_reflection_bound_resources_result)/sizeof(*test_reflection_bound_resources_result); ++i)
1041 pdesc = &test_reflection_bound_resources_result[i];
1043 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, i, &desc);
1044 ok(hr == S_OK, "GetResourceBindingDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
1046 ok(!strcmp(desc.Name, pdesc->Name), "GetResourceBindingDesc(%u) Name failed, got \"%s\", expected \"%s\"\n",
1047 i, desc.Name, pdesc->Name);
1048 ok(desc.Type == pdesc->Type, "GetResourceBindingDesc(%u) Type failed, got %x, expected %x\n",
1049 i, desc.Type, pdesc->Type);
1050 ok(desc.BindPoint == pdesc->BindPoint, "GetResourceBindingDesc(%u) BindPoint failed, got %u, expected %u\n",
1051 i, desc.BindPoint, pdesc->BindPoint);
1052 ok(desc.BindCount == pdesc->BindCount, "GetResourceBindingDesc(%u) BindCount failed, got %u, expected %u\n",
1053 i, desc.BindCount, pdesc->BindCount);
1054 ok(desc.uFlags == pdesc->uFlags, "GetResourceBindingDesc(%u) uFlags failed, got %u, expected %u\n",
1055 i, desc.uFlags, pdesc->uFlags);
1056 ok(desc.ReturnType == pdesc->ReturnType, "GetResourceBindingDesc(%u) ReturnType failed, got %x, expected %x\n",
1057 i, desc.ReturnType, pdesc->ReturnType);
1058 ok(desc.Dimension == pdesc->Dimension, "GetResourceBindingDesc(%u) Dimension failed, got %x, expected %x\n",
1059 i, desc.Dimension, pdesc->Dimension);
1060 ok(desc.NumSamples == pdesc->NumSamples, "GetResourceBindingDesc(%u) NumSamples failed, got %u, expected %u\n",
1061 i, desc.NumSamples, pdesc->NumSamples);
1064 /* GetResourceBindingDescByName */
1065 for (i = 0; i < sizeof(test_reflection_bound_resources_result)/sizeof(*test_reflection_bound_resources_result); ++i)
1067 pdesc = &test_reflection_bound_resources_result[i];
1069 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, pdesc->Name, &desc);
1070 ok(hr == S_OK, "GetResourceBindingDescByName(%u) failed, got %x, expected %x\n", i, hr, S_OK);
1072 ok(!strcmp(desc.Name, pdesc->Name), "GetResourceBindingDescByName(%u) Name failed, got \"%s\", expected \"%s\"\n",
1073 i, desc.Name, pdesc->Name);
1074 ok(desc.Type == pdesc->Type, "GetResourceBindingDescByName(%u) Type failed, got %x, expected %x\n",
1075 i, desc.Type, pdesc->Type);
1076 ok(desc.BindPoint == pdesc->BindPoint, "GetResourceBindingDescByName(%u) BindPoint failed, got %u, expected %u\n",
1077 i, desc.BindPoint, pdesc->BindPoint);
1078 ok(desc.BindCount == pdesc->BindCount, "GetResourceBindingDescByName(%u) BindCount failed, got %u, expected %u\n",
1079 i, desc.BindCount, pdesc->BindCount);
1080 ok(desc.uFlags == pdesc->uFlags, "GetResourceBindingDescByName(%u) uFlags failed, got %u, expected %u\n",
1081 i, desc.uFlags, pdesc->uFlags);
1082 ok(desc.ReturnType == pdesc->ReturnType, "GetResourceBindingDescByName(%u) ReturnType failed, got %x, expected %x\n",
1083 i, desc.ReturnType, pdesc->ReturnType);
1084 ok(desc.Dimension == pdesc->Dimension, "GetResourceBindingDescByName(%u) Dimension failed, got %x, expected %x\n",
1085 i, desc.Dimension, pdesc->Dimension);
1086 ok(desc.NumSamples == pdesc->NumSamples, "GetResourceBindingDescByName(%u) NumSamples failed, got %u, expected %u\n",
1087 i, desc.NumSamples, pdesc->NumSamples);
1090 count = ref11->lpVtbl->Release(ref11);
1091 ok(count == 0, "Release failed %u\n", count);
1095 * fxc.exe /E PS /Tps_5_0 /Fx
1097 #if 0
1098 cbuffer c1
1100 float a;
1101 float b[2];
1102 int i;
1103 struct s {
1104 float a;
1105 float b;
1106 } t;
1109 interface iTest
1111 float4 test(float2 vec);
1114 class cTest : iTest
1116 bool m_on;
1117 float4 test(float2 vec);
1120 float4 cTest::test(float2 vec)
1122 float4 res;
1123 if(m_on)
1124 res = float4(vec.x, vec.y, vec.x+vec.y, 0);
1125 else
1126 res = 0;
1127 return res;
1130 iTest g_Test;
1133 float4 PS(float2 uv : TEXCOORD0) : sv_target
1135 float4 q = g_Test.test(uv);
1136 q.x = q.x + t.a;
1137 return q;
1139 #endif
1140 static DWORD test_reflection_constant_buffer_blob[] = {
1141 0x43425844, 0xe6470e0d, 0x0d5698bb, 0x29373c30, 0x64a5d268, 0x00000001, 0x00000590, 0x00000006,
1142 0x00000038, 0x00000318, 0x0000034c, 0x00000380, 0x000003d8, 0x000004f4, 0x46454452, 0x000002d8,
1143 0x00000002, 0x00000060, 0x00000001, 0x0000003c, 0xffff0500, 0x00000100, 0x000002a4, 0x31314452,
1144 0x0000003c, 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000001, 0x0000005c,
1145 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0xab003163,
1146 0x00000090, 0x00000001, 0x000000a0, 0x00000010, 0x00000000, 0x00000002, 0x0000005c, 0x00000004,
1147 0x00000120, 0x00000040, 0x00000000, 0x00000000, 0x69685424, 0x696f5073, 0x7265746e, 0xababab00,
1148 0x000000c8, 0x00000000, 0x00000001, 0x00000006, 0x000000fc, 0x00000000, 0xffffffff, 0x00000000,
1149 0xffffffff, 0x00000000, 0x65545f67, 0x69007473, 0x74736554, 0xababab00, 0x00000006, 0x00000001,
1150 0x00000000, 0x000000d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000cf, 0x00250007,
1151 0x00040001, 0x00000000, 0x00000000, 0x000000d8, 0x00000000, 0x00000000, 0x00000000, 0x000000cf,
1152 0x000001c0, 0x00000000, 0x00000004, 0x00000000, 0x000001c8, 0x00000000, 0xffffffff, 0x00000000,
1153 0xffffffff, 0x00000000, 0x000001ec, 0x00000010, 0x00000014, 0x00000000, 0x000001f0, 0x00000000,
1154 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x00000214, 0x00000024, 0x00000004, 0x00000000,
1155 0x0000021c, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x00000240, 0x00000030,
1156 0x00000008, 0x00000002, 0x00000280, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000,
1157 0x6c660061, 0x0074616f, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1158 0x00000000, 0x00000000, 0x000001c2, 0xabab0062, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
1159 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000001c2, 0x6e690069, 0xabab0074, 0x00020000,
1160 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000216,
1161 0x00730074, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1162 0x00000000, 0x000001c2, 0x000001c0, 0x00000244, 0x00000000, 0x000001ec, 0x00000244, 0x00000004,
1163 0x00000005, 0x00020001, 0x00020000, 0x00000268, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1164 0x00000242, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072,
1165 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x0000002c,
1166 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000303,
1167 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
1168 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074,
1169 0x45434649, 0x00000050, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000040, 0x00000034,
1170 0x00000024, 0x00000000, 0x4e47534f, 0x00000001, 0x00000001, 0x00000040, 0x00000044, 0x00000048,
1171 0x00010000, 0x00000000, 0xabab0000, 0x00000000, 0x73655463, 0xabab0074, 0x58454853, 0x00000114,
1172 0x00000050, 0x00000045, 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, 0x03000091,
1173 0x00000000, 0x00000000, 0x05000092, 0x00000000, 0x00000000, 0x00010001, 0x00000000, 0x03001062,
1174 0x00101032, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x07000000,
1175 0x00100042, 0x00000000, 0x0010101a, 0x00000000, 0x0010100a, 0x00000000, 0x05000036, 0x00100032,
1176 0x00000000, 0x00101046, 0x00000000, 0x05000036, 0x00100082, 0x00000000, 0x00004001, 0x00000000,
1177 0x05000036, 0x00100032, 0x00000001, 0x0011d516, 0x00000000, 0x0a000001, 0x001000f2, 0x00000000,
1178 0x00100e46, 0x00000000, 0x04a08006, 0x0010001a, 0x00000001, 0x0010000a, 0x00000001, 0x08000000,
1179 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, 0x00000003, 0x05000036,
1180 0x001020e2, 0x00000000, 0x00100e56, 0x00000000, 0x0100003e, 0x54415453, 0x00000094, 0x00000008,
1181 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000001, 0x00000001, 0x00000000,
1182 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1183 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1184 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1185 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1188 static const D3D11_SHADER_BUFFER_DESC test_reflection_constant_buffer_cb_result[] =
1190 {"$ThisPointer", D3D_CT_INTERFACE_POINTERS, 1, 16, 0},
1191 {"c1", D3D_CT_CBUFFER, 4, 64, 0},
1194 static const struct {
1195 D3D11_SHADER_VARIABLE_DESC desc;
1196 unsigned int type;
1197 } test_reflection_constant_buffer_variable_result[] =
1199 {{"g_Test", 0, 1, 6, 0}, 0},
1200 {{"a", 0, 4, 0, 0}, 1},
1201 {{"b", 16, 20, 0, 0}, 2},
1202 {{"i", 36, 4, 0, 0}, 3},
1203 {{"t", 48, 8, 2, 0}, 4},
1206 static const D3D11_SHADER_TYPE_DESC test_reflection_constant_buffer_type_result[] =
1208 {D3D11_SVC_INTERFACE_POINTER, D3D11_SVT_INTERFACE_POINTER, 1, 4, 0, 1, 0},
1209 {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 0, 1, 0},
1210 {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 2, 1, 0},
1211 {D3D_SVC_SCALAR, D3D_SVT_INT, 1, 1, 0, 1, 0},
1212 {D3D_SVC_STRUCT, D3D_SVT_VOID, 1, 2, 0, 1, 0},
1215 static void test_reflection_constant_buffer(void)
1217 HRESULT hr;
1218 ULONG count;
1219 ID3D11ShaderReflection *ref11;
1220 ID3D11ShaderReflectionConstantBuffer *cb11, *cb11_dummy = NULL, *cb11_valid = NULL;
1221 ID3D11ShaderReflectionVariable *v11, *v11_dummy = NULL, *v11_valid = NULL;
1222 ID3D11ShaderReflectionType *t11, *t, *t2, *t11_dummy = NULL, *t11_valid = NULL;
1223 D3D11_SHADER_BUFFER_DESC cbdesc = {0};
1224 D3D11_SHADER_VARIABLE_DESC vdesc = {0};
1225 D3D11_SHADER_TYPE_DESC tdesc = {0};
1226 D3D11_SHADER_DESC sdesc = {0};
1227 const D3D11_SHADER_BUFFER_DESC *pcbdesc;
1228 const D3D11_SHADER_VARIABLE_DESC *pvdesc;
1229 const D3D11_SHADER_TYPE_DESC *ptdesc;
1230 unsigned int i;
1231 LPCSTR string;
1233 hr = D3DReflect(test_reflection_constant_buffer_blob, test_reflection_constant_buffer_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1234 ok(hr == S_OK, "D3DReflect failed %x\n", hr);
1236 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc);
1237 ok(hr == S_OK, "GetDesc failed %x\n", hr);
1239 ok(sdesc.Version == 80, "GetDesc failed, got %u, expected %u\n", sdesc.Version, 80);
1240 ok(strcmp(sdesc.Creator, (char*) shader_creator) == 0, "GetDesc failed, got \"%s\", expected \"%s\"\n", sdesc.Creator, (char*)shader_creator);
1241 ok(sdesc.Flags == 256, "GetDesc failed, got %u, expected %u\n", sdesc.Flags, 256);
1242 ok(sdesc.ConstantBuffers == 2, "GetDesc failed, got %u, expected %u\n", sdesc.ConstantBuffers, 2);
1243 ok(sdesc.BoundResources == 1, "GetDesc failed, got %u, expected %u\n", sdesc.BoundResources, 1);
1244 ok(sdesc.InputParameters == 1, "GetDesc failed, got %u, expected %u\n", sdesc.InputParameters, 1);
1245 ok(sdesc.OutputParameters == 1, "GetDesc failed, got %u, expected %u\n", sdesc.OutputParameters, 1);
1246 ok(sdesc.InstructionCount == 8, "GetDesc failed, got %u, expected %u\n", sdesc.InstructionCount, 8);
1247 ok(sdesc.TempRegisterCount == 2, "GetDesc failed, got %u, expected %u\n", sdesc.TempRegisterCount, 2);
1248 ok(sdesc.TempArrayCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TempArrayCount, 0);
1249 ok(sdesc.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.DefCount, 0);
1250 ok(sdesc.DclCount == 2, "GetDesc failed, got %u, expected %u\n", sdesc.DclCount, 2);
1251 ok(sdesc.TextureNormalInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureNormalInstructions, 0);
1252 ok(sdesc.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureLoadInstructions, 0);
1253 ok(sdesc.TextureCompInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureCompInstructions, 0);
1254 ok(sdesc.TextureBiasInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureBiasInstructions, 0);
1255 ok(sdesc.TextureGradientInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureGradientInstructions, 0);
1256 ok(sdesc.FloatInstructionCount == 2, "GetDesc failed, got %u, expected %u\n", sdesc.FloatInstructionCount, 2);
1257 ok(sdesc.IntInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.IntInstructionCount, 0);
1258 ok(sdesc.UintInstructionCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc.UintInstructionCount, 1);
1259 ok(sdesc.StaticFlowControlCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc.StaticFlowControlCount, 1);
1260 ok(sdesc.DynamicFlowControlCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.DynamicFlowControlCount, 0);
1261 ok(sdesc.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.MacroInstructionCount, 0);
1262 ok(sdesc.ArrayInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.ArrayInstructionCount, 0);
1263 ok(sdesc.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.CutInstructionCount, 0);
1264 ok(sdesc.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.EmitInstructionCount, 0);
1265 ok(sdesc.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc.GSOutputTopology, 0);
1266 ok(sdesc.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.GSMaxOutputVertexCount, 0);
1267 ok(sdesc.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc.InputPrimitive, 0);
1268 ok(sdesc.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc.PatchConstantParameters, 0);
1269 ok(sdesc.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cGSInstanceCount, 0);
1270 ok(sdesc.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cControlPoints, 0);
1271 ok(sdesc.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc.HSOutputPrimitive, 0);
1272 ok(sdesc.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc.HSPartitioning, 0);
1273 ok(sdesc.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc.TessellatorDomain, 0);
1274 ok(sdesc.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cBarrierInstructions, 0);
1275 ok(sdesc.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cInterlockedInstructions, 0);
1276 ok(sdesc.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cTextureStoreInstructions, 0);
1278 /* get the dummys for comparison */
1279 cb11_dummy = ref11->lpVtbl->GetConstantBufferByIndex(ref11, 0xffffffff);
1280 ok(cb11_dummy != NULL, "GetConstantBufferByIndex failed\n");
1282 v11_dummy = cb11_dummy->lpVtbl->GetVariableByIndex(cb11_dummy, 0xffffffff);
1283 ok(v11_dummy != NULL, "GetVariableByIndex failed\n");
1285 t11_dummy = v11_dummy->lpVtbl->GetType(v11_dummy);
1286 ok(t11_dummy != NULL, "GetType failed\n");
1288 /* get the valid variables */
1289 cb11_valid = ref11->lpVtbl->GetConstantBufferByIndex(ref11, 1);
1290 ok(cb11_valid != cb11_dummy && cb11_valid, "GetConstantBufferByIndex failed\n");
1292 v11_valid = cb11_valid->lpVtbl->GetVariableByIndex(cb11_valid, 0);
1293 ok(v11_valid != v11_dummy && v11_valid, "GetVariableByIndex failed\n");
1295 t11_valid = v11_valid->lpVtbl->GetType(v11_valid);
1296 ok(t11_valid != t11_dummy && t11_valid, "GetType failed\n");
1298 /* reflection calls */
1299 cb11 = ref11->lpVtbl->GetConstantBufferByName(ref11, "invaild");
1300 ok(cb11_dummy == cb11, "GetConstantBufferByName failed, got %p, expected %p\n", cb11, cb11_dummy);
1302 cb11 = ref11->lpVtbl->GetConstantBufferByName(ref11, NULL);
1303 ok(cb11_dummy == cb11, "GetConstantBufferByName failed, got %p, expected %p\n", cb11, cb11_dummy);
1305 v11 = ref11->lpVtbl->GetVariableByName(ref11, NULL);
1306 ok(v11_dummy == v11, "GetVariableByIndex failed, got %p, expected %p\n", v11, v11_dummy);
1308 v11 = ref11->lpVtbl->GetVariableByName(ref11, "invaild");
1309 ok(v11_dummy == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_dummy);
1311 v11 = ref11->lpVtbl->GetVariableByName(ref11, "a");
1312 ok(v11_valid == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_valid);
1314 /* constant buffer calls */
1315 v11 = cb11_dummy->lpVtbl->GetVariableByName(cb11_dummy, NULL);
1316 ok(v11_dummy == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_dummy);
1318 v11 = cb11_dummy->lpVtbl->GetVariableByName(cb11_dummy, "invalid");
1319 ok(v11_dummy == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_dummy);
1321 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, NULL);
1322 ok(v11_dummy == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_dummy);
1324 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, "invalid");
1325 ok(v11_dummy == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_dummy);
1327 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, "a");
1328 ok(v11_valid == v11, "GetVariableByName failed, got %p, expected %p\n", v11, v11_valid);
1330 hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, NULL);
1331 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1333 hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, &cbdesc);
1334 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1336 hr = cb11_valid->lpVtbl->GetDesc(cb11_valid, NULL);
1337 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1339 /* variable calls */
1340 hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, NULL);
1341 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1343 hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, &vdesc);
1344 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1346 hr = v11_valid->lpVtbl->GetDesc(v11_valid, NULL);
1347 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1349 /* type calls */
1350 hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, NULL);
1351 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1353 hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, &tdesc);
1354 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1356 hr = t11_valid->lpVtbl->GetDesc(t11_valid, NULL);
1357 ok(hr == E_FAIL, "GetDesc failed, got %x, expected %x\n", hr, E_FAIL);
1359 string = t11_dummy->lpVtbl->GetMemberTypeName(t11_dummy, 0xffffffff);
1360 ok(!strcmp(string, "$Invalid"), "GetMemberTypeName failed, got \"%s\", expected \"%s\"\n", string, "$Invalid");
1362 string = t11_valid->lpVtbl->GetMemberTypeName(t11_valid, 0xffffffff);
1363 ok(!string, "GetMemberTypeName failed, got \"%s\", expected NULL\n", string);
1365 t11 = t11_dummy->lpVtbl->GetMemberTypeByIndex(t11_dummy, 0xffffffff);
1366 ok(t11_dummy == t11, "GetMemberTypeByIndex failed, got %p, expected %p\n", t11, t11_dummy);
1368 t11 = t11_valid->lpVtbl->GetMemberTypeByIndex(t11_valid, 0xffffffff);
1369 ok(t11_dummy == t11, "GetMemberTypeByIndex failed, got %p, expected %p\n", t11, t11_dummy);
1371 t11 = t11_dummy->lpVtbl->GetMemberTypeByName(t11_dummy, NULL);
1372 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1374 t11 = t11_dummy->lpVtbl->GetMemberTypeByName(t11_dummy, "invalid");
1375 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1377 t11 = t11_valid->lpVtbl->GetMemberTypeByName(t11_valid, NULL);
1378 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1380 t11 = t11_valid->lpVtbl->GetMemberTypeByName(t11_valid, "invalid");
1381 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1383 hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_dummy);
1384 ok(hr == E_FAIL, "IsEqual failed, got %x, expected %x\n", hr, E_FAIL);
1386 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_dummy);
1387 ok(hr == S_FALSE, "IsEqual failed, got %x, expected %x\n", hr, S_FALSE);
1389 hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_valid);
1390 ok(hr == E_FAIL, "IsEqual failed, got %x, expected %x\n", hr, E_FAIL);
1392 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_valid);
1393 ok(hr == S_OK, "IsEqual failed, got %x, expected %x\n", hr, S_OK);
1395 /* constant buffers */
1396 for (i = 0; i < sizeof(test_reflection_constant_buffer_cb_result)/sizeof(*test_reflection_constant_buffer_cb_result); ++i)
1398 pcbdesc = &test_reflection_constant_buffer_cb_result[i];
1400 cb11 = ref11->lpVtbl->GetConstantBufferByIndex(ref11, i);
1401 ok(cb11_dummy != cb11, "GetConstantBufferByIndex(%u) failed\n", i);
1403 hr = cb11->lpVtbl->GetDesc(cb11, &cbdesc);
1404 ok(hr == S_OK, "GetDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
1406 ok(!strcmp(cbdesc.Name, pcbdesc->Name), "GetDesc(%u) Name failed, got \"%s\", expected \"%s\"\n",
1407 i, cbdesc.Name, pcbdesc->Name);
1408 ok(cbdesc.Type == pcbdesc->Type, "GetDesc(%u) Type failed, got %x, expected %x\n",
1409 i, cbdesc.Type, pcbdesc->Type);
1410 ok(cbdesc.Variables == pcbdesc->Variables, "GetDesc(%u) Variables failed, got %u, expected %u\n",
1411 i, cbdesc.Variables, pcbdesc->Variables);
1412 ok(cbdesc.Size == pcbdesc->Size, "GetDesc(%u) Size failed, got %u, expected %u\n",
1413 i, cbdesc.Size, pcbdesc->Size);
1414 ok(cbdesc.uFlags == pcbdesc->uFlags, "GetDesc(%u) uFlags failed, got %u, expected %u\n",
1415 i, cbdesc.uFlags, pcbdesc->uFlags);
1418 /* variables */
1419 for (i = 0; i < sizeof(test_reflection_constant_buffer_variable_result)/sizeof(*test_reflection_constant_buffer_variable_result); ++i)
1421 pvdesc = &test_reflection_constant_buffer_variable_result[i].desc;
1423 v11 = ref11->lpVtbl->GetVariableByName(ref11, pvdesc->Name);
1424 ok(v11_dummy != v11, "GetVariableByName(%u) failed\n", i);
1426 hr = v11->lpVtbl->GetDesc(v11, &vdesc);
1427 ok(hr == S_OK, "GetDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
1429 ok(!strcmp(vdesc.Name, pvdesc->Name), "GetDesc(%u) Name failed, got \"%s\", expected \"%s\"\n",
1430 i, vdesc.Name, pvdesc->Name);
1431 ok(vdesc.StartOffset == pvdesc->StartOffset, "GetDesc(%u) StartOffset failed, got %u, expected %u\n",
1432 i, vdesc.StartOffset, pvdesc->StartOffset);
1433 ok(vdesc.Size == pvdesc->Size, "GetDesc(%u) Size failed, got %u, expected %u\n",
1434 i, vdesc.Size, pvdesc->Size);
1435 ok(vdesc.uFlags == pvdesc->uFlags, "GetDesc(%u) uFlags failed, got %u, expected %u\n",
1436 i, vdesc.uFlags, pvdesc->uFlags);
1437 ok(vdesc.DefaultValue == pvdesc->DefaultValue, "GetDesc(%u) DefaultValue failed\n", i);
1439 /* types */
1440 ptdesc = &test_reflection_constant_buffer_type_result[test_reflection_constant_buffer_variable_result[i].type];
1442 t11 = v11->lpVtbl->GetType(v11);
1443 ok(t11_dummy != t11, "GetType(%u) failed\n", i);
1445 hr = t11->lpVtbl->GetDesc(t11, &tdesc);
1446 ok(hr == S_OK, "GetDesc(%u) failed, got %x, expected %x\n", i, hr, S_OK);
1448 ok(tdesc.Class == ptdesc->Class, "GetDesc(%u) Class failed, got %x, expected %x\n",
1449 i, tdesc.Class, ptdesc->Class);
1450 ok(tdesc.Type == ptdesc->Type, "GetDesc(%u) Type failed, got %x, expected %x\n",
1451 i, tdesc.Type, ptdesc->Type);
1452 ok(tdesc.Rows == ptdesc->Rows, "GetDesc(%u) Rows failed, got %x, expected %x\n",
1453 i, tdesc.Rows, ptdesc->Rows);
1454 ok(tdesc.Columns == ptdesc->Columns, "GetDesc(%u) Columns failed, got %u, expected %u\n",
1455 i, tdesc.Columns, ptdesc->Columns);
1456 ok(tdesc.Elements == ptdesc->Elements, "GetDesc(%u) Elements failed, got %u, expected %u\n",
1457 i, tdesc.Elements, ptdesc->Elements);
1458 ok(tdesc.Offset == ptdesc->Offset, "GetDesc(%u) Offset failed, got %u, expected %u\n",
1459 i, tdesc.Offset, ptdesc->Offset);
1462 /* types */
1463 v11 = ref11->lpVtbl->GetVariableByName(ref11, "t");
1464 ok(v11_dummy != v11, "GetVariableByName failed\n");
1466 t11 = v11->lpVtbl->GetType(v11);
1467 ok(t11 != t11_dummy, "GetType failed\n");
1469 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 0);
1470 ok(t != t11_dummy, "GetMemberTypeByIndex failed\n");
1472 t2 = t11->lpVtbl->GetMemberTypeByName(t11, "a");
1473 ok(t == t2, "GetMemberTypeByName failed, got %p, expected %p\n", t2, t);
1475 string = t11->lpVtbl->GetMemberTypeName(t11, 0);
1476 ok(!strcmp(string, "a"), "GetMemberTypeName failed, got \"%s\", expected \"%s\"\n", string, "a");
1478 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 1);
1479 ok(t != t11_dummy, "GetMemberTypeByIndex failed\n");
1481 t2 = t11->lpVtbl->GetMemberTypeByName(t11, "b");
1482 ok(t == t2, "GetMemberTypeByName failed, got %p, expected %p\n", t2, t);
1484 string = t11->lpVtbl->GetMemberTypeName(t11, 1);
1485 ok(!strcmp(string, "b"), "GetMemberTypeName failed, got \"%s\", expected \"%s\"\n", string, "b");
1487 /* float vs float (in struct) */
1488 hr = t11->lpVtbl->IsEqual(t11, t11_valid);
1489 ok(hr == S_FALSE, "IsEqual failed, got %x, expected %x\n", hr, S_FALSE);
1491 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11);
1492 ok(hr == S_FALSE, "IsEqual failed, got %x, expected %x\n", hr, S_FALSE);
1494 /* float vs float */
1495 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 0);
1496 ok(t != t11_dummy, "GetMemberTypeByIndex failed\n");
1498 t2 = t11->lpVtbl->GetMemberTypeByIndex(t11, 1);
1499 ok(t2 != t11_dummy, "GetMemberTypeByIndex failed\n");
1501 hr = t->lpVtbl->IsEqual(t, t2);
1502 ok(hr == S_OK, "IsEqual failed, got %x, expected %x\n", hr, S_OK);
1504 count = ref11->lpVtbl->Release(ref11);
1505 ok(count == 0, "Release failed %u\n", count);
1508 START_TEST(reflection)
1510 test_reflection_references();
1511 test_reflection_desc_vs();
1512 test_reflection_desc_ps();
1513 test_reflection_desc_ps_output();
1514 test_reflection_bound_resources();
1515 test_reflection_constant_buffer();