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
22 #include "wine/test.h"
24 static ID3D10Device *create_device(void)
28 if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device)))
30 trace("Created a HW device\n");
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");
41 trace("Failed to create a device, returning NULL\n");
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
64 float f1 : SV_POSITION;
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)
91 ID3D10EffectConstantBuffer *constantbuffer;
92 ID3D10EffectType *type, *type2, *null_type;
93 D3D10_EFFECT_TYPE_DESC type_desc;
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
207 float f3 : SV_POSITION;
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;
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",
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",
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
430 float f3 : SV_POSITION;
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;
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
613 float f3 : SV_POSITION;
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,
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;
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
1125 cbuffer cb <String s = "STRING";>
1129 matrix <uint, 2, 3> u;
1130 row_major matrix <bool, 2, 3> b;
1133 DepthStencilState depthstencil;
1134 RasterizerState rast;
1136 RenderTargetView rtv;
1137 DepthStencilView dsv;
1141 Texture2DMS <float4, 4> t2dms;
1143 Texture2DMSArray <float4, 4> t2dmsa;
1146 GeometryShader gs[2];
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;
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;
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);
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);
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
2135 float2 a6 : packoffset(c0);
2136 float3 b6 : packoffset(c1);
2137 float2 c6 : packoffset(c0.z);
2141 float2 a7 : packoffset(c0);
2142 float3 b7 : packoffset(c1);
2143 float2 c7 : packoffset(c2);
2147 float2 a8 : packoffset(c0);
2148 float3 b8 : packoffset(c0.y);
2149 float4 c8 : packoffset(c2);
2153 float2 a9 : packoffset(c0);
2154 float2 b9 : packoffset(c0.y);
2155 float2 c9 : packoffset(c0.z);
2159 float4 a10 : packoffset(c2);
2195 float2 a15[2] : packoffset(c0);
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;
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 */
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);
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; };
2399 void GS( triangle float4 Pos[3] : SV_POSITION, inout TriangleStream<GS_OUT> TriStream )
2403 TriStream.Append( out1 );
2405 TriStream.Append( out1 );
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() );
2421 SetPixelShader( NULL );
2422 SetVertexShader( NULL );
2423 SetGeometryShader( NULL );
2427 SetPixelShader( NULL );
2428 SetVertexShader( NULL );
2429 SetGeometryShader( NULL );
2433 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2434 SetVertexShader( CompileShader( vs_4_0, VS() ) );
2435 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2439 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2440 SetVertexShader( CompileShader( vs_4_0, VS2() ) );
2441 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2445 SetPixelShader( p0 );
2446 SetVertexShader( v0 );
2447 SetGeometryShader( g0 );
2451 SetPixelShader( p );
2452 SetVertexShader( v[0] );
2453 SetGeometryShader( g );
2457 SetPixelShader( p );
2458 SetVertexShader( v[1] );
2459 SetGeometryShader( g );
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)
2649 ID3D10Effect* effect;
2650 ID3D10EffectVariable* v;
2651 ID3D10EffectPass *p, *p2, *null_pass;
2652 ID3D10EffectTechnique *t, *t2, *null_technique;
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 null_technique = effect->lpVtbl->GetTechniqueByIndex(effect, 0xffffffff);
2664 null_pass = null_technique->lpVtbl->GetPassByIndex(null_technique, 0xffffffff);
2666 /* check technique */
2667 t = effect->lpVtbl->GetTechniqueByName(effect, NULL);
2668 ok(null_technique == t, "GetTechniqueByName got %p, expected %p\n", t, null_technique);
2670 t = effect->lpVtbl->GetTechniqueByName(effect, "invalid");
2671 ok(null_technique == t, "GetTechniqueByName got %p, expected %p\n", t, null_technique);
2673 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2674 ok(null_technique != t, "GetTechniqueByIndex failed %p\n", t);
2676 t2 = effect->lpVtbl->GetTechniqueByName(effect, "Render");
2677 ok(t2 == t, "GetTechniqueByName got %p, expected %p\n", t2, t);
2679 /* check invalid pass arguments */
2680 p = null_technique->lpVtbl->GetPassByName(null_technique, NULL);
2681 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2683 p = null_technique->lpVtbl->GetPassByName(null_technique, "invalid");
2684 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2687 /* This crashes on W7/DX10, if t is a valid technique and name=NULL. */
2688 p = t->lpVtbl->GetPassByName(t, NULL);
2689 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2692 p = t->lpVtbl->GetPassByIndex(t, 0xffffffff);
2693 ok(null_pass == p, "GetPassByIndex got %p, expected %p\n", p, null_pass);
2695 /* check for invalid arguments */
2696 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, NULL);
2697 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2699 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, &pdesc);
2700 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2702 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, NULL);
2703 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2705 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, &pdesc);
2706 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2708 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, NULL);
2709 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2711 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, &pdesc);
2712 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2714 /* check valid pass arguments */
2715 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2716 p = t->lpVtbl->GetPassByIndex(t, 0);
2718 p2 = t->lpVtbl->GetPassByName(t, "P0");
2719 ok(p2 == p, "GetPassByName got %p, expected %p\n", p2, p);
2721 hr = p->lpVtbl->GetVertexShaderDesc(p, NULL);
2722 ok(hr == E_INVALIDARG, "GetVertexShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2724 hr = p->lpVtbl->GetPixelShaderDesc(p, NULL);
2725 ok(hr == E_INVALIDARG, "GetPixelShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2727 hr = p->lpVtbl->GetGeometryShaderDesc(p, NULL);
2728 ok(hr == E_INVALIDARG, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2730 /* get the null_shader_variable */
2731 v = effect->lpVtbl->GetVariableByIndex(effect, 10000);
2732 null_shader = v->lpVtbl->AsShader(v);
2735 p = t->lpVtbl->GetPassByIndex(t, 0);
2736 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2737 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2738 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2739 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2741 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2742 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2744 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2745 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2746 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2747 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2749 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2750 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2752 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2753 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2754 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2755 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2757 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2758 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2761 p = t->lpVtbl->GetPassByIndex(t, 1);
2763 /* pass 1 vertexshader */
2764 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2765 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2766 null_anon_vs = pdesc.pShaderVariable;
2767 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2769 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2770 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2772 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2773 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2774 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2775 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2776 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2777 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2779 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2780 ok(ret, "IsValid() failed\n");
2782 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2783 ret = type->lpVtbl->IsValid(type);
2784 ok(ret, "IsValid() failed\n");
2786 hr = type->lpVtbl->GetDesc(type, &typedesc);
2787 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2788 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexhader\"\n", typedesc.TypeName);
2789 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2790 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2791 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2792 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2793 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2794 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2795 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2796 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2797 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2799 /* pass 1 pixelshader */
2800 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2801 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2802 null_anon_ps = pdesc.pShaderVariable;
2803 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2805 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2806 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2808 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2809 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2810 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2811 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2812 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2813 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2815 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2816 ok(ret, "IsValid() failed\n");
2818 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2819 ret = type->lpVtbl->IsValid(type);
2820 ok(ret, "IsValid() failed\n");
2822 hr = type->lpVtbl->GetDesc(type, &typedesc);
2823 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2824 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2825 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2826 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2827 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2828 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2829 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2830 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2831 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2832 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2833 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2835 /* pass 1 geometryshader */
2836 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2837 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2838 null_anon_gs = pdesc.pShaderVariable;
2839 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2841 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2842 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2844 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2845 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2846 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2847 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2848 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2849 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2851 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2852 ok(ret, "IsValid() failed\n");
2854 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2855 ret = type->lpVtbl->IsValid(type);
2856 ok(ret, "IsValid() failed\n");
2858 hr = type->lpVtbl->GetDesc(type, &typedesc);
2859 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2860 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
2861 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2862 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
2863 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2864 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2865 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2866 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2867 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2868 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2869 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2872 p = t->lpVtbl->GetPassByIndex(t, 2);
2874 /* pass 2 vertexshader */
2875 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2876 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2877 ok(pdesc.pShaderVariable == null_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_vs);
2878 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2880 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2881 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2883 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2884 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2885 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2886 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2887 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2888 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2890 /* pass 2 pixelshader */
2891 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2892 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2893 ok(pdesc.pShaderVariable == null_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_ps);
2894 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2896 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2897 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2899 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2900 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2901 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2902 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2903 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2904 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2906 /* pass 2 geometryshader */
2907 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2908 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2909 ok(pdesc.pShaderVariable == null_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_gs);
2910 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2912 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2913 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2915 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2916 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2917 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2918 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2919 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2920 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2923 p = t->lpVtbl->GetPassByIndex(t, 3);
2925 /* pass 3 vertexshader */
2926 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2927 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2928 p3_anon_vs = pdesc.pShaderVariable;
2929 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2931 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2932 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2934 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2935 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2936 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2937 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2938 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2939 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2941 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2942 ok(ret, "IsValid() failed\n");
2944 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2945 ret = type->lpVtbl->IsValid(type);
2946 ok(ret, "IsValid() failed\n");
2948 hr = type->lpVtbl->GetDesc(type, &typedesc);
2949 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2950 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
2951 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2952 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2953 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2954 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2955 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2956 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2957 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2958 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2959 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2961 /* pass 3 pixelshader */
2962 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2963 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2964 p3_anon_ps = pdesc.pShaderVariable;
2965 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2967 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2968 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2970 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2971 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2972 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2973 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2974 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2975 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2977 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2978 ok(ret, "IsValid() failed\n");
2980 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2981 ret = type->lpVtbl->IsValid(type);
2982 ok(ret, "IsValid() failed\n");
2984 hr = type->lpVtbl->GetDesc(type, &typedesc);
2985 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2986 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2987 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2988 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2989 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2990 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2991 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2992 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2993 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2994 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2995 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2997 /* pass 3 geometryshader */
2998 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2999 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3000 p3_anon_gs = pdesc.pShaderVariable;
3001 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3003 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3004 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3006 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3007 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3008 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3009 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3010 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3011 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3013 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3014 ok(ret, "IsValid() failed\n");
3016 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3017 ret = type->lpVtbl->IsValid(type);
3018 ok(ret, "IsValid() failed\n");
3020 hr = type->lpVtbl->GetDesc(type, &typedesc);
3021 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3022 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
3023 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3024 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3025 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3026 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3027 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3028 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3029 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3030 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3031 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3034 p = t->lpVtbl->GetPassByIndex(t, 4);
3036 /* pass 4 vertexshader */
3037 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3038 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3039 ok(pdesc.pShaderVariable != p3_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_vs);
3040 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3042 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3043 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3045 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3046 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3047 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3048 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3049 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3050 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3052 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3053 ok(ret, "IsValid() failed\n");
3055 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3056 ret = type->lpVtbl->IsValid(type);
3057 ok(ret, "IsValid() failed\n");
3059 hr = type->lpVtbl->GetDesc(type, &typedesc);
3060 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3061 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
3062 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3063 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3064 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3065 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3066 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3067 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3068 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3069 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3070 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3072 /* pass 4 pixelshader */
3073 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3074 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3075 ok(pdesc.pShaderVariable != p3_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_ps);
3076 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3078 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3079 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3081 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3082 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3083 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3084 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3085 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3086 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3088 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3089 ok(ret, "IsValid() failed\n");
3091 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3092 ret = type->lpVtbl->IsValid(type);
3093 ok(ret, "IsValid() failed\n");
3095 hr = type->lpVtbl->GetDesc(type, &typedesc);
3096 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3097 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
3098 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3099 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3100 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3101 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3102 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3103 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3104 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3105 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3106 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3108 /* pass 4 geometryshader */
3109 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3110 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3111 ok(pdesc.pShaderVariable != p3_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_gs);
3112 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %x\n", pdesc.ShaderIndex, 0);
3114 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3115 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3117 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3118 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3119 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3120 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3121 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3122 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3124 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3125 ok(ret, "IsValid() failed\n");
3127 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3128 ret = type->lpVtbl->IsValid(type);
3129 ok(ret, "IsValid() failed\n");
3131 hr = type->lpVtbl->GetDesc(type, &typedesc);
3132 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3133 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
3134 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3135 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3136 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3137 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3138 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3139 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3140 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3141 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3142 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3145 p = t->lpVtbl->GetPassByIndex(t, 5);
3147 /* pass 5 vertexshader */
3148 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3149 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3150 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3152 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3153 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3155 ok(strcmp(vdesc.Name, "v0") == 0, "Name is \"%s\", expected \"v0\"\n", vdesc.Name);
3156 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3157 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3158 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3159 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3160 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3162 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3163 ok(ret, "IsValid() failed\n");
3165 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3166 ret = type->lpVtbl->IsValid(type);
3167 ok(ret, "IsValid() failed\n");
3169 hr = type->lpVtbl->GetDesc(type, &typedesc);
3170 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3171 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3172 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3173 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3174 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3175 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3176 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3177 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3178 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3179 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3180 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3182 /* pass 5 pixelshader */
3183 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3184 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3185 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3187 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3188 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3190 ok(strcmp(vdesc.Name, "p0") == 0, "Name is \"%s\", expected \"p0\"\n", vdesc.Name);
3191 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3192 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3193 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3194 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3195 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3197 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3198 ok(ret, "IsValid() failed\n");
3200 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3201 ret = type->lpVtbl->IsValid(type);
3202 ok(ret, "IsValid() failed\n");
3204 hr = type->lpVtbl->GetDesc(type, &typedesc);
3205 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3206 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3207 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3208 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3209 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3210 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3211 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3212 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3213 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3214 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3215 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3217 /* pass 5 geometryshader */
3218 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3219 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3220 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3222 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3223 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3225 ok(strcmp(vdesc.Name, "g0") == 0, "Name is \"%s\", expected \"g0\"\n", vdesc.Name);
3226 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3227 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3228 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3229 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3230 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3232 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3233 ok(ret, "IsValid() failed\n");
3235 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3236 ret = type->lpVtbl->IsValid(type);
3237 ok(ret, "IsValid() failed\n");
3239 hr = type->lpVtbl->GetDesc(type, &typedesc);
3240 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3241 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3242 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3243 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3244 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3245 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3246 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3247 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3248 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3249 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3250 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3253 p = t->lpVtbl->GetPassByIndex(t, 6);
3255 /* pass 6 vertexshader */
3256 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3257 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3258 p6_vs = pdesc.pShaderVariable;
3259 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3261 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3262 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3264 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3265 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3266 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3267 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3268 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3269 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3271 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3272 ok(ret, "IsValid() failed\n");
3274 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3275 ret = type->lpVtbl->IsValid(type);
3276 ok(ret, "IsValid() failed\n");
3278 hr = type->lpVtbl->GetDesc(type, &typedesc);
3279 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3280 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3281 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3282 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3283 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3284 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3285 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3286 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3287 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3288 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3289 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3291 /* pass 6 pixelshader */
3292 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3293 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3294 p6_ps = pdesc.pShaderVariable;
3295 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3297 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3298 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3300 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3301 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3302 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3303 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3304 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3305 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3307 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3308 ok(ret, "IsValid() failed\n");
3310 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3311 ret = type->lpVtbl->IsValid(type);
3312 ok(ret, "IsValid() failed\n");
3314 hr = type->lpVtbl->GetDesc(type, &typedesc);
3315 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3316 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3317 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3318 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3319 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3320 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3321 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3322 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3323 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3324 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3325 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3327 /* pass 6 geometryshader */
3328 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3329 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3330 p6_gs = pdesc.pShaderVariable;
3331 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3333 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3334 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3336 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3337 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3338 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3339 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3340 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3341 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3343 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3344 ok(ret, "IsValid() failed\n");
3346 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3347 ret = type->lpVtbl->IsValid(type);
3348 ok(ret, "IsValid() failed\n");
3350 hr = type->lpVtbl->GetDesc(type, &typedesc);
3351 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3352 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3353 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3354 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3355 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3356 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3357 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3358 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3359 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3360 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3361 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3364 p = t->lpVtbl->GetPassByIndex(t, 7);
3366 /* pass 7 vertexshader */
3367 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3368 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3369 ok(pdesc.pShaderVariable == p6_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_vs);
3370 ok(pdesc.ShaderIndex == 1, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 1);
3372 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3373 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3375 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3376 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3377 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3378 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3379 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3380 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3382 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3383 ok(ret, "IsValid() failed\n");
3385 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3386 ret = type->lpVtbl->IsValid(type);
3387 ok(ret, "IsValid() failed\n");
3389 hr = type->lpVtbl->GetDesc(type, &typedesc);
3390 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3391 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3392 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3393 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3394 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3395 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3396 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3397 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3398 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3399 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3400 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3402 /* pass 7 pixelshader */
3403 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3404 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3405 ok(pdesc.pShaderVariable == p6_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_ps);
3406 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3408 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3409 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3411 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3412 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3413 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3414 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3415 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3416 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3418 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3419 ok(ret, "IsValid() failed\n");
3421 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3422 ret = type->lpVtbl->IsValid(type);
3423 ok(ret, "IsValid() failed\n");
3425 hr = type->lpVtbl->GetDesc(type, &typedesc);
3426 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3427 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3428 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3429 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3430 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3431 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3432 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3433 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3434 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3435 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3436 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3438 /* pass 7 geometryshader */
3439 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3440 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3441 ok(pdesc.pShaderVariable == p6_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_gs);
3442 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3444 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3445 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3447 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3448 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3449 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3450 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3451 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3452 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3454 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3455 ok(ret, "IsValid() failed\n");
3457 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3458 ret = type->lpVtbl->IsValid(type);
3459 ok(ret, "IsValid() failed\n");
3461 hr = type->lpVtbl->GetDesc(type, &typedesc);
3462 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3463 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3464 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3465 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3466 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3467 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3468 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3469 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3470 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3471 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3472 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3474 effect->lpVtbl->Release(effect);
3478 * test_effect_get_variable_by
3483 float f1 : SV_POSITION;
3488 float f3 : SV_POSITION;
3491 Texture1D tex1 : COLOR2;
3492 Texture1D tex2 : COLOR1;
3494 static DWORD fx_test_egvb[] = {
3495 0x43425844, 0x63d60ede, 0xf75a09d1, 0x47da5604, 0x7ef6e331, 0x00000001, 0x000001ca, 0x00000001,
3496 0x00000024, 0x30315846, 0x0000019e, 0xfeff1001, 0x00000002, 0x00000004, 0x00000002, 0x00000000,
3497 0x00000000, 0x00000000, 0x00000000, 0x0000008a, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3498 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
3499 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
3500 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032,
3501 0x00346600, 0x4f4c4f43, 0x54003152, 0x75747865, 0x44316572, 0x00005300, 0x00000200, 0x00000000,
3502 0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x78657400, 0x4f430031, 0x32524f4c, 0x78657400,
3503 0x00040032, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x00290000, 0x000d0000,
3504 0x002c0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x000d0000, 0x003b0000,
3505 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00420000, 0x00100000, 0x00000000, 0x00020000,
3506 0xffff0000, 0x0000ffff, 0x00460000, 0x000d0000, 0x002c0000, 0x00000000, 0x00000000, 0x00000000,
3507 0x00000000, 0x00490000, 0x000d0000, 0x004c0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000,
3508 0x00790000, 0x005d0000, 0x007e0000, 0xffff0000, 0x0000ffff, 0x00850000, 0x005d0000, 0x004c0000,
3509 0xffff0000, 0x0000ffff, 0x00000000,
3512 static void test_effect_get_variable_by(ID3D10Device *device)
3514 ID3D10Effect *effect;
3515 ID3D10EffectVariable *variable_by_index, *variable, *null_variable;
3518 hr = create_effect(fx_test_egvb, 0, device, NULL, &effect);
3519 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
3521 /* get the null variable */
3522 null_variable = effect->lpVtbl->GetVariableByIndex(effect, 0xffffffff);
3524 /* check for invalid arguments */
3525 variable = effect->lpVtbl->GetVariableByName(effect, NULL);
3526 ok(null_variable == variable, "GetVariableByName got %p, expected %p\n", variable, null_variable);
3528 variable = effect->lpVtbl->GetVariableBySemantic(effect, NULL);
3529 ok(null_variable == variable, "GetVariableBySemantic got %p, expected %p\n", variable, null_variable);
3531 variable = effect->lpVtbl->GetVariableByName(effect, "invalid");
3532 ok(null_variable == variable, "GetVariableByName got %p, expected %p\n", variable, null_variable);
3534 variable = effect->lpVtbl->GetVariableBySemantic(effect, "invalid");
3535 ok(null_variable == variable, "GetVariableBySemantic got %p, expected %p\n", variable, null_variable);
3538 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 0);
3539 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3541 variable = effect->lpVtbl->GetVariableByName(effect, "f1");
3542 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3544 variable = effect->lpVtbl->GetVariableBySemantic(effect, "SV_POSITION");
3545 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3548 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 1);
3549 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3551 variable = effect->lpVtbl->GetVariableByName(effect, "f2");
3552 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3554 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR0");
3555 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3558 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 2);
3559 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3561 variable = effect->lpVtbl->GetVariableByName(effect, "f3");
3562 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3564 variable = effect->lpVtbl->GetVariableBySemantic(effect, "SV_POSITION");
3565 ok(variable != null_variable, "GetVariableBySemantic failed %p\n", variable);
3566 ok(variable != variable_by_index, "GetVariableBySemantic failed %p\n", variable);
3569 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 3);
3570 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3572 variable = effect->lpVtbl->GetVariableByName(effect, "f4");
3573 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3575 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR1");
3576 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3579 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 4);
3580 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3582 variable = effect->lpVtbl->GetVariableByName(effect, "tex1");
3583 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3585 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR2");
3586 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3589 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 5);
3590 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3592 variable = effect->lpVtbl->GetVariableByName(effect, "tex2");
3593 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3595 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR1");
3596 ok(variable != null_variable, "GetVariableBySemantic failed %p\n", variable);
3597 ok(variable != variable_by_index, "GetVariableBySemantic failed %p\n", variable);
3599 effect->lpVtbl->Release(effect);
3603 RasterizerState rast_state
3605 FillMode = wireframe; /* 0x0c */
3606 CullMode = front; /* 0x0d */
3607 FrontCounterClockwise = true; /* 0x0e */
3608 DepthBias = -4; /* 0x0f */
3609 DepthBiasClamp = 0.5f; /* 0x10 */
3610 SlopeScaledDepthBias = 0.25f; /* 0x11 */
3611 DepthClipEnable = false; /* 0x12 */
3612 ScissorEnable = true; /* 0x13 */
3613 MultisampleEnable = true; /* 0x14 */
3614 AntialiasedLineEnable = true; /* 0x15 */
3617 DepthStencilState ds_state
3619 DepthEnable = false; /* 0x16 */
3620 DepthWriteMask = zero; /* 0x17 */
3621 DepthFunc = equal; /* 0x18 */
3622 StencilEnable = true; /* 0x19 */
3623 StencilReadMask = 0x4; /* 0x1a */
3624 StencilWriteMask = 0x5; /* 0x1b */
3625 FrontFaceStencilFail = invert; /* 0x1c */
3626 FrontFaceStencilDepthFail = incr; /* 0x1d */
3627 FrontFaceStencilPass = decr; /* 0x1e */
3628 FrontFaceStencilFunc = less_equal; /* 0x1f */
3629 BackFaceStencilFail = replace; /* 0x20 */
3630 BackFaceStencilDepthFail = incr_sat; /* 0x21 */
3631 BackFaceStencilPass = decr_sat; /* 0x22 */
3632 BackFaceStencilFunc = greater_equal; /* 0x23 */
3635 BlendState blend_state
3637 AlphaToCoverageEnable = false; /* 0x24 */
3638 BlendEnable[0] = true; /* 0x25[0] */
3639 BlendEnable[7] = false; /* 0x25[7] */
3640 SrcBlend = one; /* 0x26 */
3641 DestBlend = src_color; /* 0x27 */
3642 BlendOp = min; /* 0x28 */
3643 SrcBlendAlpha = src_alpha; /* 0x29 */
3644 DestBlendAlpha = inv_src_alpha; /* 0x2a */
3645 BlendOpAlpha = max; /* 0x2b */
3646 RenderTargetWriteMask[0] = 0x8; /* 0x2c[0] */
3647 RenderTargetWriteMask[7] = 0x7; /* 0x2c[7] */
3650 SamplerState sampler0
3652 Filter = min_mag_mip_linear; /* 0x2d */
3653 AddressU = wrap; /* 0x2e */
3654 AddressV = mirror; /* 0x2f */
3655 AddressW = clamp; /* 0x30 */
3656 MipMapLODBias = -1; /* 0x31 */
3657 MaxAnisotropy = 4u; /* 0x32 */
3658 ComparisonFunc = always; /* 0x33 */
3659 BorderColor = float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */
3660 MinLOD = 6u; /* 0x35 */
3661 MaxLOD = 5u; /* 0x36 */
3668 SetBlendState(blend_state, float4(0.5f, 0.6f, 0.7f, 0.8f), 0xffff);
3669 SetDepthStencilState(ds_state, 1.0f);
3670 SetRasterizerState(rast_state);
3674 static DWORD fx_test_state_groups[] =
3676 0x43425844, 0x519ef0cc, 0x85962b86, 0x3c2272fb,
3677 0x17942172, 0x00000001, 0x00000794, 0x00000001,
3678 0x00000024, 0x30315846, 0x00000768, 0xfeff1001,
3679 0x00000001, 0x00000000, 0x00000004, 0x00000000,
3680 0x00000000, 0x00000000, 0x00000001, 0x0000035c,
3681 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3682 0x00000001, 0x00000001, 0x00000000, 0x00000000,
3683 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
3684 0x736c6162, 0x73615200, 0x69726574, 0x5372657a,
3685 0x65746174, 0x00000d00, 0x00000200, 0x00000000,
3686 0x00000000, 0x00000000, 0x00000000, 0x00000400,
3687 0x73617200, 0x74735f74, 0x00657461, 0x00000001,
3688 0x00000002, 0x00000002, 0x00000001, 0x00000002,
3689 0x00000002, 0x00000001, 0x00000004, 0x00000001,
3690 0x00000001, 0x00000002, 0xfffffffc, 0x00000001,
3691 0x00000001, 0x3f000000, 0x00000001, 0x00000001,
3692 0x3e800000, 0x00000001, 0x00000004, 0x00000000,
3693 0x00000001, 0x00000004, 0x00000001, 0x00000001,
3694 0x00000004, 0x00000001, 0x00000001, 0x00000004,
3695 0x00000001, 0x74706544, 0x65745368, 0x6c69636e,
3696 0x74617453, 0x00bc0065, 0x00020000, 0x00000000,
3697 0x00000000, 0x00000000, 0x00000000, 0x00030000,
3698 0x73640000, 0x6174735f, 0x01006574, 0x04000000,
3699 0x00000000, 0x01000000, 0x02000000, 0x00000000,
3700 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3701 0x04000000, 0x01000000, 0x01000000, 0x02000000,
3702 0x04000000, 0x01000000, 0x02000000, 0x05000000,
3703 0x01000000, 0x02000000, 0x06000000, 0x01000000,
3704 0x02000000, 0x07000000, 0x01000000, 0x02000000,
3705 0x08000000, 0x01000000, 0x02000000, 0x04000000,
3706 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3707 0x02000000, 0x04000000, 0x01000000, 0x02000000,
3708 0x05000000, 0x01000000, 0x02000000, 0x07000000,
3709 0x42000000, 0x646e656c, 0x74617453, 0x019b0065,
3710 0x00020000, 0x00000000, 0x00000000, 0x00000000,
3711 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65,
3712 0x74617473, 0x00010065, 0x00040000, 0x00000000,
3713 0x00010000, 0x00040000, 0x00010000, 0x00010000,
3714 0x00040000, 0x00000000, 0x00010000, 0x00020000,
3715 0x00020000, 0x00010000, 0x00020000, 0x00030000,
3716 0x00010000, 0x00020000, 0x00040000, 0x00010000,
3717 0x00020000, 0x00050000, 0x00010000, 0x00020000,
3718 0x00060000, 0x00010000, 0x00020000, 0x00050000,
3719 0x00010000, 0x00020000, 0x00080000, 0x00010000,
3720 0x00020000, 0x00070000, 0x61530000, 0x656c706d,
3721 0x61745372, 0x52006574, 0x02000002, 0x00000000,
3722 0x00000000, 0x00000000, 0x00000000, 0x15000000,
3723 0x73000000, 0x6c706d61, 0x00307265, 0x00000001,
3724 0x00000002, 0x00000015, 0x00000001, 0x00000002,
3725 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3726 0x00000001, 0x00000002, 0x00000003, 0x00000001,
3727 0x00000002, 0xffffffff, 0x00000001, 0x00000002,
3728 0x00000004, 0x00000001, 0x00000002, 0x00000008,
3729 0x00000004, 0x00000001, 0x3f800000, 0x00000001,
3730 0x40000000, 0x00000001, 0x40400000, 0x00000001,
3731 0x40800000, 0x00000001, 0x00000002, 0x00000006,
3732 0x00000001, 0x00000002, 0x00000005, 0x68636574,
3733 0x61700030, 0x00307373, 0x00000004, 0x00000001,
3734 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001,
3735 0x3f333333, 0x00000001, 0x3f4ccccd, 0x00000001,
3736 0x00000002, 0x0000ffff, 0x00000001, 0x00000001,
3737 0x3f800000, 0x00000004, 0x00000000, 0x00000000,
3738 0x00000000, 0xffffffff, 0x00000000, 0x00000039,
3739 0x0000001d, 0x00000000, 0xffffffff, 0x0000000a,
3740 0x0000000c, 0x00000000, 0x00000001, 0x00000044,
3741 0x0000000d, 0x00000000, 0x00000001, 0x00000050,
3742 0x0000000e, 0x00000000, 0x00000001, 0x0000005c,
3743 0x0000000f, 0x00000000, 0x00000001, 0x00000068,
3744 0x00000010, 0x00000000, 0x00000001, 0x00000074,
3745 0x00000011, 0x00000000, 0x00000001, 0x00000080,
3746 0x00000012, 0x00000000, 0x00000001, 0x0000008c,
3747 0x00000013, 0x00000000, 0x00000001, 0x00000098,
3748 0x00000014, 0x00000000, 0x00000001, 0x000000a4,
3749 0x00000015, 0x00000000, 0x00000001, 0x000000b0,
3750 0x00000000, 0x000000ea, 0x000000ce, 0x00000000,
3751 0xffffffff, 0x0000000e, 0x00000016, 0x00000000,
3752 0x00000001, 0x000000f3, 0x00000017, 0x00000000,
3753 0x00000001, 0x000000ff, 0x00000018, 0x00000000,
3754 0x00000001, 0x0000010b, 0x00000019, 0x00000000,
3755 0x00000001, 0x00000117, 0x0000001a, 0x00000000,
3756 0x00000001, 0x00000123, 0x0000001b, 0x00000000,
3757 0x00000001, 0x0000012f, 0x0000001c, 0x00000000,
3758 0x00000001, 0x0000013b, 0x0000001d, 0x00000000,
3759 0x00000001, 0x00000147, 0x0000001e, 0x00000000,
3760 0x00000001, 0x00000153, 0x0000001f, 0x00000000,
3761 0x00000001, 0x0000015f, 0x00000020, 0x00000000,
3762 0x00000001, 0x0000016b, 0x00000021, 0x00000000,
3763 0x00000001, 0x00000177, 0x00000022, 0x00000000,
3764 0x00000001, 0x00000183, 0x00000023, 0x00000000,
3765 0x00000001, 0x0000018f, 0x00000000, 0x000001c2,
3766 0x000001a6, 0x00000000, 0xffffffff, 0x0000000b,
3767 0x00000024, 0x00000000, 0x00000001, 0x000001ce,
3768 0x00000025, 0x00000000, 0x00000001, 0x000001da,
3769 0x00000025, 0x00000007, 0x00000001, 0x000001e6,
3770 0x00000026, 0x00000000, 0x00000001, 0x000001f2,
3771 0x00000027, 0x00000000, 0x00000001, 0x000001fe,
3772 0x00000028, 0x00000000, 0x00000001, 0x0000020a,
3773 0x00000029, 0x00000000, 0x00000001, 0x00000216,
3774 0x0000002a, 0x00000000, 0x00000001, 0x00000222,
3775 0x0000002b, 0x00000000, 0x00000001, 0x0000022e,
3776 0x0000002c, 0x00000000, 0x00000001, 0x0000023a,
3777 0x0000002c, 0x00000007, 0x00000001, 0x00000246,
3778 0x00000000, 0x0000027b, 0x0000025f, 0x00000000,
3779 0xffffffff, 0x0000000a, 0x0000002d, 0x00000000,
3780 0x00000001, 0x00000284, 0x0000002e, 0x00000000,
3781 0x00000001, 0x00000290, 0x0000002f, 0x00000000,
3782 0x00000001, 0x0000029c, 0x00000030, 0x00000000,
3783 0x00000001, 0x000002a8, 0x00000031, 0x00000000,
3784 0x00000001, 0x000002b4, 0x00000032, 0x00000000,
3785 0x00000001, 0x000002c0, 0x00000033, 0x00000000,
3786 0x00000001, 0x000002cc, 0x00000034, 0x00000000,
3787 0x00000001, 0x000002d8, 0x00000035, 0x00000000,
3788 0x00000001, 0x000002fc, 0x00000036, 0x00000000,
3789 0x00000001, 0x00000308, 0x00000000, 0x00000314,
3790 0x00000001, 0x00000000, 0x0000031a, 0x00000006,
3791 0x00000000, 0x0000000a, 0x00000000, 0x00000001,
3792 0x00000320, 0x0000000b, 0x00000000, 0x00000001,
3793 0x00000344, 0x00000002, 0x00000000, 0x00000002,
3794 0x000001c2, 0x00000009, 0x00000000, 0x00000001,
3795 0x00000350, 0x00000001, 0x00000000, 0x00000002,
3796 0x000000ea, 0x00000000, 0x00000000, 0x00000002,
3800 static void test_effect_state_groups(ID3D10Device *device)
3802 ID3D10EffectDepthStencilVariable *d;
3803 ID3D10EffectRasterizerVariable *r;
3804 ID3D10DepthStencilState *ds_state;
3805 ID3D10RasterizerState *rast_state;
3806 ID3D10EffectTechnique *technique;
3807 D3D10_DEPTH_STENCIL_DESC ds_desc;
3808 D3D10_RASTERIZER_DESC rast_desc;
3809 D3D10_SAMPLER_DESC sampler_desc;
3810 ID3D10EffectSamplerVariable *s;
3811 ID3D10BlendState *blend_state;
3812 UINT sample_mask, stencil_ref;
3813 ID3D10EffectBlendVariable *b;
3814 D3D10_BLEND_DESC blend_desc;
3815 D3D10_PASS_DESC pass_desc;
3816 ID3D10EffectVariable *v;
3817 ID3D10EffectPass *pass;
3818 float blend_factor[4];
3819 ID3D10Effect *effect;
3822 hr = create_effect(fx_test_state_groups, 0, device, NULL, &effect);
3823 todo_wine ok(SUCCEEDED(hr), "Failed to create effect, hr %#x.\n", hr);
3827 v = effect->lpVtbl->GetVariableByName(effect, "sampler0");
3828 s = v->lpVtbl->AsSampler(v);
3829 s->lpVtbl->GetBackingStore(s, 0, &sampler_desc);
3830 ok(sampler_desc.Filter == D3D10_FILTER_MIN_MAG_MIP_LINEAR, "Got unexpected Filter %#x.\n", sampler_desc.Filter);
3831 ok(sampler_desc.AddressU == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected AddressU %#x.\n", sampler_desc.AddressU);
3832 ok(sampler_desc.AddressV == D3D10_TEXTURE_ADDRESS_MIRROR, "Got unexpected AddressV %#x.\n", sampler_desc.AddressV);
3833 ok(sampler_desc.AddressW == D3D10_TEXTURE_ADDRESS_CLAMP, "Got unexpected AddressW %#x.\n", sampler_desc.AddressW);
3834 ok(sampler_desc.MipLODBias == -1.0f, "Got unexpected MipLODBias %.8e.\n", sampler_desc.MipLODBias);
3835 ok(sampler_desc.MaxAnisotropy == 4, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc.MaxAnisotropy);
3836 ok(sampler_desc.ComparisonFunc == D3D10_COMPARISON_ALWAYS, "Got unexpected ComparisonFunc %#x.\n",
3837 sampler_desc.ComparisonFunc);
3838 ok(sampler_desc.BorderColor[0] == 1.0f, "Got unexpected BorderColor[0] %.8e.\n", sampler_desc.BorderColor[0]);
3839 ok(sampler_desc.BorderColor[1] == 2.0f, "Got unexpected BorderColor[1] %.8e.\n", sampler_desc.BorderColor[1]);
3840 ok(sampler_desc.BorderColor[2] == 3.0f, "Got unexpected BorderColor[2] %.8e.\n", sampler_desc.BorderColor[2]);
3841 ok(sampler_desc.BorderColor[3] == 4.0f, "Got unexpected BorderColor[3] %.8e.\n", sampler_desc.BorderColor[3]);
3842 ok(sampler_desc.MinLOD == 6.0f, "Got unexpected MinLOD %.8e.\n", sampler_desc.MinLOD);
3843 ok(sampler_desc.MaxLOD == 5.0f, "Got unexpected MaxLOD %.8e.\n", sampler_desc.MaxLOD);
3845 v = effect->lpVtbl->GetVariableByName(effect, "blend_state");
3846 b = v->lpVtbl->AsBlend(v);
3847 b->lpVtbl->GetBackingStore(b, 0, &blend_desc);
3848 ok(!blend_desc.AlphaToCoverageEnable, "Got unexpected AlphaToCoverageEnable %#x.\n",
3849 blend_desc.AlphaToCoverageEnable);
3850 ok(blend_desc.BlendEnable[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc.BlendEnable[0]);
3851 ok(!blend_desc.BlendEnable[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc.BlendEnable[7]);
3852 ok(blend_desc.SrcBlend == D3D10_BLEND_ONE, "Got unexpected SrcBlend %#x.\n", blend_desc.SrcBlend);
3853 ok(blend_desc.DestBlend == D3D10_BLEND_SRC_COLOR, "Got unexpected DestBlend %#x.\n", blend_desc.DestBlend);
3854 ok(blend_desc.BlendOp == D3D10_BLEND_OP_MIN, "Got unexpected BlendOp %#x.\n", blend_desc.BlendOp);
3855 ok(blend_desc.SrcBlendAlpha == D3D10_BLEND_SRC_ALPHA, "Got unexpected SrcBlendAlpha %#x.\n",
3856 blend_desc.SrcBlendAlpha);
3857 ok(blend_desc.DestBlendAlpha == D3D10_BLEND_INV_SRC_ALPHA, "Got unexpected DestBlendAlpha %#x.\n",
3858 blend_desc.DestBlendAlpha);
3859 ok(blend_desc.BlendOpAlpha == D3D10_BLEND_OP_MAX, "Got unexpected BlendOpAlpha %#x.\n", blend_desc.BlendOpAlpha);
3860 ok(blend_desc.RenderTargetWriteMask[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
3861 blend_desc.RenderTargetWriteMask[0]);
3862 ok(blend_desc.RenderTargetWriteMask[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
3863 blend_desc.RenderTargetWriteMask[7]);
3865 v = effect->lpVtbl->GetVariableByName(effect, "ds_state");
3866 d = v->lpVtbl->AsDepthStencil(v);
3867 d->lpVtbl->GetBackingStore(d, 0, &ds_desc);
3868 ok(!ds_desc.DepthEnable, "Got unexpected DepthEnable %#x.\n", ds_desc.DepthEnable);
3869 ok(ds_desc.DepthWriteMask == D3D10_DEPTH_WRITE_MASK_ZERO, "Got unexpected DepthWriteMask %#x.\n",
3870 ds_desc.DepthWriteMask);
3871 ok(ds_desc.DepthFunc == D3D10_COMPARISON_EQUAL, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
3872 ok(ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
3873 ok(ds_desc.StencilReadMask == 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc.StencilReadMask);
3874 ok(ds_desc.StencilWriteMask == 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc.StencilWriteMask);
3875 ok(ds_desc.FrontFace.StencilFailOp == D3D10_STENCIL_OP_INVERT, "Got unexpected FrontFaceStencilFail %#x.\n",
3876 ds_desc.FrontFace.StencilFailOp);
3877 ok(ds_desc.FrontFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR,
3878 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc.FrontFace.StencilDepthFailOp);
3879 ok(ds_desc.FrontFace.StencilPassOp == D3D10_STENCIL_OP_DECR, "Got unexpected FrontFaceStencilPass %#x.\n",
3880 ds_desc.FrontFace.StencilPassOp);
3881 ok(ds_desc.FrontFace.StencilFunc == D3D10_COMPARISON_LESS_EQUAL, "Got unexpected FrontFaceStencilFunc %#x.\n",
3882 ds_desc.FrontFace.StencilFunc);
3883 ok(ds_desc.BackFace.StencilFailOp == D3D10_STENCIL_OP_REPLACE, "Got unexpected BackFaceStencilFail %#x.\n",
3884 ds_desc.BackFace.StencilFailOp);
3885 ok(ds_desc.BackFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR_SAT,
3886 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc.BackFace.StencilDepthFailOp);
3887 ok(ds_desc.BackFace.StencilPassOp == D3D10_STENCIL_OP_DECR_SAT, "Got unexpected BackFaceStencilPass %#x.\n",
3888 ds_desc.BackFace.StencilPassOp);
3889 ok(ds_desc.BackFace.StencilFunc == D3D10_COMPARISON_GREATER_EQUAL, "Got unexpected BackFaceStencilFunc %#x.\n",
3890 ds_desc.BackFace.StencilFunc);
3892 v = effect->lpVtbl->GetVariableByName(effect, "rast_state");
3893 r = v->lpVtbl->AsRasterizer(v);
3894 r->lpVtbl->GetBackingStore(r, 0, &rast_desc);
3895 ok(rast_desc.FillMode == D3D10_FILL_WIREFRAME, "Got unexpected FillMode %#x.\n", rast_desc.FillMode);
3896 ok(rast_desc.CullMode == D3D10_CULL_FRONT, "Got unexpected CullMode %#x.\n", rast_desc.CullMode);
3897 ok(rast_desc.FrontCounterClockwise, "Got unexpected FrontCounterClockwise %#x.\n",
3898 rast_desc.FrontCounterClockwise);
3899 ok(rast_desc.DepthBias == -4, "Got unexpected DepthBias %#x.\n", rast_desc.DepthBias);
3900 ok(rast_desc.DepthBiasClamp == 0.5f, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc.DepthBiasClamp);
3901 ok(rast_desc.SlopeScaledDepthBias == 0.25f, "Got unexpected SlopeScaledDepthBias %.8e.\n",
3902 rast_desc.SlopeScaledDepthBias);
3903 ok(!rast_desc.DepthClipEnable, "Got unexpected DepthClipEnable %#x.\n", rast_desc.DepthClipEnable);
3904 ok(rast_desc.ScissorEnable, "Got unexpected ScissorEnable %#x.\n", rast_desc.ScissorEnable);
3905 ok(rast_desc.MultisampleEnable, "Got unexpected MultisampleEnable %#x.\n", rast_desc.MultisampleEnable);
3906 ok(rast_desc.AntialiasedLineEnable, "Got unexpected AntialiasedLineEnable %#x.\n",
3907 rast_desc.AntialiasedLineEnable);
3909 technique = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
3910 ok(!!technique, "Failed to get technique.\n");
3911 pass = technique->lpVtbl->GetPassByName(technique, "pass0");
3912 ok(!!pass, "Failed to get pass.\n");
3913 hr = pass->lpVtbl->GetDesc(pass, &pass_desc);
3914 ok(SUCCEEDED(hr), "Failed to get pass desc, hr %#x.\n", hr);
3915 ok(!strcmp(pass_desc.Name, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc.Name);
3916 ok(!pass_desc.Annotations, "Got unexpected Annotations %#x.\n", pass_desc.Annotations);
3917 ok(!pass_desc.pIAInputSignature, "Got unexpected pIAInputSignature %p.\n", pass_desc.pIAInputSignature);
3918 ok(pass_desc.StencilRef == 1, "Got unexpected StencilRef %#x.\n", pass_desc.StencilRef);
3919 ok(pass_desc.SampleMask == 0xffff, "Got unexpected SampleMask %#x.\n", pass_desc.SampleMask);
3920 ok(pass_desc.BlendFactor[0] == 0.5f, "Got unexpected BlendFactor[0] %.8e.\n", pass_desc.BlendFactor[0]);
3921 ok(pass_desc.BlendFactor[1] == 0.6f, "Got unexpected BlendFactor[1] %.8e.\n", pass_desc.BlendFactor[1]);
3922 ok(pass_desc.BlendFactor[2] == 0.7f, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc.BlendFactor[2]);
3923 ok(pass_desc.BlendFactor[3] == 0.8f, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc.BlendFactor[3]);
3924 hr = pass->lpVtbl->Apply(pass, 0);
3925 ok(SUCCEEDED(hr), "Failed to apply pass, hr %#x.\n", hr);
3927 ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
3928 ID3D10BlendState_GetDesc(blend_state, &blend_desc);
3929 ok(!blend_desc.AlphaToCoverageEnable, "Got unexpected AlphaToCoverageEnable %#x.\n",
3930 blend_desc.AlphaToCoverageEnable);
3931 ok(blend_desc.BlendEnable[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc.BlendEnable[0]);
3932 ok(!blend_desc.BlendEnable[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc.BlendEnable[7]);
3933 ok(blend_desc.SrcBlend == D3D10_BLEND_ONE, "Got unexpected SrcBlend %#x.\n", blend_desc.SrcBlend);
3934 ok(blend_desc.DestBlend == D3D10_BLEND_SRC_COLOR, "Got unexpected DestBlend %#x.\n", blend_desc.DestBlend);
3935 ok(blend_desc.BlendOp == D3D10_BLEND_OP_MIN, "Got unexpected BlendOp %#x.\n", blend_desc.BlendOp);
3936 ok(blend_desc.SrcBlendAlpha == D3D10_BLEND_SRC_ALPHA, "Got unexpected SrcBlendAlpha %#x.\n",
3937 blend_desc.SrcBlendAlpha);
3938 ok(blend_desc.DestBlendAlpha == D3D10_BLEND_INV_SRC_ALPHA, "Got unexpected DestBlendAlpha %#x.\n",
3939 blend_desc.DestBlendAlpha);
3940 ok(blend_desc.BlendOpAlpha == D3D10_BLEND_OP_MAX, "Got unexpected BlendOpAlpha %#x.\n", blend_desc.BlendOpAlpha);
3941 ok(blend_desc.RenderTargetWriteMask[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
3942 blend_desc.RenderTargetWriteMask[0]);
3943 ok(blend_desc.RenderTargetWriteMask[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
3944 blend_desc.RenderTargetWriteMask[7]);
3945 ok(blend_factor[0] == 0.5f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
3946 ok(blend_factor[1] == 0.6f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
3947 ok(blend_factor[2] == 0.7f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
3948 ok(blend_factor[3] == 0.8f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]);
3949 ok(sample_mask == 0xffff, "Got unexpected sample_mask %#x.\n", sample_mask);
3951 ID3D10Device_OMGetDepthStencilState(device, &ds_state, &stencil_ref);
3952 ID3D10DepthStencilState_GetDesc(ds_state, &ds_desc);
3953 ok(!ds_desc.DepthEnable, "Got unexpected DepthEnable %#x.\n", ds_desc.DepthEnable);
3954 ok(ds_desc.DepthWriteMask == D3D10_DEPTH_WRITE_MASK_ZERO, "Got unexpected DepthWriteMask %#x.\n",
3955 ds_desc.DepthWriteMask);
3956 ok(ds_desc.DepthFunc == D3D10_COMPARISON_NEVER, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
3957 ok(ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
3958 ok(ds_desc.StencilReadMask == 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc.StencilReadMask);
3959 ok(ds_desc.StencilWriteMask == 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc.StencilWriteMask);
3960 ok(ds_desc.FrontFace.StencilFailOp == D3D10_STENCIL_OP_INVERT, "Got unexpected FrontFaceStencilFail %#x.\n",
3961 ds_desc.FrontFace.StencilFailOp);
3962 ok(ds_desc.FrontFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR,
3963 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc.FrontFace.StencilDepthFailOp);
3964 ok(ds_desc.FrontFace.StencilPassOp == D3D10_STENCIL_OP_DECR, "Got unexpected FrontFaceStencilPass %#x.\n",
3965 ds_desc.FrontFace.StencilPassOp);
3966 ok(ds_desc.FrontFace.StencilFunc == D3D10_COMPARISON_LESS_EQUAL, "Got unexpected FrontFaceStencilFunc %#x.\n",
3967 ds_desc.FrontFace.StencilFunc);
3968 ok(ds_desc.BackFace.StencilFailOp == D3D10_STENCIL_OP_REPLACE, "Got unexpected BackFaceStencilFail %#x.\n",
3969 ds_desc.BackFace.StencilFailOp);
3970 ok(ds_desc.BackFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR_SAT,
3971 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc.BackFace.StencilDepthFailOp);
3972 ok(ds_desc.BackFace.StencilPassOp == D3D10_STENCIL_OP_DECR_SAT, "Got unexpected BackFaceStencilPass %#x.\n",
3973 ds_desc.BackFace.StencilPassOp);
3974 ok(ds_desc.BackFace.StencilFunc == D3D10_COMPARISON_GREATER_EQUAL, "Got unexpected BackFaceStencilFunc %#x.\n",
3975 ds_desc.BackFace.StencilFunc);
3976 ok(stencil_ref == 1, "Got unexpected stencil_ref %#x.\n", stencil_ref);
3978 ID3D10Device_RSGetState(device, &rast_state);
3979 ID3D10RasterizerState_GetDesc(rast_state, &rast_desc);
3980 ok(rast_desc.FillMode == D3D10_FILL_WIREFRAME, "Got unexpected FillMode %#x.\n", rast_desc.FillMode);
3981 ok(rast_desc.CullMode == D3D10_CULL_FRONT, "Got unexpected CullMode %#x.\n", rast_desc.CullMode);
3982 ok(rast_desc.FrontCounterClockwise, "Got unexpected FrontCounterClockwise %#x.\n",
3983 rast_desc.FrontCounterClockwise);
3984 ok(rast_desc.DepthBias == -4, "Got unexpected DepthBias %#x.\n", rast_desc.DepthBias);
3985 ok(rast_desc.DepthBiasClamp == 0.5f, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc.DepthBiasClamp);
3986 ok(rast_desc.SlopeScaledDepthBias == 0.25f, "Got unexpected SlopeScaledDepthBias %.8e.\n",
3987 rast_desc.SlopeScaledDepthBias);
3988 ok(!rast_desc.DepthClipEnable, "Got unexpected DepthClipEnable %#x.\n", rast_desc.DepthClipEnable);
3989 ok(rast_desc.ScissorEnable, "Got unexpected ScissorEnable %#x.\n", rast_desc.ScissorEnable);
3990 ok(rast_desc.MultisampleEnable, "Got unexpected MultisampleEnable %#x.\n", rast_desc.MultisampleEnable);
3991 ok(rast_desc.AntialiasedLineEnable, "Got unexpected AntialiasedLineEnable %#x.\n",
3992 rast_desc.AntialiasedLineEnable);
3994 ID3D10RasterizerState_Release(rast_state);
3995 ID3D10DepthStencilState_Release(ds_state);
3996 ID3D10BlendState_Release(blend_state);
3997 effect->lpVtbl->Release(effect);
4002 ID3D10Device *device;
4005 device = create_device();
4008 skip("Failed to create device, skipping tests\n");
4012 test_effect_constant_buffer_type(device);
4013 test_effect_variable_type(device);
4014 test_effect_variable_member(device);
4015 test_effect_variable_element(device);
4016 test_effect_variable_type_class(device);
4017 test_effect_constant_buffer_stride(device);
4018 test_effect_local_shader(device);
4019 test_effect_get_variable_by(device);
4020 test_effect_state_groups(device);
4022 refcount = ID3D10Device_Release(device);
4023 ok(!refcount, "Device has %u references left\n", refcount);