push 87b6981010d7405c33b14cddcceec21b47729eba
[wine/hacks.git] / dlls / d3d10 / tests / effect.c
blobee96fb9bf18190d0ef65053f1a3ec42c8955c2b4
1 /*
2 * Copyright 2008 Henri Verbeet for CodeWeavers
3 * Copyright 2009 Rico Schüller
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #define COBJMACROS
21 #include "d3d10.h"
22 #include "wine/test.h"
24 static ID3D10Device *create_device(void)
26 ID3D10Device *device;
28 if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device)))
30 trace("Created a HW device\n");
31 return device;
34 trace("Failed to create a HW device, trying REF\n");
35 if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device)))
37 trace("Created a REF device\n");
38 return device;
41 trace("Failed to create a device, returning NULL\n");
42 return NULL;
45 static inline HRESULT create_effect(DWORD *data, UINT flags, ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect)
48 * Don't use sizeof(data), use data[6] as size,
49 * because the DWORD data[] has only complete DWORDs and
50 * so it could happen that there are padded bytes at the end.
52 * The fx size (data[6]) could be up to 3 BYTEs smaller
53 * than the sizeof(data).
55 return D3D10CreateEffectFromMemory(data, data[6], flags, device, effect_pool, effect);
59 * test_effect_constant_buffer_type
61 #if 0
62 cbuffer cb
64 float f1 : SV_POSITION;
65 float f2 : COLOR0;
67 #endif
68 static DWORD fx_test_ecbt[] = {
69 0x43425844, 0xc92a4732, 0xbd0d68c0, 0x877f71ee,
70 0x871fc277, 0x00000001, 0x0000010a, 0x00000001,
71 0x00000024, 0x30315846, 0x000000de, 0xfeff1001,
72 0x00000001, 0x00000002, 0x00000000, 0x00000000,
73 0x00000000, 0x00000000, 0x00000000, 0x00000042,
74 0x00000000, 0x00000000, 0x00000000, 0x00000000,
75 0x00000000, 0x00000000, 0x00000000, 0x00000000,
76 0x00000000, 0x00000000, 0x00000000, 0x66006263,
77 0x74616f6c, 0x00000700, 0x00000100, 0x00000000,
78 0x00000400, 0x00001000, 0x00000400, 0x00090900,
79 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49,
80 0x43003266, 0x524f4c4f, 0x00040030, 0x00100000,
81 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff,
82 0x00290000, 0x000d0000, 0x002c0000, 0x00000000,
83 0x00000000, 0x00000000, 0x00000000, 0x00380000,
84 0x000d0000, 0x003b0000, 0x00040000, 0x00000000,
85 0x00000000, 0x00000000, 0x52590000,
88 static void test_effect_constant_buffer_type(ID3D10Device *device)
90 ID3D10Effect *effect;
91 ID3D10EffectConstantBuffer *constantbuffer;
92 ID3D10EffectType *type, *type2, *null_type;
93 D3D10_EFFECT_TYPE_DESC type_desc;
94 HRESULT hr;
95 LPCSTR string;
96 unsigned int i;
98 hr = create_effect(fx_test_ecbt, 0, device, NULL, &effect);
99 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
101 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
102 type = constantbuffer->lpVtbl->GetType(constantbuffer);
104 hr = type->lpVtbl->GetDesc(type, &type_desc);
105 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
107 ok(strcmp(type_desc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc.TypeName);
108 ok(type_desc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_OBJECT);
109 ok(type_desc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_CBUFFER);
110 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
111 ok(type_desc.Members == 2, "Members is %u, expected 2\n", type_desc.Members);
112 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
113 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
114 ok(type_desc.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", type_desc.PackedSize);
115 ok(type_desc.UnpackedSize == 0x10, "UnpackedSize is %#x, expected 0x10\n", type_desc.UnpackedSize);
116 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
118 string = type->lpVtbl->GetMemberName(type, 0);
119 ok(strcmp(string, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string);
121 string = type->lpVtbl->GetMemberSemantic(type, 0);
122 ok(strcmp(string, "SV_POSITION") == 0, "GetMemberSemantic is \"%s\", expected \"SV_POSITION\"\n", string);
124 string = type->lpVtbl->GetMemberName(type, 1);
125 ok(strcmp(string, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string);
127 string = type->lpVtbl->GetMemberSemantic(type, 1);
128 ok(strcmp(string, "COLOR0") == 0, "GetMemberSemantic is \"%s\", expected \"COLOR0\"\n", string);
130 for (i = 0; i < 3; ++i)
132 if (i == 0) type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
133 else if (i == 1) type2 = type->lpVtbl->GetMemberTypeByName(type, "f1");
134 else type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "SV_POSITION");
136 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
137 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
139 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
140 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
141 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
142 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
143 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
144 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
145 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
146 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
147 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
148 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
150 if (i == 0) type2 = type->lpVtbl->GetMemberTypeByIndex(type, 1);
151 else if (i == 1) type2 = type->lpVtbl->GetMemberTypeByName(type, "f2");
152 else type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "COLOR0");
154 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
155 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
157 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
158 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
159 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
160 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
161 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
162 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
163 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
164 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
165 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
166 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
169 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
170 hr = type2->lpVtbl->GetDesc(type2, NULL);
171 ok(hr == E_INVALIDARG, "GetDesc got %x, expected %x\n", hr, E_INVALIDARG);
173 null_type = type->lpVtbl->GetMemberTypeByIndex(type, 3);
174 hr = null_type->lpVtbl->GetDesc(null_type, &type_desc);
175 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
177 hr = null_type->lpVtbl->GetDesc(null_type, NULL);
178 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
180 type2 = type->lpVtbl->GetMemberTypeByName(type, "invalid");
181 ok(type2 == null_type, "GetMemberTypeByName got wrong type %p, expected %p\n", type2, null_type);
183 type2 = type->lpVtbl->GetMemberTypeByName(type, NULL);
184 ok(type2 == null_type, "GetMemberTypeByName got wrong type %p, expected %p\n", type2, null_type);
186 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "invalid");
187 ok(type2 == null_type, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2, null_type);
189 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, NULL);
190 ok(type2 == null_type, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2, null_type);
192 string = type->lpVtbl->GetMemberName(type, 3);
193 ok(string == NULL, "GetMemberName is \"%s\", expected \"NULL\"\n", string);
195 string = type->lpVtbl->GetMemberSemantic(type, 3);
196 ok(string == NULL, "GetMemberSemantic is \"%s\", expected \"NULL\"\n", string);
198 effect->lpVtbl->Release(effect);
202 * test_effect_variable_type
204 #if 0
205 struct test
207 float f3 : SV_POSITION;
208 float f4 : COLOR0;
210 struct test1
212 float f1;
213 float f2;
214 test t;
216 cbuffer cb
218 test1 t1;
220 #endif
221 static DWORD fx_test_evt[] = {
222 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
223 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
224 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
225 0x00000001, 0x00000001, 0x00000000, 0x00000000,
226 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
227 0x00000000, 0x00000000, 0x00000000, 0x00000000,
228 0x00000000, 0x00000000, 0x00000000, 0x00000000,
229 0x00000000, 0x00000000, 0x00000000, 0x74006263,
230 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
231 0x00010000, 0x00000000, 0x00040000, 0x00100000,
232 0x00040000, 0x09090000, 0x32660000, 0x74007400,
233 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
234 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
235 0x00000300, 0x00000000, 0x00000800, 0x00001000,
236 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
237 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
238 0x00000400, 0x00001600, 0x00000700, 0x00000300,
239 0x00000000, 0x00001800, 0x00002000, 0x00001000,
240 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
241 0x00001600, 0x00003200, 0x00000000, 0x00000400,
242 0x00001600, 0x00003500, 0x00000000, 0x00001000,
243 0x00005500, 0x00317400, 0x00000004, 0x00000020,
244 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
245 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
246 0x00000000, 0x00000000, 0x00000000,
249 static void test_effect_variable_type(ID3D10Device *device)
251 ID3D10Effect *effect;
252 ID3D10EffectConstantBuffer *constantbuffer;
253 ID3D10EffectVariable *variable;
254 ID3D10EffectType *type, *type2, *type3;
255 D3D10_EFFECT_TYPE_DESC type_desc;
256 HRESULT hr;
257 LPCSTR string;
258 unsigned int i;
260 hr = create_effect(fx_test_evt, 0, device, NULL, &effect);
261 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
263 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
264 type = constantbuffer->lpVtbl->GetType(constantbuffer);
265 hr = type->lpVtbl->GetDesc(type, &type_desc);
266 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
268 ok(strcmp(type_desc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc.TypeName);
269 ok(type_desc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_OBJECT);
270 ok(type_desc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_CBUFFER);
271 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
272 ok(type_desc.Members == 1, "Members is %u, expected 1\n", type_desc.Members);
273 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
274 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
275 ok(type_desc.PackedSize == 0x10, "PackedSize is %#x, expected 0x10\n", type_desc.PackedSize);
276 ok(type_desc.UnpackedSize == 0x20, "UnpackedSize is %#x, expected 0x20\n", type_desc.UnpackedSize);
277 ok(type_desc.Stride == 0x20, "Stride is %#x, expected 0x20\n", type_desc.Stride);
279 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
280 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
281 type = variable->lpVtbl->GetType(variable);
282 hr = type->lpVtbl->GetDesc(type, &type_desc);
283 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
285 ok(strcmp(type_desc.TypeName, "test1") == 0, "TypeName is \"%s\", expected \"test1\"\n", type_desc.TypeName);
286 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
287 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
288 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
289 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
290 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
291 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
292 ok(type_desc.PackedSize == 0x10, "PackedSize is %#x, expected 0x10\n", type_desc.PackedSize);
293 ok(type_desc.UnpackedSize == 0x18, "UnpackedSize is %#x, expected 0x18\n", type_desc.UnpackedSize);
294 ok(type_desc.Stride == 0x20, "Stride is %#x, expected 0x20\n", type_desc.Stride);
296 string = type->lpVtbl->GetMemberName(type, 0);
297 ok(strcmp(string, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string);
299 string = type->lpVtbl->GetMemberName(type, 1);
300 ok(strcmp(string, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string);
302 string = type->lpVtbl->GetMemberName(type, 2);
303 ok(strcmp(string, "t") == 0, "GetMemberName is \"%s\", expected \"t\"\n", string);
305 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
306 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
307 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
309 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
310 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
311 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
312 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
313 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
314 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
315 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
316 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
317 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
318 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
320 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 1);
321 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
322 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
324 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
325 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
326 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
327 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
328 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
329 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
330 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
331 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
332 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
333 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
335 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 2);
336 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
337 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
339 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
340 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
341 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
342 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
343 ok(type_desc.Members == 2, "Members is %u, expected 2\n", type_desc.Members);
344 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
345 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
346 ok(type_desc.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", type_desc.PackedSize);
347 ok(type_desc.UnpackedSize == 0x8, "UnpackedSize is %#x, expected 0x8\n", type_desc.UnpackedSize);
348 ok(type_desc.Stride == 0x10, "Stride is %x, expected 0x10\n", type_desc.Stride);
350 for (i = 0; i < 3; ++i)
352 if (i == 0) type3 = type2->lpVtbl->GetMemberTypeByIndex(type2, 0);
353 else if (i == 1) type3 = type2->lpVtbl->GetMemberTypeByName(type2, "f3");
354 else type3 = type2->lpVtbl->GetMemberTypeBySemantic(type2, "SV_POSITION");
356 hr = type3->lpVtbl->GetDesc(type3, &type_desc);
357 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
359 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
360 type_desc.TypeName);
361 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
362 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
363 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
364 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
365 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
366 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
367 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
368 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
369 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
371 if (i == 0) type3 = type2->lpVtbl->GetMemberTypeByIndex(type2, 1);
372 else if (i == 1) type3 = type2->lpVtbl->GetMemberTypeByName(type2, "f4");
373 else type3 = type2->lpVtbl->GetMemberTypeBySemantic(type2, "COLOR0");
375 hr = type3->lpVtbl->GetDesc(type3, &type_desc);
376 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
378 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
379 type_desc.TypeName);
380 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
381 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
382 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
383 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
384 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
385 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
386 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
387 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
388 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
391 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
392 hr = type2->lpVtbl->GetDesc(type2, NULL);
393 ok(hr == E_INVALIDARG, "GetDesc got %x, expected %x\n", hr, E_INVALIDARG);
395 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 4);
396 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
397 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
399 type2 = type->lpVtbl->GetMemberTypeByName(type, "invalid");
400 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
401 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
403 type2 = type->lpVtbl->GetMemberTypeByName(type, NULL);
404 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
405 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
407 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "invalid");
408 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
409 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
411 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, NULL);
412 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
413 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
415 string = type->lpVtbl->GetMemberName(type, 4);
416 ok(string == NULL, "GetMemberName is \"%s\", expected NULL\n", string);
418 string = type->lpVtbl->GetMemberSemantic(type, 4);
419 ok(string == NULL, "GetMemberSemantic is \"%s\", expected NULL\n", string);
421 effect->lpVtbl->Release(effect);
425 * test_effect_variable_member
427 #if 0
428 struct test
430 float f3 : SV_POSITION;
431 float f4 : COLOR0;
433 struct test1
435 float f1;
436 float f2;
437 test t;
439 cbuffer cb
441 test1 t1;
443 #endif
444 static DWORD fx_test_evm[] = {
445 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
446 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
447 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
448 0x00000001, 0x00000001, 0x00000000, 0x00000000,
449 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
450 0x00000000, 0x00000000, 0x00000000, 0x00000000,
451 0x00000000, 0x00000000, 0x00000000, 0x00000000,
452 0x00000000, 0x00000000, 0x00000000, 0x74006263,
453 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
454 0x00010000, 0x00000000, 0x00040000, 0x00100000,
455 0x00040000, 0x09090000, 0x32660000, 0x74007400,
456 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
457 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
458 0x00000300, 0x00000000, 0x00000800, 0x00001000,
459 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
460 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
461 0x00000400, 0x00001600, 0x00000700, 0x00000300,
462 0x00000000, 0x00001800, 0x00002000, 0x00001000,
463 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
464 0x00001600, 0x00003200, 0x00000000, 0x00000400,
465 0x00001600, 0x00003500, 0x00000000, 0x00001000,
466 0x00005500, 0x00317400, 0x00000004, 0x00000020,
467 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
468 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
469 0x00000000, 0x00000000, 0x00000000,
472 static void test_effect_variable_member(ID3D10Device *device)
474 ID3D10Effect *effect;
475 ID3D10EffectConstantBuffer *constantbuffer;
476 ID3D10EffectVariable *variable, *variable2, *variable3, *null_variable;
477 D3D10_EFFECT_VARIABLE_DESC desc;
478 HRESULT hr;
480 hr = create_effect(fx_test_evm, 0, device, NULL, &effect);
481 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
483 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
484 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc);
485 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
487 ok(strcmp(desc.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc.Name);
488 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
489 ok(desc.Flags == 0, "Type is %u, expected 0\n", desc.Flags);
490 ok(desc.Annotations == 0, "Elements is %u, expected 0\n", desc.Annotations);
491 ok(desc.BufferOffset == 0, "Members is %u, expected 0\n", desc.BufferOffset);
492 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
494 null_variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 1);
495 hr = null_variable->lpVtbl->GetDesc(null_variable, &desc);
496 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
498 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
499 hr = variable->lpVtbl->GetDesc(variable, &desc);
500 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
502 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "t1");
503 ok(variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, variable);
504 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
505 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
507 ok(strcmp(desc.Name, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", desc.Name);
508 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
509 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
510 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
511 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
512 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
514 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "invalid");
515 ok(null_variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, null_variable);
517 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, NULL);
518 ok(null_variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, null_variable);
520 variable2 = constantbuffer->lpVtbl->GetMemberBySemantic(constantbuffer, "invalid");
521 ok(null_variable == variable2, "GetMemberBySemantic got %p, expected %p\n", variable2, null_variable);
523 variable2 = constantbuffer->lpVtbl->GetMemberBySemantic(constantbuffer, NULL);
524 ok(null_variable == variable2, "GetMemberBySemantic got %p, expected %p\n", variable2, null_variable);
526 /* check members of "t1" */
527 variable2 = variable->lpVtbl->GetMemberByName(variable, "f1");
528 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
529 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
531 ok(strcmp(desc.Name, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc.Name);
532 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
533 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
534 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
535 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
536 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
538 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 0);
539 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
541 variable2 = variable->lpVtbl->GetMemberByName(variable, "f2");
542 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
543 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
545 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
546 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
547 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
548 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
549 ok(desc.BufferOffset == 4, "BufferOffset is %u, expected 4\n", desc.BufferOffset);
550 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
552 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 1);
553 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
555 variable2 = variable->lpVtbl->GetMemberByName(variable, "t");
556 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
557 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
559 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
560 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
561 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
562 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
563 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
564 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
566 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 2);
567 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
569 /* check members of "t" */
570 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f3");
571 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
572 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
574 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
575 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
576 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
577 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
578 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
579 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
581 variable = variable2->lpVtbl->GetMemberBySemantic(variable2, "SV_POSITION");
582 ok(variable == variable3, "GetMemberBySemantic got %p, expected %p\n", variable, variable3);
584 variable = variable2->lpVtbl->GetMemberByIndex(variable2, 0);
585 ok(variable == variable3, "GetMemberByIndex got %p, expected %p\n", variable, variable3);
587 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f4");
588 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
589 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
591 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
592 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
593 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
594 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
595 ok(desc.BufferOffset == 20, "BufferOffset is %u, expected 20\n", desc.BufferOffset);
596 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
598 variable = variable2->lpVtbl->GetMemberBySemantic(variable2, "COLOR0");
599 ok(variable == variable3, "GetMemberBySemantic got %p, expected %p\n", variable, variable3);
601 variable = variable2->lpVtbl->GetMemberByIndex(variable2, 1);
602 ok(variable == variable3, "GetMemberByIndex got %p, expected %p\n", variable, variable3);
604 effect->lpVtbl->Release(effect);
608 * test_effect_variable_element
610 #if 0
611 struct test
613 float f3 : SV_POSITION;
614 float f4 : COLOR0;
615 float f5 : COLOR1;
617 struct test1
619 float f1;
620 float f2[3];
621 test t[2];
623 cbuffer cb
625 test1 t1;
627 #endif
628 static DWORD fx_test_eve[] = {
629 0x43425844, 0x6ea69fd9, 0x9b4e6390, 0x006f9f71,
630 0x57ad58f4, 0x00000001, 0x000001c2, 0x00000001,
631 0x00000024, 0x30315846, 0x00000196, 0xfeff1001,
632 0x00000001, 0x00000001, 0x00000000, 0x00000000,
633 0x00000000, 0x00000000, 0x00000000, 0x00000116,
634 0x00000000, 0x00000000, 0x00000000, 0x00000000,
635 0x00000000, 0x00000000, 0x00000000, 0x00000000,
636 0x00000000, 0x00000000, 0x00000000, 0x74006263,
637 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
638 0x00010000, 0x00000000, 0x00040000, 0x00100000,
639 0x00040000, 0x09090000, 0x32660000, 0x00001000,
640 0x00000100, 0x00000300, 0x00002400, 0x00001000,
641 0x00000c00, 0x00090900, 0x74007400, 0x00747365,
642 0x53003366, 0x4f505f56, 0x49544953, 0x66004e4f,
643 0x4f430034, 0x30524f4c, 0x00356600, 0x4f4c4f43,
644 0x53003152, 0x03000000, 0x02000000, 0x1c000000,
645 0x10000000, 0x18000000, 0x03000000, 0x58000000,
646 0x5b000000, 0x00000000, 0x16000000, 0x67000000,
647 0x6a000000, 0x04000000, 0x16000000, 0x71000000,
648 0x74000000, 0x08000000, 0x16000000, 0x07000000,
649 0x03000000, 0x00000000, 0x5c000000, 0x60000000,
650 0x28000000, 0x03000000, 0x0d000000, 0x00000000,
651 0x00000000, 0x16000000, 0x32000000, 0x00000000,
652 0x10000000, 0x35000000, 0x51000000, 0x00000000,
653 0x40000000, 0x7b000000, 0x74000000, 0x00040031,
654 0x00600000, 0x00000000, 0x00010000, 0xffff0000,
655 0x0000ffff, 0x01130000, 0x00c70000, 0x00000000,
656 0x00000000, 0x00000000, 0x00000000, 0x00000000,
657 0x00000000,
660 static void test_effect_variable_element(ID3D10Device *device)
662 ID3D10Effect *effect;
663 ID3D10EffectConstantBuffer *constantbuffer, *parent;
664 ID3D10EffectVariable *variable, *variable2, *variable3, *variable4, *variable5;
665 ID3D10EffectType *type, *type2;
666 D3D10_EFFECT_VARIABLE_DESC desc;
667 D3D10_EFFECT_TYPE_DESC type_desc;
668 HRESULT hr;
670 hr = create_effect(fx_test_eve, 0, device, NULL, &effect);
671 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
673 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
674 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc);
675 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
677 ok(strcmp(desc.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc.Name);
678 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
679 ok(desc.Flags == 0, "Type is %u, expected 0\n", desc.Flags);
680 ok(desc.Annotations == 0, "Elements is %u, expected 0\n", desc.Annotations);
681 ok(desc.BufferOffset == 0, "Members is %u, expected 0\n", desc.BufferOffset);
682 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
684 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
685 hr = variable->lpVtbl->GetDesc(variable, &desc);
686 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
688 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
689 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
690 parent, constantbuffer);
692 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "t1");
693 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
694 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
696 parent = variable2->lpVtbl->GetParentConstantBuffer(variable2);
697 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
699 /* check variable f1 */
700 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f1");
701 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
702 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
704 ok(strcmp(desc.Name, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc.Name);
705 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
706 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
707 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
708 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
709 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
711 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
712 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
713 parent, constantbuffer);
715 type = variable3->lpVtbl->GetType(variable3);
716 hr = type->lpVtbl->GetDesc(type, &type_desc);
717 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
719 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
720 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
721 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
722 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
723 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
724 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
725 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
726 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
727 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
728 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
730 /* check variable f2 */
731 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f2");
732 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
733 ok(SUCCEEDED(hr), "GetDesc failed (%x)!\n", hr);
735 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
736 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
737 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
738 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
739 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
740 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
742 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
743 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
744 parent, constantbuffer);
746 type = variable3->lpVtbl->GetType(variable3);
747 hr = type->lpVtbl->GetDesc(type, &type_desc);
748 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
750 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
751 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
752 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
753 ok(type_desc.Elements == 3, "Elements is %u, expected 3\n", type_desc.Elements);
754 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
755 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
756 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
757 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
758 ok(type_desc.UnpackedSize == 0x24, "UnpackedSize is %#x, expected 0x24\n", type_desc.UnpackedSize);
759 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
761 variable4 = variable3->lpVtbl->GetElement(variable3, 0);
762 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
763 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
765 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
766 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
767 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
768 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
769 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
770 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
772 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
773 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
774 parent, constantbuffer);
776 type = variable4->lpVtbl->GetType(variable4);
777 hr = type->lpVtbl->GetDesc(type, &type_desc);
778 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
780 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
781 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
782 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
783 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
784 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
785 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
786 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
787 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
788 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
789 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
791 variable4 = variable3->lpVtbl->GetElement(variable3, 1);
792 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
793 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
795 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
796 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
797 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
798 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
799 ok(desc.BufferOffset == 32, "BufferOffset is %u, expected 32\n", desc.BufferOffset);
800 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
802 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
803 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
804 parent, constantbuffer);
806 type2 = variable4->lpVtbl->GetType(variable4);
807 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
808 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
809 ok(type == type2, "type(%p) != type2(%p)\n", type, type2);
811 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
812 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
813 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
814 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
815 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
816 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
817 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
818 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
819 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
820 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
822 variable4 = variable3->lpVtbl->GetElement(variable3, 2);
823 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
824 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
826 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
827 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
828 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
829 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
830 ok(desc.BufferOffset == 48, "BufferOffset is %u, expected 48\n", desc.BufferOffset);
831 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
833 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
834 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
835 parent, constantbuffer);
837 type2 = variable4->lpVtbl->GetType(variable4);
838 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
839 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
840 ok(type == type2, "type(%p) != type2(%p)\n", type, type2);
842 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
843 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
844 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
845 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
846 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
847 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
848 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
849 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
850 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
851 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
853 /* check variable t */
854 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "t");
855 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
856 ok(SUCCEEDED(hr), "GetDesc failed (%x)!\n", hr);
858 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
859 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
860 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
861 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
862 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
863 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
865 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
866 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
867 parent, constantbuffer);
869 type = variable3->lpVtbl->GetType(variable3);
870 hr = type->lpVtbl->GetDesc(type, &type_desc);
871 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
873 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
874 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
875 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
876 ok(type_desc.Elements == 2, "Elements is %u, expected 2\n", type_desc.Elements);
877 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
878 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
879 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
880 ok(type_desc.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", type_desc.PackedSize);
881 ok(type_desc.UnpackedSize == 0x1c, "UnpackedSize is %#x, expected 0x1c\n", type_desc.UnpackedSize);
882 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
884 variable4 = variable3->lpVtbl->GetElement(variable3, 0);
885 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
886 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
888 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
889 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
890 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
891 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
892 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
893 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
895 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
896 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
897 parent, constantbuffer);
899 type = variable4->lpVtbl->GetType(variable4);
900 hr = type->lpVtbl->GetDesc(type, &type_desc);
901 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
903 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
904 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
905 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
906 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
907 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
908 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
909 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
910 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
911 ok(type_desc.UnpackedSize == 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc.UnpackedSize);
912 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
914 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 0);
915 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
916 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
918 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
919 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
920 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
921 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
922 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
923 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
925 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
926 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
928 type = variable5->lpVtbl->GetType(variable5);
929 hr = type->lpVtbl->GetDesc(type, &type_desc);
930 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
932 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
933 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
934 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
935 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
936 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
937 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
938 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
939 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
940 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
941 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
943 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 1);
944 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
945 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
947 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
948 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
949 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
950 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
951 ok(desc.BufferOffset == 68, "BufferOffset is %u, expected 68\n", desc.BufferOffset);
952 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
954 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
955 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
957 type = variable5->lpVtbl->GetType(variable5);
958 hr = type->lpVtbl->GetDesc(type, &type_desc);
959 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
961 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
962 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
963 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
964 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
965 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
966 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
967 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
968 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
969 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
970 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
972 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 2);
973 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
974 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
976 ok(strcmp(desc.Name, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc.Name);
977 ok(strcmp(desc.Semantic, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc.Semantic);
978 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
979 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
980 ok(desc.BufferOffset == 72, "BufferOffset is %u, expected 72\n", desc.BufferOffset);
981 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
983 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
984 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
986 type = variable5->lpVtbl->GetType(variable5);
987 hr = type->lpVtbl->GetDesc(type, &type_desc);
988 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
990 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
991 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
992 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
993 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
994 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
995 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
996 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
997 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
998 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
999 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1001 variable4 = variable3->lpVtbl->GetElement(variable3, 1);
1002 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
1003 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1005 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
1006 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
1007 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1008 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1009 ok(desc.BufferOffset == 80, "BufferOffset is %u, expected 80\n", desc.BufferOffset);
1010 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1012 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
1013 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
1014 parent, constantbuffer);
1016 type = variable4->lpVtbl->GetType(variable4);
1017 hr = type->lpVtbl->GetDesc(type, &type_desc);
1018 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1020 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
1021 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
1022 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
1023 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1024 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
1025 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
1026 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
1027 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
1028 ok(type_desc.UnpackedSize == 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc.UnpackedSize);
1029 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1031 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 0);
1032 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1033 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1035 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
1036 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
1037 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1038 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1039 ok(desc.BufferOffset == 80, "BufferOffset is %u, expected 80\n", desc.BufferOffset);
1040 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1042 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1043 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1045 type = variable5->lpVtbl->GetType(variable5);
1046 hr = type->lpVtbl->GetDesc(type, &type_desc);
1047 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1049 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1050 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1051 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1052 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1053 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1054 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1055 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1056 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1057 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1058 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1060 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 1);
1061 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1062 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1064 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
1065 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
1066 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1067 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1068 ok(desc.BufferOffset == 84, "BufferOffset is %u, expected 84\n", desc.BufferOffset);
1069 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1071 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1072 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1074 type = variable5->lpVtbl->GetType(variable5);
1075 hr = type->lpVtbl->GetDesc(type, &type_desc);
1076 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1078 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1079 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1080 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1081 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1082 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1083 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1084 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1085 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1086 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1087 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1089 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 2);
1090 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1091 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1093 ok(strcmp(desc.Name, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc.Name);
1094 ok(strcmp(desc.Semantic, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc.Semantic);
1095 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1096 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1097 ok(desc.BufferOffset == 88, "BufferOffset is %u, expected 88\n", desc.BufferOffset);
1098 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1100 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1101 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1103 type = variable5->lpVtbl->GetType(variable5);
1104 hr = type->lpVtbl->GetDesc(type, &type_desc);
1105 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1107 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1108 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1109 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1110 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1111 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1112 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1113 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1114 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1115 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1116 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1118 effect->lpVtbl->Release(effect);
1122 * test_effect_variable_type_class
1124 #if 0
1125 cbuffer cb <String s = "STRING";>
1127 float f;
1128 vector <int, 2> i;
1129 matrix <uint, 2, 3> u;
1130 row_major matrix <bool, 2, 3> b;
1132 BlendState blend;
1133 DepthStencilState depthstencil;
1134 RasterizerState rast;
1135 SamplerState sam;
1136 RenderTargetView rtv;
1137 DepthStencilView dsv;
1138 Texture1D t1;
1139 Texture1DArray t1a;
1140 Texture2D t2;
1141 Texture2DMS <float4, 4> t2dms;
1142 Texture2DArray t2a;
1143 Texture2DMSArray <float4, 4> t2dmsa;
1144 Texture3D t3;
1145 TextureCube tq;
1146 GeometryShader gs[2];
1147 PixelShader ps;
1148 VertexShader vs[1];
1149 #endif
1150 static DWORD fx_test_evtc[] = {
1151 0x43425844, 0xc04c50cb, 0x0afeb4ef, 0xbb93f346,
1152 0x97a29499, 0x00000001, 0x00000659, 0x00000001,
1153 0x00000024, 0x30315846, 0x0000062d, 0xfeff1001,
1154 0x00000001, 0x00000004, 0x00000011, 0x00000000,
1155 0x00000000, 0x00000000, 0x00000000, 0x000003d9,
1156 0x00000000, 0x00000008, 0x00000001, 0x00000001,
1157 0x00000001, 0x00000001, 0x00000001, 0x00000001,
1158 0x00000004, 0x00000000, 0x00000000, 0x53006263,
1159 0x6e697274, 0x00070067, 0x00020000, 0x00000000,
1160 0x00000000, 0x00000000, 0x00000000, 0x00010000,
1161 0x00730000, 0x49525453, 0x6600474e, 0x74616f6c,
1162 0x00003300, 0x00000100, 0x00000000, 0x00000400,
1163 0x00001000, 0x00000400, 0x00090900, 0x69006600,
1164 0x0032746e, 0x00000057, 0x00000001, 0x00000000,
1165 0x00000008, 0x00000010, 0x00000008, 0x00001112,
1166 0x69750069, 0x7832746e, 0x007a0033, 0x00010000,
1167 0x00000000, 0x00280000, 0x00300000, 0x00180000,
1168 0x5a1b0000, 0x00750000, 0x6c6f6f62, 0x00337832,
1169 0x000000a0, 0x00000001, 0x00000000, 0x0000001c,
1170 0x00000020, 0x00000018, 0x00001a23, 0x6c420062,
1171 0x53646e65, 0x65746174, 0x0000c600, 0x00000200,
1172 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1173 0x00000200, 0x656c6200, 0x4400646e, 0x68747065,
1174 0x6e657453, 0x536c6963, 0x65746174, 0x0000f300,
1175 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1176 0x00000000, 0x00000300, 0x70656400, 0x74736874,
1177 0x69636e65, 0x6152006c, 0x72657473, 0x72657a69,
1178 0x74617453, 0x012e0065, 0x00020000, 0x00000000,
1179 0x00000000, 0x00000000, 0x00000000, 0x00040000,
1180 0x61720000, 0x53007473, 0x6c706d61, 0x74537265,
1181 0x00657461, 0x0000015f, 0x00000002, 0x00000000,
1182 0x00000000, 0x00000000, 0x00000000, 0x00000015,
1183 0x006d6173, 0x646e6552, 0x61547265, 0x74656772,
1184 0x77656956, 0x00018c00, 0x00000200, 0x00000000,
1185 0x00000000, 0x00000000, 0x00000000, 0x00001300,
1186 0x76747200, 0x70654400, 0x74536874, 0x69636e65,
1187 0x6569566c, 0x01bd0077, 0x00020000, 0x00000000,
1188 0x00000000, 0x00000000, 0x00000000, 0x00140000,
1189 0x73640000, 0x65540076, 0x72757478, 0x00443165,
1190 0x000001ee, 0x00000002, 0x00000000, 0x00000000,
1191 0x00000000, 0x00000000, 0x0000000a, 0x54003174,
1192 0x75747865, 0x44316572, 0x61727241, 0x02170079,
1193 0x00020000, 0x00000000, 0x00000000, 0x00000000,
1194 0x00000000, 0x000b0000, 0x31740000, 0x65540061,
1195 0x72757478, 0x00443265, 0x00000246, 0x00000002,
1196 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1197 0x0000000c, 0x54003274, 0x75747865, 0x44326572,
1198 0x6f00534d, 0x02000002, 0x00000000, 0x00000000,
1199 0x00000000, 0x00000000, 0x0e000000, 0x74000000,
1200 0x736d6432, 0x78655400, 0x65727574, 0x72414432,
1201 0x00796172, 0x0000029d, 0x00000002, 0x00000000,
1202 0x00000000, 0x00000000, 0x00000000, 0x0000000d,
1203 0x00613274, 0x74786554, 0x32657275, 0x41534d44,
1204 0x79617272, 0x0002cc00, 0x00000200, 0x00000000,
1205 0x00000000, 0x00000000, 0x00000000, 0x00000f00,
1206 0x64327400, 0x0061736d, 0x74786554, 0x33657275,
1207 0x03000044, 0x00020000, 0x00000000, 0x00000000,
1208 0x00000000, 0x00000000, 0x00100000, 0x33740000,
1209 0x78655400, 0x65727574, 0x65627543, 0x00032900,
1210 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1211 0x00000000, 0x00001100, 0x00717400, 0x6d6f6547,
1212 0x79727465, 0x64616853, 0x54007265, 0x02000003,
1213 0x02000000, 0x00000000, 0x00000000, 0x00000000,
1214 0x07000000, 0x67000000, 0x69500073, 0x536c6578,
1215 0x65646168, 0x03820072, 0x00020000, 0x00000000,
1216 0x00000000, 0x00000000, 0x00000000, 0x00050000,
1217 0x73700000, 0x72655600, 0x53786574, 0x65646168,
1218 0x03ad0072, 0x00020000, 0x00010000, 0x00000000,
1219 0x00000000, 0x00000000, 0x00060000, 0x73760000,
1220 0x00000400, 0x00006000, 0x00000000, 0x00000400,
1221 0xffffff00, 0x000001ff, 0x00002a00, 0x00000e00,
1222 0x00002c00, 0x00005500, 0x00003900, 0x00000000,
1223 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1224 0x00007800, 0x00005c00, 0x00000000, 0x00000400,
1225 0x00000000, 0x00000000, 0x00000000, 0x00009e00,
1226 0x00008200, 0x00000000, 0x00001000, 0x00000000,
1227 0x00000000, 0x00000000, 0x0000c400, 0x0000a800,
1228 0x00000000, 0x00004000, 0x00000000, 0x00000000,
1229 0x00000000, 0x0000ed00, 0x0000d100, 0x00000000,
1230 0xffffff00, 0x000000ff, 0x00000000, 0x00012100,
1231 0x00010500, 0x00000000, 0xffffff00, 0x000000ff,
1232 0x00000000, 0x00015a00, 0x00013e00, 0x00000000,
1233 0xffffff00, 0x000000ff, 0x00000000, 0x00018800,
1234 0x00016c00, 0x00000000, 0xffffff00, 0x000000ff,
1235 0x00000000, 0x0001b900, 0x00019d00, 0x00000000,
1236 0xffffff00, 0x000000ff, 0x0001ea00, 0x0001ce00,
1237 0x00000000, 0xffffff00, 0x000000ff, 0x00021400,
1238 0x0001f800, 0x00000000, 0xffffff00, 0x000000ff,
1239 0x00024200, 0x00022600, 0x00000000, 0xffffff00,
1240 0x000000ff, 0x00026c00, 0x00025000, 0x00000000,
1241 0xffffff00, 0x000000ff, 0x00029700, 0x00027b00,
1242 0x00000000, 0xffffff00, 0x000000ff, 0x0002c800,
1243 0x0002ac00, 0x00000000, 0xffffff00, 0x000000ff,
1244 0x0002f900, 0x0002dd00, 0x00000000, 0xffffff00,
1245 0x000000ff, 0x00032600, 0x00030a00, 0x00000000,
1246 0xffffff00, 0x000000ff, 0x00035100, 0x00033500,
1247 0x00000000, 0xffffff00, 0x000000ff, 0x00037f00,
1248 0x00036300, 0x00000000, 0xffffff00, 0x000000ff,
1249 0x00000000, 0x00000000, 0x0003aa00, 0x00038e00,
1250 0x00000000, 0xffffff00, 0x000000ff, 0x00000000,
1251 0x0003d600, 0x0003ba00, 0x00000000, 0xffffff00,
1252 0x000000ff, 0x00000000, 0x00000000,
1255 static BOOL is_valid_check(BOOL a, BOOL b)
1257 return (a && b) || (!a && !b);
1260 static void check_as(ID3D10EffectVariable *variable)
1262 ID3D10EffectVariable *variable2;
1263 ID3D10EffectType *type;
1264 D3D10_EFFECT_TYPE_DESC td;
1265 BOOL ret, is_valid;
1266 HRESULT hr;
1268 type = variable->lpVtbl->GetType(variable);
1269 hr = type->lpVtbl->GetDesc(type, &td);
1270 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1272 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsConstantBuffer(variable);
1273 is_valid = variable2->lpVtbl->IsValid(variable2);
1274 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_CBUFFER);
1275 ok(ret, "AsConstantBuffer valid check failed (Type is %x)\n", td.Type);
1277 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsString(variable);
1278 is_valid = variable2->lpVtbl->IsValid(variable2);
1279 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_STRING);
1280 ok(ret, "AsString valid check failed (Type is %x)\n", td.Type);
1282 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsScalar(variable);
1283 is_valid = variable2->lpVtbl->IsValid(variable2);
1284 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_SCALAR);
1285 ok(ret, "AsScalar valid check failed (Class is %x)\n", td.Class);
1287 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsVector(variable);
1288 is_valid = variable2->lpVtbl->IsValid(variable2);
1289 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_VECTOR);
1290 ok(ret, "AsVector valid check failed (Class is %x)\n", td.Class);
1292 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsMatrix(variable);
1293 is_valid = variable2->lpVtbl->IsValid(variable2);
1294 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_MATRIX_ROWS
1295 || td.Class == D3D10_SVC_MATRIX_COLUMNS);
1296 ok(ret, "AsMatrix valid check failed (Class is %x)\n", td.Class);
1298 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsBlend(variable);
1299 is_valid = variable2->lpVtbl->IsValid(variable2);
1300 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_BLEND);
1301 ok(ret, "AsBlend valid check failed (Type is %x)\n", td.Type);
1303 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsDepthStencil(variable);
1304 is_valid = variable2->lpVtbl->IsValid(variable2);
1305 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_DEPTHSTENCIL);
1306 ok(ret, "AsDepthStencil valid check failed (Type is %x)\n", td.Type);
1308 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsRasterizer(variable);
1309 is_valid = variable2->lpVtbl->IsValid(variable2);
1310 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_RASTERIZER);
1311 ok(ret, "AsRasterizer valid check failed (Type is %x)\n", td.Type);
1313 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsSampler(variable);
1314 is_valid = variable2->lpVtbl->IsValid(variable2);
1315 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_SAMPLER);
1316 ok(ret, "AsSampler valid check failed (Type is %x)\n", td.Type);
1318 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsDepthStencilView(variable);
1319 is_valid = variable2->lpVtbl->IsValid(variable2);
1320 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_DEPTHSTENCILVIEW);
1321 ok(ret, "AsDepthStencilView valid check failed (Type is %x)\n", td.Type);
1323 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsRenderTargetView(variable);
1324 is_valid = variable2->lpVtbl->IsValid(variable2);
1325 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_RENDERTARGETVIEW);
1326 ok(ret, "AsRenderTargetView valid check failed (Type is %x)\n", td.Type);
1328 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsShaderResource(variable);
1329 is_valid = variable2->lpVtbl->IsValid(variable2);
1330 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_TEXTURE1D
1331 || td.Type == D3D10_SVT_TEXTURE1DARRAY || td.Type == D3D10_SVT_TEXTURE2D
1332 || td.Type == D3D10_SVT_TEXTURE2DMS || td.Type == D3D10_SVT_TEXTURE2DARRAY
1333 || td.Type == D3D10_SVT_TEXTURE2DMSARRAY || td.Type == D3D10_SVT_TEXTURE3D
1334 || td.Type == D3D10_SVT_TEXTURECUBE);
1335 ok(ret, "AsShaderResource valid check failed (Type is %x)\n", td.Type);
1337 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsShader(variable);
1338 is_valid = variable2->lpVtbl->IsValid(variable2);
1339 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_GEOMETRYSHADER
1340 || td.Type == D3D10_SVT_PIXELSHADER || td.Type == D3D10_SVT_VERTEXSHADER);
1341 ok(ret, "AsShader valid check failed (Type is %x)\n", td.Type);
1344 static void test_effect_variable_type_class(ID3D10Device *device)
1346 ID3D10Effect *effect;
1347 ID3D10EffectConstantBuffer *constantbuffer, *null_buffer, *parent;
1348 ID3D10EffectVariable *variable;
1349 ID3D10EffectType *type;
1350 D3D10_EFFECT_VARIABLE_DESC vd;
1351 D3D10_EFFECT_TYPE_DESC td;
1352 HRESULT hr;
1353 unsigned int variable_nr = 0;
1355 hr = create_effect(fx_test_evtc, 0, device, NULL, &effect);
1356 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
1358 /* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
1359 null_buffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 1);
1361 /* check constantbuffer cb */
1362 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
1363 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &vd);
1364 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1366 ok(strcmp(vd.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", vd.Name);
1367 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1368 ok(vd.Flags == 0, "Type is %u, expected 0\n", vd.Flags);
1369 ok(vd.Annotations == 1, "Elements is %u, expected 1\n", vd.Annotations);
1370 ok(vd.BufferOffset == 0, "Members is %u, expected 0\n", vd.BufferOffset);
1371 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1373 check_as((ID3D10EffectVariable *)constantbuffer);
1375 parent = constantbuffer->lpVtbl->GetParentConstantBuffer(constantbuffer);
1376 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1378 type = constantbuffer->lpVtbl->GetType(constantbuffer);
1379 hr = type->lpVtbl->GetDesc(type, &td);
1380 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1382 ok(strcmp(td.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", td.TypeName);
1383 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1384 ok(td.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_CBUFFER);
1385 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1386 ok(td.Members == 4, "Members is %u, expected 4\n", td.Members);
1387 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1388 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1389 ok(td.PackedSize == 0x3c, "PackedSize is %#x, expected 0x3c\n", td.PackedSize);
1390 ok(td.UnpackedSize == 0x60, "UnpackedSize is %#x, expected 0x60\n", td.UnpackedSize);
1391 ok(td.Stride == 0x60, "Stride is %#x, expected 0x60\n", td.Stride);
1393 /* check annotation a */
1394 variable = constantbuffer->lpVtbl->GetAnnotationByIndex(constantbuffer, 0);
1395 hr = variable->lpVtbl->GetDesc(variable, &vd);
1396 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1398 ok(strcmp(vd.Name, "s") == 0, "Name is \"%s\", expected \"s\"\n", vd.Name);
1399 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1400 ok(vd.Flags == 2, "Flags is %u, expected 2\n", vd.Flags);
1401 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1402 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1403 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1405 check_as((ID3D10EffectVariable *)variable);
1407 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1408 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1410 type = variable->lpVtbl->GetType(variable);
1411 hr = type->lpVtbl->GetDesc(type, &td);
1412 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1414 ok(strcmp(td.TypeName, "String") == 0, "TypeName is \"%s\", expected \"String\"\n", td.TypeName);
1415 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1416 ok(td.Type == D3D10_SVT_STRING, "Type is %x, expected %x\n", td.Type, D3D10_SVT_STRING);
1417 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1418 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1419 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1420 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1421 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1422 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1423 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1425 /* check float f */
1426 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1427 hr = variable->lpVtbl->GetDesc(variable, &vd);
1428 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1430 ok(strcmp(vd.Name, "f") == 0, "Name is \"%s\", expected \"f\"\n", vd.Name);
1431 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1432 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1433 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1434 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1435 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1437 check_as((ID3D10EffectVariable *)variable);
1439 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1440 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1442 type = variable->lpVtbl->GetType(variable);
1443 hr = type->lpVtbl->GetDesc(type, &td);
1444 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1446 ok(strcmp(td.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", td.TypeName);
1447 ok(td.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", td.Class, D3D10_SVC_SCALAR);
1448 ok(td.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_FLOAT);
1449 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1450 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1451 ok(td.Rows == 1, "Rows is %u, expected 1\n", td.Rows);
1452 ok(td.Columns == 1, "Columns is %u, expected 1\n", td.Columns);
1453 ok(td.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", td.PackedSize);
1454 ok(td.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", td.UnpackedSize);
1455 ok(td.Stride == 0x10, "Stride is %#x, expected 0x10\n", td.Stride);
1457 /* check int2 i */
1458 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1459 hr = variable->lpVtbl->GetDesc(variable, &vd);
1460 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1462 ok(strcmp(vd.Name, "i") == 0, "Name is \"%s\", expected \"i\"\n", vd.Name);
1463 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1464 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1465 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1466 ok(vd.BufferOffset == 4, "BufferOffset is %u, expected 4\n", vd.BufferOffset);
1467 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1469 check_as((ID3D10EffectVariable *)variable);
1471 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1472 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1474 type = variable->lpVtbl->GetType(variable);
1475 hr = type->lpVtbl->GetDesc(type, &td);
1476 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1478 ok(strcmp(td.TypeName, "int2") == 0, "TypeName is \"%s\", expected \"int2\"\n", td.TypeName);
1479 ok(td.Class == D3D10_SVC_VECTOR, "Class is %x, expected %x\n", td.Class, D3D10_SVC_VECTOR);
1480 ok(td.Type == D3D10_SVT_INT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_INT);
1481 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1482 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1483 ok(td.Rows == 1, "Rows is %u, expected 1\n", td.Rows);
1484 ok(td.Columns == 2, "Columns is %u, expected 2\n", td.Columns);
1485 ok(td.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", td.PackedSize);
1486 ok(td.UnpackedSize == 0x8, "UnpackedSize is %#x, expected 0x8\n", td.UnpackedSize);
1487 ok(td.Stride == 0x10, "Stride is %#x, expected 0x10\n", td.Stride);
1489 /* check uint2x3 u */
1490 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1491 hr = variable->lpVtbl->GetDesc(variable, &vd);
1492 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1494 ok(strcmp(vd.Name, "u") == 0, "Name is \"%s\", expected \"u\"\n", vd.Name);
1495 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1496 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1497 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1498 ok(vd.BufferOffset == 16, "BufferOffset is %u, expected 16\n", vd.BufferOffset);
1499 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1501 check_as((ID3D10EffectVariable *)variable);
1503 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1504 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1506 type = variable->lpVtbl->GetType(variable);
1507 hr = type->lpVtbl->GetDesc(type, &td);
1508 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1510 ok(strcmp(td.TypeName, "uint2x3") == 0, "TypeName is \"%s\", expected \"uint2x3\"\n", td.TypeName);
1511 ok(td.Class == D3D10_SVC_MATRIX_COLUMNS, "Class is %x, expected %x\n", td.Class, D3D10_SVC_MATRIX_COLUMNS);
1512 ok(td.Type == D3D10_SVT_UINT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_UINT);
1513 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1514 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1515 ok(td.Rows == 2, "Rows is %u, expected 2\n", td.Rows);
1516 ok(td.Columns == 3, "Columns is %u, expected 3\n", td.Columns);
1517 ok(td.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", td.PackedSize);
1518 ok(td.UnpackedSize == 0x28, "UnpackedSize is %#x, expected 0x28\n", td.UnpackedSize);
1519 ok(td.Stride == 0x30, "Stride is %#x, expected 0x30\n", td.Stride);
1521 /* check bool2x3 b */
1522 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1523 hr = variable->lpVtbl->GetDesc(variable, &vd);
1524 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1526 ok(strcmp(vd.Name, "b") == 0, "Name is \"%s\", expected \"b\"\n", vd.Name);
1527 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1528 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1529 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1530 ok(vd.BufferOffset == 64, "BufferOffset is %u, expected 64\n", vd.BufferOffset);
1531 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1533 check_as((ID3D10EffectVariable *)variable);
1535 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1536 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1538 type = variable->lpVtbl->GetType(variable);
1539 hr = type->lpVtbl->GetDesc(type, &td);
1540 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1542 ok(strcmp(td.TypeName, "bool2x3") == 0, "TypeName is \"%s\", expected \"bool2x3\"\n", td.TypeName);
1543 ok(td.Class == D3D10_SVC_MATRIX_ROWS, "Class is %x, expected %x\n", td.Class, D3D10_SVC_MATRIX_ROWS);
1544 ok(td.Type == D3D10_SVT_BOOL, "Type is %x, expected %x\n", td.Type, D3D10_SVT_BOOL);
1545 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1546 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1547 ok(td.Rows == 2, "Rows is %u, expected 2\n", td.Rows);
1548 ok(td.Columns == 3, "Columns is %u, expected 3\n", td.Columns);
1549 ok(td.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", td.PackedSize);
1550 ok(td.UnpackedSize == 0x1c, "UnpackedSize is %#x, expected 0x1c\n", td.UnpackedSize);
1551 ok(td.Stride == 0x20, "Stride is %#x, expected 0x20\n", td.Stride);
1553 /* check BlendState blend */
1554 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1555 hr = variable->lpVtbl->GetDesc(variable, &vd);
1556 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1558 ok(strcmp(vd.Name, "blend") == 0, "Name is \"%s\", expected \"blend\"\n", vd.Name);
1559 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1560 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1561 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1562 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1563 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1565 check_as((ID3D10EffectVariable *)variable);
1567 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1568 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1570 type = variable->lpVtbl->GetType(variable);
1571 hr = type->lpVtbl->GetDesc(type, &td);
1572 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1574 ok(strcmp(td.TypeName, "BlendState") == 0, "TypeName is \"%s\", expected \"BlendState\"\n", td.TypeName);
1575 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1576 ok(td.Type == D3D10_SVT_BLEND, "Type is %x, expected %x\n", td.Type, D3D10_SVT_BLEND);
1577 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1578 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1579 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1580 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1581 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1582 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1583 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1585 /* check DepthStencilState depthstencil */
1586 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1587 hr = variable->lpVtbl->GetDesc(variable, &vd);
1588 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1590 ok(strcmp(vd.Name, "depthstencil") == 0, "Name is \"%s\", expected \"depthstencil\"\n", vd.Name);
1591 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1592 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1593 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1594 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1595 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1597 check_as((ID3D10EffectVariable *)variable);
1599 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1600 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1602 type = variable->lpVtbl->GetType(variable);
1603 hr = type->lpVtbl->GetDesc(type, &td);
1604 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1606 ok(strcmp(td.TypeName, "DepthStencilState") == 0, "TypeName is \"%s\", expected \"DepthStencilState\"\n", td.TypeName);
1607 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1608 ok(td.Type == D3D10_SVT_DEPTHSTENCIL, "Type is %x, expected %x\n", td.Type, D3D10_SVT_DEPTHSTENCIL);
1609 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1610 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1611 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1612 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1613 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1614 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1615 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1617 /* check RasterizerState rast */
1618 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1619 hr = variable->lpVtbl->GetDesc(variable, &vd);
1620 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1622 ok(strcmp(vd.Name, "rast") == 0, "Name is \"%s\", expected \"rast\"\n", vd.Name);
1623 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1624 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1625 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1626 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1627 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1629 check_as((ID3D10EffectVariable *)variable);
1631 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1632 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1634 type = variable->lpVtbl->GetType(variable);
1635 hr = type->lpVtbl->GetDesc(type, &td);
1636 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1638 ok(strcmp(td.TypeName, "RasterizerState") == 0, "TypeName is \"%s\", expected \"RasterizerState\"\n", td.TypeName);
1639 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1640 ok(td.Type == D3D10_SVT_RASTERIZER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_RASTERIZER);
1641 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1642 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1643 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1644 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1645 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1646 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1647 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1649 /* check SamplerState sam */
1650 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1651 hr = variable->lpVtbl->GetDesc(variable, &vd);
1652 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1654 ok(strcmp(vd.Name, "sam") == 0, "Name is \"%s\", expected \"sam\"\n", vd.Name);
1655 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1656 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1657 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1658 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1659 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1661 check_as((ID3D10EffectVariable *)variable);
1663 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1664 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1666 type = variable->lpVtbl->GetType(variable);
1667 hr = type->lpVtbl->GetDesc(type, &td);
1668 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1670 ok(strcmp(td.TypeName, "SamplerState") == 0, "TypeName is \"%s\", expected \"SamplerState\"\n", td.TypeName);
1671 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1672 ok(td.Type == D3D10_SVT_SAMPLER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_SAMPLER);
1673 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1674 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1675 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1676 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1677 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1678 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1679 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1681 /* check RenderTargetView rtv */
1682 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1683 hr = variable->lpVtbl->GetDesc(variable, &vd);
1684 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1686 ok(strcmp(vd.Name, "rtv") == 0, "Name is \"%s\", expected \"rtv\"\n", vd.Name);
1687 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1688 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1689 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1690 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1691 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1693 check_as((ID3D10EffectVariable *)variable);
1695 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1696 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1698 type = variable->lpVtbl->GetType(variable);
1699 hr = type->lpVtbl->GetDesc(type, &td);
1700 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1702 ok(strcmp(td.TypeName, "RenderTargetView") == 0, "TypeName is \"%s\", expected \"RenderTargetView\"\n", td.TypeName);
1703 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1704 ok(td.Type == D3D10_SVT_RENDERTARGETVIEW, "Type is %x, expected %x\n", td.Type, D3D10_SVT_RENDERTARGETVIEW);
1705 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1706 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1707 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1708 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1709 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1710 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1711 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1713 /* check DepthStencilView dsv */
1714 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1715 hr = variable->lpVtbl->GetDesc(variable, &vd);
1716 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1718 ok(strcmp(vd.Name, "dsv") == 0, "Name is \"%s\", expected \"dsv\"\n", vd.Name);
1719 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1720 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1721 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1722 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1723 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1725 check_as((ID3D10EffectVariable *)variable);
1727 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1728 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1730 type = variable->lpVtbl->GetType(variable);
1731 hr = type->lpVtbl->GetDesc(type, &td);
1732 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1734 ok(strcmp(td.TypeName, "DepthStencilView") == 0, "TypeName is \"%s\", expected \"DepthStencilView\"\n", td.TypeName);
1735 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1736 ok(td.Type == D3D10_SVT_DEPTHSTENCILVIEW, "Type is %x, expected %x\n", td.Type, D3D10_SVT_DEPTHSTENCILVIEW);
1737 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1738 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1739 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1740 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1741 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1742 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1743 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1745 /* check Texture1D t1 */
1746 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1747 hr = variable->lpVtbl->GetDesc(variable, &vd);
1748 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1750 ok(strcmp(vd.Name, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", vd.Name);
1751 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1752 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1753 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1754 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1755 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1757 check_as((ID3D10EffectVariable *)variable);
1759 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1760 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1762 type = variable->lpVtbl->GetType(variable);
1763 hr = type->lpVtbl->GetDesc(type, &td);
1764 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1766 ok(strcmp(td.TypeName, "Texture1D") == 0, "TypeName is \"%s\", expected \"Texture1D\"\n", td.TypeName);
1767 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1768 ok(td.Type == D3D10_SVT_TEXTURE1D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE1D);
1769 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1770 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1771 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1772 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1773 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1774 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1775 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1777 /* check Texture1DArray t1a */
1778 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1779 hr = variable->lpVtbl->GetDesc(variable, &vd);
1780 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1782 ok(strcmp(vd.Name, "t1a") == 0, "Name is \"%s\", expected \"t1a\"\n", vd.Name);
1783 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1784 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1785 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1786 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1787 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1789 check_as((ID3D10EffectVariable *)variable);
1791 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1792 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1794 type = variable->lpVtbl->GetType(variable);
1795 hr = type->lpVtbl->GetDesc(type, &td);
1796 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1798 ok(strcmp(td.TypeName, "Texture1DArray") == 0, "TypeName is \"%s\", expected \"Texture1DArray\"\n", td.TypeName);
1799 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1800 ok(td.Type == D3D10_SVT_TEXTURE1DARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE1DARRAY);
1801 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1802 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1803 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1804 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1805 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1806 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1807 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1809 /* check Texture2D t2 */
1810 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1811 hr = variable->lpVtbl->GetDesc(variable, &vd);
1812 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1814 ok(strcmp(vd.Name, "t2") == 0, "Name is \"%s\", expected \"t2\"\n", vd.Name);
1815 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1816 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1817 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1818 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1819 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1821 check_as((ID3D10EffectVariable *)variable);
1823 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1824 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1826 type = variable->lpVtbl->GetType(variable);
1827 hr = type->lpVtbl->GetDesc(type, &td);
1828 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1830 ok(strcmp(td.TypeName, "Texture2D") == 0, "TypeName is \"%s\", expected \"Texture2D\"\n", td.TypeName);
1831 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1832 ok(td.Type == D3D10_SVT_TEXTURE2D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2D);
1833 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1834 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1835 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1836 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1837 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1838 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1839 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1841 /* check Texture2DMS t2dms */
1842 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1843 hr = variable->lpVtbl->GetDesc(variable, &vd);
1844 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1846 ok(strcmp(vd.Name, "t2dms") == 0, "Name is \"%s\", expected \"t2dms\"\n", vd.Name);
1847 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1848 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1849 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1850 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1851 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1853 check_as((ID3D10EffectVariable *)variable);
1855 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1856 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1858 type = variable->lpVtbl->GetType(variable);
1859 hr = type->lpVtbl->GetDesc(type, &td);
1860 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1862 ok(strcmp(td.TypeName, "Texture2DMS") == 0, "TypeName is \"%s\", expected \"Texture2DMS\"\n", td.TypeName);
1863 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1864 ok(td.Type == D3D10_SVT_TEXTURE2DMS, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DMS);
1865 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1866 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1867 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1868 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1869 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1870 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1871 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1873 /* check Texture2DArray t2a */
1874 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1875 hr = variable->lpVtbl->GetDesc(variable, &vd);
1876 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1878 ok(strcmp(vd.Name, "t2a") == 0, "Name is \"%s\", expected \"t2a\"\n", vd.Name);
1879 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1880 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1881 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1882 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1883 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1885 check_as((ID3D10EffectVariable *)variable);
1887 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1888 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1890 type = variable->lpVtbl->GetType(variable);
1891 hr = type->lpVtbl->GetDesc(type, &td);
1892 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1894 ok(strcmp(td.TypeName, "Texture2DArray") == 0, "TypeName is \"%s\", expected \"Texture2DArray\"\n", td.TypeName);
1895 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1896 ok(td.Type == D3D10_SVT_TEXTURE2DARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DARRAY);
1897 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1898 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1899 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1900 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1901 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1902 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1903 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1905 /* check Texture2DMSArray t2dmsa */
1906 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1907 hr = variable->lpVtbl->GetDesc(variable, &vd);
1908 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1910 ok(strcmp(vd.Name, "t2dmsa") == 0, "Name is \"%s\", expected \"t2dmsa\"\n", vd.Name);
1911 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1912 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1913 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1914 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1915 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1917 check_as((ID3D10EffectVariable *)variable);
1919 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1920 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1922 type = variable->lpVtbl->GetType(variable);
1923 hr = type->lpVtbl->GetDesc(type, &td);
1924 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1926 ok(strcmp(td.TypeName, "Texture2DMSArray") == 0, "TypeName is \"%s\", expected \"TTexture2DMSArray\"\n", td.TypeName);
1927 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1928 ok(td.Type == D3D10_SVT_TEXTURE2DMSARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DMSARRAY);
1929 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1930 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1931 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1932 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1933 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1934 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1935 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1937 /* check Texture3D t3 */
1938 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1939 hr = variable->lpVtbl->GetDesc(variable, &vd);
1940 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1942 ok(strcmp(vd.Name, "t3") == 0, "Name is \"%s\", expected \"t3\"\n", vd.Name);
1943 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1944 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1945 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1946 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1947 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1949 check_as((ID3D10EffectVariable *)variable);
1951 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1952 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1954 type = variable->lpVtbl->GetType(variable);
1955 hr = type->lpVtbl->GetDesc(type, &td);
1956 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1958 ok(strcmp(td.TypeName, "Texture3D") == 0, "TypeName is \"%s\", expected \"Texture3D\"\n", td.TypeName);
1959 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1960 ok(td.Type == D3D10_SVT_TEXTURE3D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE3D);
1961 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1962 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1963 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1964 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1965 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1966 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1967 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1969 /* check TextureCube tq */
1970 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1971 hr = variable->lpVtbl->GetDesc(variable, &vd);
1972 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1974 ok(strcmp(vd.Name, "tq") == 0, "Name is \"%s\", expected \"tq\"\n", vd.Name);
1975 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1976 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1977 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1978 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1979 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1981 check_as((ID3D10EffectVariable *)variable);
1983 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1984 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1986 type = variable->lpVtbl->GetType(variable);
1987 hr = type->lpVtbl->GetDesc(type, &td);
1988 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1990 ok(strcmp(td.TypeName, "TextureCube") == 0, "TypeName is \"%s\", expected \"TextureCube\"\n", td.TypeName);
1991 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1992 ok(td.Type == D3D10_SVT_TEXTURECUBE, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURECUBE);
1993 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1994 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1995 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1996 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1997 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1998 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1999 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2001 /* check GeometryShader gs[2] */
2002 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2003 hr = variable->lpVtbl->GetDesc(variable, &vd);
2004 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2006 ok(strcmp(vd.Name, "gs") == 0, "Name is \"%s\", expected \"gs\"\n", vd.Name);
2007 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2008 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2009 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2010 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2011 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2013 check_as((ID3D10EffectVariable *)variable);
2015 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2016 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2018 type = variable->lpVtbl->GetType(variable);
2019 hr = type->lpVtbl->GetDesc(type, &td);
2020 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2022 ok(strcmp(td.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", td.TypeName);
2023 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2024 ok(td.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_GEOMETRYSHADER);
2025 ok(td.Elements == 2, "Elements is %u, expected 2\n", td.Elements);
2026 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2027 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2028 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2029 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2030 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2031 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2033 /* check PixelShader ps */
2034 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2035 hr = variable->lpVtbl->GetDesc(variable, &vd);
2036 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2038 ok(strcmp(vd.Name, "ps") == 0, "Name is \"%s\", expected \"ps\"\n", vd.Name);
2039 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2040 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2041 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2042 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2043 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2045 check_as((ID3D10EffectVariable *)variable);
2047 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2048 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2050 type = variable->lpVtbl->GetType(variable);
2051 hr = type->lpVtbl->GetDesc(type, &td);
2052 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2054 ok(strcmp(td.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", td.TypeName);
2055 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2056 ok(td.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_PIXELSHADER);
2057 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
2058 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2059 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2060 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2061 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2062 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2063 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2065 /* check VertexShader vs[1] */
2066 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2067 hr = variable->lpVtbl->GetDesc(variable, &vd);
2068 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2070 ok(strcmp(vd.Name, "vs") == 0, "Name is \"%s\", expected \"vs\"\n", vd.Name);
2071 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2072 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2073 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2074 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2075 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2077 check_as((ID3D10EffectVariable *)variable);
2079 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2080 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2082 type = variable->lpVtbl->GetType(variable);
2083 hr = type->lpVtbl->GetDesc(type, &td);
2084 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2086 ok(strcmp(td.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", td.TypeName);
2087 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2088 ok(td.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_VERTEXSHADER);
2089 ok(td.Elements == 1, "Elements is %u, expected 1\n", td.Elements);
2090 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2091 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2092 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2093 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2094 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2095 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2097 effect->lpVtbl->Release(effect);
2101 * test_effect_constant_buffer_stride
2103 #if 0
2104 cbuffer cb1
2106 float a1;
2107 float b1;
2108 float c1;
2109 float d1;
2111 cbuffer cb2
2113 float a2;
2114 float2 b2;
2116 cbuffer cb3
2118 float2 a3;
2119 float3 b3;
2121 cbuffer cb4
2123 float2 a4;
2124 float3 b4;
2125 float2 c4;
2127 cbuffer cb5
2129 float2 a5;
2130 float2 b5;
2131 float3 c5;
2133 cbuffer cb6
2135 float2 a6 : packoffset(c0);
2136 float3 b6 : packoffset(c1);
2137 float2 c6 : packoffset(c0.z);
2139 cbuffer cb7
2141 float2 a7 : packoffset(c0);
2142 float3 b7 : packoffset(c1);
2143 float2 c7 : packoffset(c2);
2145 cbuffer cb8
2147 float2 a8 : packoffset(c0);
2148 float3 b8 : packoffset(c0.y);
2149 float4 c8 : packoffset(c2);
2151 cbuffer cb9
2153 float2 a9 : packoffset(c0);
2154 float2 b9 : packoffset(c0.y);
2155 float2 c9 : packoffset(c0.z);
2157 cbuffer cb10
2159 float4 a10 : packoffset(c2);
2161 cbuffer cb11
2163 struct {
2164 float4 a11;
2165 float b11;
2166 } s11;
2167 float c11;
2169 cbuffer cb12
2171 float c12;
2172 struct {
2173 float b12;
2174 float4 a12;
2175 } s12;
2177 cbuffer cb13
2179 float a13;
2180 struct {
2181 float b13;
2182 } s13;
2184 cbuffer cb14
2186 struct {
2187 float a14;
2188 } s14;
2189 struct {
2190 float b14;
2191 } t14;
2193 cbuffer cb15
2195 float2 a15[2] : packoffset(c0);
2197 #endif
2198 static DWORD fx_test_ecbs[] = {
2199 0x43425844, 0x615d7d77, 0x21289d92, 0xe9e8d98e,
2200 0xcae7b74e, 0x00000001, 0x00000855, 0x00000001,
2201 0x00000024, 0x30315846, 0x00000829, 0xfeff1001,
2202 0x0000000f, 0x00000024, 0x00000000, 0x00000000,
2203 0x00000000, 0x00000000, 0x00000000, 0x00000285,
2204 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2205 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2206 0x00000000, 0x00000000, 0x00000000, 0x00316263,
2207 0x616f6c66, 0x00080074, 0x00010000, 0x00000000,
2208 0x00040000, 0x00100000, 0x00040000, 0x09090000,
2209 0x31610000, 0x00316200, 0x64003163, 0x62630031,
2210 0x32610032, 0x6f6c6600, 0x00327461, 0x0000003d,
2211 0x00000001, 0x00000000, 0x00000008, 0x00000010,
2212 0x00000008, 0x0000110a, 0x63003262, 0x61003362,
2213 0x6c660033, 0x3374616f, 0x00006a00, 0x00000100,
2214 0x00000000, 0x00000c00, 0x00001000, 0x00000c00,
2215 0x00190a00, 0x00336200, 0x00346263, 0x62003461,
2216 0x34630034, 0x35626300, 0x00356100, 0x63003562,
2217 0x62630035, 0x36610036, 0x00366200, 0x63003663,
2218 0x61003762, 0x37620037, 0x00376300, 0x00386263,
2219 0x62003861, 0x6c660038, 0x3474616f, 0x0000ce00,
2220 0x00000100, 0x00000000, 0x00001000, 0x00001000,
2221 0x00001000, 0x00210a00, 0x00386300, 0x00396263,
2222 0x62003961, 0x39630039, 0x31626300, 0x31610030,
2223 0x62630030, 0x3c003131, 0x616e6e75, 0x3e64656d,
2224 0x31316100, 0x31316200, 0x00010f00, 0x00000300,
2225 0x00000000, 0x00001400, 0x00002000, 0x00001400,
2226 0x00000200, 0x00011900, 0x00000000, 0x00000000,
2227 0x0000d500, 0x00011d00, 0x00000000, 0x00001000,
2228 0x00000e00, 0x31317300, 0x31316300, 0x31626300,
2229 0x31630032, 0x31620032, 0x31610032, 0x010f0032,
2230 0x00030000, 0x00000000, 0x00200000, 0x00200000,
2231 0x00140000, 0x00020000, 0x016e0000, 0x00000000,
2232 0x00000000, 0x000e0000, 0x01720000, 0x00000000,
2233 0x00100000, 0x00d50000, 0x31730000, 0x62630032,
2234 0x61003331, 0x62003331, 0x0f003331, 0x03000001,
2235 0x00000000, 0x04000000, 0x10000000, 0x04000000,
2236 0x01000000, 0xbf000000, 0x00000001, 0x00000000,
2237 0x0e000000, 0x73000000, 0x63003331, 0x00343162,
2238 0x00343161, 0x0000010f, 0x00000003, 0x00000000,
2239 0x00000004, 0x00000010, 0x00000004, 0x00000001,
2240 0x000001f8, 0x00000000, 0x00000000, 0x0000000e,
2241 0x00343173, 0x00343162, 0x0000010f, 0x00000003,
2242 0x00000000, 0x00000004, 0x00000010, 0x00000004,
2243 0x00000001, 0x0000022c, 0x00000000, 0x00000000,
2244 0x0000000e, 0x00343174, 0x35316263, 0x00003d00,
2245 0x00000100, 0x00000200, 0x00001800, 0x00001000,
2246 0x00001000, 0x00110a00, 0x35316100, 0x00000400,
2247 0x00001000, 0x00000000, 0x00000400, 0xffffff00,
2248 0x000000ff, 0x00002a00, 0x00000e00, 0x00000000,
2249 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2250 0x00002d00, 0x00000e00, 0x00000000, 0x00000400,
2251 0x00000000, 0x00000000, 0x00000000, 0x00003000,
2252 0x00000e00, 0x00000000, 0x00000800, 0x00000000,
2253 0x00000000, 0x00000000, 0x00003300, 0x00000e00,
2254 0x00000000, 0x00000c00, 0x00000000, 0x00000000,
2255 0x00000000, 0x00003600, 0x00001000, 0x00000000,
2256 0x00000200, 0xffffff00, 0x000000ff, 0x00003a00,
2257 0x00000e00, 0x00000000, 0x00000000, 0x00000000,
2258 0x00000000, 0x00000000, 0x00006000, 0x00004400,
2259 0x00000000, 0x00000400, 0x00000000, 0x00000000,
2260 0x00000000, 0x00006300, 0x00002000, 0x00000000,
2261 0x00000200, 0xffffff00, 0x000000ff, 0x00006700,
2262 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2263 0x00000000, 0x00000000, 0x00008d00, 0x00007100,
2264 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2265 0x00000000, 0x00009000, 0x00003000, 0x00000000,
2266 0x00000300, 0xffffff00, 0x000000ff, 0x00009400,
2267 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2268 0x00000000, 0x00000000, 0x00009700, 0x00007100,
2269 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2270 0x00000000, 0x00009a00, 0x00004400, 0x00000000,
2271 0x00002000, 0x00000000, 0x00000000, 0x00000000,
2272 0x00009d00, 0x00002000, 0x00000000, 0x00000300,
2273 0xffffff00, 0x000000ff, 0x0000a100, 0x00004400,
2274 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2275 0x00000000, 0x0000a400, 0x00004400, 0x00000000,
2276 0x00000800, 0x00000000, 0x00000000, 0x00000000,
2277 0x0000a700, 0x00007100, 0x00000000, 0x00001000,
2278 0x00000000, 0x00000000, 0x00000000, 0x0000aa00,
2279 0x00002000, 0x00000000, 0x00000300, 0xffffff00,
2280 0x000000ff, 0x0000ae00, 0x00004400, 0x00000000,
2281 0x00000000, 0x00000000, 0x00000400, 0x00000000,
2282 0x0000b100, 0x00007100, 0x00000000, 0x00001000,
2283 0x00000000, 0x00000400, 0x00000000, 0x0000b400,
2284 0x00004400, 0x00000000, 0x00000800, 0x00000000,
2285 0x00000400, 0x00000000, 0x0000b700, 0x00003000,
2286 0x00000000, 0x00000300, 0xffffff00, 0x000000ff,
2287 0x0000bb00, 0x00004400, 0x00000000, 0x00000000,
2288 0x00000000, 0x00000400, 0x00000000, 0x0000be00,
2289 0x00007100, 0x00000000, 0x00001000, 0x00000000,
2290 0x00000400, 0x00000000, 0x0000c100, 0x00004400,
2291 0x00000000, 0x00002000, 0x00000000, 0x00000400,
2292 0x00000000, 0x0000c400, 0x00003000, 0x00000000,
2293 0x00000300, 0xffffff00, 0x000000ff, 0x0000c800,
2294 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2295 0x00000400, 0x00000000, 0x0000cb00, 0x00007100,
2296 0x00000000, 0x00000400, 0x00000000, 0x00000400,
2297 0x00000000, 0x0000f100, 0x0000d500, 0x00000000,
2298 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2299 0x0000f400, 0x00001000, 0x00000000, 0x00000300,
2300 0xffffff00, 0x000000ff, 0x0000f800, 0x00004400,
2301 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2302 0x00000000, 0x0000fb00, 0x00004400, 0x00000000,
2303 0x00000400, 0x00000000, 0x00000400, 0x00000000,
2304 0x0000fe00, 0x00004400, 0x00000000, 0x00000800,
2305 0x00000000, 0x00000400, 0x00000000, 0x00010100,
2306 0x00003000, 0x00000000, 0x00000100, 0xffffff00,
2307 0x000000ff, 0x00010600, 0x0000d500, 0x00000000,
2308 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2309 0x00010a00, 0x00002000, 0x00000000, 0x00000200,
2310 0xffffff00, 0x000000ff, 0x00015d00, 0x00012100,
2311 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2312 0x00000000, 0x00016100, 0x00000e00, 0x00000000,
2313 0x00001400, 0x00000000, 0x00000000, 0x00000000,
2314 0x00016500, 0x00003000, 0x00000000, 0x00000200,
2315 0xffffff00, 0x000000ff, 0x00016a00, 0x00000e00,
2316 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2317 0x00000000, 0x0001b200, 0x00017600, 0x00000000,
2318 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2319 0x0001b600, 0x00002000, 0x00000000, 0x00000200,
2320 0xffffff00, 0x000000ff, 0x0001bb00, 0x00000e00,
2321 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2322 0x00000000, 0x0001ef00, 0x0001c300, 0x00000000,
2323 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2324 0x0001f300, 0x00002000, 0x00000000, 0x00000200,
2325 0xffffff00, 0x000000ff, 0x00022800, 0x0001fc00,
2326 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2327 0x00000000, 0x00025c00, 0x00023000, 0x00000000,
2328 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2329 0x00026000, 0x00002000, 0x00000000, 0x00000100,
2330 0xffffff00, 0x000000ff, 0x00028100, 0x00026500,
2331 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2332 0x00000000, 0x00000000,
2335 static void test_effect_constant_buffer_stride(ID3D10Device *device)
2337 ID3D10Effect *effect;
2338 ID3D10EffectConstantBuffer *constantbuffer;
2339 ID3D10EffectType *type;
2340 D3D10_EFFECT_TYPE_DESC tdesc;
2341 HRESULT hr;
2342 unsigned int i;
2344 static const struct {
2345 unsigned int m; /* members */
2346 unsigned int p; /* packed size */
2347 unsigned int u; /* unpacked size */
2348 unsigned int s; /* stride */
2349 } tv_ecbs[] = {
2350 {4, 0x10, 0x10, 0x10},
2351 {2, 0xc, 0x10, 0x10},
2352 {2, 0x14, 0x20, 0x20},
2353 {3, 0x1c, 0x30, 0x30},
2354 {3, 0x1c, 0x20, 0x20},
2355 {3, 0x1c, 0x20, 0x20},
2356 {3, 0x1c, 0x30, 0x30},
2357 {3, 0x24, 0x30, 0x30},
2358 {3, 0x18, 0x10, 0x10},
2359 {1, 0x10, 0x30, 0x30},
2360 {2, 0x18, 0x20, 0x20},
2361 {2, 0x18, 0x30, 0x30},
2362 {2, 0x8, 0x20, 0x20},
2363 {2, 0x8, 0x20, 0x20},
2364 {1, 0x10, 0x20, 0x20},
2367 hr = create_effect(fx_test_ecbs, 0, device, NULL, &effect);
2368 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
2370 for (i=0; i<sizeof(tv_ecbs)/sizeof(tv_ecbs[0]); i++)
2372 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, i);
2373 type = constantbuffer->lpVtbl->GetType(constantbuffer);
2375 hr = type->lpVtbl->GetDesc(type, &tdesc);
2376 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2378 ok(strcmp(tdesc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", tdesc.TypeName);
2379 ok(tdesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", tdesc.Class, D3D10_SVC_OBJECT);
2380 ok(tdesc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", tdesc.Type, D3D10_SVT_CBUFFER);
2381 ok(tdesc.Elements == 0, "Elements is %u, expected 0\n", tdesc.Elements);
2382 ok(tdesc.Members == tv_ecbs[i].m, "Members is %u, expected %u\n", tdesc.Members, tv_ecbs[i].m);
2383 ok(tdesc.Rows == 0, "Rows is %u, expected 0\n", tdesc.Rows);
2384 ok(tdesc.Columns == 0, "Columns is %u, expected 0\n", tdesc.Columns);
2385 ok(tdesc.PackedSize == tv_ecbs[i].p, "PackedSize is %#x, expected %#x\n", tdesc.PackedSize, tv_ecbs[i].p);
2386 ok(tdesc.UnpackedSize == tv_ecbs[i].u, "UnpackedSize is %#x, expected %#x\n", tdesc.UnpackedSize, tv_ecbs[i].u);
2387 ok(tdesc.Stride == tv_ecbs[i].s, "Stride is %#x, expected %#x\n", tdesc.Stride, tv_ecbs[i].s);
2390 effect->lpVtbl->Release(effect);
2393 #if 0
2394 float4 VS( float4 Pos : POSITION ) : SV_POSITION { return Pos; }
2395 float4 VS2( int4 Pos : POSITION ) : SV_POSITION { return Pos; }
2396 float4 PS( float4 Pos : SV_POSITION ) : SV_Target { return float4( 1.0f, 1.0f, 0.0f, 1.0f ); }
2397 struct GS_OUT { float4 Pos : SV_POSITION; };
2398 [maxvertexcount(3)]
2399 void GS( triangle float4 Pos[3] : SV_POSITION, inout TriangleStream<GS_OUT> TriStream )
2401 GS_OUT out1;
2402 out1.Pos = Pos[0];
2403 TriStream.Append( out1 );
2404 out1.Pos = Pos[1];
2405 TriStream.Append( out1 );
2406 out1.Pos = Pos[2];
2407 TriStream.Append( out1 );
2408 TriStream.RestartStrip();
2410 VertexShader v0 = NULL;
2411 PixelShader p0 = NULL;
2412 GeometryShader g0 = NULL;
2413 VertexShader v[2] = { CompileShader( vs_4_0, VS() ), CompileShader( vs_4_0, VS2() ) };
2414 PixelShader p = CompileShader( ps_4_0, PS() );
2415 GeometryShader g = CompileShader( gs_4_0, GS() );
2416 technique10 Render
2418 pass P0 {}
2419 pass P1
2421 SetPixelShader( NULL );
2422 SetVertexShader( NULL );
2423 SetGeometryShader( NULL );
2425 pass P2
2427 SetPixelShader( NULL );
2428 SetVertexShader( NULL );
2429 SetGeometryShader( NULL );
2431 pass P3
2433 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2434 SetVertexShader( CompileShader( vs_4_0, VS() ) );
2435 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2437 pass P4
2439 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2440 SetVertexShader( CompileShader( vs_4_0, VS2() ) );
2441 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2443 pass P5
2445 SetPixelShader( p0 );
2446 SetVertexShader( v0 );
2447 SetGeometryShader( g0 );
2449 pass P6
2451 SetPixelShader( p );
2452 SetVertexShader( v[0] );
2453 SetGeometryShader( g );
2455 pass P7
2457 SetPixelShader( p );
2458 SetVertexShader( v[1] );
2459 SetGeometryShader( g );
2462 #endif
2463 static DWORD fx_local_shader[] = {
2464 0x43425844, 0x95577e13, 0xab5facae, 0xd06d9eab, 0x8b127be0, 0x00000001, 0x00001652, 0x00000001,
2465 0x00000024, 0x30315846, 0x00001626, 0xfeff1001, 0x00000000, 0x00000000, 0x00000006, 0x00000000,
2466 0x00000000, 0x00000000, 0x00000001, 0x0000138a, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2467 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000d, 0x00000006, 0x00000000, 0x74726556,
2468 0x68537865, 0x72656461, 0x00000400, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2469 0x00000600, 0x00307600, 0x65786950, 0x6168536c, 0x00726564, 0x00000030, 0x00000002, 0x00000000,
2470 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x47003070, 0x656d6f65, 0x53797274, 0x65646168,
2471 0x005b0072, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00070000, 0x30670000,
2472 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000600, 0xb4007600,
2473 0x44000001, 0x02434258, 0x5f11b96d, 0x31cdd883, 0xade81d9f, 0x014d6a2d, 0xb4000000, 0x05000001,
2474 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000,
2475 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369,
2476 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2477 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000,
2478 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49,
2479 0x4fababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000,
2480 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000,
2481 0x0f000100, 0x5f000000, 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000,
2482 0x36000000, 0xf2050000, 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154,
2483 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000,
2484 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2485 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2486 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xb4000000, 0x44000001, 0xa4434258,
2487 0x42e88ad3, 0xcc4b1ab5, 0x5f89bf37, 0x0139edfb, 0xb4000000, 0x05000001, 0x34000000, 0x8c000000,
2488 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000, 0x00000000, 0x00000000,
2489 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820,
2490 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235,
2491 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x00000000,
2492 0x02000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49, 0x4fababab, 0x2c4e4753,
2493 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000,
2494 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000, 0x0f000100, 0x5f000000,
2495 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000, 0x2b000000, 0xf2050000,
2496 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154, 0x02000000, 0x00000000,
2497 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000,
2498 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2499 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2500 0x00000000, 0x00000000, 0x00000000, 0x70000000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2501 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2502 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2503 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2504 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2505 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2506 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2507 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2508 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2509 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2510 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2511 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2512 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2513 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2514 0x00000000, 0x10006700, 0x44000002, 0x5c434258, 0x7482cd04, 0xb6d82978, 0xe48192f2, 0x01eec6be,
2515 0x10000000, 0x05000002, 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x94000000, 0x52000001,
2516 0x50464544, 0x00000000, 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00475304, 0x1c000001,
2517 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
2518 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000,
2519 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x5300000f,
2520 0x4f505f56, 0x49544953, 0x4f004e4f, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000,
2521 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f,
2522 0x98524448, 0x40000000, 0x26000200, 0x61000000, 0xf2050000, 0x03002010, 0x00000000, 0x01000000,
2523 0x5d000000, 0x5c010018, 0x67010028, 0xf2040000, 0x00001020, 0x01000000, 0x5e000000, 0x03020000,
2524 0x36000000, 0xf2060000, 0x00001020, 0x46000000, 0x0000201e, 0x00000000, 0x13000000, 0x36010000,
2525 0xf2060000, 0x00001020, 0x46000000, 0x0100201e, 0x00000000, 0x13000000, 0x36010000, 0xf2060000,
2526 0x00001020, 0x46000000, 0x0200201e, 0x00000000, 0x13000000, 0x09010000, 0x3e010000, 0x53010000,
2527 0x74544154, 0x08000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000,
2528 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000,
2529 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2530 0x03000000, 0x05000000, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x52000000, 0x65646e65,
2531 0x30500072, 0x00315000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
2532 0x00000001, 0x00000002, 0x00000000, 0x01003250, 0x02000000, 0x00000000, 0x01000000, 0x02000000,
2533 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x50000000, 0x01b00033, 0x58440000, 0x269a4342,
2534 0x7ba57ff9, 0x728d8af1, 0x9e9d796d, 0x0001ff59, 0x01b00000, 0x00050000, 0x00340000, 0x008c0000,
2535 0x00c00000, 0x00f40000, 0x01340000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000,
2536 0x001c0000, 0x04000000, 0x0100ffff, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228,
2537 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32,
2538 0xab003434, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000,
2539 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47,
2540 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000,
2541 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00385244, 0x00400000, 0x000e0000, 0x00650000,
2542 0x20f20300, 0x00000010, 0x00360000, 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80,
2543 0x00003f80, 0x00000000, 0x003e3f80, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2544 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2545 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2546 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2547 0x00000000, 0x00000000, 0x083e0000, 0x00000000, 0x01b40000, 0x58440000, 0x6d024342, 0x835f11b9,
2548 0x9f31cdd8, 0x2dade81d, 0x00014d6a, 0x01b40000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2549 0x00f40000, 0x01380000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2550 0x04000000, 0x0100fffe, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2551 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2552 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000,
2553 0x00000000, 0x0f0f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab, 0x002c4e47, 0x00010000,
2554 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2555 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001, 0x005f0000, 0x10f20300,
2556 0x00000010, 0x00670000, 0x20f20400, 0x00000010, 0x00010000, 0x00360000, 0x20f20500, 0x00000010,
2557 0x1e460000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2558 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2559 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2560 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2561 0x00000000, 0x00000000, 0x09fa0000, 0x00000000, 0x02100000, 0x58440000, 0x045c4342, 0x787482cd,
2562 0xf2b6d829, 0xbee48192, 0x0001eec6, 0x02100000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2563 0x00f40000, 0x01940000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2564 0x04000000, 0x01004753, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2565 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2566 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000,
2567 0x00000000, 0x0f0f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47, 0x00010000,
2568 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2569 0x534f505f, 0x4f495449, 0x4853004e, 0x00985244, 0x00400000, 0x00260002, 0x00610000, 0x10f20500,
2570 0x00030020, 0x00000000, 0x00010000, 0x185d0000, 0x285c0100, 0x00670100, 0x20f20400, 0x00000010,
2571 0x00010000, 0x005e0000, 0x00030200, 0x00360000, 0x20f20600, 0x00000010, 0x1e460000, 0x00000020,
2572 0x00000000, 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00010020, 0x00000000,
2573 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00020020, 0x00000000, 0x00130000,
2574 0x00090100, 0x003e0100, 0x54530100, 0x00745441, 0x00080000, 0x00000000, 0x00000000, 0x00020000,
2575 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2576 0x00010000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2577 0x00000000, 0x00000000, 0x00000000, 0x00030000, 0x00050000, 0x00030000, 0x00000000, 0x00000000,
2578 0x00000000, 0x0bba0000, 0x00000000, 0x34500000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2579 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2580 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2581 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2582 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2583 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2584 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2585 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2586 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2587 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2588 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2589 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2590 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2591 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2592 0x00000000, 0x000dd900, 0x00000000, 0x0001b400, 0x42584400, 0x8ad3a443, 0x1ab542e8, 0xbf37cc4b,
2593 0xedfb5f89, 0x00000139, 0x0001b400, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2594 0x00013800, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0xfe040000,
2595 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2596 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2597 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2598 0x000f0f00, 0x534f5000, 0x4f495449, 0xabab004e, 0x47534fab, 0x00002c4e, 0x00000100, 0x00000800,
2599 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2600 0x4e4f4954, 0x44485300, 0x00003c52, 0x01004000, 0x00000f00, 0x00005f00, 0x1010f203, 0x00000000,
2601 0x00006700, 0x1020f204, 0x00000000, 0x00000100, 0x00002b00, 0x1020f205, 0x00000000, 0x101e4600,
2602 0x00000000, 0x00003e00, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000200,
2603 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2604 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2605 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2606 0x00000000, 0x000f9500, 0x00000000, 0x00021000, 0x42584400, 0xcd045c43, 0x29787482, 0x92f2b6d8,
2607 0xc6bee481, 0x000001ee, 0x00021000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2608 0x00019400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x53040000,
2609 0x00010047, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2610 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2611 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2612 0x000f0f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800,
2613 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2614 0x4e4f4954, 0x44485300, 0x00009852, 0x02004000, 0x00002600, 0x00006100, 0x2010f205, 0x00000300,
2615 0x00000000, 0x00000100, 0x00185d00, 0x00285c01, 0x00006701, 0x1020f204, 0x00000000, 0x00000100,
2616 0x00005e00, 0x00000302, 0x00003600, 0x1020f206, 0x00000000, 0x201e4600, 0x00000000, 0x00000000,
2617 0x00001300, 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000100, 0x00000000, 0x00001300,
2618 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000200, 0x00000000, 0x00001300, 0x00000901,
2619 0x00003e01, 0x41545301, 0x00007454, 0x00000800, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2620 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2621 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2622 0x00000000, 0x00000000, 0x00000300, 0x00000500, 0x00000300, 0x00000000, 0x00000000, 0x00000000,
2623 0x00115500, 0x00000000, 0x00355000, 0xa5003650, 0x00000000, 0x50000000, 0x00a50037, 0x00010000,
2624 0x002d0000, 0x00110000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00580000, 0x003c0000,
2625 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00860000, 0x006a0000, 0x00000000, 0xffff0000,
2626 0x0000ffff, 0x00000000, 0x00a50000, 0x00890000, 0x00000000, 0xffff0000, 0x00a7ffff, 0x025f0000,
2627 0x00000000, 0x04170000, 0x003c0000, 0x00000000, 0xffff0000, 0x0419ffff, 0x00000000, 0x05cd0000,
2628 0x006a0000, 0x00000000, 0xffff0000, 0x05cfffff, 0x00000000, 0x07e30000, 0x00080000, 0x00000000,
2629 0x07ea0000, 0x00000000, 0x00000000, 0x07ed0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000,
2630 0x00010000, 0x07f00000, 0x00060000, 0x00000000, 0x00010000, 0x07fc0000, 0x00080000, 0x00000000,
2631 0x00010000, 0x08080000, 0x08140000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00010000,
2632 0x08170000, 0x00060000, 0x00000000, 0x00010000, 0x08230000, 0x00080000, 0x00000000, 0x00010000,
2633 0x082f0000, 0x083b0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x09f20000,
2634 0x00060000, 0x00000000, 0x00070000, 0x0bb20000, 0x00080000, 0x00000000, 0x00070000, 0x0dce0000,
2635 0x0dd60000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x0f8d0000, 0x00060000,
2636 0x00000000, 0x00070000, 0x114d0000, 0x00080000, 0x00000000, 0x00070000, 0x13690000, 0x13710000,
2637 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x00580000, 0x00060000, 0x00000000,
2638 0x00020000, 0x002d0000, 0x00080000, 0x00000000, 0x00020000, 0x00860000, 0x13740000, 0x00030000,
2639 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000,
2640 0x13770000, 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x137f0000, 0x00030000, 0x00000000,
2641 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000, 0x13820000,
2642 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x00000000,
2645 static void test_effect_local_shader(ID3D10Device *device)
2647 HRESULT hr;
2648 BOOL ret;
2649 ID3D10Effect* effect;
2650 ID3D10EffectVariable* v;
2651 ID3D10EffectPass *p, *null_pass;
2652 ID3D10EffectTechnique *t;
2653 D3D10_PASS_SHADER_DESC pdesc = {0};
2654 D3D10_EFFECT_VARIABLE_DESC vdesc = {0};
2655 ID3D10EffectType *type;
2656 D3D10_EFFECT_TYPE_DESC typedesc;
2657 ID3D10EffectShaderVariable *null_shader, *null_anon_vs, *null_anon_ps, *null_anon_gs,
2658 *p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs;
2660 hr = create_effect(fx_local_shader, 0, device, NULL, &effect);
2661 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed!\n");
2663 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2664 null_pass = t->lpVtbl->GetPassByIndex(t, 10000);
2666 /* check for invalid arguments */
2667 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, NULL);
2668 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2670 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, &pdesc);
2671 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2673 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, NULL);
2674 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2676 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, &pdesc);
2677 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2679 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, NULL);
2680 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2682 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, &pdesc);
2683 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2685 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2686 p = t->lpVtbl->GetPassByIndex(t, 0);
2688 hr = p->lpVtbl->GetVertexShaderDesc(p, NULL);
2689 ok(hr == E_INVALIDARG, "GetVertexShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2691 hr = p->lpVtbl->GetPixelShaderDesc(p, NULL);
2692 ok(hr == E_INVALIDARG, "GetPixelShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2694 hr = p->lpVtbl->GetGeometryShaderDesc(p, NULL);
2695 ok(hr == E_INVALIDARG, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2697 /* get the null_shader_variable */
2698 v = effect->lpVtbl->GetVariableByIndex(effect, 10000);
2699 null_shader = v->lpVtbl->AsShader(v);
2701 /* pass 0 */
2702 p = t->lpVtbl->GetPassByIndex(t, 0);
2703 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2704 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2705 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2706 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2708 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2709 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2711 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2712 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2713 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2714 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2716 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2717 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2719 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2720 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2721 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2722 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2724 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2725 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2727 /* pass 1 */
2728 p = t->lpVtbl->GetPassByIndex(t, 1);
2730 /* pass 1 vertexshader */
2731 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2732 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2733 null_anon_vs = pdesc.pShaderVariable;
2734 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2736 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2737 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2739 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2740 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2741 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2742 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2743 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2744 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2746 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2747 ok(ret, "IsValid() failed\n");
2749 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2750 ret = type->lpVtbl->IsValid(type);
2751 ok(ret, "IsValid() failed\n");
2753 hr = type->lpVtbl->GetDesc(type, &typedesc);
2754 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2755 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexhader\"\n", typedesc.TypeName);
2756 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2757 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2758 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2759 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2760 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2761 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2762 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2763 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2764 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2766 /* pass 1 pixelshader */
2767 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2768 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2769 null_anon_ps = pdesc.pShaderVariable;
2770 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2772 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2773 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2775 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2776 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2777 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2778 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2779 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2780 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2782 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2783 ok(ret, "IsValid() failed\n");
2785 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2786 ret = type->lpVtbl->IsValid(type);
2787 ok(ret, "IsValid() failed\n");
2789 hr = type->lpVtbl->GetDesc(type, &typedesc);
2790 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2791 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2792 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2793 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2794 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2795 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2796 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2797 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2798 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2799 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2800 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2802 /* pass 1 geometryshader */
2803 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2804 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2805 null_anon_gs = pdesc.pShaderVariable;
2806 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2808 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2809 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2811 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2812 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2813 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2814 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2815 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2816 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2818 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2819 ok(ret, "IsValid() failed\n");
2821 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2822 ret = type->lpVtbl->IsValid(type);
2823 ok(ret, "IsValid() failed\n");
2825 hr = type->lpVtbl->GetDesc(type, &typedesc);
2826 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2827 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
2828 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2829 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
2830 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2831 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2832 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2833 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2834 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2835 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2836 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2838 /* pass 2 */
2839 p = t->lpVtbl->GetPassByIndex(t, 2);
2841 /* pass 2 vertexshader */
2842 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2843 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2844 ok(pdesc.pShaderVariable == null_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_vs);
2845 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2847 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2848 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2850 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2851 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2852 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2853 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2854 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2855 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2857 /* pass 2 pixelshader */
2858 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2859 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2860 ok(pdesc.pShaderVariable == null_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_ps);
2861 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2863 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2864 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2866 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2867 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2868 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2869 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2870 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2871 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2873 /* pass 2 geometryshader */
2874 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2875 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2876 ok(pdesc.pShaderVariable == null_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_gs);
2877 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2879 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2880 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2882 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2883 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2884 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2885 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2886 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2887 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2889 /* pass 3 */
2890 p = t->lpVtbl->GetPassByIndex(t, 3);
2892 /* pass 3 vertexshader */
2893 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2894 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2895 p3_anon_vs = pdesc.pShaderVariable;
2896 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2898 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2899 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2901 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2902 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2903 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2904 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2905 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2906 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2908 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2909 ok(ret, "IsValid() failed\n");
2911 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2912 ret = type->lpVtbl->IsValid(type);
2913 ok(ret, "IsValid() failed\n");
2915 hr = type->lpVtbl->GetDesc(type, &typedesc);
2916 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2917 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
2918 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2919 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2920 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2921 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2922 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2923 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2924 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2925 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2926 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2928 /* pass 3 pixelshader */
2929 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2930 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2931 p3_anon_ps = pdesc.pShaderVariable;
2932 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2934 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2935 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2937 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2938 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2939 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2940 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2941 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2942 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2944 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2945 ok(ret, "IsValid() failed\n");
2947 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2948 ret = type->lpVtbl->IsValid(type);
2949 ok(ret, "IsValid() failed\n");
2951 hr = type->lpVtbl->GetDesc(type, &typedesc);
2952 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2953 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2954 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2955 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2956 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2957 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2958 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2959 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2960 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2961 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2962 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2964 /* pass 3 geometryshader */
2965 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2966 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2967 p3_anon_gs = pdesc.pShaderVariable;
2968 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2970 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2971 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2973 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2974 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2975 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2976 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2977 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2978 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2980 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2981 ok(ret, "IsValid() failed\n");
2983 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2984 ret = type->lpVtbl->IsValid(type);
2985 ok(ret, "IsValid() failed\n");
2987 hr = type->lpVtbl->GetDesc(type, &typedesc);
2988 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2989 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
2990 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2991 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
2992 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2993 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2994 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2995 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2996 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2997 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2998 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3000 /* pass 4 */
3001 p = t->lpVtbl->GetPassByIndex(t, 4);
3003 /* pass 4 vertexshader */
3004 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3005 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3006 ok(pdesc.pShaderVariable != p3_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_vs);
3007 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3009 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3010 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3012 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3013 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3014 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3015 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3016 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3017 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3019 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3020 ok(ret, "IsValid() failed\n");
3022 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3023 ret = type->lpVtbl->IsValid(type);
3024 ok(ret, "IsValid() failed\n");
3026 hr = type->lpVtbl->GetDesc(type, &typedesc);
3027 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3028 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
3029 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3030 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3031 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3032 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3033 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3034 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3035 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3036 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3037 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3039 /* pass 4 pixelshader */
3040 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3041 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3042 ok(pdesc.pShaderVariable != p3_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_ps);
3043 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3045 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3046 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3048 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3049 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3050 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3051 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3052 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3053 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3055 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3056 ok(ret, "IsValid() failed\n");
3058 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3059 ret = type->lpVtbl->IsValid(type);
3060 ok(ret, "IsValid() failed\n");
3062 hr = type->lpVtbl->GetDesc(type, &typedesc);
3063 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3064 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
3065 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3066 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3067 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3068 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3069 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3070 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3071 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3072 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3073 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3075 /* pass 4 geometryshader */
3076 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3077 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3078 ok(pdesc.pShaderVariable != p3_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_gs);
3079 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %x\n", pdesc.ShaderIndex, 0);
3081 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3082 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3084 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3085 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3086 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3087 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3088 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3089 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3091 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3092 ok(ret, "IsValid() failed\n");
3094 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3095 ret = type->lpVtbl->IsValid(type);
3096 ok(ret, "IsValid() failed\n");
3098 hr = type->lpVtbl->GetDesc(type, &typedesc);
3099 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3100 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
3101 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3102 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3103 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3104 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3105 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3106 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3107 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3108 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3109 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3111 /* pass 5 */
3112 p = t->lpVtbl->GetPassByIndex(t, 5);
3114 /* pass 5 vertexshader */
3115 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3116 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3117 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3119 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3120 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3122 ok(strcmp(vdesc.Name, "v0") == 0, "Name is \"%s\", expected \"v0\"\n", vdesc.Name);
3123 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3124 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3125 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3126 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3127 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3129 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3130 ok(ret, "IsValid() failed\n");
3132 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3133 ret = type->lpVtbl->IsValid(type);
3134 ok(ret, "IsValid() failed\n");
3136 hr = type->lpVtbl->GetDesc(type, &typedesc);
3137 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3138 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3139 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3140 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3141 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3142 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3143 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3144 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3145 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3146 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3147 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3149 /* pass 5 pixelshader */
3150 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3151 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3152 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3154 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3155 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3157 ok(strcmp(vdesc.Name, "p0") == 0, "Name is \"%s\", expected \"p0\"\n", vdesc.Name);
3158 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3159 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3160 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3161 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3162 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3164 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3165 ok(ret, "IsValid() failed\n");
3167 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3168 ret = type->lpVtbl->IsValid(type);
3169 ok(ret, "IsValid() failed\n");
3171 hr = type->lpVtbl->GetDesc(type, &typedesc);
3172 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3173 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3174 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3175 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3176 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3177 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3178 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3179 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3180 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3181 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3182 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3184 /* pass 5 geometryshader */
3185 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3186 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3187 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3189 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3190 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3192 ok(strcmp(vdesc.Name, "g0") == 0, "Name is \"%s\", expected \"g0\"\n", vdesc.Name);
3193 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3194 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3195 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3196 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3197 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3199 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3200 ok(ret, "IsValid() failed\n");
3202 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3203 ret = type->lpVtbl->IsValid(type);
3204 ok(ret, "IsValid() failed\n");
3206 hr = type->lpVtbl->GetDesc(type, &typedesc);
3207 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3208 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3209 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3210 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3211 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3212 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3213 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3214 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3215 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3216 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3217 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3219 /* pass 6 */
3220 p = t->lpVtbl->GetPassByIndex(t, 6);
3222 /* pass 6 vertexshader */
3223 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3224 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3225 p6_vs = pdesc.pShaderVariable;
3226 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3228 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3229 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3231 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3232 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3233 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3234 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3235 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3236 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3238 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3239 ok(ret, "IsValid() failed\n");
3241 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3242 ret = type->lpVtbl->IsValid(type);
3243 ok(ret, "IsValid() failed\n");
3245 hr = type->lpVtbl->GetDesc(type, &typedesc);
3246 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3247 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3248 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3249 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3250 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3251 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3252 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3253 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3254 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3255 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3256 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3258 /* pass 6 pixelshader */
3259 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3260 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3261 p6_ps = pdesc.pShaderVariable;
3262 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3264 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3265 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3267 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3268 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3269 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3270 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3271 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3272 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3274 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3275 ok(ret, "IsValid() failed\n");
3277 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3278 ret = type->lpVtbl->IsValid(type);
3279 ok(ret, "IsValid() failed\n");
3281 hr = type->lpVtbl->GetDesc(type, &typedesc);
3282 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3283 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3284 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3285 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3286 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3287 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3288 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3289 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3290 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3291 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3292 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3294 /* pass 6 geometryshader */
3295 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3296 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3297 p6_gs = pdesc.pShaderVariable;
3298 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3300 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3301 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3303 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3304 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3305 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3306 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3307 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3308 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3310 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3311 ok(ret, "IsValid() failed\n");
3313 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3314 ret = type->lpVtbl->IsValid(type);
3315 ok(ret, "IsValid() failed\n");
3317 hr = type->lpVtbl->GetDesc(type, &typedesc);
3318 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3319 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3320 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3321 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3322 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3323 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3324 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3325 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3326 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3327 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3328 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3330 /* pass 7 */
3331 p = t->lpVtbl->GetPassByIndex(t, 7);
3333 /* pass 7 vertexshader */
3334 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3335 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3336 ok(pdesc.pShaderVariable == p6_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_vs);
3337 ok(pdesc.ShaderIndex == 1, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 1);
3339 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3340 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3342 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3343 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3344 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3345 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3346 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3347 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3349 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3350 ok(ret, "IsValid() failed\n");
3352 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3353 ret = type->lpVtbl->IsValid(type);
3354 ok(ret, "IsValid() failed\n");
3356 hr = type->lpVtbl->GetDesc(type, &typedesc);
3357 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3358 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3359 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3360 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3361 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3362 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3363 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3364 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3365 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3366 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3367 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3369 /* pass 7 pixelshader */
3370 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3371 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3372 ok(pdesc.pShaderVariable == p6_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_ps);
3373 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3375 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3376 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3378 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3379 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3380 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3381 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3382 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3383 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3385 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3386 ok(ret, "IsValid() failed\n");
3388 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3389 ret = type->lpVtbl->IsValid(type);
3390 ok(ret, "IsValid() failed\n");
3392 hr = type->lpVtbl->GetDesc(type, &typedesc);
3393 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3394 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3395 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3396 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3397 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3398 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3399 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3400 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3401 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3402 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3403 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3405 /* pass 7 geometryshader */
3406 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3407 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3408 ok(pdesc.pShaderVariable == p6_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_gs);
3409 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3411 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3412 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3414 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3415 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3416 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3417 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3418 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3419 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3421 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3422 ok(ret, "IsValid() failed\n");
3424 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3425 ret = type->lpVtbl->IsValid(type);
3426 ok(ret, "IsValid() failed\n");
3428 hr = type->lpVtbl->GetDesc(type, &typedesc);
3429 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3430 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3431 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3432 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3433 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3434 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3435 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3436 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3437 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3438 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3439 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3441 effect->lpVtbl->Release(effect);
3444 START_TEST(effect)
3446 ID3D10Device *device;
3447 ULONG refcount;
3449 device = create_device();
3450 if (!device)
3452 skip("Failed to create device, skipping tests\n");
3453 return;
3456 test_effect_constant_buffer_type(device);
3457 test_effect_variable_type(device);
3458 test_effect_variable_member(device);
3459 test_effect_variable_element(device);
3460 test_effect_variable_type_class(device);
3461 test_effect_constant_buffer_stride(device);
3462 test_effect_local_shader(device);
3464 refcount = ID3D10Device_Release(device);
3465 ok(!refcount, "Device has %u references left\n", refcount);