ReactOS 0.4.17-dev-970-gcf0f1a6
reflection.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 Rico Schüller
3 *
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.
8 *
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.
13 *
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
17 */
18
19/*
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
23 */
24
25#define COBJMACROS
26#include "initguid.h"
27#include "d3dcompiler.h"
28#include "wine/test.h"
29
30/* includes for older reflection interfaces */
31#include "d3d11_1.h"
32
33/*
34 * This doesn't belong here, but for some functions it is possible to return that value,
35 * see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
36 * The original definition is in D3DX10core.h.
37 */
38#define D3DERR_INVALIDCALL 0x8876086c
39
40static HRESULT call_reflect(const void *data, SIZE_T data_size, REFIID riid, void **reflection)
41{
42#if D3D_COMPILER_VERSION
43 return D3DReflect(data, data_size, riid, reflection);
44#else
45 return D3D10ReflectShader(data, data_size, (ID3D10ShaderReflection **)reflection);
46#endif
47}
48
49/* Creator string for comparison - Version 9.29.952.3111 (43) */
510x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d,
520x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00,
53};
54
55/*
56 * fxc.exe /E VS /Tvs_4_0 /Fx
57 */
58#if 0
59float4 VS(float4 position : POSITION, float4 pos : SV_POSITION) : SV_POSITION
60{
61 return position;
62}
63#endif
650x43425844, 0x77c6324f, 0xfd27948a, 0xe6958d31, 0x53361cba, 0x00000001, 0x000001d8, 0x00000005,
660x00000034, 0x0000008c, 0x000000e4, 0x00000118, 0x0000015c, 0x46454452, 0x00000050, 0x00000000,
670x00000000, 0x00000000, 0x0000001c, 0xfffe0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
680x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
690x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000050, 0x00000002, 0x00000008, 0x00000038,
700x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000,
710x00000003, 0x00000001, 0x0000000f, 0x49534f50, 0x4e4f4954, 0x5f565300, 0x49534f50, 0x4e4f4954,
720xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001,
730x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c,
740x00010040, 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000,
750x00000001, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, 0x54415453,
760x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
770x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
780x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
790x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
80};
81
82#if D3D_COMPILER_VERSION
83static void test_reflection_references(void)
84{
85 ID3D11ShaderReflection *ref11, *ref11_test;
86 ID3D10ShaderReflection1 *ref10_1;
90
92 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
93
94 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D11ShaderReflection, (void **)&ref11_test);
95 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
96
97 count = ref11_test->lpVtbl->Release(ref11_test);
98 ok(count == 1, "Release failed %lu\n", count);
99
100 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection, (void **)&ref10);
101 ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
102
103 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
104 ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
105
106 count = ref11->lpVtbl->Release(ref11);
107 ok(!count, "Got unexpected count %lu.\n", count);
108
109 /* check invalid cases */
110#if D3D_COMPILER_VERSION >= 46
112#else
114#endif
115 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection, (void **)&ref10);
116 ok(hr == expected || broken(hr == E_NOINTERFACE) /* Windows 8 */,
117 "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
118
119 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
120 ok(hr == expected || broken(hr == E_NOINTERFACE) /* Windows 8 */,
121 "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
122
123 hr = D3DReflect(NULL, test_reflection_blob[6], &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
124 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
125
127 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
128
129 /* returns different errors with different sizes */
130 hr = D3DReflect(test_reflection_blob, 31, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
131 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
132
133#if D3D_COMPILER_VERSION >= 46
135#else
137#endif
138 hr = D3DReflect(test_reflection_blob, 32, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
139 ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
140
141 hr = D3DReflect(test_reflection_blob, test_reflection_blob[6]-1, &IID_ID3D10ShaderReflection1, (void **)&ref10_1);
142 ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
143
145 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
146
148 ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
149
151 ok(hr == expected, "Got unexpected hr %#lx, expected %#lx.\n", hr, expected);
152}
153#endif
154
155#if D3D_COMPILER_VERSION
156static void test_reflection_interfaces(void)
157{
161 IUnknown *iface, *iunk;
162 ULONG count;
163
165 hr = call_reflect(test_reflection_blob, test_reflection_blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12);
166 /* Broken with older d3dcompiler_46, d3dcompiler_47. */
168 "Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr);
169
170 if (hr != S_OK)
171 return;
172
174 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
175
176 hr = ref12->lpVtbl->QueryInterface(ref12, &IID_ID3D11ShaderReflection, (void **)&iface);
177 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
178 ok(iface == (void *)ref12, "Got unexpected interfaces %p, %p.\n", iface, ref12);
179 hr = iface->lpVtbl->QueryInterface(iface, &IID_IUnknown, (void **)&iunk);
180 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
181 ok(iface == iunk, "Got unexpected iface %p.\n", iface);
182 iface->lpVtbl->Release(iunk);
183 iface->lpVtbl->Release(iface);
184
185 hr = ref12->lpVtbl->QueryInterface(ref12, &IID_IUnknown, (void **)&iface);
186 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
187 ok(iface == (IUnknown *)ref12, "Got unexpected iface %p.\n", iface);
188 iface->lpVtbl->Release(iface);
189
190 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D12ShaderReflection, (void **)&iface);
191 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
192 ok(iface == (void *)ref11, "Got unexpected interfaces %p, %p.\n", iface, ref11);
193 hr = iface->lpVtbl->QueryInterface(iface, &IID_IUnknown, (void **)&iunk);
194 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
195 ok(iface == iunk, "Got unexpected iface %p.\n", iface);
196 iface->lpVtbl->Release(iunk);
197 iface->lpVtbl->Release(iface);
198
199 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_IUnknown, (void **)&iface);
200 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
201 ok(iface == (IUnknown *)ref11, "Got unexpected iface %p.\n", iface);
202 iface->lpVtbl->Release(iface);
203
204 hr = ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D10ShaderReflection, (void **)&iface);
205 ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
206 hr = ref12->lpVtbl->QueryInterface(ref12, &IID_ID3D10ShaderReflection, (void **)&iface);
207 ok(hr == E_NOINTERFACE, "Got unexpected hr %#lx.\n", hr);
208
209 count = ref12->lpVtbl->Release(ref12);
210 ok(!count, "Got unexpected ref count %lu.\n", count);
211 count = ref11->lpVtbl->Release(ref11);
212 ok(!count, "Got unexpected ref count %lu.\n", count);
213}
214#else
215static void test_d3d10_interfaces(void)
216{
218 IUnknown *unk;
219 HRESULT hr;
220
222 ok(hr == S_OK, "Got hr %#lx.\n", hr);
223
224 hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D10ShaderReflection, (void **)&unk);
225 ok(hr == S_OK, "Got hr %#lx.\n", hr);
226 IUnknown_Release(unk);
227
228 hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D10ShaderReflection1, (void **)&unk);
229 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
230
231 hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D11ShaderReflection, (void **)&unk);
232 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
233
234 hr = ref10->lpVtbl->QueryInterface(ref10, &IID_ID3D12ShaderReflection, (void **)&unk);
235 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
236
237 ref10->lpVtbl->Release(ref10);
238}
239#endif
240
241/*
242 * fxc.exe /E VS /Tvs_4_1 /Fx
243 */
244#if 0
245struct vsin
246{
247 float4 x : SV_position;
248 float4 a : BINORMAL;
249 uint b : BLENDINDICES;
250 float c : BLENDWEIGHT;
251 float4 d : COLOR;
252 float4 d1 : COLOR1;
253 float4 e : NORMAL;
254 float4 f : POSITION;
255 float4 g : POSITIONT;
256 float h : PSIZE;
257 float4 i : TANGENT;
258 float4 j : TEXCOORD;
259 uint k : SV_VertexID;
260 uint l : SV_InstanceID;
261 float m : testin;
262};
263struct vsout
264{
265 float4 x : SV_position;
266 float4 a : COLOR0;
267 float b : FOG;
268 float4 c : POSITION0;
269 float d : PSIZE;
270 float e : TESSFACTOR0;
271 float4 f : TEXCOORD0;
272 float g : SV_ClipDistance0;
273 float h : SV_CullDistance0;
274 uint i : SV_InstanceID;
275 float j : testout;
276};
277vsout VS(vsin x)
278{
279 vsout s;
280 s.x = float4(1.6f, 0.3f, 0.1f, 0.0f);
281 int y = 1;
282 int p[5] = {1, 2, 3, 5, 4};
283 y = y << (int) x.x.x & 0xf;
284 s.x.x = p[y];
285 s.a = x.d;
286 s.b = x.c;
287 s.c = x.f;
288 s.d = x.h;
289 s.e = x.h;
290 s.f = x.j;
291 s.g = 1.0f;
292 s.h = 1.0f;
293 s.i = 2;
294 s.j = x.m;
295 return s;
296}
297#endif
2990x43425844, 0xb65955ac, 0xcea1cb75, 0x06c5a1ad, 0x8a555fa1, 0x00000001, 0x0000076c, 0x00000005,
3000x00000034, 0x0000008c, 0x0000028c, 0x00000414, 0x000006f0, 0x46454452, 0x00000050, 0x00000000,
3010x00000000, 0x00000000, 0x0000001c, 0xfffe0401, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
3020x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
3030x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x000001f8, 0x0000000f, 0x00000008, 0x00000170,
3040x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000010f, 0x0000017c, 0x00000000, 0x00000000,
3050x00000003, 0x00000001, 0x0000000f, 0x00000185, 0x00000000, 0x00000000, 0x00000001, 0x00000002,
3060x00000001, 0x00000192, 0x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000101, 0x0000019e,
3070x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000f0f, 0x0000019e, 0x00000001, 0x00000000,
3080x00000003, 0x00000005, 0x0000000f, 0x000001a4, 0x00000000, 0x00000000, 0x00000003, 0x00000006,
3090x0000000f, 0x000001ab, 0x00000000, 0x00000000, 0x00000003, 0x00000007, 0x00000f0f, 0x000001b4,
3100x00000000, 0x00000000, 0x00000003, 0x00000008, 0x0000000f, 0x000001be, 0x00000000, 0x00000000,
3110x00000003, 0x00000009, 0x00000101, 0x000001c4, 0x00000000, 0x00000000, 0x00000003, 0x0000000a,
3120x0000000f, 0x000001cc, 0x00000000, 0x00000000, 0x00000003, 0x0000000b, 0x00000f0f, 0x000001d5,
3130x00000000, 0x00000006, 0x00000001, 0x0000000c, 0x00000001, 0x000001e1, 0x00000000, 0x00000008,
3140x00000001, 0x0000000d, 0x00000001, 0x000001ef, 0x00000000, 0x00000000, 0x00000003, 0x0000000e,
3150x00000101, 0x705f5653, 0x7469736f, 0x006e6f69, 0x4f4e4942, 0x4c414d52, 0x454c4200, 0x4e49444e,
3160x45434944, 0x4c420053, 0x57444e45, 0x48474945, 0x4f430054, 0x00524f4c, 0x4d524f4e, 0x50004c41,
3170x5449534f, 0x004e4f49, 0x49534f50, 0x4e4f4954, 0x53500054, 0x00455a49, 0x474e4154, 0x00544e45,
3180x43584554, 0x44524f4f, 0x5f565300, 0x74726556, 0x44497865, 0x5f565300, 0x74736e49, 0x65636e61,
3190x74004449, 0x69747365, 0xabab006e, 0x4e47534f, 0x00000180, 0x0000000b, 0x00000008, 0x00000110,
3200x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000011c, 0x00000000, 0x00000000,
3210x00000003, 0x00000001, 0x0000000f, 0x00000122, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3220x00000e01, 0x00000126, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000d02, 0x0000012c,
3230x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000b04, 0x00000137, 0x00000000, 0x00000000,
3240x00000003, 0x00000002, 0x00000708, 0x0000013f, 0x00000000, 0x00000000, 0x00000003, 0x00000003,
3250x0000000f, 0x00000148, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x0000000f, 0x00000151,
3260x00000000, 0x00000002, 0x00000003, 0x00000005, 0x00000e01, 0x00000161, 0x00000000, 0x00000003,
3270x00000003, 0x00000005, 0x00000d02, 0x00000171, 0x00000000, 0x00000000, 0x00000001, 0x00000006,
3280x00000e01, 0x705f5653, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0x4f460052, 0x53500047, 0x00455a49,
3290x53534554, 0x54434146, 0x7400524f, 0x6f747365, 0x50007475, 0x5449534f, 0x004e4f49, 0x43584554,
3300x44524f4f, 0x5f565300, 0x70696c43, 0x74736944, 0x65636e61, 0x5f565300, 0x6c6c7543, 0x74736944,
3310x65636e61, 0x5f565300, 0x74736e49, 0x65636e61, 0xab004449, 0x52444853, 0x000002d4, 0x00010041,
3320x000000b5, 0x0100086a, 0x0300005f, 0x00101012, 0x00000000, 0x0300005f, 0x00101012, 0x00000003,
3330x0300005f, 0x001010f2, 0x00000004, 0x0300005f, 0x001010f2, 0x00000007, 0x0300005f, 0x00101012,
3340x00000009, 0x0300005f, 0x001010f2, 0x0000000b, 0x0300005f, 0x00101012, 0x0000000e, 0x04000067,
3350x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x03000065, 0x00102012,
3360x00000002, 0x03000065, 0x00102022, 0x00000002, 0x03000065, 0x00102042, 0x00000002, 0x03000065,
3370x00102082, 0x00000002, 0x03000065, 0x001020f2, 0x00000003, 0x03000065, 0x001020f2, 0x00000004,
3380x04000067, 0x00102012, 0x00000005, 0x00000002, 0x04000067, 0x00102022, 0x00000005, 0x00000003,
3390x03000065, 0x00102012, 0x00000006, 0x02000068, 0x00000001, 0x04000069, 0x00000000, 0x00000005,
3400x00000004, 0x06000036, 0x00203012, 0x00000000, 0x00000000, 0x00004001, 0x00000001, 0x06000036,
3410x00203012, 0x00000000, 0x00000001, 0x00004001, 0x00000002, 0x06000036, 0x00203012, 0x00000000,
3420x00000002, 0x00004001, 0x00000003, 0x06000036, 0x00203012, 0x00000000, 0x00000003, 0x00004001,
3430x00000005, 0x06000036, 0x00203012, 0x00000000, 0x00000004, 0x00004001, 0x00000004, 0x0500001b,
3440x00100012, 0x00000000, 0x0010100a, 0x00000000, 0x07000029, 0x00100012, 0x00000000, 0x00004001,
3450x00000001, 0x0010000a, 0x00000000, 0x07000001, 0x00100012, 0x00000000, 0x0010000a, 0x00000000,
3460x00004001, 0x0000000f, 0x07000036, 0x00100012, 0x00000000, 0x0420300a, 0x00000000, 0x0010000a,
3470x00000000, 0x0500002b, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x08000036, 0x001020e2,
3480x00000000, 0x00004002, 0x00000000, 0x3e99999a, 0x3dcccccd, 0x00000000, 0x05000036, 0x001020f2,
3490x00000001, 0x00101e46, 0x00000004, 0x05000036, 0x00102012, 0x00000002, 0x0010100a, 0x00000003,
3500x05000036, 0x00102062, 0x00000002, 0x00101006, 0x00000009, 0x05000036, 0x00102082, 0x00000002,
3510x0010100a, 0x0000000e, 0x05000036, 0x001020f2, 0x00000003, 0x00101e46, 0x00000007, 0x05000036,
3520x001020f2, 0x00000004, 0x00101e46, 0x0000000b, 0x05000036, 0x00102012, 0x00000005, 0x00004001,
3530x3f800000, 0x05000036, 0x00102022, 0x00000005, 0x00004001, 0x3f800000, 0x05000036, 0x00102012,
3540x00000006, 0x00004001, 0x00000002, 0x0100003e, 0x54415453, 0x00000074, 0x00000015, 0x00000001,
3550x00000000, 0x00000012, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000000,
3560x00000005, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3570x00000000, 0x0000000a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3580x00000000, 0x00000000, 0x00000000,
359};
360
362{
363 {"SV_position", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x1, 0},
364 {"BINORMAL", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
365 {"BLENDINDICES", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
366 {"BLENDWEIGHT", 0, 3, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
367 {"COLOR", 0, 4, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
368 {"COLOR", 1, 5, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
369 {"NORMAL", 0, 6, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
370 {"POSITION", 0, 7, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
371 {"POSITIONT", 0, 8, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
372 {"PSIZE", 0, 9, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
373 {"TANGENT", 0, 10, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
374 {"TEXCOORD", 0, 11, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0xf, 0},
375 {"SV_VertexID", 0, 12, D3D_NAME_VERTEX_ID, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
376 {"SV_InstanceID", 0, 13, D3D_NAME_INSTANCE_ID, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
377 {"testin", 0, 14, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0x1, 0},
378};
379
381{
382 {"SV_position", 0, 0, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
383 {"COLOR", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
384 {"FOG", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
385 {"PSIZE", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x2, 0xd, 0},
386 {"TESSFACTOR", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x4, 0xb, 0},
387 {"testout", 0, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x8, 0x7, 0},
388 {"POSITION", 0, 3, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
389 {"TEXCOORD", 0, 4, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
390 {"SV_ClipDistance", 0, 5, D3D_NAME_CLIP_DISTANCE, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
391 {"SV_CullDistance", 0, 5, D3D_NAME_CULL_DISTANCE, D3D_REGISTER_COMPONENT_FLOAT32, 0x2, 0xd, 0},
392 {"SV_InstanceID", 0, 6, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0},
393};
394
396{
397 const char *SemanticName;
406};
407
408static void test_reflection_desc_vs(void)
409{
410 struct D3D11_SIGNATURE_PARAMETER_DESC_46 desc_46 = {0};
414 D3D_MIN_PRECISION expected_min_prec;
415 D3D11_SHADER_DESC sdesc11 = {0};
416 D3D12_SHADER_DESC sdesc12 = {0};
419 unsigned int i;
420 ULONG count;
421 HRESULT hr;
422#if D3D_COMPILER_VERSION
423 UINT ret;
424#endif
425
427 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
428
429 ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D12ShaderReflection, (void **)&ref12);
430
431 hr = ref11->lpVtbl->GetDesc(ref11, NULL);
432 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
433
434 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
435 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
436
437 ok(sdesc11.Version == 0x10041, "Unexpected Version %#x.\n", sdesc11.Version);
438 ok(!strcmp(sdesc11.Creator, (char *)shader_creator), "Unexpected Creator \"%s\".\n", sdesc11.Creator);
439 ok(sdesc11.Flags == 0x100, "Unexpected Flags %#x.\n", sdesc11.Flags);
440 ok(sdesc11.ConstantBuffers == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ConstantBuffers, 0);
441 ok(sdesc11.BoundResources == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.BoundResources, 0);
442 ok(sdesc11.InputParameters == 15, "GetDesc failed, got %u, expected %u\n", sdesc11.InputParameters, 15);
443 ok(sdesc11.OutputParameters == 11, "GetDesc failed, got %u, expected %u\n", sdesc11.OutputParameters, 11);
444 ok(sdesc11.InstructionCount == 21, "GetDesc failed, got %u, expected %u\n", sdesc11.InstructionCount, 21);
445 ok(sdesc11.TempRegisterCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.TempRegisterCount, 1);
446 ok(sdesc11.TempArrayCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.TempArrayCount, 5);
447 ok(sdesc11.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DefCount, 0);
448 ok(sdesc11.DclCount == 18, "GetDesc failed, got %u, expected %u\n", sdesc11.DclCount, 18);
449 ok(sdesc11.TextureNormalInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureNormalInstructions, 0);
450 ok(sdesc11.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureLoadInstructions, 0);
451 ok(sdesc11.TextureCompInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureCompInstructions, 0);
452 ok(sdesc11.TextureBiasInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureBiasInstructions, 0);
453 ok(sdesc11.TextureGradientInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureGradientInstructions, 0);
454 ok(sdesc11.FloatInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.FloatInstructionCount, 0);
455 ok(sdesc11.IntInstructionCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.IntInstructionCount, 1);
456 ok(sdesc11.UintInstructionCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.UintInstructionCount, 1);
457 ok(sdesc11.StaticFlowControlCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.StaticFlowControlCount, 1);
458 ok(sdesc11.DynamicFlowControlCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DynamicFlowControlCount, 0);
459 ok(sdesc11.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.MacroInstructionCount, 0);
460 ok(sdesc11.ArrayInstructionCount == 6, "GetDesc failed, got %u, expected %u\n", sdesc11.ArrayInstructionCount, 6);
461 ok(sdesc11.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.CutInstructionCount, 0);
462 ok(sdesc11.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.EmitInstructionCount, 0);
463 ok(sdesc11.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.GSOutputTopology, 0);
464 ok(sdesc11.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.GSMaxOutputVertexCount, 0);
465 ok(sdesc11.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.InputPrimitive, 0);
466 ok(sdesc11.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.PatchConstantParameters, 0);
467 ok(sdesc11.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cGSInstanceCount, 0);
468 ok(sdesc11.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cControlPoints, 0);
469 ok(sdesc11.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSOutputPrimitive, 0);
470 ok(sdesc11.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSPartitioning, 0);
471 ok(sdesc11.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.TessellatorDomain, 0);
472 ok(sdesc11.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cBarrierInstructions, 0);
473 ok(sdesc11.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cInterlockedInstructions, 0);
474 ok(sdesc11.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cTextureStoreInstructions, 0);
475
476 if (ref12)
477 {
478 hr = ref12->lpVtbl->GetDesc(ref12, &sdesc12);
479 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
480 ok(!memcmp(&sdesc11, &sdesc12, sizeof(sdesc12)), "D3D11 and D3D12 descs do not match.\n");
481 }
482
483#if D3D_COMPILER_VERSION
484 ret = ref11->lpVtbl->GetBitwiseInstructionCount(ref11);
485 ok(ret == 0, "Got unexpected ret %u.\n", ret);
486
487 ret = ref11->lpVtbl->GetConversionInstructionCount(ref11);
488 ok(ret == 2, "Got unexpected ret %u.\n", ret);
489
490 ret = ref11->lpVtbl->GetMovInstructionCount(ref11);
491 ok(ret == 10, "Got unexpected ret %u.\n", ret);
492
493 ret = ref11->lpVtbl->GetMovcInstructionCount(ref11);
494 ok(ret == 0, "Got unexpected ret %u.\n", ret);
495
496 if (ref12)
497 {
498 ret = ref12->lpVtbl->GetBitwiseInstructionCount(ref12);
499 ok(ret == 0, "Got unexpected ret %u.\n", ret);
500
501 ret = ref12->lpVtbl->GetConversionInstructionCount(ref12);
502 ok(ret == 2, "Got unexpected ret %u.\n", ret);
503
504 ret = ref12->lpVtbl->GetMovInstructionCount(ref12);
505 ok(ret == 10, "Got unexpected ret %u.\n", ret);
506
507 ret = ref12->lpVtbl->GetMovcInstructionCount(ref12);
508 ok(ret == 0, "Got unexpected ret %u.\n", ret);
509 }
510#endif
511
512 /* GetIn/OutputParameterDesc */
513 desc_46.MinPrecision = ~0u;
514 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0, (D3D11_SIGNATURE_PARAMETER_DESC *)&desc_46);
515#if D3D_COMPILER_VERSION >= 46
516 expected_min_prec = 0;
517#else
518 expected_min_prec = ~0u;
519#endif
520 ok(desc_46.MinPrecision == expected_min_prec, "Got MinPrecision %#x, expected %#x.\n",
521 desc_46.MinPrecision, expected_min_prec);
522
524 {
526
527 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc11);
528 ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
529
530 ok(!strcmp(desc11.SemanticName, pdesc->SemanticName), "Got unexpected SemanticName \"%s\", i %u.\n",
531 desc11.SemanticName, i);
532 ok(desc11.SemanticIndex == pdesc->SemanticIndex, "Got unexpected SemanticIndex %u, i %u.\n",
533 desc11.SemanticIndex, i);
534 ok(desc11.Register == pdesc->Register, "Got unexpected Register %u, i %u.\n", desc11.Register, i);
535 ok(desc11.SystemValueType == pdesc->SystemValueType, "Got unexpected SystemValueType %u, i %u.\n",
536 desc11.SystemValueType, i);
537 ok(desc11.ComponentType == pdesc->ComponentType, "Got unexpected ComponentType %u, i %u.\n",
538 desc11.ComponentType, i);
539 ok(desc11.Mask == pdesc->Mask, "Got unexpected SystemValueType %#x, i %u.\n", desc11.Mask, i);
540 ok(desc11.ReadWriteMask == pdesc->ReadWriteMask, "Got unexpected ReadWriteMask %#x, i %u.\n",
541 desc11.ReadWriteMask, i);
542 /* The Stream field of D3D11_SIGNATURE_PARAMETER_DESC is in the
543 * trailing padding of the D3D10_SIGNATURE_PARAMETER_DESC struct on
544 * 64-bits and thus undefined. Don't test it. */
546 ok(desc11.Stream == pdesc->Stream, "Got unexpected Stream %u, i %u.\n",
547 desc11.Stream, i);
548 else if (sizeof(void *) == 4)
549 ok(!desc11.Stream, "Got unexpected Stream %u, i %u.\n", desc11.Stream, i);
550
551 if (ref12)
552 {
553 hr = ref12->lpVtbl->GetInputParameterDesc(ref12, i, &desc12);
554 ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
555
556 ok(!memcmp(&desc12, &desc11, sizeof(desc11)), "D3D11 and D3D12 descs do not match.\n");
557 }
558 }
559
561 {
563
564 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc11);
565 ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
566
567 ok(!strcmp(desc11.SemanticName, pdesc->SemanticName), "Got unexpected SemanticName \"%s\", i %u.\n",
568 desc11.SemanticName, i);
569 ok(desc11.SemanticIndex == pdesc->SemanticIndex, "Got unexpected SemanticIndex %u, i %u.\n",
570 desc11.SemanticIndex, i);
571 ok(desc11.Register == pdesc->Register, "Got unexpected Register %u, i %u.\n", desc11.Register, i);
572 ok(desc11.SystemValueType == pdesc->SystemValueType, "Got unexpected SystemValueType %u, i %u.\n",
573 desc11.SystemValueType, i);
574 ok(desc11.ComponentType == pdesc->ComponentType, "Got unexpected ComponentType %u, i %u.\n",
575 desc11.ComponentType, i);
576 ok(desc11.Mask == pdesc->Mask, "Got unexpected SystemValueType %#x, i %u.\n", desc11.Mask, i);
577 ok(desc11.ReadWriteMask == pdesc->ReadWriteMask, "Got unexpected ReadWriteMask %#x, i %u.\n",
578 desc11.ReadWriteMask, i);
579 /* The Stream field of D3D11_SIGNATURE_PARAMETER_DESC is in the
580 * trailing padding of the D3D10_SIGNATURE_PARAMETER_DESC struct on
581 * 64-bits and thus undefined. Don't test it. */
583 ok(desc11.Stream == pdesc->Stream, "Got unexpected Stream %u, i %u.\n",
584 desc11.Stream, i);
585 else if (sizeof(void *) == 4)
586 ok(!desc11.Stream, "Got unexpected Stream %u, i %u.\n", desc11.Stream, i);
587
588 if (ref12)
589 {
590 hr = ref12->lpVtbl->GetOutputParameterDesc(ref12, i, &desc12);
591 ok(hr == S_OK, "Got unexpected hr %#lx, i %u.\n", hr, i);
592
593 ok(!memcmp(&desc12, &desc11, sizeof(desc11)), "D3D11 and D3D12 descs do not match.\n");
594 }
595 }
596
597 if (ref12)
598 {
599 count = ref12->lpVtbl->Release(ref12);
600 ok(count == 1, "Got unexpected ref count %lu.\n", count);
601 }
602
603 count = ref11->lpVtbl->Release(ref11);
604 ok(count == 0, "Got unexpected ref count %lu.\n", count);
605}
606
607/*
608 * fxc.exe /E PS /Tps_4_1 /Fx
609 */
610#if 0
611Texture2D tex1;
612Texture2D tex2;
613SamplerState sam
614{
615 Filter = MIN_MAG_MIP_LINEAR;
616 AddressU = Wrap;
617 AddressV = Wrap;
618};
619SamplerComparisonState samc
620{
621 Filter = MIN_MAG_MIP_LINEAR;
622 AddressU = w1;
623 AddressV = Wrap;
624 ComparisonFunc = LESS;
625};
626struct psin
627{
628 uint f : SV_RenderTargetArrayIndex;
629 uint g : SV_InstanceID;
630 uint h : SV_PrimitiveID;
631 float2 uv : TEXCOORD;
632 float4 a : COLOR3;
633 float b : VFACE;
634 float4 c : SV_position;
635 bool d : SV_Coverage;
636 bool e : SV_IsFrontFace;
637};
638struct psout
639{
640 float a : SV_Target1;
641 float b : SV_Depth;
642 float x : SV_Target;
643 bool c : SV_Coverage;
644};
645psout PS(psin p)
646{
647 psout a;
648 float4 x = tex1.Sample(sam, p.uv);
649 x += tex1.SampleCmp(samc, p.uv, 0.3f);
650 if (x.y < 0.1f)
651 x += tex2.SampleCmp(samc, p.uv, 0.4f);
652 else if (x.y < 0.2f)
653 x += tex2.SampleCmp(samc, p.uv, 0.1f);
654 else if (x.y < 0.3f)
655 x += tex2.SampleBias(sam, p.uv, 0.1f);
656 else if (x.y < 0.4f)
657 x += tex2.SampleBias(sam, p.uv, 0.2f);
658 else if (x.y < 0.5f)
659 x += tex2.SampleBias(sam, p.uv, 0.3f);
660 else
661 x += tex2.SampleBias(sam, p.uv, 0.4f);
662 x += tex2.SampleGrad(sam, p.uv, x.xy, x.xy);
663 x += tex2.SampleGrad(sam, p.uv, x.xz, x.xz);
664 x += tex2.SampleGrad(sam, p.uv, x.xz, x.zy);
665 x += tex2.SampleGrad(sam, p.uv, x.xz, x.zw);
666 x += tex2.SampleGrad(sam, p.uv, x.xz, x.wz);
667 a.a = x.y;
668 a.b = x.x;
669 a.x = x.x;
670 a.c = true;
671 return a;
672}
673#endif
6750x43425844, 0x19e2f325, 0xf1ec39a3, 0x3c5a8b53, 0x5bd5fb65, 0x00000001, 0x000008d0, 0x00000005,
6760x00000034, 0x0000011c, 0x00000254, 0x000002e4, 0x00000854, 0x46454452, 0x000000e0, 0x00000000,
6770x00000000, 0x00000004, 0x0000001c, 0xffff0401, 0x00000100, 0x000000af, 0x0000009c, 0x00000003,
6780x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000a0, 0x00000003,
6790x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000a5, 0x00000002,
6800x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000001, 0x0000000c, 0x000000aa, 0x00000002,
6810x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000c, 0x006d6173, 0x636d6173,
6820x78657400, 0x65740031, 0x4d003278, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6830x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x4e475349,
6840x00000130, 0x00000008, 0x00000008, 0x000000c8, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
6850x00000001, 0x000000e2, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000002, 0x000000f0,
6860x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000004, 0x000000ff, 0x00000000, 0x00000009,
6870x00000001, 0x00000000, 0x00000008, 0x0000010e, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
6880x00000303, 0x00000117, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000004, 0x0000011d,
6890x00000003, 0x00000000, 0x00000003, 0x00000002, 0x0000000f, 0x00000123, 0x00000000, 0x00000001,
6900x00000003, 0x00000003, 0x0000000f, 0x525f5653, 0x65646e65, 0x72615472, 0x41746567, 0x79617272,
6910x65646e49, 0x56530078, 0x736e495f, 0x636e6174, 0x00444965, 0x505f5653, 0x696d6972, 0x65766974,
6920x53004449, 0x73495f56, 0x6e6f7246, 0x63614674, 0x45540065, 0x4f4f4358, 0x56004452, 0x45434146,
6930x4c4f4300, 0x5300524f, 0x6f705f56, 0x69746973, 0xab006e6f, 0x4e47534f, 0x00000088, 0x00000004,
6940x00000008, 0x00000068, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000e01, 0x00000068,
6950x00000001, 0x00000000, 0x00000003, 0x00000001, 0x00000e01, 0x00000072, 0x00000000, 0x00000000,
6960x00000001, 0xffffffff, 0x00000e01, 0x0000007e, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
6970x00000e01, 0x545f5653, 0x65677261, 0x56530074, 0x766f435f, 0x67617265, 0x56530065, 0x7065445f,
6980xab006874, 0x52444853, 0x00000568, 0x00000041, 0x0000015a, 0x0100086a, 0x0300005a, 0x00106000,
6990x00000000, 0x0300085a, 0x00106000, 0x00000001, 0x04001858, 0x00107000, 0x00000000, 0x00005555,
7000x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03001062, 0x00101032, 0x00000001, 0x03000065,
7010x00102012, 0x00000000, 0x03000065, 0x00102012, 0x00000001, 0x02000065, 0x0000f000, 0x02000065,
7020x0000c001, 0x02000068, 0x00000003, 0x09000045, 0x001000f2, 0x00000000, 0x00101046, 0x00000001,
7030x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0b000046, 0x00100012, 0x00000001, 0x00101046,
7040x00000001, 0x00107006, 0x00000000, 0x00106000, 0x00000001, 0x00004001, 0x3e99999a, 0x07000000,
7050x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100006, 0x00000001, 0x07000031, 0x00100012,
7060x00000001, 0x0010001a, 0x00000000, 0x00004001, 0x3dcccccd, 0x0304001f, 0x0010000a, 0x00000001,
7070x0b000046, 0x00100012, 0x00000001, 0x00101046, 0x00000001, 0x00107006, 0x00000001, 0x00106000,
7080x00000001, 0x00004001, 0x3ecccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000,
7090x00100006, 0x00000001, 0x01000012, 0x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000,
7100x00004001, 0x3e4ccccd, 0x0304001f, 0x0010000a, 0x00000002, 0x0b000046, 0x00100012, 0x00000002,
7110x00101046, 0x00000001, 0x00107006, 0x00000001, 0x00106000, 0x00000001, 0x00004001, 0x3dcccccd,
7120x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100006, 0x00000002, 0x01000012,
7130x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000, 0x00004001, 0x3e99999a, 0x0304001f,
7140x0010000a, 0x00000002, 0x0b00004a, 0x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46,
7150x00000001, 0x00106000, 0x00000000, 0x00004001, 0x3dcccccd, 0x07000000, 0x001000f2, 0x00000001,
7160x00100e46, 0x00000000, 0x00100e46, 0x00000002, 0x01000012, 0x07000031, 0x00100012, 0x00000002,
7170x0010001a, 0x00000000, 0x00004001, 0x3ecccccd, 0x0304001f, 0x0010000a, 0x00000002, 0x0b00004a,
7180x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000,
7190x00004001, 0x3e4ccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46,
7200x00000002, 0x01000012, 0x07000031, 0x00100012, 0x00000002, 0x0010001a, 0x00000000, 0x00004001,
7210x3f000000, 0x0304001f, 0x0010000a, 0x00000002, 0x0b00004a, 0x001000f2, 0x00000002, 0x00101046,
7220x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00004001, 0x3e99999a, 0x07000000,
7230x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46, 0x00000002, 0x01000012, 0x0b00004a,
7240x001000f2, 0x00000002, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000,
7250x00004001, 0x3ecccccd, 0x07000000, 0x001000f2, 0x00000001, 0x00100e46, 0x00000000, 0x00100e46,
7260x00000002, 0x01000015, 0x01000015, 0x01000015, 0x01000015, 0x01000015, 0x0d000049, 0x001000f2,
7270x00000000, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00100046,
7280x00000001, 0x00100046, 0x00000001, 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000,
7290x00100e46, 0x00000001, 0x0d000049, 0x001000f2, 0x00000001, 0x00101046, 0x00000001, 0x00107e46,
7300x00000001, 0x00106000, 0x00000000, 0x00100086, 0x00000000, 0x00100086, 0x00000000, 0x07000000,
7310x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0d000049, 0x001000f2,
7320x00000001, 0x00101046, 0x00000001, 0x00107e46, 0x00000001, 0x00106000, 0x00000000, 0x00100086,
7330x00000000, 0x00100a66, 0x00000000, 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000,
7340x00100e46, 0x00000001, 0x0d000049, 0x001000f2, 0x00000001, 0x00101046, 0x00000001, 0x00107e46,
7350x00000001, 0x00106000, 0x00000000, 0x00100086, 0x00000000, 0x00100ae6, 0x00000000, 0x07000000,
7360x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x0d000049, 0x001000c2,
7370x00000000, 0x00101046, 0x00000001, 0x001074e6, 0x00000001, 0x00106000, 0x00000000, 0x00100086,
7380x00000000, 0x00100fb6, 0x00000000, 0x07000000, 0x00100032, 0x00000000, 0x00100ae6, 0x00000000,
7390x00100046, 0x00000000, 0x05000036, 0x00102012, 0x00000001, 0x0010001a, 0x00000000, 0x04000036,
7400x0000c001, 0x0010000a, 0x00000000, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000,
7410x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e, 0x54415453, 0x00000074, 0x00000032,
7420x00000003, 0x00000000, 0x00000005, 0x00000011, 0x00000000, 0x00000000, 0x00000006, 0x00000005,
7430x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000003,
7440x00000004, 0x00000005, 0x00000018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7450x00000000, 0x00000000, 0x00000000, 0x00000000,
746};
747
749{
750 {"SV_RenderTargetArrayIndex", 0, 0, D3D_NAME_RENDER_TARGET_ARRAY_INDEX, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0x0, 0},
751 {"SV_InstanceID", 0, 0, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_UINT32, 0x2, 0x0, 0},
752 {"SV_PrimitiveID", 0, 0, D3D_NAME_PRIMITIVE_ID, D3D_REGISTER_COMPONENT_UINT32, 0x4, 0x0, 0},
753 {"SV_IsFrontFace", 0, 0, D3D_NAME_IS_FRONT_FACE, D3D_REGISTER_COMPONENT_UINT32, 0x8, 0x0, 0},
754 {"TEXCOORD", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x3, 0x3, 0},
755 {"VFACE", 0, 1, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0x4, 0x0, 0},
756 {"COLOR", 3, 2, D3D_NAME_UNDEFINED, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
757 {"SV_position", 0, 3, D3D_NAME_POSITION, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0x0, 0},
758};
759
761{
762 {"SV_Target", 0, 0, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
763 {"SV_Target", 1, 1, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
764 {"SV_Coverage", 0, 0xffffffff, D3D_NAME_COVERAGE, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0},
765 {"SV_Depth", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0},
766};
767
768static void test_reflection_desc_ps(void)
769{
770 HRESULT hr;
771 ULONG count;
773 D3D11_SHADER_DESC sdesc11 = {0};
777 unsigned int i;
778#if D3D_COMPILER_VERSION
779 UINT size_x, size_y, size_z, size_total;
780 UINT ret;
781#endif
782
784 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
785
786 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc11);
787 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
788
789 ok(sdesc11.Version == 0x41, "Unexpected Version %#x.\n", sdesc11.Version);
790 ok(!strcmp(sdesc11.Creator, (char *)shader_creator), "Unexpected Creator \"%s\".\n", sdesc11.Creator);
791 ok(sdesc11.Flags == 0x100, "Unexpected Flags %#x.\n", sdesc11.Flags);
792 ok(sdesc11.ConstantBuffers == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ConstantBuffers, 0);
793 ok(sdesc11.BoundResources == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.BoundResources, 4);
794 ok(sdesc11.InputParameters == 8, "GetDesc failed, got %u, expected %u\n", sdesc11.InputParameters, 8);
795 ok(sdesc11.OutputParameters == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.OutputParameters, 4);
796 ok(sdesc11.InstructionCount == 50, "GetDesc failed, got %u, expected %u\n", sdesc11.InstructionCount, 50);
797 ok(sdesc11.TempRegisterCount == 3, "GetDesc failed, got %u, expected %u\n", sdesc11.TempRegisterCount, 3);
798 ok(sdesc11.TempArrayCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TempArrayCount, 0);
799 ok(sdesc11.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.DefCount, 0);
800 ok(sdesc11.DclCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.DclCount, 5);
801 ok(sdesc11.TextureNormalInstructions == 1, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureNormalInstructions, 1);
802 ok(sdesc11.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureLoadInstructions, 0);
803 ok(sdesc11.TextureCompInstructions == 3, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureCompInstructions, 3);
804 ok(sdesc11.TextureBiasInstructions == 4, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureBiasInstructions, 4);
805 ok(sdesc11.TextureGradientInstructions == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.TextureGradientInstructions, 5);
806 ok(sdesc11.FloatInstructionCount == 17, "GetDesc failed, got %u, expected %u\n", sdesc11.FloatInstructionCount, 17);
807 ok(sdesc11.IntInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.IntInstructionCount, 0);
808 ok(sdesc11.UintInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.UintInstructionCount, 0);
809 ok(sdesc11.StaticFlowControlCount == 6, "GetDesc failed, got %u, expected %u\n", sdesc11.StaticFlowControlCount, 6);
810 ok(sdesc11.DynamicFlowControlCount == 5, "GetDesc failed, got %u, expected %u\n", sdesc11.DynamicFlowControlCount, 5);
811 ok(sdesc11.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.MacroInstructionCount, 0);
812 ok(sdesc11.ArrayInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.ArrayInstructionCount, 0);
813 ok(sdesc11.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.CutInstructionCount, 0);
814 ok(sdesc11.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.EmitInstructionCount, 0);
815 ok(sdesc11.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.GSOutputTopology, 0);
816 ok(sdesc11.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.GSMaxOutputVertexCount, 0);
817 ok(sdesc11.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.InputPrimitive, 0);
818 ok(sdesc11.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.PatchConstantParameters, 0);
819 ok(sdesc11.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cGSInstanceCount, 0);
820 ok(sdesc11.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cControlPoints, 0);
821 ok(sdesc11.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSOutputPrimitive, 0);
822 ok(sdesc11.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.HSPartitioning, 0);
823 ok(sdesc11.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc11.TessellatorDomain, 0);
824 ok(sdesc11.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cBarrierInstructions, 0);
825 ok(sdesc11.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cInterlockedInstructions, 0);
826 ok(sdesc11.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc11.cTextureStoreInstructions, 0);
827
828#if D3D_COMPILER_VERSION
829 ret = ref11->lpVtbl->GetBitwiseInstructionCount(ref11);
830 ok(ret == 0, "GetBitwiseInstructionCount failed, got %u, expected %u\n", ret, 0);
831
832 ret = ref11->lpVtbl->GetConversionInstructionCount(ref11);
833 ok(ret == 0, "GetConversionInstructionCount failed, got %u, expected %u\n", ret, 0);
834
835 ret = ref11->lpVtbl->GetMovInstructionCount(ref11);
836 ok(ret == 24, "GetMovInstructionCount failed, got %u, expected %u\n", ret, 24);
837
838 ret = ref11->lpVtbl->GetMovcInstructionCount(ref11);
839 ok(ret == 0, "GetMovcInstructionCount failed, got %u, expected %u\n", ret, 0);
840#endif
841
842 /* check invalid Get*ParameterDesc cases*/
843 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0, NULL);
844 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
845
846 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, 0xffffffff, &desc);
847 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
848
849 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, NULL);
850 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
851
852 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0xffffffff, &desc);
853 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
854
855#if D3D_COMPILER_VERSION
856 hr = ref11->lpVtbl->GetPatchConstantParameterDesc(ref11, 0, &desc);
857 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
858#endif
859
860 /* GetIn/OutputParameterDesc */
862 {
864
865 hr = ref11->lpVtbl->GetInputParameterDesc(ref11, i, &desc);
866 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
867
868 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetInputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
869 i, desc.SemanticName, pdesc->SemanticName);
870 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetInputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
871 i, desc.SemanticIndex, pdesc->SemanticIndex);
872 ok(desc.Register == pdesc->Register, "GetInputParameterDesc(%u) Register failed, got %u, expected %u\n",
873 i, desc.Register, pdesc->Register);
874 ok(desc.SystemValueType == pdesc->SystemValueType, "GetInputParameterDesc(%u) SystemValueType failed, got %x, expected %x\n",
875 i, desc.SystemValueType, pdesc->SystemValueType);
876 ok(desc.ComponentType == pdesc->ComponentType, "GetInputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
877 i, desc.ComponentType, pdesc->ComponentType);
878 ok(desc.Mask == pdesc->Mask, "GetInputParameterDesc(%u) Mask failed, got %x, expected %x\n",
879 i, desc.Mask, pdesc->Mask);
880 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetInputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
881 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
883 ok(desc.Stream == pdesc->Stream, "(%u): got unexpected Stream %u, expected %u.\n",
884 i, desc.Stream, pdesc->Stream);
885 else if (sizeof(void *) == 4)
886 ok(!desc.Stream, "(%u): got unexpected Stream %u.\n", i, desc.Stream);
887 }
888
890 {
892
893 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, i, &desc);
894 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
895
896 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "GetOutputParameterDesc(%u) SemanticName failed, got \"%s\", expected \"%s\"\n",
897 i, desc.SemanticName, pdesc->SemanticName);
898 ok(desc.SemanticIndex == pdesc->SemanticIndex, "GetOutputParameterDesc(%u) SemanticIndex failed, got %u, expected %u\n",
899 i, desc.SemanticIndex, pdesc->SemanticIndex);
900 ok(desc.Register == pdesc->Register, "GetOutputParameterDesc(%u) Register failed, got %u, expected %u\n",
901 i, desc.Register, pdesc->Register);
902#if D3D_COMPILER_VERSION
903 expected = pdesc->SystemValueType;
904#else
907#endif
908 ok(desc.SystemValueType == expected, "(%u): got unexpected SystemValueType %#x, expected %#x.\n",
909 i, desc.SystemValueType, expected);
910 ok(desc.ComponentType == pdesc->ComponentType, "GetOutputParameterDesc(%u) ComponentType failed, got %x, expected %x\n",
911 i, desc.ComponentType, pdesc->ComponentType);
912 ok(desc.Mask == pdesc->Mask, "GetOutputParameterDesc(%u) Mask failed, got %x, expected %x\n",
913 i, desc.Mask, pdesc->Mask);
914 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "GetOutputParameterDesc(%u) ReadWriteMask failed, got %x, expected %x\n",
915 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
917 ok(desc.Stream == pdesc->Stream, "(%u): got unexpected Stream %u, expected %u.\n",
918 i, desc.Stream, pdesc->Stream);
919 else if (sizeof(void *) == 4)
920 ok(!desc.Stream, "(%u): got unexpected Stream %u.\n", i, desc.Stream);
921 }
922
923#if D3D_COMPILER_VERSION
924 size_x = 0xdeadbeef;
925 size_y = 0xdeadbeef;
926 size_z = 0xdeadbeef;
927 size_total = ref11->lpVtbl->GetThreadGroupSize(ref11, &size_x, &size_y, &size_z);
928 ok(!size_x, "Unexpected size %u.\n", size_x);
929 ok(!size_y, "Unexpected size %u.\n", size_y);
930 ok(!size_z, "Unexpected size %u.\n", size_z);
931 ok(!size_total, "Unexpected size %u.\n", size_total);
932#endif
933
934 count = ref11->lpVtbl->Release(ref11);
935 ok(!count, "Got unexpected count %lu.\n", count);
936}
937
938/* The following shaders are stripped, in order to show that the correct
939 * reporting of pixel shader output sysvals should not depend on the RDEF chunk
940 * being present. */
941#if 0
942float4 PS() : SV_Target3
943{
944 float4 a = float4(1.2f, 1.0f, 0.2f, 0.0f);
945 return a;
946}
947#endif
949{
950 0x43425844, 0xc3773602, 0x04f86bdc, 0x715f33b2, 0x9c063cae, 0x00000001, 0x000000b4, 0x00000003,
951 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
952 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000003, 0x00000000, 0x00000003, 0x00000003,
953 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000003c, 0x00000050, 0x0000000f,
954 0x0100086a, 0x03000065, 0x001020f2, 0x00000003, 0x08000036, 0x001020f2, 0x00000003, 0x00004002,
955 0x3f99999a, 0x3f800000, 0x3e4ccccd, 0x00000000, 0x0100003e,
956};
957
958#if 0
959float PS() : SV_DepthLessEqual
960{
961 float a = 1.2f;
962 return a;
963}
964#endif
966{
967 0x43425844, 0xc45db587, 0xdb0601fb, 0x7370900b, 0x219464be, 0x00000001, 0x000000a8, 0x00000003,
968 0x0000002c, 0x0000003c, 0x00000078, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
969 0x00000034, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
970 0x00000e01, 0x445f5653, 0x68747065, 0x7373654c, 0x61757145, 0xabab006c, 0x58454853, 0x00000028,
971 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00027001, 0x04000036, 0x00027001, 0x00004001,
972 0x3f99999a, 0x0100003e,
973};
974
975#if 0
976float PS() : SV_DepthGreaterEqual
977{
978 float a = 1.2f;
979 return a;
980}
981#endif
983{
984 0x43425844, 0x13cce144, 0x3628f322, 0xa8ea9b7d, 0xbbf9f8d7, 0x00000001, 0x000000ac, 0x00000003,
985 0x0000002c, 0x0000003c, 0x0000007c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
986 0x00000038, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
987 0x00000e01, 0x445f5653, 0x68747065, 0x61657247, 0x45726574, 0x6c617571, 0xababab00, 0x58454853,
988 0x00000028, 0x00000050, 0x0000000a, 0x0100086a, 0x02000065, 0x00026001, 0x04000036, 0x00026001,
989 0x00004001, 0x3f99999a, 0x0100003e,
990};
991
992#if 0
993float PS() : sV_DePtH
994{
995 float a = 1.2f;
996 return a;
997}
998#endif
1000{
1001 0x43425844, 0x31c891d1, 0xcbb9d935, 0xa199e1d5, 0x70205254, 0x00000001, 0x000000a0, 0x00000003,
1002 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
1003 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
1004 0x00000e01, 0x445f5673, 0x48745065, 0xababab00, 0x58454853, 0x00000028, 0x00000050, 0x0000000a,
1005 0x0100086a, 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
1006};
1007
1008#if 0
1009float PS() : SV_Depth
1010{
1011 float a = 1.2f;
1012 return a;
1013}
1014#endif
1016{
1017 0x43425844, 0x1d404736, 0x00e4a4aa, 0x5fcdad54, 0x5abd13f8, 0x00000001, 0x0000009c, 0x00000003,
1018 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
1019 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff,
1020 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000024, 0x00000040, 0x00000009,
1021 0x02000065, 0x0000c001, 0x04000036, 0x0000c001, 0x00004001, 0x3f99999a, 0x0100003e,
1022};
1023
1024#if 0
1025bool PS() : SV_COVERAGE
1026{
1027 bool a = true;
1028 return a;
1029}
1030#endif
1032{
1033 0x43425844, 0x6127612d, 0x09e2bb9a, 0xbba3889a, 0x987dafc2, 0x00000001, 0x000000a0, 0x00000003,
1034 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
1035 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, 0xffffffff,
1036 0x00000e01, 0x435f5653, 0x5245564f, 0x00454741, 0x52444853, 0x00000028, 0x00000041, 0x0000000a,
1037 0x0100086a, 0x02000065, 0x0000f000, 0x04000036, 0x0000f001, 0x00004001, 0xffffffff, 0x0100003e,
1038};
1039
1041{
1042 static const struct test_reflection_desc_ps_output_test
1043 {
1044 const DWORD *blob;
1046 }
1047 tests[] =
1048 {
1050 {"SV_Target", 3, 3, D3D_NAME_TARGET, D3D_REGISTER_COMPONENT_FLOAT32, 0xf, 0, 0}},
1052 {"SV_DepthLessEqual", 0, 0xffffffff, D3D_NAME_DEPTH_LESS_EQUAL, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0}},
1054 {"SV_DepthGreaterEqual", 0, 0xffffffff, D3D11_NAME_DEPTH_GREATER_EQUAL, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0}},
1056 {"sV_DePtH", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0}},
1058 {"SV_Depth", 0, 0xffffffff, D3D_NAME_DEPTH, D3D_REGISTER_COMPONENT_FLOAT32, 0x1, 0xe, 0}},
1060 {"SV_COVERAGE", 0, 0xffffffff, D3D_NAME_COVERAGE, D3D_REGISTER_COMPONENT_UINT32, 0x1, 0xe, 0}},
1061 };
1062 HRESULT hr;
1063 ULONG count;
1066 const D3D11_SIGNATURE_PARAMETER_DESC *pdesc;
1068 unsigned int i;
1069
1070 for (i = 0; i < ARRAY_SIZE(tests); ++i)
1071 {
1072 hr = call_reflect(tests[i].blob, tests[i].blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1074 {
1075 todo_wine ok(hr == E_INVALIDARG, "%u: Got unexpected hr %#lx.\n", i, hr);
1076 if (SUCCEEDED(hr))
1077 ref11->lpVtbl->Release(ref11);
1078 continue;
1079 }
1080 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1081
1082 pdesc = &tests[i].desc;
1083
1084 hr = ref11->lpVtbl->GetOutputParameterDesc(ref11, 0, &desc);
1085 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1086
1087 ok(!strcmp(desc.SemanticName, pdesc->SemanticName), "(%u): GetOutputParameterDesc SemanticName failed, got \"%s\", expected \"%s\"\n",
1088 i, desc.SemanticName, pdesc->SemanticName);
1089 ok(desc.SemanticIndex == pdesc->SemanticIndex, "(%u): GetOutputParameterDesc SemanticIndex failed, got %u, expected %u\n",
1090 i, desc.SemanticIndex, pdesc->SemanticIndex);
1091 ok(desc.Register == pdesc->Register, "(%u): GetOutputParameterDesc Register failed, got %u, expected %u\n",
1092 i, desc.Register, pdesc->Register);
1093#if D3D_COMPILER_VERSION
1094 expected = pdesc->SystemValueType;
1095#else
1097 todo_wine
1098#endif
1099 ok(desc.SystemValueType == expected, "(%u): Got unexpected SystemValueType %#x, expected %x.\n",
1100 i, desc.SystemValueType, expected);
1101 ok(desc.ComponentType == pdesc->ComponentType, "(%u): GetOutputParameterDesc ComponentType failed, got %x, expected %x\n",
1102 i, desc.ComponentType, pdesc->ComponentType);
1103 ok(desc.Mask == pdesc->Mask, "(%u): GetOutputParameterDesc Mask failed, got %x, expected %x\n",
1104 i, desc.Mask, pdesc->Mask);
1105 ok(desc.ReadWriteMask == pdesc->ReadWriteMask, "(%u): GetOutputParameterDesc ReadWriteMask failed, got %x, expected %x\n",
1106 i, desc.ReadWriteMask, pdesc->ReadWriteMask);
1108 ok(desc.Stream == pdesc->Stream, "(%u): got unexpected Stream %u, expected %u.\n",
1109 i, desc.Stream, pdesc->Stream);
1110 else if (sizeof(void *) == 4)
1111 ok(!desc.Stream, "(%u): got unexpected Stream %u.\n", i, desc.Stream);
1112
1113 count = ref11->lpVtbl->Release(ref11);
1114 ok(!count, "%u: Got unexpected count %lu.\n", i, count);
1115 }
1116}
1117
1118/*
1119 * fxc.exe /E PS /Tps_4_0 /Fo
1120 */
1121#if 0
1122Texture2D tex1[2];
1123Texture2D tex2;
1124SamplerState sam
1125{
1126 Filter = MIN_MAG_MIP_LINEAR;
1127 AddressU = Wrap;
1128 AddressV = Wrap;
1129};
1130cbuffer c1
1131{
1132 float x;
1133 float y[2];
1134 int z;
1135};
1136cbuffer c2
1137{
1138 float t;
1139};
1140
1141float4 PS(float2 uv : TEXCOORD0) : sv_target
1142{
1143 float4 q = tex1[0].Sample(sam, uv) + tex1[1].Sample(sam, uv) + tex2.Sample(sam, uv);
1144 q.x = q.x + x;
1145 q.w = q.w + y[0] + y[1] + t;
1146 return q;
1147}
1148#endif
1150{
1151 0x43425844, 0x003472ed, 0xe3436185, 0xcc1faad3, 0xfdac0a07, 0x00000001, 0x000004b0, 0x00000005,
1152 0x00000034, 0x00000204, 0x00000238, 0x0000026c, 0x00000434, 0x46454452, 0x000001c8, 0x00000002,
1153 0x000000d0, 0x00000005, 0x0000001c, 0xffff0400, 0x00000100, 0x0000019e, 0x000000bc, 0x00000003,
1154 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000c0, 0x00000002,
1155 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000002, 0x0000000c, 0x000000c5, 0x00000002,
1156 0x00000005, 0x00000004, 0xffffffff, 0x00000002, 0x00000001, 0x0000000c, 0x000000ca, 0x00000000,
1157 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x000000cd, 0x00000000,
1158 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x006d6173, 0x31786574,
1159 0x78657400, 0x31630032, 0x00326300, 0x000000ca, 0x00000003, 0x00000100, 0x00000030, 0x00000000,
1160 0x00000000, 0x000000cd, 0x00000001, 0x00000184, 0x00000010, 0x00000000, 0x00000000, 0x00000148,
1161 0x00000000, 0x00000004, 0x00000002, 0x0000014c, 0x00000000, 0x0000015c, 0x00000010, 0x00000014,
1162 0x00000002, 0x00000160, 0x00000000, 0x00000170, 0x00000024, 0x00000004, 0x00000000, 0x00000174,
1163 0x00000000, 0xabab0078, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0xabab0079, 0x00030000,
1164 0x00010001, 0x00000002, 0x00000000, 0xabab007a, 0x00020000, 0x00010001, 0x00000000, 0x00000000,
1165 0x0000019c, 0x00000000, 0x00000004, 0x00000002, 0x0000014c, 0x00000000, 0x694d0074, 0x736f7263,
1166 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120,
1167 0xabab0031, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000,
1168 0x00000003, 0x00000000, 0x00000303, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c,
1169 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f,
1170 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x000001c0, 0x00000040, 0x00000070, 0x04000059,
1171 0x00208e46, 0x00000000, 0x00000003, 0x04000059, 0x00208e46, 0x00000001, 0x00000001, 0x0300005a,
1172 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, 0x04001858, 0x00107000,
1173 0x00000001, 0x00005555, 0x04001858, 0x00107000, 0x00000002, 0x00005555, 0x03001062, 0x00101032,
1174 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x09000045, 0x001000f2,
1175 0x00000000, 0x00101046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x09000045,
1176 0x001000f2, 0x00000001, 0x00101046, 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000000,
1177 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x09000045,
1178 0x001000f2, 0x00000001, 0x00101046, 0x00000000, 0x00107e46, 0x00000002, 0x00106000, 0x00000000,
1179 0x07000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x00100e46, 0x00000001, 0x08000000,
1180 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000000, 0x00000001, 0x08000000,
1181 0x00100082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000000, 0x00000002, 0x08000000,
1182 0x00102082, 0x00000000, 0x0010003a, 0x00000000, 0x0020800a, 0x00000001, 0x00000000, 0x08000000,
1183 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x05000036,
1184 0x00102062, 0x00000000, 0x00100656, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x0000000b,
1185 0x00000002, 0x00000000, 0x00000002, 0x00000006, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
1186 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000,
1187 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1188 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1189};
1190
1192{
1193 {"sam", D3D_SIT_SAMPLER, 0, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
1194 {"tex1", D3D_SIT_TEXTURE, 0, 2, 12, D3D_RETURN_TYPE_FLOAT, D3D_SRV_DIMENSION_TEXTURE2D, 0xffffffff},
1195 {"tex2", D3D_SIT_TEXTURE, 2, 1, 12, D3D_RETURN_TYPE_FLOAT, D3D_SRV_DIMENSION_TEXTURE2D, 0xffffffff, 0, 2},
1196 {"c1", D3D_SIT_CBUFFER, 0, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
1197 {"c2", D3D_SIT_CBUFFER, 1, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0, 0, 1},
1198};
1199
1200static void test_reflection_cs(void)
1201{
1202 /*
1203 * fxc.exe /T cs_4_0 /Fo
1204 */
1205#if 0
1206 [numthreads(16, 8, 4)]
1207 void main( uint3 DTid : SV_DispatchThreadID )
1208 {
1209 }
1210#endif
1211 static const DWORD test_blob_cs_4_0[] =
1212 {
1213 0x43425844, 0x698a31ca, 0x8c6eee35, 0x2377107a, 0xe1e69066, 0x00000001, 0x00000150, 0x00000005,
1214 0x00000034, 0x0000008c, 0x0000009c, 0x000000ac, 0x000000d4, 0x46454452, 0x00000050, 0x00000000,
1215 0x00000000, 0x00000000, 0x0000001c, 0x43530400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f,
1216 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e,
1217 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
1218 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000020, 0x00050040, 0x00000008, 0x0100086a,
1219 0x0400009b, 0x00000010, 0x00000008, 0x00000004, 0x0100003e, 0x54415453, 0x00000074, 0x00000001,
1220 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
1221 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1222 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1223 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1224 };
1225
1226 /*
1227 * fxc.exe /T cs_5_1 /Fo
1228 */
1229#if 0
1230 [numthreads(16, 8, 4)]
1231 void main( uint3 DTid : SV_DispatchThreadID )
1232 {
1233 }
1234#endif
1235 static const DWORD test_blob[] =
1236 {
1237 0x43425844, 0x77a220d9, 0xfebd5b9c, 0x14a86e30, 0x57537394, 0x00000001, 0x00000184, 0x00000005,
1238 0x00000034, 0x000000a0, 0x000000b0, 0x000000c0, 0x000000e8, 0x46454452, 0x00000064, 0x00000000,
1239 0x00000000, 0x00000000, 0x0000003c, 0x43530501, 0x00000500, 0x0000003c, 0x25441313, 0x0000003c,
1240 0x00000018, 0x00000028, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x7263694d, 0x666f736f,
1241 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30,
1242 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, 0x00000008, 0x00000000, 0x00000008,
1243 0x58454853, 0x00000020, 0x00050051, 0x00000008, 0x0100086a, 0x0400009b, 0x00000010, 0x00000008,
1244 0x00000004, 0x0100003e, 0x54415453, 0x00000094, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
1245 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1246 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1247 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1248 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1249 0x00000000,
1250 };
1251 UINT size_x, size_y, size_z, size_total;
1254
1256 hr = call_reflect(test_blob_cs_4_0, test_blob_cs_4_0[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1257 ok(hr == expected, "Unexpected hr %#lx.\n", hr);
1258
1259 if (SUCCEEDED(hr))
1260 ref11->lpVtbl->Release(ref11);
1261
1262 hr = call_reflect(test_blob, test_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1263 ok(hr == expected, "Unexpected hr %#lx.\n", hr);
1264 if (FAILED(hr))
1265 return;
1266 size_total = ref11->lpVtbl->GetThreadGroupSize(ref11, &size_x, &size_y, &size_z);
1267 ok(size_x == 16, "Unexpected size %u.\n", size_x);
1268 ok(size_y == 8, "Unexpected size %u.\n", size_y);
1269 ok(size_z == 4, "Unexpected size %u.\n", size_z);
1270 ok(size_total == size_x * size_y * size_z, "Unexpected size %u.\n", size_total);
1271
1272 ref11->lpVtbl->Release(ref11);
1273}
1274
1276 unsigned int result_count, unsigned int target_version)
1277{
1278 ID3D12ShaderReflection *ref12 = NULL, *ref12_from_d3d11 = NULL, *ref11_from_d3d12 = NULL;
1279 const D3D12_SHADER_INPUT_BIND_DESC *pdesc;
1284 unsigned int i;
1285 UINT expected;
1286 ULONG count;
1287
1288 hr = call_reflect(blob, blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
1289
1290 expected_hr = D3D_COMPILER_VERSION < 47 && target_version >= 0x501 ? E_INVALIDARG : S_OK;
1291
1292 /* Older d3dcompiler_47 does not support sm5.1. */
1293 ok(hr == expected_hr || broken(hr == E_INVALIDARG && target_version >= 0x501),
1294 "Got unexpected hr %#lx, expected %#lx.\n", hr, expected_hr);
1295
1296 if (hr == E_INVALIDARG)
1297 return;
1298
1299#if D3D_COMPILER_VERSION
1300 call_reflect(blob, blob[6], &IID_ID3D12ShaderReflection, (void **)&ref12);
1301 ref11->lpVtbl->QueryInterface(ref11, &IID_ID3D12ShaderReflection, (void **)&ref12_from_d3d11);
1302 ok((!ref12 && !ref12_from_d3d11) || (ref12 && ref12_from_d3d11), "Got unexpected interfaces %p, %p.\n",
1303 ref12, ref12_from_d3d11);
1304
1305 if (ref12)
1306 {
1307 ok(ref12 != (void *)ref11, "Got unexpected interfaces %p, %p.\n", ref11, ref12);
1308 ok(ref12_from_d3d11 == (void *)ref11, "Got unexpected interfaces %p, %p.\n",
1309 ref11, ref12_from_d3d11);
1310 ref12->lpVtbl->QueryInterface(ref12, &IID_ID3D11ShaderReflection, (void **)&ref11_from_d3d12);
1311 ok(!!ref11_from_d3d12, "Got zero interface.\n");
1312 }
1313#endif
1314
1315 /* check invalid cases */
1316 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0, NULL);
1317 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1318
1319 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, 0xffffffff, &desc11);
1320 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1321
1322#if D3D_COMPILER_VERSION
1323 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, NULL, &desc11);
1324 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1325
1326 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "sam", NULL);
1327 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1328
1329 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", NULL);
1330 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1331
1332 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, "invalid", &desc11);
1333 ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
1334#endif
1335
1336 /* GetResourceBindingDesc */
1337 for (i = 0; i < result_count; ++i)
1338 {
1339 pdesc = &result[i];
1340
1341 hr = ref11->lpVtbl->GetResourceBindingDesc(ref11, i, &desc11);
1342 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1343
1344 ok(!strcmp(desc11.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc11.Name, i);
1345 ok(desc11.Type == pdesc->Type, "Got unexpected Type %#x, i %u.\n", desc11.Type, i);
1346 ok(desc11.BindPoint == pdesc->BindPoint, "Got unexpected BindPoint %u, i %u.\n", desc11.BindPoint, i);
1347 ok(desc11.BindCount == pdesc->BindCount, "Got unexpected BindCount %u, i %u.\n", desc11.BindCount, i);
1348#if D3D_COMPILER_VERSION
1349 expected = pdesc->uFlags;
1350#else
1351 expected = 0;
1352 todo_wine_if(pdesc->uFlags)
1353#endif
1354 ok(desc11.uFlags == expected, "Got unexpected uFlags %#x, i %u.\n", desc11.uFlags, i);
1355 ok(desc11.ReturnType == pdesc->ReturnType, "Got unexpected ReturnType %#x, i %u.\n", desc11.ReturnType, i);
1356 ok(desc11.Dimension == pdesc->Dimension, "Got unexpected Dimension %#x, i %u.\n", desc11.Dimension, i);
1357 ok(desc11.NumSamples == pdesc->NumSamples, "Got unexpected NumSamples %u, i %u.\n", desc11.NumSamples, i);
1358
1359 if (ref12)
1360 {
1361 memset(&desc12, 0, sizeof(desc12));
1362 desc12.Space = 0xdeadbeef;
1363 desc12.uID = 0xdeadbeef;
1364
1365 hr = ref12->lpVtbl->GetResourceBindingDesc(ref12, i, &desc12);
1366 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1367
1368 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1369 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1370 "D3D11 and D3D12 descs do not match.\n");
1371 ok(desc12.Space == pdesc->Space, "Got unexpected Space %u, i %u.\n", desc12.Space, i);
1372 ok(desc12.uID == pdesc->uID, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1373
1374 memset(&desc12, 0, sizeof(desc12));
1375 desc12.Space = 0xdeadbeef;
1376 desc12.uID = 0xdeadbeef;
1377 hr = ref12_from_d3d11->lpVtbl->GetResourceBindingDesc(ref12_from_d3d11, i, &desc12);
1378 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1379
1380 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1381 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1382 "D3D11 and D3D12 descs do not match.\n");
1383 /* Native d3dcompiler_47 returns the same interface pointer when queried for ID3D12ShaderReflection
1384 * from ID3D11ShaderReflection. Space field still gets the correct value on x64 due to
1385 * D3D11_SHADER_INPUT_BIND_DESC padding. */
1387 ? pdesc->Space : 0xdeadbeef;
1388 ok(desc12.Space == expected, "Got unexpected Space %u, i %u.\n",
1389 desc12.Space, i);
1390 ok(desc12.uID == 0xdeadbeef, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1391
1392 memset(&desc12, 0, sizeof(desc12));
1393 desc12.Space = 0xdeadbeef;
1394 desc12.uID = 0xdeadbeef;
1395 hr = ref11_from_d3d12->lpVtbl->GetResourceBindingDesc(ref11_from_d3d12, i, &desc12);
1396 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1397 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1398 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1399 "D3D11 and D3D12 descs do not match.\n");
1400 ok(desc12.Space == pdesc->Space, "Got unexpected Space %u, i %u.\n", desc12.Space, i);
1401 ok(desc12.uID == pdesc->uID, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1402 }
1403 }
1404
1405#if D3D_COMPILER_VERSION
1406 /* GetResourceBindingDescByName */
1407 for (i = 0; i < result_count; ++i)
1408 {
1409 pdesc = &result[i];
1410
1411 hr = ref11->lpVtbl->GetResourceBindingDescByName(ref11, pdesc->Name, &desc11);
1412 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1413
1414 ok(!strcmp(desc11.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc11.Name, i);
1415 ok(desc11.Type == pdesc->Type, "Got unexpected Type %#x, i %u.\n", desc11.Type, i);
1416 ok(desc11.BindPoint == pdesc->BindPoint, "Got unexpected BindPoint %u, i %u.\n", desc11.BindPoint, i);
1417 ok(desc11.BindCount == pdesc->BindCount, "Got unexpected BindCount failed %u, i %u.\n", desc11.BindCount, i);
1418 ok(desc11.uFlags == pdesc->uFlags, "Got unexpected uFlags %#x, i %u.\n", desc11.uFlags, i);
1419 ok(desc11.ReturnType == pdesc->ReturnType, "Got unexpected ReturnType %#x, i %u.\n", desc11.ReturnType, i);
1420 ok(desc11.Dimension == pdesc->Dimension, "Got unexpected Dimension %#x, i %u.\n", desc11.Dimension, i);
1421 ok(desc11.NumSamples == pdesc->NumSamples, "Got unexpected NumSamples %u, i %u.\n", desc11.NumSamples, i);
1422
1423 if (ref12)
1424 {
1425 memset(&desc12, 0, sizeof(desc12));
1426 desc12.Space = 0xdeadbeef;
1427 desc12.uID = 0xdeadbeef;
1428
1429 hr = ref12->lpVtbl->GetResourceBindingDescByName(ref12, pdesc->Name, &desc12);
1430 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1431
1432 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1433 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1434 "D3D11 and D3D12 descs do not match.\n");
1435 ok(desc12.Space == pdesc->Space, "Got unexpected Space %u, i %u.\n", desc12.Space, i);
1436 ok(desc12.uID == pdesc->uID, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1437
1438 memset(&desc12, 0, sizeof(desc12));
1439 desc12.Space = 0xdeadbeef;
1440 desc12.uID = 0xdeadbeef;
1441 hr = ref12_from_d3d11->lpVtbl->GetResourceBindingDescByName(ref12_from_d3d11, pdesc->Name, &desc12);
1442 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1443
1444 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1445 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1446 "D3D11 and D3D12 descs do not match.\n");
1448 ? pdesc->Space : 0xdeadbeef;
1449 ok(desc12.Space == expected, "Got unexpected Space %u, i %u.\n",
1450 desc12.Space, i);
1451 ok(desc12.uID == 0xdeadbeef, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1452
1453 memset(&desc12, 0, sizeof(desc12));
1454 desc12.Space = 0xdeadbeef;
1455 desc12.uID = 0xdeadbeef;
1456 hr = ref11_from_d3d12->lpVtbl->GetResourceBindingDescByName(ref11_from_d3d12, pdesc->Name, &desc12);
1457 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1458 ok(!strcmp(desc12.Name, pdesc->Name), "Got unexpected Name \"%s\", i %u.\n", desc12.Name, i);
1459 ok(!memcmp(&desc12.Type, &desc11.Type, sizeof(desc11) - offsetof(D3D11_SHADER_INPUT_BIND_DESC, Type)),
1460 "D3D11 and D3D12 descs do not match.\n");
1461 ok(desc12.Space == pdesc->Space, "Got unexpected Space %u, i %u.\n", desc12.Space, i);
1462 ok(desc12.uID == pdesc->uID, "Got unexpected uID %#x, i %u.\n", desc12.uID, i);
1463 }
1464 }
1465#endif
1466
1467 if (ref12)
1468 {
1469 count = ref11_from_d3d12->lpVtbl->Release(ref11_from_d3d12);
1470 ok(count == 1, "Got unexpected ref count %lu.\n", count);
1471
1472 count = ref12->lpVtbl->Release(ref12);
1473 ok(!count, "Got unexpected ref count %lu.\n", count);
1474
1475 count = ref12_from_d3d11->lpVtbl->Release(ref12_from_d3d11);
1476 ok(count == 1, "Got unexpected ref count %lu.\n", count);
1477 }
1478
1479 count = ref11->lpVtbl->Release(ref11);
1480 ok(!count, "Got unexpected ref count %lu.\n", count);
1481}
1482
1483#if D3D_COMPILER_VERSION
1484/*
1485 * fxc.exe /E PS /Tps_5_0 /Fx
1486 */
1487#if 0
1488cbuffer c1
1489{
1490 float a;
1491 float b[2];
1492 int i;
1493 struct s {
1494 float a;
1495 float b;
1496 } t;
1497};
1498
1499interface iTest
1500{
1501 float4 test(float2 vec);
1502};
1503
1504class cTest : iTest
1505{
1506 bool m_on;
1507 float4 test(float2 vec);
1508};
1509
1510float4 cTest::test(float2 vec)
1511{
1512 float4 res;
1513 if(m_on)
1514 res = float4(vec.x, vec.y, vec.x+vec.y, 0);
1515 else
1516 res = 0;
1517 return res;
1518}
1519
1520iTest g_Test;
1521
1522
1523float4 PS(float2 uv : TEXCOORD0) : sv_target
1524{
1525 float4 q = g_Test.test(uv);
1526 q.x = q.x + t.a;
1527 return q;
1528}
1529#endif
15310x43425844, 0xe6470e0d, 0x0d5698bb, 0x29373c30, 0x64a5d268, 0x00000001, 0x00000590, 0x00000006,
15320x00000038, 0x00000318, 0x0000034c, 0x00000380, 0x000003d8, 0x000004f4, 0x46454452, 0x000002d8,
15330x00000002, 0x00000060, 0x00000001, 0x0000003c, 0xffff0500, 0x00000100, 0x000002a4, 0x31314452,
15340x0000003c, 0x00000018, 0x00000020, 0x00000028, 0x00000024, 0x0000000c, 0x00000001, 0x0000005c,
15350x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0xab003163,
15360x00000090, 0x00000001, 0x000000a0, 0x00000010, 0x00000000, 0x00000002, 0x0000005c, 0x00000004,
15370x00000120, 0x00000040, 0x00000000, 0x00000000, 0x69685424, 0x696f5073, 0x7265746e, 0xababab00,
15380x000000c8, 0x00000000, 0x00000001, 0x00000006, 0x000000fc, 0x00000000, 0xffffffff, 0x00000000,
15390xffffffff, 0x00000000, 0x65545f67, 0x69007473, 0x74736554, 0xababab00, 0x00000006, 0x00000001,
15400x00000000, 0x000000d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000cf, 0x00250007,
15410x00040001, 0x00000000, 0x00000000, 0x000000d8, 0x00000000, 0x00000000, 0x00000000, 0x000000cf,
15420x000001c0, 0x00000000, 0x00000004, 0x00000000, 0x000001c8, 0x00000000, 0xffffffff, 0x00000000,
15430xffffffff, 0x00000000, 0x000001ec, 0x00000010, 0x00000014, 0x00000000, 0x000001f0, 0x00000000,
15440xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x00000214, 0x00000024, 0x00000004, 0x00000000,
15450x0000021c, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x00000240, 0x00000030,
15460x00000008, 0x00000002, 0x00000280, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000,
15470x6c660061, 0x0074616f, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15480x00000000, 0x00000000, 0x000001c2, 0xabab0062, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
15490x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000001c2, 0x6e690069, 0xabab0074, 0x00020000,
15500x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000216,
15510x00730074, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15520x00000000, 0x000001c2, 0x000001c0, 0x00000244, 0x00000000, 0x000001ec, 0x00000244, 0x00000004,
15530x00000005, 0x00020001, 0x00020000, 0x00000268, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15540x00000242, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072,
15550x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x0000002c,
15560x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000303,
15570x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
15580x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074,
15590x45434649, 0x00000050, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000040, 0x00000034,
15600x00000024, 0x00000000, 0x4e47534f, 0x00000001, 0x00000001, 0x00000040, 0x00000044, 0x00000048,
15610x00010000, 0x00000000, 0xabab0000, 0x00000000, 0x73655463, 0xabab0074, 0x58454853, 0x00000114,
15620x00000050, 0x00000045, 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000004, 0x03000091,
15630x00000000, 0x00000000, 0x05000092, 0x00000000, 0x00000000, 0x00010001, 0x00000000, 0x03001062,
15640x00101032, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000002, 0x07000000,
15650x00100042, 0x00000000, 0x0010101a, 0x00000000, 0x0010100a, 0x00000000, 0x05000036, 0x00100032,
15660x00000000, 0x00101046, 0x00000000, 0x05000036, 0x00100082, 0x00000000, 0x00004001, 0x00000000,
15670x05000036, 0x00100032, 0x00000001, 0x0011d516, 0x00000000, 0x0a000001, 0x001000f2, 0x00000000,
15680x00100e46, 0x00000000, 0x04a08006, 0x0010001a, 0x00000001, 0x0010000a, 0x00000001, 0x08000000,
15690x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0020800a, 0x00000000, 0x00000003, 0x05000036,
15700x001020e2, 0x00000000, 0x00100e56, 0x00000000, 0x0100003e, 0x54415453, 0x00000094, 0x00000008,
15710x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000001, 0x00000001, 0x00000000,
15720x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15730x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15740x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
15750x00000000, 0x00000000, 0x00000000, 0x00000000,
1576};
1577
1579{
1580 {"$ThisPointer", D3D_CT_INTERFACE_POINTERS, 1, 16, 0},
1581 {"c1", D3D_CT_CBUFFER, 4, 64, 0},
1582};
1583
1584static const struct
1585{
1587 unsigned int type;
1589{
1590 {{"g_Test", 0, 1, 6, 0}, 0},
1591 {{"a", 0, 4, 0, 0}, 1},
1592 {{"b", 16, 20, 0, 0}, 2},
1593 {{"i", 36, 4, 0, 0}, 3},
1594 {{"t", 48, 8, 2, 0}, 4},
1595};
1596
1597#else
1598/*
1599 * fxc.exe /E PS /Tps_4_0 /Fx
1600 */
1601#if 0
1602cbuffer c1
1603{
1604 float a;
1605 float b[2];
1606 int i;
1607 struct s {
1608 float a;
1609 float b;
1610 } t;
1611};
1612
1613class cTest
1614{
1615 bool m_on;
1616 float4 test(float2 vec);
1617};
1618
1619float4 cTest::test(float2 vec)
1620{
1621 float4 res;
1622 if(m_on)
1623 res = float4(vec.x, vec.y, vec.x+vec.y, 0);
1624 else
1625 res = 0;
1626 return res;
1627}
1628
1629cTest g_Test;
1630
1631
1632float4 PS(float2 uv : TEXCOORD0) : sv_target
1633{
1634 float4 q = g_Test.test(uv);
1635 q.x = q.x + t.a;
1636 return q;
1637}
1638#endif
16400x43425844, 0x0241ca0a, 0xa3bf8da0, 0xdd5f853e, 0xfe868252, 0x00000001, 0x00000414, 0x00000005,
16410x00000034, 0x00000230, 0x00000264, 0x00000298, 0x00000398, 0x46454452, 0x000001f4, 0x00000002,
16420x00000068, 0x00000002, 0x0000001c, 0xffff0400, 0x00000100, 0x000001c0, 0x0000005c, 0x00000000,
16430x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000065, 0x00000000,
16440x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x6f6c4724, 0x736c6162,
16450x00316300, 0x0000005c, 0x00000001, 0x00000098, 0x00000010, 0x00000000, 0x00000000, 0x00000065,
16460x00000004, 0x000000e8, 0x00000040, 0x00000000, 0x00000000, 0x000000b0, 0x00000000, 0x00000004,
16470x00000002, 0x000000d8, 0x00000000, 0x65545f67, 0x6d007473, 0x006e6f5f, 0x00010000, 0x00010001,
16480x00000000, 0x00000000, 0x000000b7, 0x000000bc, 0x00000000, 0x00000005, 0x00010001, 0x00010000,
16490x000000cc, 0x00000148, 0x00000000, 0x00000004, 0x00000000, 0x0000014c, 0x00000000, 0x0000015c,
16500x00000010, 0x00000014, 0x00000000, 0x00000160, 0x00000000, 0x00000170, 0x00000024, 0x00000004,
16510x00000000, 0x00000174, 0x00000000, 0x00000184, 0x00000030, 0x00000008, 0x00000002, 0x000001b0,
16520x00000000, 0xabab0061, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0xabab0062, 0x00030000,
16530x00010001, 0x00000002, 0x00000000, 0xabab0069, 0x00020000, 0x00010001, 0x00000000, 0x00000000,
16540xabab0074, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x00000148, 0x00000188, 0x00000000,
16550x0000015c, 0x00000188, 0x00000004, 0x00000005, 0x00020001, 0x00020000, 0x00000198, 0x7263694d,
16560x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265,
16570x2e39322e, 0x2e323539, 0x31313133, 0xababab00, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008,
16580x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000303, 0x43584554, 0x44524f4f,
16590xababab00, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000,
16600x00000003, 0x00000000, 0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x000000f8,
16610x00000040, 0x0000003e, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04000059, 0x00208e46,
16620x00000001, 0x00000004, 0x03001062, 0x00101032, 0x00000000, 0x03000065, 0x001020f2, 0x00000000,
16630x02000068, 0x00000001, 0x07000000, 0x00100042, 0x00000000, 0x0010101a, 0x00000000, 0x0010100a,
16640x00000000, 0x05000036, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x05000036, 0x00100082,
16650x00000000, 0x00004001, 0x00000000, 0x0d000037, 0x001000f2, 0x00000000, 0x00208006, 0x00000000,
16660x00000000, 0x00100e46, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
16670x08000000, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0020800a, 0x00000001, 0x00000003,
16680x05000036, 0x001020e2, 0x00000000, 0x00100e56, 0x00000000, 0x0100003e, 0x54415453, 0x00000074,
16690x00000007, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
16700x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
16710x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
16720x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1673};
1674
1676{
1677 {"$Globals", D3D_CT_CBUFFER, 1, 16, 0},
1678 {"c1", D3D_CT_CBUFFER, 4, 64, 0},
1679};
1680
1681static const struct
1682{
1684 unsigned int type;
1686{
1687 {{"a", 0, 4, 0, 0}, 1},
1688 {{"b", 16, 20, 0, 0}, 2},
1689 {{"i", 36, 4, 0, 0}, 3},
1690 {{"t", 48, 8, 2, 0}, 4},
1692
1693#endif
1694
1696{
1698 {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 0, 1, 0, "float"},
1699 {D3D_SVC_SCALAR, D3D_SVT_FLOAT, 1, 1, 2, 1, 0, "float"},
1700 {D3D_SVC_SCALAR, D3D_SVT_INT, 1, 1, 0, 1, 0, "int"},
1701 {D3D_SVC_STRUCT, D3D_SVT_VOID, 1, 2, 0, 1, 0, "s"},
1702};
1703
1705{
1706 ID3D12ShaderReflectionType *t12, *mt12, *mt12_2, *t12_dummy = NULL, *t12_valid = NULL;
1707 ID3D12ShaderReflectionConstantBuffer *cb12, *cb12_dummy = NULL, *cb12_valid = NULL;
1708 ID3D11ShaderReflectionConstantBuffer *cb11, *cb11_dummy = NULL, *cb11_valid = NULL;
1709 ID3D11ShaderReflectionType *t11, *t, *t2, *t11_dummy = NULL, *t11_valid = NULL;
1710 ID3D12ShaderReflectionVariable *v12, *v12_dummy = NULL, *v12_valid = NULL;
1711 ID3D11ShaderReflectionVariable *v11, *v11_dummy = NULL, *v11_valid = NULL;
1712 D3D12_SHADER_VARIABLE_DESC vdesc12 = {0};
1713 const D3D11_SHADER_VARIABLE_DESC *pvdesc;
1714 const D3D11_SHADER_BUFFER_DESC *pcbdesc;
1715 D3D12_SHADER_BUFFER_DESC cbdesc12 = {0};
1716 D3D11_SHADER_VARIABLE_DESC vdesc = {0};
1717 D3D11_SHADER_BUFFER_DESC cbdesc = {0};
1719 const D3D11_SHADER_TYPE_DESC *ptdesc;
1720 D3D12_SHADER_TYPE_DESC tdesc12 = {0};
1721 D3D11_SHADER_TYPE_DESC tdesc = {0};
1723 D3D11_SHADER_DESC sdesc = {0};
1724 unsigned int i, expected;
1725 LPCSTR string;
1726 ULONG count;
1727 HRESULT hr;
1728
1730 &IID_ID3D11ShaderReflection, (void **)&ref11);
1731 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
1732
1733#if D3D_COMPILER_VERSION
1735 &IID_ID3D12ShaderReflection, (void **)&ref12);
1736#endif
1737
1738 hr = ref11->lpVtbl->GetDesc(ref11, &sdesc);
1739 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
1740
1741 expected = D3D_COMPILER_VERSION ? 0x50 : 0x40;
1742 ok(sdesc.Version == expected, "Unexpected Version %#x.\n", sdesc.Version);
1743 ok(!strcmp(sdesc.Creator, (char *)shader_creator), "Unexpected Creator \"%s\".\n", sdesc.Creator);
1744 ok(sdesc.Flags == 0x100, "Unexpected Flags %#x.\n", sdesc.Flags);
1745 ok(sdesc.ConstantBuffers == 2, "GetDesc failed, got %u, expected %u\n", sdesc.ConstantBuffers, 2);
1747 ok(sdesc.BoundResources == expected, "Got unexpected BoundResources %u.\n", sdesc.BoundResources);
1748 ok(sdesc.InputParameters == 1, "GetDesc failed, got %u, expected %u\n", sdesc.InputParameters, 1);
1749 ok(sdesc.OutputParameters == 1, "GetDesc failed, got %u, expected %u\n", sdesc.OutputParameters, 1);
1751 ok(sdesc.InstructionCount == expected, "Got unexpected InstructionCount %u.\n", sdesc.InstructionCount);
1753 ok(sdesc.TempRegisterCount == expected, "Got unexpected TempRegisterCount %u.\n", sdesc.TempRegisterCount);
1754 ok(sdesc.TempArrayCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TempArrayCount, 0);
1755 ok(sdesc.DefCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.DefCount, 0);
1756 ok(sdesc.DclCount == 2, "GetDesc failed, got %u, expected %u\n", sdesc.DclCount, 2);
1757 ok(sdesc.TextureNormalInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureNormalInstructions, 0);
1758 ok(sdesc.TextureLoadInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureLoadInstructions, 0);
1759 ok(sdesc.TextureCompInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureCompInstructions, 0);
1760 ok(sdesc.TextureBiasInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureBiasInstructions, 0);
1761 ok(sdesc.TextureGradientInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.TextureGradientInstructions, 0);
1762 ok(sdesc.FloatInstructionCount == 2, "GetDesc failed, got %u, expected %u\n", sdesc.FloatInstructionCount, 2);
1763 ok(sdesc.IntInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.IntInstructionCount, 0);
1765 ok(sdesc.UintInstructionCount == expected, "Got unexpected UintInstructionCount %u.\n",
1766 sdesc.UintInstructionCount);
1767 ok(sdesc.StaticFlowControlCount == 1, "GetDesc failed, got %u, expected %u\n", sdesc.StaticFlowControlCount, 1);
1768 ok(sdesc.DynamicFlowControlCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.DynamicFlowControlCount, 0);
1769 ok(sdesc.MacroInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.MacroInstructionCount, 0);
1770 ok(sdesc.ArrayInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.ArrayInstructionCount, 0);
1771 ok(sdesc.CutInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.CutInstructionCount, 0);
1772 ok(sdesc.EmitInstructionCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.EmitInstructionCount, 0);
1773 ok(sdesc.GSOutputTopology == 0, "GetDesc failed, got %x, expected %x\n", sdesc.GSOutputTopology, 0);
1774 ok(sdesc.GSMaxOutputVertexCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.GSMaxOutputVertexCount, 0);
1775 ok(sdesc.InputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc.InputPrimitive, 0);
1776 ok(sdesc.PatchConstantParameters == 0, "GetDesc failed, got %u, expected %u\n", sdesc.PatchConstantParameters, 0);
1777 ok(sdesc.cGSInstanceCount == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cGSInstanceCount, 0);
1778 ok(sdesc.cControlPoints == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cControlPoints, 0);
1779 ok(sdesc.HSOutputPrimitive == 0, "GetDesc failed, got %x, expected %x\n", sdesc.HSOutputPrimitive, 0);
1780 ok(sdesc.HSPartitioning == 0, "GetDesc failed, got %x, expected %x\n", sdesc.HSPartitioning, 0);
1781 ok(sdesc.TessellatorDomain == 0, "GetDesc failed, got %x, expected %x\n", sdesc.TessellatorDomain, 0);
1782 ok(sdesc.cBarrierInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cBarrierInstructions, 0);
1783 ok(sdesc.cInterlockedInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cInterlockedInstructions, 0);
1784 ok(sdesc.cTextureStoreInstructions == 0, "GetDesc failed, got %u, expected %u\n", sdesc.cTextureStoreInstructions, 0);
1785
1786 /* get the dummys for comparison */
1787 cb11_dummy = ref11->lpVtbl->GetConstantBufferByIndex(ref11, 0xffffffff);
1788 ok(!!cb11_dummy, "Got unexpected buffer %p.\n", cb11_dummy);
1789
1790 if (ref12)
1791 {
1792 cb12_dummy = ref12->lpVtbl->GetConstantBufferByIndex(ref12, 0xffffffff);
1793 ok(!!cb12_dummy, "Got unexpected buffer %p.\n", cb12_dummy);
1794 ok(cb12_dummy == (void *)cb11_dummy, "Got unexpected buffer %p.\n", cb12_dummy);
1795
1796 v12_dummy = cb12_dummy->lpVtbl->GetVariableByIndex(cb12_dummy, 0xffffffff);
1797 ok(!!v12_dummy, "Got unexpected NULL variable.\n");
1798 }
1799 v11_dummy = cb11_dummy->lpVtbl->GetVariableByIndex(cb11_dummy, 0xffffffff);
1800 ok(!!v11_dummy, "Got unexpected NULL variable.\n");
1801
1802 t11_dummy = v11_dummy->lpVtbl->GetType(v11_dummy);
1803 ok(!!t11_dummy, "Got NULL type.\n");
1804
1805 /* get the valid variables */
1806 cb11_valid = ref11->lpVtbl->GetConstantBufferByIndex(ref11, 1);
1807 ok(cb11_valid != cb11_dummy && cb11_valid, "Got unexpected buffer %p.\n", cb11_valid);
1808 if (ref12)
1809 {
1810 cb12_valid = ref12->lpVtbl->GetConstantBufferByIndex(ref12, 1);
1811 ok(cb12_valid != cb12_dummy && cb12_valid, "Got unexpected buffer %p.\n", cb11_valid);
1812 ok(cb12_valid != (void *)cb11_valid, "Got unexpected buffer %p.\n", cb12_valid);
1813
1814 v12_valid = cb12_valid->lpVtbl->GetVariableByIndex(cb12_valid, 0);
1815 ok(v12_valid != v12_dummy && v12_valid, "Got unexpected variable %p.\n", v12_valid);
1816
1817 t12_dummy = v12_dummy->lpVtbl->GetType(v12_dummy);
1818 ok(!!t12_dummy, "Got NULL type.\n");
1819
1820 t12_valid = v12_valid->lpVtbl->GetType(v12_valid);
1821 ok(t12_valid != t12_dummy && t12_valid, "GetType failed\n");
1822 }
1823
1824 v11_valid = cb11_valid->lpVtbl->GetVariableByIndex(cb11_valid, 0);
1825 ok(v11_valid != v11_dummy && v11_valid, "Got unexpected variable %p.\n", v11_valid);
1826
1827 t11_valid = v11_valid->lpVtbl->GetType(v11_valid);
1828 ok(t11_valid != t11_dummy && t11_valid, "GetType failed\n");
1829
1830 /* reflection calls */
1831 cb11 = ref11->lpVtbl->GetConstantBufferByName(ref11, "invalid");
1832 ok(cb11_dummy == cb11, "GetConstantBufferByName failed, got %p, expected %p\n", cb11, cb11_dummy);
1833
1834 cb11 = ref11->lpVtbl->GetConstantBufferByName(ref11, NULL);
1835 ok(cb11_dummy == cb11, "GetConstantBufferByName failed, got %p, expected %p\n", cb11, cb11_dummy);
1836
1837#if D3D_COMPILER_VERSION
1838 v11 = ref11->lpVtbl->GetVariableByName(ref11, NULL);
1839 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1840
1841 v11 = ref11->lpVtbl->GetVariableByName(ref11, "invalid");
1842 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1843
1844 v11 = ref11->lpVtbl->GetVariableByName(ref11, "a");
1845 ok(v11_valid == v11, "Got unexpected variable %p.\n", v11);
1846#endif
1847
1848 /* constant buffer calls */
1849 v11 = cb11_dummy->lpVtbl->GetVariableByName(cb11_dummy, NULL);
1850 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1851
1852 v11 = cb11_dummy->lpVtbl->GetVariableByName(cb11_dummy, "invalid");
1853 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1854
1855 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, NULL);
1856 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1857
1858 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, "invalid");
1859 ok(v11_dummy == v11, "Got unexpected variable %p.\n", v11);
1860
1861 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, "a");
1862 ok(v11_valid == v11, "Got unexpected variable %p.\n", v11);
1863
1864 if (ref12)
1865 {
1866 v12 = cb12_valid->lpVtbl->GetVariableByName(cb12_valid, "a");
1867 ok(v12_valid == v12, "Got unexpected variable %p.\n", v12);
1868 }
1869
1870 hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, NULL);
1871 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1872
1873 hr = cb11_dummy->lpVtbl->GetDesc(cb11_dummy, &cbdesc);
1874 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1875
1876 hr = cb11_valid->lpVtbl->GetDesc(cb11_valid, NULL);
1877 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1878
1879 /* variable calls */
1880 hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, NULL);
1881 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1882
1883 hr = v11_dummy->lpVtbl->GetDesc(v11_dummy, &vdesc);
1884 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1885
1886 hr = v11_valid->lpVtbl->GetDesc(v11_valid, NULL);
1887 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1888
1889 /* type calls */
1890 hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, NULL);
1891 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1892
1893 hr = t11_dummy->lpVtbl->GetDesc(t11_dummy, &tdesc);
1894 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1895
1896 hr = t11_valid->lpVtbl->GetDesc(t11_valid, NULL);
1897 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1898
1899 string = t11_dummy->lpVtbl->GetMemberTypeName(t11_dummy, 0xffffffff);
1900 ok(!strcmp(string, "$Invalid"), "GetMemberTypeName failed, got \"%s\", expected \"%s\"\n", string, "$Invalid");
1901
1902 string = t11_valid->lpVtbl->GetMemberTypeName(t11_valid, 0xffffffff);
1903 ok(!string, "GetMemberTypeName failed, got \"%s\", expected NULL\n", string);
1904
1905 t11 = t11_dummy->lpVtbl->GetMemberTypeByIndex(t11_dummy, 0xffffffff);
1906 ok(t11_dummy == t11, "GetMemberTypeByIndex failed, got %p, expected %p\n", t11, t11_dummy);
1907
1908 t11 = t11_valid->lpVtbl->GetMemberTypeByIndex(t11_valid, 0xffffffff);
1909 ok(t11_dummy == t11, "GetMemberTypeByIndex failed, got %p, expected %p\n", t11, t11_dummy);
1910
1911 t11 = t11_dummy->lpVtbl->GetMemberTypeByName(t11_dummy, NULL);
1912 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1913
1914 t11 = t11_dummy->lpVtbl->GetMemberTypeByName(t11_dummy, "invalid");
1915 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1916
1917 t11 = t11_valid->lpVtbl->GetMemberTypeByName(t11_valid, NULL);
1918 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1919
1920 t11 = t11_valid->lpVtbl->GetMemberTypeByName(t11_valid, "invalid");
1921 ok(t11_dummy == t11, "GetMemberTypeByName failed, got %p, expected %p\n", t11, t11_dummy);
1922
1923#if D3D_COMPILER_VERSION
1924 hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_dummy);
1925 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1926
1927 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_dummy);
1928 ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
1929
1930 hr = t11_dummy->lpVtbl->IsEqual(t11_dummy, t11_valid);
1931 ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
1932
1933 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11_valid);
1934 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
1935#endif
1936
1937 /* constant buffers */
1939 {
1941
1942 cb11 = ref11->lpVtbl->GetConstantBufferByIndex(ref11, i);
1943 ok(cb11_dummy != cb11, "Got dummy constant buffer, i %u.\n", i);
1944
1945 hr = cb11->lpVtbl->GetDesc(cb11, &cbdesc);
1946 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1947
1948 ok(!strcmp(cbdesc.Name, pcbdesc->Name), "Got unexpected name \"%s\", i %u.\n", cbdesc.Name, i);
1949 ok(cbdesc.Type == pcbdesc->Type, "Got unexpected Type %#x, i %u.\n", cbdesc.Type, i);
1950 ok(cbdesc.Variables == pcbdesc->Variables, "Got unexpected Variables %u, i %u.\n", cbdesc.Variables, i);
1951 ok(cbdesc.Size == pcbdesc->Size, "Got unexpected Size %u, i %u.\n", cbdesc.Size, i);
1952 ok(cbdesc.uFlags == pcbdesc->uFlags, "Got unexpected uFlags %#x, i %u.\n", cbdesc.uFlags, i);
1953
1954 if (ref12)
1955 {
1956 cb12 = ref12->lpVtbl->GetConstantBufferByIndex(ref12, i);
1957 ok(cb12_dummy != cb12, "Got dummy constant buffer, i %u.\n", i);
1958
1959 hr = cb12->lpVtbl->GetDesc(cb12, &cbdesc12);
1960 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1961
1962 ok(!strcmp(cbdesc12.Name, pcbdesc->Name), "Got unexpected name \"%s\", i %u.\n", cbdesc.Name, i);
1963 ok(cbdesc.Type == pcbdesc->Type, "Got unexpected Type %#x, i %u.\n", cbdesc.Type, i);
1964 ok(!memcmp(&cbdesc12.Type, &cbdesc.Type, sizeof(cbdesc) - offsetof(D3D11_SHADER_BUFFER_DESC, Type)),
1965 "CB description does not match. i %u.\n", i);
1966 }
1967 }
1968
1969 /* variables */
1971 {
1973
1975 v11 = ref11->lpVtbl->GetVariableByName(ref11, pvdesc->Name);
1976 else
1977 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, pvdesc->Name);
1978 ok(v11_dummy != v11, "Test %u, got unexpected variable %p.\n", i, v11);
1979
1981 {
1982 vdesc.StartTexture = 0xdeadbeef;
1983 vdesc.TextureSize = 0xdeadbeef;
1984 vdesc.StartSampler = 0xdeadbeef;
1985 vdesc.SamplerSize = 0xdeadbeef;
1986 }
1987 else
1988 {
1989 vdesc.StartTexture = 0xffffffff;
1990 vdesc.StartSampler = 0xffffffff;
1991 }
1992
1993 hr = v11->lpVtbl->GetDesc(v11, &vdesc);
1994 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
1995
1996 ok(!strcmp(vdesc.Name, pvdesc->Name), "Got unexpected name \"%s\", i %u", vdesc.Name, i);
1997 ok(vdesc.StartOffset == pvdesc->StartOffset, "Got unexpected StartOffset %u, i %u.\n",
1998 vdesc.StartOffset, i);
1999 ok(vdesc.Size == pvdesc->Size, "Got unexpected Size %u, i %u.\n", vdesc.Size, i);
2000 ok(vdesc.uFlags == pvdesc->uFlags, "Got unexpected uFlags %#x, i %u.\n", vdesc.uFlags, i);
2001 ok(vdesc.DefaultValue == pvdesc->DefaultValue, "Got unexpected DefaultValue %p, i %u.\n",
2002 vdesc.DefaultValue, i);
2003 ok(vdesc.StartTexture == 0xffffffff, "Got unexpected StartTexture %#x, i %u.\n", vdesc.StartTexture, i);
2004 ok(!vdesc.TextureSize, "Got unexpected TextureSize %u, i %u.\n", vdesc.TextureSize, i);
2005 ok(vdesc.StartSampler == 0xffffffff, "Got unexpected StartSampler %u, i %u.\n", vdesc.StartSampler, i);
2006 ok(!vdesc.SamplerSize, "Got unexpected SamplerSize %u, i %u.\n", vdesc.SamplerSize, i);
2007
2008 if (ref12)
2009 {
2010 v12 = ref12->lpVtbl->GetVariableByName(ref12, pvdesc->Name);
2011 ok(v12_dummy != v12, "Test %u, got unexpected variable %p.\n", i, v12);
2012 hr = v12->lpVtbl->GetDesc(v12, &vdesc12);
2013 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
2014 ok(!strcmp(vdesc12.Name, pvdesc->Name), "Got unexpected name \"%s\", i %u", vdesc12.Name, i);
2015 ok(!memcmp(&vdesc12.StartOffset, &vdesc.StartOffset,
2016 sizeof(vdesc) - offsetof(D3D11_SHADER_VARIABLE_DESC, StartOffset)),
2017 "D3D11 and D3D12 descs do not match.\n");
2018 }
2019 else
2020 {
2021 /* Silence compiler warning. */
2022 v12 = NULL;
2023 }
2024
2025 /* types */
2027
2028 t11 = v11->lpVtbl->GetType(v11);
2029 ok(t11_dummy != t11, "Got unexpected type %p, i %u.\n", t11, i);
2030
2031 hr = t11->lpVtbl->GetDesc(t11, &tdesc);
2032 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
2033
2034 ok(tdesc.Class == ptdesc->Class, "Got unexpected Class %u, i %u.\n", tdesc.Class, i);
2035 ok(tdesc.Type == ptdesc->Type, "Got unexpected Type %u, i %u.\n", tdesc.Type, i);
2036 ok(tdesc.Rows == ptdesc->Rows, "Got unexpected Rows %u, i %u.\n", tdesc.Rows, i);
2037 ok(tdesc.Columns == ptdesc->Columns, "Got unexpected Columns %u, i %u.\n", tdesc.Columns, i);
2038 ok(tdesc.Elements == ptdesc->Elements, "Got unexpected Elements %u, i %u.\n", tdesc.Elements, i);
2039 ok(tdesc.Offset == ptdesc->Offset, "Got unexpected Offset %u, i %u.\n", tdesc.Offset, i);
2041 ok(!strcmp(tdesc.Name, ptdesc->Name), "Got unexpected Name %s, i %u.\n", debugstr_a(tdesc.Name), i);
2042
2043 if (ref12)
2044 {
2045 t12 = v12->lpVtbl->GetType(v12);
2046 ok(t12_dummy != t12, "Got unexpected type %p, i %u.\n", t12, i);
2047
2048 hr = t12->lpVtbl->GetDesc(t12, &tdesc12);
2049 ok(hr == S_OK, "%u: Got unexpected hr %#lx.\n", i, hr);
2050 ok(!memcmp(&tdesc12, &tdesc, offsetof(D3D11_SHADER_TYPE_DESC, Name)),
2051 "D3D11 and D3D12 descs do not match.\n");
2052 ok(!strcmp(tdesc12.Name, ptdesc->Name), "Got unexpected Name %s, i %u.\n", debugstr_a(tdesc12.Name), i);
2053 }
2054 }
2055
2056 /* types */
2058 v11 = ref11->lpVtbl->GetVariableByName(ref11, "t");
2059 else
2060 v11 = cb11_valid->lpVtbl->GetVariableByName(cb11_valid, pvdesc->Name);
2061 ok(v11_dummy != v11, "Got unexpected variable %p.\n", v11);
2062
2063 t11 = v11->lpVtbl->GetType(v11);
2064 ok(t11 != t11_dummy, "Got unexpected type %p.\n", t11);
2065
2066 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 0);
2067 ok(t != t11_dummy, "Got unexpected type %p.\n", t);
2068
2069 t2 = t11->lpVtbl->GetMemberTypeByName(t11, "a");
2070 ok(t == t2, "Got unexpected type %p.\n", t2);
2071
2072 string = t11->lpVtbl->GetMemberTypeName(t11, 0);
2073 ok(!strcmp(string, "a"), "Got unexpected string \"%s\".\n", string);
2074
2075 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 1);
2076 ok(t != t11_dummy, "Got unexpected type %p.\n", t);
2077
2078 t2 = t11->lpVtbl->GetMemberTypeByName(t11, "b");
2079 ok(t == t2, "Got unexpected type %p.\n", t2);
2080
2081 string = t11->lpVtbl->GetMemberTypeName(t11, 1);
2082 ok(!strcmp(string, "b"), "Got unexpected string \"%s\".\n", string);
2083
2084#if D3D_COMPILER_VERSION
2085 /* float vs float (in struct) */
2086 hr = t11->lpVtbl->IsEqual(t11, t11_valid);
2087 ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
2088
2089 hr = t11_valid->lpVtbl->IsEqual(t11_valid, t11);
2090 ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
2091
2092 /* float vs float */
2093 t = t11->lpVtbl->GetMemberTypeByIndex(t11, 0);
2094 ok(t != t11_dummy, "Got unexpected type %p.\n", t);
2095
2096 t2 = t11->lpVtbl->GetMemberTypeByIndex(t11, 1);
2097 ok(t2 != t11_dummy, "Got unexpected type %p.\n", t2);
2098
2099 hr = t->lpVtbl->IsEqual(t, t2);
2100 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
2101#endif
2102
2103 if (ref12)
2104 {
2105 v12 = ref12->lpVtbl->GetVariableByName(ref12, "t");
2106 ok(v12_dummy != v12, "Got unexpected variable %p.\n", v12);
2107
2108 t12 = v12->lpVtbl->GetType(v12);
2109 ok(t12 != t12_dummy, "Got unexpected type %p.\n", t12);
2110
2111 mt12 = t12->lpVtbl->GetMemberTypeByIndex(t12, 0);
2112 ok(mt12 != t12_dummy, "Got unexpected type %p.\n", mt12);
2113
2114 mt12_2 = t12->lpVtbl->GetMemberTypeByName(t12, "a");
2115 ok(mt12 == mt12_2, "Got unexpected type %p.\n", mt12_2);
2116
2117 string = t12->lpVtbl->GetMemberTypeName(t12, 0);
2118 ok(!strcmp(string, "a"), "Got unexpected string \"%s\".\n", string);
2119
2120 mt12 = t12->lpVtbl->GetMemberTypeByIndex(t12, 1);
2121 ok(mt12 != t12_dummy, "Got unexpected type %p.\n", mt12);
2122
2123 mt12_2 = t12->lpVtbl->GetMemberTypeByName(t12, "b");
2124 ok(mt12 == mt12_2, "Got unexpected type %p.\n", mt12_2);
2125
2126 string = t12->lpVtbl->GetMemberTypeName(t12, 1);
2127 ok(!strcmp(string, "b"), "Got unexpected string \"%s\".\n", string);
2128
2129 hr = t12->lpVtbl->IsEqual(t12, t12_valid);
2130 ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
2131
2132 hr = t12_valid->lpVtbl->IsEqual(t12_valid, t12);
2133 ok(hr == S_FALSE, "Got unexpected hr %#lx.\n", hr);
2134
2135 mt12 = t12->lpVtbl->GetMemberTypeByIndex(t12, 0);
2136 ok(mt12 != t12_dummy, "Got unexpected type %p.\n", mt12);
2137
2138 mt12_2 = t12->lpVtbl->GetMemberTypeByIndex(t12, 1);
2139 ok(mt12_2 != t12_dummy, "Got unexpected type %p.\n", mt12_2);
2140
2141 hr = mt12->lpVtbl->IsEqual(mt12, mt12_2);
2142 ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
2143
2144 count = ref12->lpVtbl->Release(ref12);
2145 ok(!count, "Got unexpected ref count %lu.\n", count);
2146 }
2147 count = ref11->lpVtbl->Release(ref11);
2148 ok(!count, "Got unexpected ref count %lu.\n", count);
2149}
2150
2151/*
2152 * fxc.exe /E PS /Tps_5_1 /Fo
2153 */
2154#if 0
2155Texture2D tex1 : register(t1, space1);
2156SamplerState sam
2157{
2158 Filter = MIN_MAG_MIP_LINEAR;
2159 AddressU = Wrap;
2160 AddressV = Wrap;
2161};
2162cbuffer c1 : register(b0, space0)
2163{
2164 float x;
2165 float y[2];
2166 int z;
2167};
2168cbuffer c2 : register(b0, space1)
2169{
2170 float t;
2171};
2172
2173float4 PS(float2 uv : TEXCOORD0) : sv_target
2174{
2175 float4 q = tex1.Sample(sam, uv);
2176 q.x = q.x + x;
2177 q.w = q.w + y[0] + y[1] + t;
2178 return q;
2179}
2180#endif
2182{
2183 0x43425844, 0x01b901c9, 0xaa053e53, 0x0b6ee9ab, 0x66bcfb8c, 0x00000001, 0x0000051c, 0x00000005,
2184 0x00000034, 0x000002a4, 0x000002d8, 0x0000030c, 0x00000480, 0x46454452, 0x00000268, 0x00000002,
2185 0x000000ec, 0x00000004, 0x0000003c, 0xffff0501, 0x00000500, 0x0000023e, 0x25441313, 0x0000003c,
2186 0x00000018, 0x00000028, 0x00000028, 0x00000024, 0x0000000c, 0x00000000, 0x000000dc, 0x00000003,
2187 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
2188 0x000000e0, 0x00000002, 0x00000005, 0x00000004, 0xffffffff, 0x00000001, 0x00000001, 0x0000000c,
2189 0x00000001, 0x00000000, 0x000000e5, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2190 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x000000e8, 0x00000000, 0x00000000, 0x00000000,
2191 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x006d6173, 0x31786574,
2192 0x00316300, 0xab003263, 0x000000e5, 0x00000003, 0x0000011c, 0x00000030, 0x00000000, 0x00000000,
2193 0x000000e8, 0x00000001, 0x00000214, 0x00000010, 0x00000000, 0x00000000, 0x00000194, 0x00000000,
2194 0x00000004, 0x00000002, 0x0000019c, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000,
2195 0x000001c0, 0x00000010, 0x00000014, 0x00000002, 0x000001c4, 0x00000000, 0xffffffff, 0x00000000,
2196 0xffffffff, 0x00000000, 0x000001e8, 0x00000024, 0x00000004, 0x00000000, 0x000001f0, 0x00000000,
2197 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x6c660078, 0x0074616f, 0x00030000, 0x00010001,
2198 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000196, 0xabab0079,
2199 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2200 0x00000196, 0x6e69007a, 0xabab0074, 0x00020000, 0x00010001, 0x00000000, 0x00000000, 0x00000000,
2201 0x00000000, 0x00000000, 0x00000000, 0x000001ea, 0x0000023c, 0x00000000, 0x00000004, 0x00000002,
2202 0x0000019c, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0x694d0074, 0x736f7263,
2203 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120,
2204 0xabab0031, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000,
2205 0x00000003, 0x00000000, 0x00000303, 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000002c,
2206 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f,
2207 0x745f7673, 0x65677261, 0xabab0074, 0x58454853, 0x0000016c, 0x00000051, 0x0000005b, 0x0100086a,
2208 0x07000059, 0x00308e46, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x07000059,
2209 0x00308e46, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0600005a, 0x00306e46,
2210 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07001858, 0x00307e46, 0x00000000, 0x00000001,
2211 0x00000001, 0x00005555, 0x00000001, 0x03001062, 0x00101032, 0x00000000, 0x03000065, 0x001020f2,
2212 0x00000000, 0x02000068, 0x00000001, 0x0b000045, 0x001000f2, 0x00000000, 0x00101046, 0x00000000,
2213 0x00207e46, 0x00000000, 0x00000001, 0x00206000, 0x00000000, 0x00000000, 0x09000000, 0x00102012,
2214 0x00000000, 0x0010000a, 0x00000000, 0x0030800a, 0x00000000, 0x00000000, 0x00000000, 0x09000000,
2215 0x00100012, 0x00000000, 0x0010003a, 0x00000000, 0x0030800a, 0x00000000, 0x00000000, 0x00000001,
2216 0x09000000, 0x00100012, 0x00000000, 0x0010000a, 0x00000000, 0x0030800a, 0x00000000, 0x00000000,
2217 0x00000002, 0x09000000, 0x00102082, 0x00000000, 0x0010000a, 0x00000000, 0x0030800a, 0x00000001,
2218 0x00000000, 0x00000000, 0x05000036, 0x00102062, 0x00000000, 0x00100656, 0x00000000, 0x0100003e,
2219 0x54415453, 0x00000094, 0x00000007, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
2220 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2221 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
2222 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2223 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2224};
2225
2227{
2228 {"sam", D3D_SIT_SAMPLER, 0, 1, 0, 0, D3D_SRV_DIMENSION_UNKNOWN, 0},
2229 {"tex1", D3D_SIT_TEXTURE, 1, 1, 12, D3D_RETURN_TYPE_FLOAT, D3D_SRV_DIMENSION_TEXTURE2D, 0xffffffff, 1, 0},
2232};
2233
2234START_TEST(reflection)
2235{
2236#if D3D_COMPILER_VERSION
2237 test_reflection_references();
2238 test_reflection_interfaces();
2239#else
2241#endif
2252}
#define POSITION
Type
Definition: Type.h:7
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
static REGSAM sam
Definition: query.c:143
#define NORMAL
Definition: main.h:128
#define ARRAY_SIZE(A)
Definition: main.h:20
const GUID IID_IUnknown
r l[0]
Definition: byte_order.h:168
#define D3DERR_INVALIDCALL
Definition: d3d10_private.h:42
#define D3D_COMPILER_VERSION
Definition: d3d11shader.h:26
@ D3D_SIF_USERPACKED
Definition: d3dcommon.idl:283
@ D3D11_SVC_INTERFACE_POINTER
Definition: d3dcommon.idl:149
@ D3D_SVC_SCALAR
Definition: d3dcommon.idl:134
@ D3D_SVC_STRUCT
Definition: d3dcommon.idl:139
@ D3D_SVT_INT
Definition: d3dcommon.idl:170
@ D3D_SVT_VOID
Definition: d3dcommon.idl:168
@ D3D_SVT_FLOAT
Definition: d3dcommon.idl:171
@ D3D11_SVT_INTERFACE_POINTER
Definition: d3dcommon.idl:263
@ D3D_SRV_DIMENSION_TEXTURE2D
Definition: d3dcommon.idl:553
@ D3D_SRV_DIMENSION_UNKNOWN
Definition: d3dcommon.idl:549
D3D_NAME
Definition: d3dcommon.idl:635
@ D3D_NAME_POSITION
Definition: d3dcommon.idl:637
@ D3D_NAME_CLIP_DISTANCE
Definition: d3dcommon.idl:638
@ D3D_NAME_UNDEFINED
Definition: d3dcommon.idl:636
@ D3D_NAME_IS_FRONT_FACE
Definition: d3dcommon.idl:645
@ D3D_NAME_TARGET
Definition: d3dcommon.idl:656
@ D3D_NAME_PRIMITIVE_ID
Definition: d3dcommon.idl:643
@ D3D_NAME_RENDER_TARGET_ARRAY_INDEX
Definition: d3dcommon.idl:640
@ D3D_NAME_DEPTH_LESS_EQUAL
Definition: d3dcommon.idl:660
@ D3D_NAME_CULL_DISTANCE
Definition: d3dcommon.idl:639
@ D3D11_NAME_DEPTH_GREATER_EQUAL
Definition: d3dcommon.idl:683
@ D3D_NAME_DEPTH
Definition: d3dcommon.idl:657
@ D3D_NAME_INSTANCE_ID
Definition: d3dcommon.idl:644
@ D3D_NAME_COVERAGE
Definition: d3dcommon.idl:658
@ D3D_NAME_VERTEX_ID
Definition: d3dcommon.idl:642
@ D3D_RETURN_TYPE_FLOAT
Definition: d3dcommon.idl:614
@ D3D_SIT_SAMPLER
Definition: d3dcommon.idl:697
@ D3D_SIT_TEXTURE
Definition: d3dcommon.idl:696
@ D3D_SIT_CBUFFER
Definition: d3dcommon.idl:694
D3D_MIN_PRECISION
Definition: d3dcommon.idl:522
@ D3D_CT_CBUFFER
Definition: d3dcommon.idl:535
@ D3D_CT_INTERFACE_POINTERS
Definition: d3dcommon.idl:537
D3D_REGISTER_COMPONENT_TYPE
Definition: d3dcommon.idl:597
@ D3D_REGISTER_COMPONENT_FLOAT32
Definition: d3dcommon.idl:601
@ D3D_REGISTER_COMPONENT_UINT32
Definition: d3dcommon.idl:599
HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector)
HRESULT expected_hr
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
UINT32 uint
Definition: types.h:83
#define ID3D11ShaderReflectionType
Definition: reflection.c:30
#define ID3D11ShaderReflectionConstantBuffer
Definition: reflection.c:28
#define ID3D11ShaderReflection
Definition: reflection.c:26
#define ID3D11ShaderReflectionVariable
Definition: reflection.c:32
#define IID_ID3D11ShaderReflection
Definition: reflection.c:34
#define D3D11_SHADER_INPUT_BIND_DESC
Definition: reflection.c:37
HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector)
Definition: reflection.c:1969
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
return ret
Definition: mutex.c:147
int main()
Definition: test.c:6
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
FT_Vector * vec
Definition: ftbbox.c:469
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble t
Definition: gl.h:2047
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLuint res
Definition: glext.h:9613
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
Definition: glext.h:8308
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLdouble GLdouble z
Definition: glext.h:5874
const GLfloat * m
Definition: glext.h:10848
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
HRESULT GetDesc(D3D12_SHADER_BUFFER_DESC *desc)
ID3D12ShaderReflectionVariable * GetVariableByIndex(UINT index)
ID3D12ShaderReflectionType * GetMemberTypeByIndex(UINT index)
HRESULT GetDesc(D3D12_SHADER_TYPE_DESC *desc)
ID3D12ShaderReflectionType * GetMemberTypeByName(const char *name)
HRESULT IsEqual(ID3D12ShaderReflectionType *type)
const char * GetMemberTypeName(UINT index)
HRESULT GetDesc(D3D12_SHADER_VARIABLE_DESC *desc)
ID3D12ShaderReflectionType * GetType()
UINT GetConversionInstructionCount()
HRESULT GetOutputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc)
ID3D12ShaderReflectionVariable * GetVariableByName(const char *name)
HRESULT GetResourceBindingDescByName(const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc)
HRESULT GetResourceBindingDesc(UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc)
ID3D12ShaderReflectionConstantBuffer * GetConstantBufferByIndex(UINT index)
HRESULT GetDesc(D3D12_SHADER_DESC *desc)
HRESULT GetInputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
nsresult QueryInterface(nsIIDRef riid, void **result)
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
struct _SIZE * PSIZE
#define d
Definition: ke_i.h:81
#define e
Definition: ke_i.h:82
#define f
Definition: ke_i.h:83
#define a
Definition: ke_i.h:78
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79
#define debugstr_a
Definition: kernel32.h:31
#define todo_wine_if(is_todo)
Definition: minitest.h:81
#define todo_wine
Definition: minitest.h:80
char string[160]
Definition: util.h:11
static struct test_info tests[]
BOOL expected
Definition: store.c:2000
static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_ps_resultin[]
Definition: reflection.c:748
static const D3D12_SHADER_INPUT_BIND_DESC test_reflection_bound_resources_sm51_result[]
Definition: reflection.c:2226
static const DWORD test_reflection_bound_resources_blob[]
Definition: reflection.c:1149
static const DWORD test_reflection_desc_ps_output_blob_4[]
Definition: reflection.c:1015
static const D3D11_SHADER_TYPE_DESC test_reflection_constant_buffer_type_result[]
Definition: reflection.c:1695
static const D3D11_SHADER_BUFFER_DESC test_reflection_constant_buffer_cb_result[]
Definition: reflection.c:1675
static DWORD test_reflection_desc_ps_blob[]
Definition: reflection.c:674
static void test_reflection_desc_vs(void)
Definition: reflection.c:408
static void test_reflection_constant_buffer(void)
Definition: reflection.c:1704
static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_ps_resultout[]
Definition: reflection.c:760
static const DWORD test_reflection_desc_ps_output_blob_1[]
Definition: reflection.c:965
static const DWORD test_reflection_desc_ps_output_blob_3[]
Definition: reflection.c:999
static const struct @1914 test_reflection_constant_buffer_variable_result[]
static void test_reflection_cs(void)
Definition: reflection.c:1200
static void test_reflection_desc_ps_output(void)
Definition: reflection.c:1040
static DWORD shader_creator[]
Definition: reflection.c:50
static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_vs_resultout[]
Definition: reflection.c:380
static void test_reflection_desc_ps(void)
Definition: reflection.c:768
static const DWORD test_reflection_desc_ps_output_blob_5[]
Definition: reflection.c:1031
static const DWORD test_reflection_desc_ps_output_blob_0[]
Definition: reflection.c:948
static void test_d3d10_interfaces(void)
Definition: reflection.c:215
static HRESULT call_reflect(const void *data, SIZE_T data_size, REFIID riid, void **reflection)
Definition: reflection.c:40
static const DWORD test_reflection_bound_resources_sm51_blob[]
Definition: reflection.c:2181
static DWORD test_reflection_desc_vs_blob[]
Definition: reflection.c:298
static const D3D11_SIGNATURE_PARAMETER_DESC test_reflection_desc_vs_resultin[]
Definition: reflection.c:361
static DWORD test_reflection_blob[]
Definition: reflection.c:64
static void test_reflection_bound_resources(const DWORD *blob, const D3D12_SHADER_INPUT_BIND_DESC *result, unsigned int result_count, unsigned int target_version)
Definition: reflection.c:1275
static const D3D12_SHADER_INPUT_BIND_DESC test_reflection_bound_resources_result[]
Definition: reflection.c:1191
static DWORD test_reflection_constant_buffer_blob[]
Definition: reflection.c:1639
static const DWORD test_reflection_desc_ps_output_blob_2[]
Definition: reflection.c:982
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
int k
Definition: mpi.c:3369
#define REFIID
Definition: guiddef.h:118
#define test
Definition: rosglue.h:37
#define offsetof(TYPE, MEMBER)
#define memset(x, y, z)
Definition: compat.h:39
#define COLOR
Definition: utils.c:23
D3D_MIN_PRECISION MinPrecision
Definition: reflection.c:405
D3D_REGISTER_COMPONENT_TYPE ComponentType
Definition: reflection.c:401
FT_Pos x
Definition: ftimage.h:77
FT_Pos y
Definition: ftimage.h:78
D3D_CBUFFER_TYPE Type
Definition: d3d11shader.h:120
UINT TextureCompInstructions
Definition: d3d11shader.h:66
D3D_TESSELLATOR_PARTITIONING HSPartitioning
Definition: d3d11shader.h:85
UINT GSMaxOutputVertexCount
Definition: d3d11shader.h:79
UINT TextureGradientInstructions
Definition: d3d11shader.h:68
UINT PatchConstantParameters
Definition: d3d11shader.h:81
const char * Creator
Definition: d3d11shader.h:53
UINT TextureBiasInstructions
Definition: d3d11shader.h:67
UINT StaticFlowControlCount
Definition: d3d11shader.h:72
D3D_PRIMITIVE InputPrimitive
Definition: d3d11shader.h:80
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology
Definition: d3d11shader.h:78
D3D_TESSELLATOR_DOMAIN TessellatorDomain
Definition: d3d11shader.h:86
UINT cInterlockedInstructions
Definition: d3d11shader.h:88
UINT TextureLoadInstructions
Definition: d3d11shader.h:65
UINT DynamicFlowControlCount
Definition: d3d11shader.h:73
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive
Definition: d3d11shader.h:84
UINT cTextureStoreInstructions
Definition: d3d11shader.h:89
UINT TextureNormalInstructions
Definition: d3d11shader.h:64
UINT MacroInstructionCount
Definition: d3d11shader.h:74
UINT FloatInstructionCount
Definition: d3d11shader.h:69
UINT ArrayInstructionCount
Definition: d3d11shader.h:75
D3D_SRV_DIMENSION Dimension
Definition: d3d11shader.h:134
D3D_SHADER_INPUT_TYPE Type
Definition: d3d11shader.h:129
D3D_RESOURCE_RETURN_TYPE ReturnType
Definition: d3d11shader.h:133
D3D_SHADER_VARIABLE_CLASS Class
Definition: d3d11shader.h:107
D3D_SHADER_VARIABLE_TYPE Type
Definition: d3d11shader.h:108
D3D_REGISTER_COMPONENT_TYPE ComponentType
Definition: d3d11shader.h:144
D3D_SHADER_INPUT_TYPE Type
D3D_RESOURCE_RETURN_TYPE ReturnType
Definition: image.c:229
const char * LPCSTR
Definition: typedefs.h:52
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
unsigned char BYTE
Definition: xxhash.c:193