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"
26 static ID3D10Device *create_device(void)
30 if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device)))
32 trace("Created a HW device\n");
36 trace("Failed to create a HW device, trying REF\n");
37 if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device)))
39 trace("Created a REF device\n");
43 trace("Failed to create a device, returning NULL\n");
47 static inline HRESULT create_effect(DWORD *data, UINT flags, ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect)
50 * Don't use sizeof(data), use data[6] as size,
51 * because the DWORD data[] has only complete DWORDs and
52 * so it could happen that there are padded bytes at the end.
54 * The fx size (data[6]) could be up to 3 BYTEs smaller
55 * than the sizeof(data).
57 return D3D10CreateEffectFromMemory(data, data[6], flags, device, effect_pool, effect);
61 * test_effect_constant_buffer_type
66 float f1 : SV_POSITION;
70 static DWORD fx_test_ecbt[] = {
71 0x43425844, 0xc92a4732, 0xbd0d68c0, 0x877f71ee,
72 0x871fc277, 0x00000001, 0x0000010a, 0x00000001,
73 0x00000024, 0x30315846, 0x000000de, 0xfeff1001,
74 0x00000001, 0x00000002, 0x00000000, 0x00000000,
75 0x00000000, 0x00000000, 0x00000000, 0x00000042,
76 0x00000000, 0x00000000, 0x00000000, 0x00000000,
77 0x00000000, 0x00000000, 0x00000000, 0x00000000,
78 0x00000000, 0x00000000, 0x00000000, 0x66006263,
79 0x74616f6c, 0x00000700, 0x00000100, 0x00000000,
80 0x00000400, 0x00001000, 0x00000400, 0x00090900,
81 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49,
82 0x43003266, 0x524f4c4f, 0x00040030, 0x00100000,
83 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff,
84 0x00290000, 0x000d0000, 0x002c0000, 0x00000000,
85 0x00000000, 0x00000000, 0x00000000, 0x00380000,
86 0x000d0000, 0x003b0000, 0x00040000, 0x00000000,
87 0x00000000, 0x00000000, 0x52590000,
90 static void test_effect_constant_buffer_type(ID3D10Device *device)
93 ID3D10EffectConstantBuffer *constantbuffer;
94 ID3D10EffectType *type, *type2, *null_type;
95 D3D10_EFFECT_TYPE_DESC type_desc;
100 hr = create_effect(fx_test_ecbt, 0, device, NULL, &effect);
101 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
103 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
104 type = constantbuffer->lpVtbl->GetType(constantbuffer);
106 hr = type->lpVtbl->GetDesc(type, &type_desc);
107 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
109 ok(strcmp(type_desc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc.TypeName);
110 ok(type_desc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_OBJECT);
111 ok(type_desc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_CBUFFER);
112 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
113 ok(type_desc.Members == 2, "Members is %u, expected 2\n", type_desc.Members);
114 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
115 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
116 ok(type_desc.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", type_desc.PackedSize);
117 ok(type_desc.UnpackedSize == 0x10, "UnpackedSize is %#x, expected 0x10\n", type_desc.UnpackedSize);
118 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
120 string = type->lpVtbl->GetMemberName(type, 0);
121 ok(strcmp(string, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string);
123 string = type->lpVtbl->GetMemberSemantic(type, 0);
124 ok(strcmp(string, "SV_POSITION") == 0, "GetMemberSemantic is \"%s\", expected \"SV_POSITION\"\n", string);
126 string = type->lpVtbl->GetMemberName(type, 1);
127 ok(strcmp(string, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string);
129 string = type->lpVtbl->GetMemberSemantic(type, 1);
130 ok(strcmp(string, "COLOR0") == 0, "GetMemberSemantic is \"%s\", expected \"COLOR0\"\n", string);
132 for (i = 0; i < 3; ++i)
134 if (i == 0) type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
135 else if (i == 1) type2 = type->lpVtbl->GetMemberTypeByName(type, "f1");
136 else type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "SV_POSITION");
138 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
139 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
141 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
142 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
143 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
144 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
145 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
146 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
147 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
148 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
149 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
150 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
152 if (i == 0) type2 = type->lpVtbl->GetMemberTypeByIndex(type, 1);
153 else if (i == 1) type2 = type->lpVtbl->GetMemberTypeByName(type, "f2");
154 else type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "COLOR0");
156 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
157 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
159 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
160 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
161 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
162 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
163 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
164 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
165 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
166 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
167 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
168 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
171 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
172 hr = type2->lpVtbl->GetDesc(type2, NULL);
173 ok(hr == E_INVALIDARG, "GetDesc got %x, expected %x\n", hr, E_INVALIDARG);
175 null_type = type->lpVtbl->GetMemberTypeByIndex(type, 3);
176 hr = null_type->lpVtbl->GetDesc(null_type, &type_desc);
177 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
179 hr = null_type->lpVtbl->GetDesc(null_type, NULL);
180 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
182 type2 = type->lpVtbl->GetMemberTypeByName(type, "invalid");
183 ok(type2 == null_type, "GetMemberTypeByName got wrong type %p, expected %p\n", type2, null_type);
185 type2 = type->lpVtbl->GetMemberTypeByName(type, NULL);
186 ok(type2 == null_type, "GetMemberTypeByName got wrong type %p, expected %p\n", type2, null_type);
188 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "invalid");
189 ok(type2 == null_type, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2, null_type);
191 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, NULL);
192 ok(type2 == null_type, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2, null_type);
194 string = type->lpVtbl->GetMemberName(type, 3);
195 ok(string == NULL, "GetMemberName is \"%s\", expected \"NULL\"\n", string);
197 string = type->lpVtbl->GetMemberSemantic(type, 3);
198 ok(string == NULL, "GetMemberSemantic is \"%s\", expected \"NULL\"\n", string);
200 effect->lpVtbl->Release(effect);
204 * test_effect_variable_type
209 float f3 : SV_POSITION;
223 static DWORD fx_test_evt[] = {
224 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
225 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
226 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
227 0x00000001, 0x00000001, 0x00000000, 0x00000000,
228 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
229 0x00000000, 0x00000000, 0x00000000, 0x00000000,
230 0x00000000, 0x00000000, 0x00000000, 0x00000000,
231 0x00000000, 0x00000000, 0x00000000, 0x74006263,
232 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
233 0x00010000, 0x00000000, 0x00040000, 0x00100000,
234 0x00040000, 0x09090000, 0x32660000, 0x74007400,
235 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
236 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
237 0x00000300, 0x00000000, 0x00000800, 0x00001000,
238 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
239 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
240 0x00000400, 0x00001600, 0x00000700, 0x00000300,
241 0x00000000, 0x00001800, 0x00002000, 0x00001000,
242 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
243 0x00001600, 0x00003200, 0x00000000, 0x00000400,
244 0x00001600, 0x00003500, 0x00000000, 0x00001000,
245 0x00005500, 0x00317400, 0x00000004, 0x00000020,
246 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
247 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
248 0x00000000, 0x00000000, 0x00000000,
251 static void test_effect_variable_type(ID3D10Device *device)
253 ID3D10Effect *effect;
254 ID3D10EffectConstantBuffer *constantbuffer;
255 ID3D10EffectVariable *variable;
256 ID3D10EffectType *type, *type2, *type3;
257 D3D10_EFFECT_TYPE_DESC type_desc;
262 hr = create_effect(fx_test_evt, 0, device, NULL, &effect);
263 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
265 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
266 type = constantbuffer->lpVtbl->GetType(constantbuffer);
267 hr = type->lpVtbl->GetDesc(type, &type_desc);
268 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
270 ok(strcmp(type_desc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc.TypeName);
271 ok(type_desc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_OBJECT);
272 ok(type_desc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_CBUFFER);
273 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
274 ok(type_desc.Members == 1, "Members is %u, expected 1\n", type_desc.Members);
275 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
276 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
277 ok(type_desc.PackedSize == 0x10, "PackedSize is %#x, expected 0x10\n", type_desc.PackedSize);
278 ok(type_desc.UnpackedSize == 0x20, "UnpackedSize is %#x, expected 0x20\n", type_desc.UnpackedSize);
279 ok(type_desc.Stride == 0x20, "Stride is %#x, expected 0x20\n", type_desc.Stride);
281 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
282 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
283 type = variable->lpVtbl->GetType(variable);
284 hr = type->lpVtbl->GetDesc(type, &type_desc);
285 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
287 ok(strcmp(type_desc.TypeName, "test1") == 0, "TypeName is \"%s\", expected \"test1\"\n", type_desc.TypeName);
288 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
289 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
290 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
291 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
292 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
293 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
294 ok(type_desc.PackedSize == 0x10, "PackedSize is %#x, expected 0x10\n", type_desc.PackedSize);
295 ok(type_desc.UnpackedSize == 0x18, "UnpackedSize is %#x, expected 0x18\n", type_desc.UnpackedSize);
296 ok(type_desc.Stride == 0x20, "Stride is %#x, expected 0x20\n", type_desc.Stride);
298 string = type->lpVtbl->GetMemberName(type, 0);
299 ok(strcmp(string, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string);
301 string = type->lpVtbl->GetMemberName(type, 1);
302 ok(strcmp(string, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string);
304 string = type->lpVtbl->GetMemberName(type, 2);
305 ok(strcmp(string, "t") == 0, "GetMemberName is \"%s\", expected \"t\"\n", string);
307 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
308 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
309 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
311 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
312 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
313 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
314 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
315 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
316 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
317 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
318 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
319 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
320 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
322 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 1);
323 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
324 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
326 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
327 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
328 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
329 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
330 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
331 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
332 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
333 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
334 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
335 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
337 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 2);
338 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
339 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
341 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
342 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
343 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
344 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
345 ok(type_desc.Members == 2, "Members is %u, expected 2\n", type_desc.Members);
346 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
347 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
348 ok(type_desc.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", type_desc.PackedSize);
349 ok(type_desc.UnpackedSize == 0x8, "UnpackedSize is %#x, expected 0x8\n", type_desc.UnpackedSize);
350 ok(type_desc.Stride == 0x10, "Stride is %x, expected 0x10\n", type_desc.Stride);
352 for (i = 0; i < 3; ++i)
354 if (i == 0) type3 = type2->lpVtbl->GetMemberTypeByIndex(type2, 0);
355 else if (i == 1) type3 = type2->lpVtbl->GetMemberTypeByName(type2, "f3");
356 else type3 = type2->lpVtbl->GetMemberTypeBySemantic(type2, "SV_POSITION");
358 hr = type3->lpVtbl->GetDesc(type3, &type_desc);
359 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
361 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
363 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
364 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
365 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
366 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
367 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
368 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
369 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
370 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
371 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
373 if (i == 0) type3 = type2->lpVtbl->GetMemberTypeByIndex(type2, 1);
374 else if (i == 1) type3 = type2->lpVtbl->GetMemberTypeByName(type2, "f4");
375 else type3 = type2->lpVtbl->GetMemberTypeBySemantic(type2, "COLOR0");
377 hr = type3->lpVtbl->GetDesc(type3, &type_desc);
378 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
380 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
382 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
383 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
384 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
385 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
386 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
387 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
388 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
389 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
390 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
393 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 0);
394 hr = type2->lpVtbl->GetDesc(type2, NULL);
395 ok(hr == E_INVALIDARG, "GetDesc got %x, expected %x\n", hr, E_INVALIDARG);
397 type2 = type->lpVtbl->GetMemberTypeByIndex(type, 4);
398 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
399 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
401 type2 = type->lpVtbl->GetMemberTypeByName(type, "invalid");
402 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
403 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
405 type2 = type->lpVtbl->GetMemberTypeByName(type, NULL);
406 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
407 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
409 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, "invalid");
410 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
411 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
413 type2 = type->lpVtbl->GetMemberTypeBySemantic(type, NULL);
414 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
415 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
417 string = type->lpVtbl->GetMemberName(type, 4);
418 ok(string == NULL, "GetMemberName is \"%s\", expected NULL\n", string);
420 string = type->lpVtbl->GetMemberSemantic(type, 4);
421 ok(string == NULL, "GetMemberSemantic is \"%s\", expected NULL\n", string);
423 effect->lpVtbl->Release(effect);
427 * test_effect_variable_member
432 float f3 : SV_POSITION;
446 static DWORD fx_test_evm[] = {
447 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
448 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
449 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
450 0x00000001, 0x00000001, 0x00000000, 0x00000000,
451 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
452 0x00000000, 0x00000000, 0x00000000, 0x00000000,
453 0x00000000, 0x00000000, 0x00000000, 0x00000000,
454 0x00000000, 0x00000000, 0x00000000, 0x74006263,
455 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
456 0x00010000, 0x00000000, 0x00040000, 0x00100000,
457 0x00040000, 0x09090000, 0x32660000, 0x74007400,
458 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
459 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
460 0x00000300, 0x00000000, 0x00000800, 0x00001000,
461 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
462 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
463 0x00000400, 0x00001600, 0x00000700, 0x00000300,
464 0x00000000, 0x00001800, 0x00002000, 0x00001000,
465 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
466 0x00001600, 0x00003200, 0x00000000, 0x00000400,
467 0x00001600, 0x00003500, 0x00000000, 0x00001000,
468 0x00005500, 0x00317400, 0x00000004, 0x00000020,
469 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
470 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
471 0x00000000, 0x00000000, 0x00000000,
474 static void test_effect_variable_member(ID3D10Device *device)
476 ID3D10Effect *effect;
477 ID3D10EffectConstantBuffer *constantbuffer;
478 ID3D10EffectVariable *variable, *variable2, *variable3, *null_variable;
479 D3D10_EFFECT_VARIABLE_DESC desc;
482 hr = create_effect(fx_test_evm, 0, device, NULL, &effect);
483 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
485 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
486 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc);
487 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
489 ok(strcmp(desc.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc.Name);
490 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
491 ok(desc.Flags == 0, "Type is %u, expected 0\n", desc.Flags);
492 ok(desc.Annotations == 0, "Elements is %u, expected 0\n", desc.Annotations);
493 ok(desc.BufferOffset == 0, "Members is %u, expected 0\n", desc.BufferOffset);
494 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
496 null_variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 1);
497 hr = null_variable->lpVtbl->GetDesc(null_variable, &desc);
498 ok(hr == E_FAIL, "GetDesc got %x, expected %x\n", hr, E_FAIL);
500 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
501 hr = variable->lpVtbl->GetDesc(variable, &desc);
502 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
504 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "t1");
505 ok(variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, variable);
506 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
507 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
509 ok(strcmp(desc.Name, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", desc.Name);
510 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
511 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
512 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
513 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
514 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
516 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "invalid");
517 ok(null_variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, null_variable);
519 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, NULL);
520 ok(null_variable == variable2, "GetMemberByName got %p, expected %p\n", variable2, null_variable);
522 variable2 = constantbuffer->lpVtbl->GetMemberBySemantic(constantbuffer, "invalid");
523 ok(null_variable == variable2, "GetMemberBySemantic got %p, expected %p\n", variable2, null_variable);
525 variable2 = constantbuffer->lpVtbl->GetMemberBySemantic(constantbuffer, NULL);
526 ok(null_variable == variable2, "GetMemberBySemantic got %p, expected %p\n", variable2, null_variable);
528 /* check members of "t1" */
529 variable2 = variable->lpVtbl->GetMemberByName(variable, "f1");
530 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
531 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
533 ok(strcmp(desc.Name, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc.Name);
534 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
535 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
536 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
537 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
538 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
540 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 0);
541 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
543 variable2 = variable->lpVtbl->GetMemberByName(variable, "f2");
544 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
545 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
547 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
548 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
549 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
550 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
551 ok(desc.BufferOffset == 4, "BufferOffset is %u, expected 4\n", desc.BufferOffset);
552 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
554 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 1);
555 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
557 variable2 = variable->lpVtbl->GetMemberByName(variable, "t");
558 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
559 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
561 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
562 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
563 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
564 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
565 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
566 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
568 variable3 = variable->lpVtbl->GetMemberByIndex(variable, 2);
569 ok(variable2 == variable3, "GetMemberByIndex got %p, expected %p\n", variable3, variable2);
571 /* check members of "t" */
572 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f3");
573 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
574 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
576 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
577 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
578 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
579 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
580 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
581 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
583 variable = variable2->lpVtbl->GetMemberBySemantic(variable2, "SV_POSITION");
584 ok(variable == variable3, "GetMemberBySemantic got %p, expected %p\n", variable, variable3);
586 variable = variable2->lpVtbl->GetMemberByIndex(variable2, 0);
587 ok(variable == variable3, "GetMemberByIndex got %p, expected %p\n", variable, variable3);
589 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f4");
590 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
591 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
593 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
594 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
595 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
596 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
597 ok(desc.BufferOffset == 20, "BufferOffset is %u, expected 20\n", desc.BufferOffset);
598 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
600 variable = variable2->lpVtbl->GetMemberBySemantic(variable2, "COLOR0");
601 ok(variable == variable3, "GetMemberBySemantic got %p, expected %p\n", variable, variable3);
603 variable = variable2->lpVtbl->GetMemberByIndex(variable2, 1);
604 ok(variable == variable3, "GetMemberByIndex got %p, expected %p\n", variable, variable3);
606 effect->lpVtbl->Release(effect);
610 * test_effect_variable_element
615 float f3 : SV_POSITION;
630 static DWORD fx_test_eve[] = {
631 0x43425844, 0x6ea69fd9, 0x9b4e6390, 0x006f9f71,
632 0x57ad58f4, 0x00000001, 0x000001c2, 0x00000001,
633 0x00000024, 0x30315846, 0x00000196, 0xfeff1001,
634 0x00000001, 0x00000001, 0x00000000, 0x00000000,
635 0x00000000, 0x00000000, 0x00000000, 0x00000116,
636 0x00000000, 0x00000000, 0x00000000, 0x00000000,
637 0x00000000, 0x00000000, 0x00000000, 0x00000000,
638 0x00000000, 0x00000000, 0x00000000, 0x74006263,
639 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
640 0x00010000, 0x00000000, 0x00040000, 0x00100000,
641 0x00040000, 0x09090000, 0x32660000, 0x00001000,
642 0x00000100, 0x00000300, 0x00002400, 0x00001000,
643 0x00000c00, 0x00090900, 0x74007400, 0x00747365,
644 0x53003366, 0x4f505f56, 0x49544953, 0x66004e4f,
645 0x4f430034, 0x30524f4c, 0x00356600, 0x4f4c4f43,
646 0x53003152, 0x03000000, 0x02000000, 0x1c000000,
647 0x10000000, 0x18000000, 0x03000000, 0x58000000,
648 0x5b000000, 0x00000000, 0x16000000, 0x67000000,
649 0x6a000000, 0x04000000, 0x16000000, 0x71000000,
650 0x74000000, 0x08000000, 0x16000000, 0x07000000,
651 0x03000000, 0x00000000, 0x5c000000, 0x60000000,
652 0x28000000, 0x03000000, 0x0d000000, 0x00000000,
653 0x00000000, 0x16000000, 0x32000000, 0x00000000,
654 0x10000000, 0x35000000, 0x51000000, 0x00000000,
655 0x40000000, 0x7b000000, 0x74000000, 0x00040031,
656 0x00600000, 0x00000000, 0x00010000, 0xffff0000,
657 0x0000ffff, 0x01130000, 0x00c70000, 0x00000000,
658 0x00000000, 0x00000000, 0x00000000, 0x00000000,
662 static void test_effect_variable_element(ID3D10Device *device)
664 ID3D10Effect *effect;
665 ID3D10EffectConstantBuffer *constantbuffer, *parent;
666 ID3D10EffectVariable *variable, *variable2, *variable3, *variable4, *variable5;
667 ID3D10EffectType *type, *type2;
668 D3D10_EFFECT_VARIABLE_DESC desc;
669 D3D10_EFFECT_TYPE_DESC type_desc;
672 hr = create_effect(fx_test_eve, 0, device, NULL, &effect);
673 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
675 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
676 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &desc);
677 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
679 ok(strcmp(desc.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc.Name);
680 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
681 ok(desc.Flags == 0, "Type is %u, expected 0\n", desc.Flags);
682 ok(desc.Annotations == 0, "Elements is %u, expected 0\n", desc.Annotations);
683 ok(desc.BufferOffset == 0, "Members is %u, expected 0\n", desc.BufferOffset);
684 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
686 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, 0);
687 hr = variable->lpVtbl->GetDesc(variable, &desc);
688 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
690 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
691 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
692 parent, constantbuffer);
694 variable2 = constantbuffer->lpVtbl->GetMemberByName(constantbuffer, "t1");
695 hr = variable2->lpVtbl->GetDesc(variable2, &desc);
696 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
698 parent = variable2->lpVtbl->GetParentConstantBuffer(variable2);
699 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
701 /* check variable f1 */
702 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f1");
703 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
704 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
706 ok(strcmp(desc.Name, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc.Name);
707 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
708 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
709 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
710 ok(desc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", desc.BufferOffset);
711 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
713 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
714 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
715 parent, constantbuffer);
717 type = variable3->lpVtbl->GetType(variable3);
718 hr = type->lpVtbl->GetDesc(type, &type_desc);
719 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
721 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
722 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
723 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
724 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
725 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
726 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
727 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
728 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
729 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
730 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
732 /* check variable f2 */
733 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "f2");
734 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
735 ok(SUCCEEDED(hr), "GetDesc failed (%x)!\n", hr);
737 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
738 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
739 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
740 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
741 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
742 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
744 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
745 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
746 parent, constantbuffer);
748 type = variable3->lpVtbl->GetType(variable3);
749 hr = type->lpVtbl->GetDesc(type, &type_desc);
750 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
752 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
753 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
754 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
755 ok(type_desc.Elements == 3, "Elements is %u, expected 3\n", type_desc.Elements);
756 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
757 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
758 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
759 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
760 ok(type_desc.UnpackedSize == 0x24, "UnpackedSize is %#x, expected 0x24\n", type_desc.UnpackedSize);
761 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
763 variable4 = variable3->lpVtbl->GetElement(variable3, 0);
764 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
765 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
767 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
768 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
769 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
770 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
771 ok(desc.BufferOffset == 16, "BufferOffset is %u, expected 16\n", desc.BufferOffset);
772 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
774 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
775 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
776 parent, constantbuffer);
778 type = variable4->lpVtbl->GetType(variable4);
779 hr = type->lpVtbl->GetDesc(type, &type_desc);
780 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
782 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
783 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
784 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
785 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
786 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
787 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
788 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
789 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
790 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
791 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
793 variable4 = variable3->lpVtbl->GetElement(variable3, 1);
794 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
795 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
797 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
798 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
799 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
800 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
801 ok(desc.BufferOffset == 32, "BufferOffset is %u, expected 32\n", desc.BufferOffset);
802 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
804 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
805 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
806 parent, constantbuffer);
808 type2 = variable4->lpVtbl->GetType(variable4);
809 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
810 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
811 ok(type == type2, "type(%p) != type2(%p)\n", type, type2);
813 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
814 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
815 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
816 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
817 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
818 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
819 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
820 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
821 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
822 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
824 variable4 = variable3->lpVtbl->GetElement(variable3, 2);
825 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
826 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
828 ok(strcmp(desc.Name, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc.Name);
829 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
830 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
831 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
832 ok(desc.BufferOffset == 48, "BufferOffset is %u, expected 48\n", desc.BufferOffset);
833 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
835 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
836 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
837 parent, constantbuffer);
839 type2 = variable4->lpVtbl->GetType(variable4);
840 hr = type2->lpVtbl->GetDesc(type2, &type_desc);
841 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
842 ok(type == type2, "type(%p) != type2(%p)\n", type, type2);
844 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
845 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
846 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
847 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
848 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
849 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
850 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
851 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
852 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
853 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
855 /* check variable t */
856 variable3 = variable2->lpVtbl->GetMemberByName(variable2, "t");
857 hr = variable3->lpVtbl->GetDesc(variable3, &desc);
858 ok(SUCCEEDED(hr), "GetDesc failed (%x)!\n", hr);
860 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
861 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
862 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
863 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
864 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
865 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
867 parent = variable3->lpVtbl->GetParentConstantBuffer(variable3);
868 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
869 parent, constantbuffer);
871 type = variable3->lpVtbl->GetType(variable3);
872 hr = type->lpVtbl->GetDesc(type, &type_desc);
873 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
875 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
876 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
877 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
878 ok(type_desc.Elements == 2, "Elements is %u, expected 2\n", type_desc.Elements);
879 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
880 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
881 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
882 ok(type_desc.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", type_desc.PackedSize);
883 ok(type_desc.UnpackedSize == 0x1c, "UnpackedSize is %#x, expected 0x1c\n", type_desc.UnpackedSize);
884 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
886 variable4 = variable3->lpVtbl->GetElement(variable3, 0);
887 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
888 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
890 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
891 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
892 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
893 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
894 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
895 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
897 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
898 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
899 parent, constantbuffer);
901 type = variable4->lpVtbl->GetType(variable4);
902 hr = type->lpVtbl->GetDesc(type, &type_desc);
903 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
905 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
906 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
907 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
908 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
909 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
910 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
911 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
912 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
913 ok(type_desc.UnpackedSize == 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc.UnpackedSize);
914 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
916 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 0);
917 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
918 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
920 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
921 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
922 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
923 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
924 ok(desc.BufferOffset == 64, "BufferOffset is %u, expected 64\n", desc.BufferOffset);
925 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
927 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
928 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
930 type = variable5->lpVtbl->GetType(variable5);
931 hr = type->lpVtbl->GetDesc(type, &type_desc);
932 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
934 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
935 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
936 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
937 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
938 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
939 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
940 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
941 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
942 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
943 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
945 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 1);
946 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
947 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
949 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
950 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
951 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
952 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
953 ok(desc.BufferOffset == 68, "BufferOffset is %u, expected 68\n", desc.BufferOffset);
954 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
956 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
957 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
959 type = variable5->lpVtbl->GetType(variable5);
960 hr = type->lpVtbl->GetDesc(type, &type_desc);
961 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
963 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
964 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
965 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
966 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
967 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
968 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
969 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
970 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
971 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
972 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
974 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 2);
975 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
976 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
978 ok(strcmp(desc.Name, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc.Name);
979 ok(strcmp(desc.Semantic, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc.Semantic);
980 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
981 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
982 ok(desc.BufferOffset == 72, "BufferOffset is %u, expected 72\n", desc.BufferOffset);
983 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
985 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
986 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
988 type = variable5->lpVtbl->GetType(variable5);
989 hr = type->lpVtbl->GetDesc(type, &type_desc);
990 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
992 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
993 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
994 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
995 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
996 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
997 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
998 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
999 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1000 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1001 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1003 variable4 = variable3->lpVtbl->GetElement(variable3, 1);
1004 hr = variable4->lpVtbl->GetDesc(variable4, &desc);
1005 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1007 ok(strcmp(desc.Name, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc.Name);
1008 ok(desc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", desc.Semantic);
1009 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1010 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1011 ok(desc.BufferOffset == 80, "BufferOffset is %u, expected 80\n", desc.BufferOffset);
1012 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1014 parent = variable4->lpVtbl->GetParentConstantBuffer(variable4);
1015 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n",
1016 parent, constantbuffer);
1018 type = variable4->lpVtbl->GetType(variable4);
1019 hr = type->lpVtbl->GetDesc(type, &type_desc);
1020 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1022 ok(strcmp(type_desc.TypeName, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc.TypeName);
1023 ok(type_desc.Class == D3D10_SVC_STRUCT, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_STRUCT);
1024 ok(type_desc.Type == D3D10_SVT_VOID, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_VOID);
1025 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1026 ok(type_desc.Members == 3, "Members is %u, expected 3\n", type_desc.Members);
1027 ok(type_desc.Rows == 0, "Rows is %u, expected 0\n", type_desc.Rows);
1028 ok(type_desc.Columns == 0, "Columns is %u, expected 0\n", type_desc.Columns);
1029 ok(type_desc.PackedSize == 0xc, "PackedSize is %#x, expected 0xc\n", type_desc.PackedSize);
1030 ok(type_desc.UnpackedSize == 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc.UnpackedSize);
1031 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1033 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 0);
1034 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1035 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1037 ok(strcmp(desc.Name, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc.Name);
1038 ok(strcmp(desc.Semantic, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc.Semantic);
1039 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1040 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1041 ok(desc.BufferOffset == 80, "BufferOffset is %u, expected 80\n", desc.BufferOffset);
1042 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1044 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1045 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1047 type = variable5->lpVtbl->GetType(variable5);
1048 hr = type->lpVtbl->GetDesc(type, &type_desc);
1049 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1051 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1052 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1053 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1054 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1055 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1056 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1057 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1058 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1059 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1060 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1062 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 1);
1063 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1064 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1066 ok(strcmp(desc.Name, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc.Name);
1067 ok(strcmp(desc.Semantic, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc.Semantic);
1068 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1069 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1070 ok(desc.BufferOffset == 84, "BufferOffset is %u, expected 84\n", desc.BufferOffset);
1071 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1073 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1074 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1076 type = variable5->lpVtbl->GetType(variable5);
1077 hr = type->lpVtbl->GetDesc(type, &type_desc);
1078 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1080 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1081 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1082 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1083 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1084 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1085 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1086 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1087 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1088 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1089 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1091 variable5 = variable4->lpVtbl->GetMemberByIndex(variable4, 2);
1092 hr = variable5->lpVtbl->GetDesc(variable5, &desc);
1093 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1095 ok(strcmp(desc.Name, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc.Name);
1096 ok(strcmp(desc.Semantic, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc.Semantic);
1097 ok(desc.Flags == 0, "Flags is %u, expected 0\n", desc.Flags);
1098 ok(desc.Annotations == 0, "Annotations is %u, expected 0\n", desc.Annotations);
1099 ok(desc.BufferOffset == 88, "BufferOffset is %u, expected 88\n", desc.BufferOffset);
1100 ok(desc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", desc.ExplicitBindPoint);
1102 parent = variable5->lpVtbl->GetParentConstantBuffer(variable5);
1103 ok(parent == constantbuffer, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1105 type = variable5->lpVtbl->GetType(variable5);
1106 hr = type->lpVtbl->GetDesc(type, &type_desc);
1107 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1109 ok(strcmp(type_desc.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc.TypeName);
1110 ok(type_desc.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", type_desc.Class, D3D10_SVC_SCALAR);
1111 ok(type_desc.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", type_desc.Type, D3D10_SVT_FLOAT);
1112 ok(type_desc.Elements == 0, "Elements is %u, expected 0\n", type_desc.Elements);
1113 ok(type_desc.Members == 0, "Members is %u, expected 0\n", type_desc.Members);
1114 ok(type_desc.Rows == 1, "Rows is %u, expected 1\n", type_desc.Rows);
1115 ok(type_desc.Columns == 1, "Columns is %u, expected 1\n", type_desc.Columns);
1116 ok(type_desc.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", type_desc.PackedSize);
1117 ok(type_desc.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc.UnpackedSize);
1118 ok(type_desc.Stride == 0x10, "Stride is %#x, expected 0x10\n", type_desc.Stride);
1120 effect->lpVtbl->Release(effect);
1124 * test_effect_variable_type_class
1127 cbuffer cb <String s = "STRING";>
1131 matrix <uint, 2, 3> u;
1132 row_major matrix <bool, 2, 3> b;
1135 DepthStencilState depthstencil;
1136 RasterizerState rast;
1138 RenderTargetView rtv;
1139 DepthStencilView dsv;
1143 Texture2DMS <float4, 4> t2dms;
1145 Texture2DMSArray <float4, 4> t2dmsa;
1148 GeometryShader gs[2];
1152 static DWORD fx_test_evtc[] = {
1153 0x43425844, 0xc04c50cb, 0x0afeb4ef, 0xbb93f346,
1154 0x97a29499, 0x00000001, 0x00000659, 0x00000001,
1155 0x00000024, 0x30315846, 0x0000062d, 0xfeff1001,
1156 0x00000001, 0x00000004, 0x00000011, 0x00000000,
1157 0x00000000, 0x00000000, 0x00000000, 0x000003d9,
1158 0x00000000, 0x00000008, 0x00000001, 0x00000001,
1159 0x00000001, 0x00000001, 0x00000001, 0x00000001,
1160 0x00000004, 0x00000000, 0x00000000, 0x53006263,
1161 0x6e697274, 0x00070067, 0x00020000, 0x00000000,
1162 0x00000000, 0x00000000, 0x00000000, 0x00010000,
1163 0x00730000, 0x49525453, 0x6600474e, 0x74616f6c,
1164 0x00003300, 0x00000100, 0x00000000, 0x00000400,
1165 0x00001000, 0x00000400, 0x00090900, 0x69006600,
1166 0x0032746e, 0x00000057, 0x00000001, 0x00000000,
1167 0x00000008, 0x00000010, 0x00000008, 0x00001112,
1168 0x69750069, 0x7832746e, 0x007a0033, 0x00010000,
1169 0x00000000, 0x00280000, 0x00300000, 0x00180000,
1170 0x5a1b0000, 0x00750000, 0x6c6f6f62, 0x00337832,
1171 0x000000a0, 0x00000001, 0x00000000, 0x0000001c,
1172 0x00000020, 0x00000018, 0x00001a23, 0x6c420062,
1173 0x53646e65, 0x65746174, 0x0000c600, 0x00000200,
1174 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1175 0x00000200, 0x656c6200, 0x4400646e, 0x68747065,
1176 0x6e657453, 0x536c6963, 0x65746174, 0x0000f300,
1177 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1178 0x00000000, 0x00000300, 0x70656400, 0x74736874,
1179 0x69636e65, 0x6152006c, 0x72657473, 0x72657a69,
1180 0x74617453, 0x012e0065, 0x00020000, 0x00000000,
1181 0x00000000, 0x00000000, 0x00000000, 0x00040000,
1182 0x61720000, 0x53007473, 0x6c706d61, 0x74537265,
1183 0x00657461, 0x0000015f, 0x00000002, 0x00000000,
1184 0x00000000, 0x00000000, 0x00000000, 0x00000015,
1185 0x006d6173, 0x646e6552, 0x61547265, 0x74656772,
1186 0x77656956, 0x00018c00, 0x00000200, 0x00000000,
1187 0x00000000, 0x00000000, 0x00000000, 0x00001300,
1188 0x76747200, 0x70654400, 0x74536874, 0x69636e65,
1189 0x6569566c, 0x01bd0077, 0x00020000, 0x00000000,
1190 0x00000000, 0x00000000, 0x00000000, 0x00140000,
1191 0x73640000, 0x65540076, 0x72757478, 0x00443165,
1192 0x000001ee, 0x00000002, 0x00000000, 0x00000000,
1193 0x00000000, 0x00000000, 0x0000000a, 0x54003174,
1194 0x75747865, 0x44316572, 0x61727241, 0x02170079,
1195 0x00020000, 0x00000000, 0x00000000, 0x00000000,
1196 0x00000000, 0x000b0000, 0x31740000, 0x65540061,
1197 0x72757478, 0x00443265, 0x00000246, 0x00000002,
1198 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1199 0x0000000c, 0x54003274, 0x75747865, 0x44326572,
1200 0x6f00534d, 0x02000002, 0x00000000, 0x00000000,
1201 0x00000000, 0x00000000, 0x0e000000, 0x74000000,
1202 0x736d6432, 0x78655400, 0x65727574, 0x72414432,
1203 0x00796172, 0x0000029d, 0x00000002, 0x00000000,
1204 0x00000000, 0x00000000, 0x00000000, 0x0000000d,
1205 0x00613274, 0x74786554, 0x32657275, 0x41534d44,
1206 0x79617272, 0x0002cc00, 0x00000200, 0x00000000,
1207 0x00000000, 0x00000000, 0x00000000, 0x00000f00,
1208 0x64327400, 0x0061736d, 0x74786554, 0x33657275,
1209 0x03000044, 0x00020000, 0x00000000, 0x00000000,
1210 0x00000000, 0x00000000, 0x00100000, 0x33740000,
1211 0x78655400, 0x65727574, 0x65627543, 0x00032900,
1212 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1213 0x00000000, 0x00001100, 0x00717400, 0x6d6f6547,
1214 0x79727465, 0x64616853, 0x54007265, 0x02000003,
1215 0x02000000, 0x00000000, 0x00000000, 0x00000000,
1216 0x07000000, 0x67000000, 0x69500073, 0x536c6578,
1217 0x65646168, 0x03820072, 0x00020000, 0x00000000,
1218 0x00000000, 0x00000000, 0x00000000, 0x00050000,
1219 0x73700000, 0x72655600, 0x53786574, 0x65646168,
1220 0x03ad0072, 0x00020000, 0x00010000, 0x00000000,
1221 0x00000000, 0x00000000, 0x00060000, 0x73760000,
1222 0x00000400, 0x00006000, 0x00000000, 0x00000400,
1223 0xffffff00, 0x000001ff, 0x00002a00, 0x00000e00,
1224 0x00002c00, 0x00005500, 0x00003900, 0x00000000,
1225 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1226 0x00007800, 0x00005c00, 0x00000000, 0x00000400,
1227 0x00000000, 0x00000000, 0x00000000, 0x00009e00,
1228 0x00008200, 0x00000000, 0x00001000, 0x00000000,
1229 0x00000000, 0x00000000, 0x0000c400, 0x0000a800,
1230 0x00000000, 0x00004000, 0x00000000, 0x00000000,
1231 0x00000000, 0x0000ed00, 0x0000d100, 0x00000000,
1232 0xffffff00, 0x000000ff, 0x00000000, 0x00012100,
1233 0x00010500, 0x00000000, 0xffffff00, 0x000000ff,
1234 0x00000000, 0x00015a00, 0x00013e00, 0x00000000,
1235 0xffffff00, 0x000000ff, 0x00000000, 0x00018800,
1236 0x00016c00, 0x00000000, 0xffffff00, 0x000000ff,
1237 0x00000000, 0x0001b900, 0x00019d00, 0x00000000,
1238 0xffffff00, 0x000000ff, 0x0001ea00, 0x0001ce00,
1239 0x00000000, 0xffffff00, 0x000000ff, 0x00021400,
1240 0x0001f800, 0x00000000, 0xffffff00, 0x000000ff,
1241 0x00024200, 0x00022600, 0x00000000, 0xffffff00,
1242 0x000000ff, 0x00026c00, 0x00025000, 0x00000000,
1243 0xffffff00, 0x000000ff, 0x00029700, 0x00027b00,
1244 0x00000000, 0xffffff00, 0x000000ff, 0x0002c800,
1245 0x0002ac00, 0x00000000, 0xffffff00, 0x000000ff,
1246 0x0002f900, 0x0002dd00, 0x00000000, 0xffffff00,
1247 0x000000ff, 0x00032600, 0x00030a00, 0x00000000,
1248 0xffffff00, 0x000000ff, 0x00035100, 0x00033500,
1249 0x00000000, 0xffffff00, 0x000000ff, 0x00037f00,
1250 0x00036300, 0x00000000, 0xffffff00, 0x000000ff,
1251 0x00000000, 0x00000000, 0x0003aa00, 0x00038e00,
1252 0x00000000, 0xffffff00, 0x000000ff, 0x00000000,
1253 0x0003d600, 0x0003ba00, 0x00000000, 0xffffff00,
1254 0x000000ff, 0x00000000, 0x00000000,
1257 static BOOL is_valid_check(BOOL a, BOOL b)
1259 return (a && b) || (!a && !b);
1262 static void check_as(ID3D10EffectVariable *variable)
1264 ID3D10EffectVariable *variable2;
1265 ID3D10EffectType *type;
1266 D3D10_EFFECT_TYPE_DESC td;
1270 type = variable->lpVtbl->GetType(variable);
1271 hr = type->lpVtbl->GetDesc(type, &td);
1272 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1274 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsConstantBuffer(variable);
1275 is_valid = variable2->lpVtbl->IsValid(variable2);
1276 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_CBUFFER);
1277 ok(ret, "AsConstantBuffer valid check failed (Type is %x)\n", td.Type);
1279 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsString(variable);
1280 is_valid = variable2->lpVtbl->IsValid(variable2);
1281 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_STRING);
1282 ok(ret, "AsString valid check failed (Type is %x)\n", td.Type);
1284 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsScalar(variable);
1285 is_valid = variable2->lpVtbl->IsValid(variable2);
1286 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_SCALAR);
1287 ok(ret, "AsScalar valid check failed (Class is %x)\n", td.Class);
1289 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsVector(variable);
1290 is_valid = variable2->lpVtbl->IsValid(variable2);
1291 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_VECTOR);
1292 ok(ret, "AsVector valid check failed (Class is %x)\n", td.Class);
1294 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsMatrix(variable);
1295 is_valid = variable2->lpVtbl->IsValid(variable2);
1296 ret = is_valid_check(is_valid, td.Class == D3D10_SVC_MATRIX_ROWS
1297 || td.Class == D3D10_SVC_MATRIX_COLUMNS);
1298 ok(ret, "AsMatrix valid check failed (Class is %x)\n", td.Class);
1300 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsBlend(variable);
1301 is_valid = variable2->lpVtbl->IsValid(variable2);
1302 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_BLEND);
1303 ok(ret, "AsBlend valid check failed (Type is %x)\n", td.Type);
1305 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsDepthStencil(variable);
1306 is_valid = variable2->lpVtbl->IsValid(variable2);
1307 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_DEPTHSTENCIL);
1308 ok(ret, "AsDepthStencil valid check failed (Type is %x)\n", td.Type);
1310 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsRasterizer(variable);
1311 is_valid = variable2->lpVtbl->IsValid(variable2);
1312 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_RASTERIZER);
1313 ok(ret, "AsRasterizer valid check failed (Type is %x)\n", td.Type);
1315 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsSampler(variable);
1316 is_valid = variable2->lpVtbl->IsValid(variable2);
1317 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_SAMPLER);
1318 ok(ret, "AsSampler valid check failed (Type is %x)\n", td.Type);
1320 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsDepthStencilView(variable);
1321 is_valid = variable2->lpVtbl->IsValid(variable2);
1322 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_DEPTHSTENCILVIEW);
1323 ok(ret, "AsDepthStencilView valid check failed (Type is %x)\n", td.Type);
1325 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsRenderTargetView(variable);
1326 is_valid = variable2->lpVtbl->IsValid(variable2);
1327 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_RENDERTARGETVIEW);
1328 ok(ret, "AsRenderTargetView valid check failed (Type is %x)\n", td.Type);
1330 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsShaderResource(variable);
1331 is_valid = variable2->lpVtbl->IsValid(variable2);
1332 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_TEXTURE1D
1333 || td.Type == D3D10_SVT_TEXTURE1DARRAY || td.Type == D3D10_SVT_TEXTURE2D
1334 || td.Type == D3D10_SVT_TEXTURE2DMS || td.Type == D3D10_SVT_TEXTURE2DARRAY
1335 || td.Type == D3D10_SVT_TEXTURE2DMSARRAY || td.Type == D3D10_SVT_TEXTURE3D
1336 || td.Type == D3D10_SVT_TEXTURECUBE);
1337 ok(ret, "AsShaderResource valid check failed (Type is %x)\n", td.Type);
1339 variable2 = (ID3D10EffectVariable *)variable->lpVtbl->AsShader(variable);
1340 is_valid = variable2->lpVtbl->IsValid(variable2);
1341 ret = is_valid_check(is_valid, td.Type == D3D10_SVT_GEOMETRYSHADER
1342 || td.Type == D3D10_SVT_PIXELSHADER || td.Type == D3D10_SVT_VERTEXSHADER);
1343 ok(ret, "AsShader valid check failed (Type is %x)\n", td.Type);
1346 static void test_effect_variable_type_class(ID3D10Device *device)
1348 ID3D10Effect *effect;
1349 ID3D10EffectConstantBuffer *constantbuffer, *null_buffer, *parent;
1350 ID3D10EffectVariable *variable;
1351 ID3D10EffectType *type;
1352 D3D10_EFFECT_VARIABLE_DESC vd;
1353 D3D10_EFFECT_TYPE_DESC td;
1355 unsigned int variable_nr = 0;
1357 hr = create_effect(fx_test_evtc, 0, device, NULL, &effect);
1358 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
1360 /* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
1361 null_buffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 1);
1363 /* check constantbuffer cb */
1364 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, 0);
1365 hr = constantbuffer->lpVtbl->GetDesc(constantbuffer, &vd);
1366 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1368 ok(strcmp(vd.Name, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", vd.Name);
1369 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1370 ok(vd.Flags == 0, "Type is %u, expected 0\n", vd.Flags);
1371 ok(vd.Annotations == 1, "Elements is %u, expected 1\n", vd.Annotations);
1372 ok(vd.BufferOffset == 0, "Members is %u, expected 0\n", vd.BufferOffset);
1373 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1375 check_as((ID3D10EffectVariable *)constantbuffer);
1377 parent = constantbuffer->lpVtbl->GetParentConstantBuffer(constantbuffer);
1378 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1380 type = constantbuffer->lpVtbl->GetType(constantbuffer);
1381 hr = type->lpVtbl->GetDesc(type, &td);
1382 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1384 ok(strcmp(td.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", td.TypeName);
1385 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1386 ok(td.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_CBUFFER);
1387 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1388 ok(td.Members == 4, "Members is %u, expected 4\n", td.Members);
1389 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1390 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1391 ok(td.PackedSize == 0x3c, "PackedSize is %#x, expected 0x3c\n", td.PackedSize);
1392 ok(td.UnpackedSize == 0x60, "UnpackedSize is %#x, expected 0x60\n", td.UnpackedSize);
1393 ok(td.Stride == 0x60, "Stride is %#x, expected 0x60\n", td.Stride);
1395 /* check annotation a */
1396 variable = constantbuffer->lpVtbl->GetAnnotationByIndex(constantbuffer, 0);
1397 hr = variable->lpVtbl->GetDesc(variable, &vd);
1398 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1400 ok(strcmp(vd.Name, "s") == 0, "Name is \"%s\", expected \"s\"\n", vd.Name);
1401 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1402 ok(vd.Flags == 2, "Flags is %u, expected 2\n", vd.Flags);
1403 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1404 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1405 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1407 check_as((ID3D10EffectVariable *)variable);
1409 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1410 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1412 type = variable->lpVtbl->GetType(variable);
1413 hr = type->lpVtbl->GetDesc(type, &td);
1414 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1416 ok(strcmp(td.TypeName, "String") == 0, "TypeName is \"%s\", expected \"String\"\n", td.TypeName);
1417 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1418 ok(td.Type == D3D10_SVT_STRING, "Type is %x, expected %x\n", td.Type, D3D10_SVT_STRING);
1419 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1420 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1421 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1422 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1423 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1424 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1425 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1428 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1429 hr = variable->lpVtbl->GetDesc(variable, &vd);
1430 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1432 ok(strcmp(vd.Name, "f") == 0, "Name is \"%s\", expected \"f\"\n", vd.Name);
1433 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1434 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1435 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1436 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1437 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1439 check_as((ID3D10EffectVariable *)variable);
1441 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1442 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1444 type = variable->lpVtbl->GetType(variable);
1445 hr = type->lpVtbl->GetDesc(type, &td);
1446 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1448 ok(strcmp(td.TypeName, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", td.TypeName);
1449 ok(td.Class == D3D10_SVC_SCALAR, "Class is %x, expected %x\n", td.Class, D3D10_SVC_SCALAR);
1450 ok(td.Type == D3D10_SVT_FLOAT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_FLOAT);
1451 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1452 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1453 ok(td.Rows == 1, "Rows is %u, expected 1\n", td.Rows);
1454 ok(td.Columns == 1, "Columns is %u, expected 1\n", td.Columns);
1455 ok(td.PackedSize == 0x4, "PackedSize is %#x, expected 0x4\n", td.PackedSize);
1456 ok(td.UnpackedSize == 0x4, "UnpackedSize is %#x, expected 0x4\n", td.UnpackedSize);
1457 ok(td.Stride == 0x10, "Stride is %#x, expected 0x10\n", td.Stride);
1460 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1461 hr = variable->lpVtbl->GetDesc(variable, &vd);
1462 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1464 ok(strcmp(vd.Name, "i") == 0, "Name is \"%s\", expected \"i\"\n", vd.Name);
1465 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1466 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1467 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1468 ok(vd.BufferOffset == 4, "BufferOffset is %u, expected 4\n", vd.BufferOffset);
1469 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1471 check_as((ID3D10EffectVariable *)variable);
1473 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1474 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1476 type = variable->lpVtbl->GetType(variable);
1477 hr = type->lpVtbl->GetDesc(type, &td);
1478 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1480 ok(strcmp(td.TypeName, "int2") == 0, "TypeName is \"%s\", expected \"int2\"\n", td.TypeName);
1481 ok(td.Class == D3D10_SVC_VECTOR, "Class is %x, expected %x\n", td.Class, D3D10_SVC_VECTOR);
1482 ok(td.Type == D3D10_SVT_INT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_INT);
1483 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1484 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1485 ok(td.Rows == 1, "Rows is %u, expected 1\n", td.Rows);
1486 ok(td.Columns == 2, "Columns is %u, expected 2\n", td.Columns);
1487 ok(td.PackedSize == 0x8, "PackedSize is %#x, expected 0x8\n", td.PackedSize);
1488 ok(td.UnpackedSize == 0x8, "UnpackedSize is %#x, expected 0x8\n", td.UnpackedSize);
1489 ok(td.Stride == 0x10, "Stride is %#x, expected 0x10\n", td.Stride);
1491 /* check uint2x3 u */
1492 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1493 hr = variable->lpVtbl->GetDesc(variable, &vd);
1494 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1496 ok(strcmp(vd.Name, "u") == 0, "Name is \"%s\", expected \"u\"\n", vd.Name);
1497 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1498 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1499 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1500 ok(vd.BufferOffset == 16, "BufferOffset is %u, expected 16\n", vd.BufferOffset);
1501 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1503 check_as((ID3D10EffectVariable *)variable);
1505 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1506 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1508 type = variable->lpVtbl->GetType(variable);
1509 hr = type->lpVtbl->GetDesc(type, &td);
1510 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1512 ok(strcmp(td.TypeName, "uint2x3") == 0, "TypeName is \"%s\", expected \"uint2x3\"\n", td.TypeName);
1513 ok(td.Class == D3D10_SVC_MATRIX_COLUMNS, "Class is %x, expected %x\n", td.Class, D3D10_SVC_MATRIX_COLUMNS);
1514 ok(td.Type == D3D10_SVT_UINT, "Type is %x, expected %x\n", td.Type, D3D10_SVT_UINT);
1515 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1516 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1517 ok(td.Rows == 2, "Rows is %u, expected 2\n", td.Rows);
1518 ok(td.Columns == 3, "Columns is %u, expected 3\n", td.Columns);
1519 ok(td.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", td.PackedSize);
1520 ok(td.UnpackedSize == 0x28, "UnpackedSize is %#x, expected 0x28\n", td.UnpackedSize);
1521 ok(td.Stride == 0x30, "Stride is %#x, expected 0x30\n", td.Stride);
1523 /* check bool2x3 b */
1524 variable = constantbuffer->lpVtbl->GetMemberByIndex(constantbuffer, variable_nr++);
1525 hr = variable->lpVtbl->GetDesc(variable, &vd);
1526 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1528 ok(strcmp(vd.Name, "b") == 0, "Name is \"%s\", expected \"b\"\n", vd.Name);
1529 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1530 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1531 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1532 ok(vd.BufferOffset == 64, "BufferOffset is %u, expected 64\n", vd.BufferOffset);
1533 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1535 check_as((ID3D10EffectVariable *)variable);
1537 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1538 ok(constantbuffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, constantbuffer);
1540 type = variable->lpVtbl->GetType(variable);
1541 hr = type->lpVtbl->GetDesc(type, &td);
1542 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1544 ok(strcmp(td.TypeName, "bool2x3") == 0, "TypeName is \"%s\", expected \"bool2x3\"\n", td.TypeName);
1545 ok(td.Class == D3D10_SVC_MATRIX_ROWS, "Class is %x, expected %x\n", td.Class, D3D10_SVC_MATRIX_ROWS);
1546 ok(td.Type == D3D10_SVT_BOOL, "Type is %x, expected %x\n", td.Type, D3D10_SVT_BOOL);
1547 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1548 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1549 ok(td.Rows == 2, "Rows is %u, expected 2\n", td.Rows);
1550 ok(td.Columns == 3, "Columns is %u, expected 3\n", td.Columns);
1551 ok(td.PackedSize == 0x18, "PackedSize is %#x, expected 0x18\n", td.PackedSize);
1552 ok(td.UnpackedSize == 0x1c, "UnpackedSize is %#x, expected 0x1c\n", td.UnpackedSize);
1553 ok(td.Stride == 0x20, "Stride is %#x, expected 0x20\n", td.Stride);
1555 /* check BlendState blend */
1556 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1557 hr = variable->lpVtbl->GetDesc(variable, &vd);
1558 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1560 ok(strcmp(vd.Name, "blend") == 0, "Name is \"%s\", expected \"blend\"\n", vd.Name);
1561 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1562 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1563 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1564 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1565 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1567 check_as((ID3D10EffectVariable *)variable);
1569 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1570 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1572 type = variable->lpVtbl->GetType(variable);
1573 hr = type->lpVtbl->GetDesc(type, &td);
1574 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1576 ok(strcmp(td.TypeName, "BlendState") == 0, "TypeName is \"%s\", expected \"BlendState\"\n", td.TypeName);
1577 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1578 ok(td.Type == D3D10_SVT_BLEND, "Type is %x, expected %x\n", td.Type, D3D10_SVT_BLEND);
1579 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1580 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1581 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1582 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1583 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1584 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1585 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1587 /* check DepthStencilState depthstencil */
1588 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1589 hr = variable->lpVtbl->GetDesc(variable, &vd);
1590 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1592 ok(strcmp(vd.Name, "depthstencil") == 0, "Name is \"%s\", expected \"depthstencil\"\n", vd.Name);
1593 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1594 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1595 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1596 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1597 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1599 check_as((ID3D10EffectVariable *)variable);
1601 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1602 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1604 type = variable->lpVtbl->GetType(variable);
1605 hr = type->lpVtbl->GetDesc(type, &td);
1606 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1608 ok(strcmp(td.TypeName, "DepthStencilState") == 0, "TypeName is \"%s\", expected \"DepthStencilState\"\n", td.TypeName);
1609 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1610 ok(td.Type == D3D10_SVT_DEPTHSTENCIL, "Type is %x, expected %x\n", td.Type, D3D10_SVT_DEPTHSTENCIL);
1611 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1612 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1613 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1614 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1615 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1616 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1617 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1619 /* check RasterizerState rast */
1620 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1621 hr = variable->lpVtbl->GetDesc(variable, &vd);
1622 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1624 ok(strcmp(vd.Name, "rast") == 0, "Name is \"%s\", expected \"rast\"\n", vd.Name);
1625 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1626 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1627 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1628 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1629 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1631 check_as((ID3D10EffectVariable *)variable);
1633 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1634 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1636 type = variable->lpVtbl->GetType(variable);
1637 hr = type->lpVtbl->GetDesc(type, &td);
1638 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1640 ok(strcmp(td.TypeName, "RasterizerState") == 0, "TypeName is \"%s\", expected \"RasterizerState\"\n", td.TypeName);
1641 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1642 ok(td.Type == D3D10_SVT_RASTERIZER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_RASTERIZER);
1643 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1644 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1645 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1646 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1647 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1648 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1649 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1651 /* check SamplerState sam */
1652 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1653 hr = variable->lpVtbl->GetDesc(variable, &vd);
1654 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1656 ok(strcmp(vd.Name, "sam") == 0, "Name is \"%s\", expected \"sam\"\n", vd.Name);
1657 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1658 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1659 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1660 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1661 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1663 check_as((ID3D10EffectVariable *)variable);
1665 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1666 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1668 type = variable->lpVtbl->GetType(variable);
1669 hr = type->lpVtbl->GetDesc(type, &td);
1670 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1672 ok(strcmp(td.TypeName, "SamplerState") == 0, "TypeName is \"%s\", expected \"SamplerState\"\n", td.TypeName);
1673 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1674 ok(td.Type == D3D10_SVT_SAMPLER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_SAMPLER);
1675 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1676 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1677 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1678 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1679 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1680 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1681 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1683 /* check RenderTargetView rtv */
1684 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1685 hr = variable->lpVtbl->GetDesc(variable, &vd);
1686 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1688 ok(strcmp(vd.Name, "rtv") == 0, "Name is \"%s\", expected \"rtv\"\n", vd.Name);
1689 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1690 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1691 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1692 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1693 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1695 check_as((ID3D10EffectVariable *)variable);
1697 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1698 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1700 type = variable->lpVtbl->GetType(variable);
1701 hr = type->lpVtbl->GetDesc(type, &td);
1702 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1704 ok(strcmp(td.TypeName, "RenderTargetView") == 0, "TypeName is \"%s\", expected \"RenderTargetView\"\n", td.TypeName);
1705 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1706 ok(td.Type == D3D10_SVT_RENDERTARGETVIEW, "Type is %x, expected %x\n", td.Type, D3D10_SVT_RENDERTARGETVIEW);
1707 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1708 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1709 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1710 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1711 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1712 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1713 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1715 /* check DepthStencilView dsv */
1716 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1717 hr = variable->lpVtbl->GetDesc(variable, &vd);
1718 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1720 ok(strcmp(vd.Name, "dsv") == 0, "Name is \"%s\", expected \"dsv\"\n", vd.Name);
1721 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1722 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1723 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1724 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1725 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1727 check_as((ID3D10EffectVariable *)variable);
1729 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1730 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1732 type = variable->lpVtbl->GetType(variable);
1733 hr = type->lpVtbl->GetDesc(type, &td);
1734 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1736 ok(strcmp(td.TypeName, "DepthStencilView") == 0, "TypeName is \"%s\", expected \"DepthStencilView\"\n", td.TypeName);
1737 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1738 ok(td.Type == D3D10_SVT_DEPTHSTENCILVIEW, "Type is %x, expected %x\n", td.Type, D3D10_SVT_DEPTHSTENCILVIEW);
1739 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1740 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1741 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1742 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1743 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1744 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1745 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1747 /* check Texture1D t1 */
1748 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1749 hr = variable->lpVtbl->GetDesc(variable, &vd);
1750 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1752 ok(strcmp(vd.Name, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", vd.Name);
1753 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1754 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1755 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1756 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1757 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1759 check_as((ID3D10EffectVariable *)variable);
1761 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1762 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1764 type = variable->lpVtbl->GetType(variable);
1765 hr = type->lpVtbl->GetDesc(type, &td);
1766 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1768 ok(strcmp(td.TypeName, "Texture1D") == 0, "TypeName is \"%s\", expected \"Texture1D\"\n", td.TypeName);
1769 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1770 ok(td.Type == D3D10_SVT_TEXTURE1D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE1D);
1771 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1772 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1773 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1774 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1775 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1776 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1777 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1779 /* check Texture1DArray t1a */
1780 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1781 hr = variable->lpVtbl->GetDesc(variable, &vd);
1782 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1784 ok(strcmp(vd.Name, "t1a") == 0, "Name is \"%s\", expected \"t1a\"\n", vd.Name);
1785 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1786 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1787 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1788 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1789 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1791 check_as((ID3D10EffectVariable *)variable);
1793 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1794 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1796 type = variable->lpVtbl->GetType(variable);
1797 hr = type->lpVtbl->GetDesc(type, &td);
1798 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1800 ok(strcmp(td.TypeName, "Texture1DArray") == 0, "TypeName is \"%s\", expected \"Texture1DArray\"\n", td.TypeName);
1801 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1802 ok(td.Type == D3D10_SVT_TEXTURE1DARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE1DARRAY);
1803 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1804 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1805 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1806 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1807 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1808 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1809 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1811 /* check Texture2D t2 */
1812 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1813 hr = variable->lpVtbl->GetDesc(variable, &vd);
1814 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1816 ok(strcmp(vd.Name, "t2") == 0, "Name is \"%s\", expected \"t2\"\n", vd.Name);
1817 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1818 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1819 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1820 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1821 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1823 check_as((ID3D10EffectVariable *)variable);
1825 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1826 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1828 type = variable->lpVtbl->GetType(variable);
1829 hr = type->lpVtbl->GetDesc(type, &td);
1830 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1832 ok(strcmp(td.TypeName, "Texture2D") == 0, "TypeName is \"%s\", expected \"Texture2D\"\n", td.TypeName);
1833 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1834 ok(td.Type == D3D10_SVT_TEXTURE2D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2D);
1835 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1836 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1837 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1838 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1839 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1840 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1841 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1843 /* check Texture2DMS t2dms */
1844 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1845 hr = variable->lpVtbl->GetDesc(variable, &vd);
1846 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1848 ok(strcmp(vd.Name, "t2dms") == 0, "Name is \"%s\", expected \"t2dms\"\n", vd.Name);
1849 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1850 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1851 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1852 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1853 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1855 check_as((ID3D10EffectVariable *)variable);
1857 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1858 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1860 type = variable->lpVtbl->GetType(variable);
1861 hr = type->lpVtbl->GetDesc(type, &td);
1862 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1864 ok(strcmp(td.TypeName, "Texture2DMS") == 0, "TypeName is \"%s\", expected \"Texture2DMS\"\n", td.TypeName);
1865 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1866 ok(td.Type == D3D10_SVT_TEXTURE2DMS, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DMS);
1867 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1868 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1869 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1870 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1871 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1872 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1873 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1875 /* check Texture2DArray t2a */
1876 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1877 hr = variable->lpVtbl->GetDesc(variable, &vd);
1878 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1880 ok(strcmp(vd.Name, "t2a") == 0, "Name is \"%s\", expected \"t2a\"\n", vd.Name);
1881 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1882 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1883 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1884 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1885 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1887 check_as((ID3D10EffectVariable *)variable);
1889 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1890 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1892 type = variable->lpVtbl->GetType(variable);
1893 hr = type->lpVtbl->GetDesc(type, &td);
1894 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1896 ok(strcmp(td.TypeName, "Texture2DArray") == 0, "TypeName is \"%s\", expected \"Texture2DArray\"\n", td.TypeName);
1897 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1898 ok(td.Type == D3D10_SVT_TEXTURE2DARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DARRAY);
1899 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1900 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1901 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1902 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1903 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1904 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1905 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1907 /* check Texture2DMSArray t2dmsa */
1908 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1909 hr = variable->lpVtbl->GetDesc(variable, &vd);
1910 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1912 ok(strcmp(vd.Name, "t2dmsa") == 0, "Name is \"%s\", expected \"t2dmsa\"\n", vd.Name);
1913 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1914 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1915 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1916 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1917 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1919 check_as((ID3D10EffectVariable *)variable);
1921 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1922 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1924 type = variable->lpVtbl->GetType(variable);
1925 hr = type->lpVtbl->GetDesc(type, &td);
1926 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1928 ok(strcmp(td.TypeName, "Texture2DMSArray") == 0, "TypeName is \"%s\", expected \"TTexture2DMSArray\"\n", td.TypeName);
1929 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1930 ok(td.Type == D3D10_SVT_TEXTURE2DMSARRAY, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE2DMSARRAY);
1931 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1932 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1933 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1934 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1935 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1936 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1937 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1939 /* check Texture3D t3 */
1940 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1941 hr = variable->lpVtbl->GetDesc(variable, &vd);
1942 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1944 ok(strcmp(vd.Name, "t3") == 0, "Name is \"%s\", expected \"t3\"\n", vd.Name);
1945 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1946 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1947 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1948 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1949 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1951 check_as((ID3D10EffectVariable *)variable);
1953 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1954 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1956 type = variable->lpVtbl->GetType(variable);
1957 hr = type->lpVtbl->GetDesc(type, &td);
1958 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1960 ok(strcmp(td.TypeName, "Texture3D") == 0, "TypeName is \"%s\", expected \"Texture3D\"\n", td.TypeName);
1961 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1962 ok(td.Type == D3D10_SVT_TEXTURE3D, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURE3D);
1963 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1964 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1965 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1966 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1967 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
1968 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
1969 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
1971 /* check TextureCube tq */
1972 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
1973 hr = variable->lpVtbl->GetDesc(variable, &vd);
1974 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1976 ok(strcmp(vd.Name, "tq") == 0, "Name is \"%s\", expected \"tq\"\n", vd.Name);
1977 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
1978 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
1979 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
1980 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
1981 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
1983 check_as((ID3D10EffectVariable *)variable);
1985 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
1986 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
1988 type = variable->lpVtbl->GetType(variable);
1989 hr = type->lpVtbl->GetDesc(type, &td);
1990 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
1992 ok(strcmp(td.TypeName, "TextureCube") == 0, "TypeName is \"%s\", expected \"TextureCube\"\n", td.TypeName);
1993 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
1994 ok(td.Type == D3D10_SVT_TEXTURECUBE, "Type is %x, expected %x\n", td.Type, D3D10_SVT_TEXTURECUBE);
1995 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
1996 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
1997 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
1998 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
1999 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2000 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2001 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2003 /* check GeometryShader gs[2] */
2004 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2005 hr = variable->lpVtbl->GetDesc(variable, &vd);
2006 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2008 ok(strcmp(vd.Name, "gs") == 0, "Name is \"%s\", expected \"gs\"\n", vd.Name);
2009 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2010 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2011 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2012 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2013 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2015 check_as((ID3D10EffectVariable *)variable);
2017 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2018 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2020 type = variable->lpVtbl->GetType(variable);
2021 hr = type->lpVtbl->GetDesc(type, &td);
2022 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2024 ok(strcmp(td.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", td.TypeName);
2025 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2026 ok(td.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_GEOMETRYSHADER);
2027 ok(td.Elements == 2, "Elements is %u, expected 2\n", td.Elements);
2028 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2029 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2030 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2031 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2032 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2033 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2035 /* check PixelShader ps */
2036 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2037 hr = variable->lpVtbl->GetDesc(variable, &vd);
2038 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2040 ok(strcmp(vd.Name, "ps") == 0, "Name is \"%s\", expected \"ps\"\n", vd.Name);
2041 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2042 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2043 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2044 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2045 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2047 check_as((ID3D10EffectVariable *)variable);
2049 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2050 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2052 type = variable->lpVtbl->GetType(variable);
2053 hr = type->lpVtbl->GetDesc(type, &td);
2054 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2056 ok(strcmp(td.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", td.TypeName);
2057 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2058 ok(td.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_PIXELSHADER);
2059 ok(td.Elements == 0, "Elements is %u, expected 0\n", td.Elements);
2060 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2061 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2062 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2063 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2064 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2065 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2067 /* check VertexShader vs[1] */
2068 variable = effect->lpVtbl->GetVariableByIndex(effect, variable_nr++);
2069 hr = variable->lpVtbl->GetDesc(variable, &vd);
2070 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2072 ok(strcmp(vd.Name, "vs") == 0, "Name is \"%s\", expected \"vs\"\n", vd.Name);
2073 ok(vd.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vd.Semantic);
2074 ok(vd.Flags == 0, "Flags is %u, expected 0\n", vd.Flags);
2075 ok(vd.Annotations == 0, "Annotations is %u, expected 0\n", vd.Annotations);
2076 ok(vd.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vd.BufferOffset);
2077 ok(vd.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vd.ExplicitBindPoint);
2079 check_as((ID3D10EffectVariable *)variable);
2081 parent = variable->lpVtbl->GetParentConstantBuffer(variable);
2082 ok(null_buffer == parent, "GetParentConstantBuffer got %p, expected %p\n", parent, null_buffer);
2084 type = variable->lpVtbl->GetType(variable);
2085 hr = type->lpVtbl->GetDesc(type, &td);
2086 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2088 ok(strcmp(td.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", td.TypeName);
2089 ok(td.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", td.Class, D3D10_SVC_OBJECT);
2090 ok(td.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", td.Type, D3D10_SVT_VERTEXSHADER);
2091 ok(td.Elements == 1, "Elements is %u, expected 1\n", td.Elements);
2092 ok(td.Members == 0, "Members is %u, expected 0\n", td.Members);
2093 ok(td.Rows == 0, "Rows is %u, expected 0\n", td.Rows);
2094 ok(td.Columns == 0, "Columns is %u, expected 0\n", td.Columns);
2095 ok(td.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", td.PackedSize);
2096 ok(td.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", td.UnpackedSize);
2097 ok(td.Stride == 0x0, "Stride is %#x, expected 0x0\n", td.Stride);
2099 effect->lpVtbl->Release(effect);
2103 * test_effect_constant_buffer_stride
2137 float2 a6 : packoffset(c0);
2138 float3 b6 : packoffset(c1);
2139 float2 c6 : packoffset(c0.z);
2143 float2 a7 : packoffset(c0);
2144 float3 b7 : packoffset(c1);
2145 float2 c7 : packoffset(c2);
2149 float2 a8 : packoffset(c0);
2150 float3 b8 : packoffset(c0.y);
2151 float4 c8 : packoffset(c2);
2155 float2 a9 : packoffset(c0);
2156 float2 b9 : packoffset(c0.y);
2157 float2 c9 : packoffset(c0.z);
2161 float4 a10 : packoffset(c2);
2197 float2 a15[2] : packoffset(c0);
2200 static DWORD fx_test_ecbs[] = {
2201 0x43425844, 0x615d7d77, 0x21289d92, 0xe9e8d98e,
2202 0xcae7b74e, 0x00000001, 0x00000855, 0x00000001,
2203 0x00000024, 0x30315846, 0x00000829, 0xfeff1001,
2204 0x0000000f, 0x00000024, 0x00000000, 0x00000000,
2205 0x00000000, 0x00000000, 0x00000000, 0x00000285,
2206 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2207 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2208 0x00000000, 0x00000000, 0x00000000, 0x00316263,
2209 0x616f6c66, 0x00080074, 0x00010000, 0x00000000,
2210 0x00040000, 0x00100000, 0x00040000, 0x09090000,
2211 0x31610000, 0x00316200, 0x64003163, 0x62630031,
2212 0x32610032, 0x6f6c6600, 0x00327461, 0x0000003d,
2213 0x00000001, 0x00000000, 0x00000008, 0x00000010,
2214 0x00000008, 0x0000110a, 0x63003262, 0x61003362,
2215 0x6c660033, 0x3374616f, 0x00006a00, 0x00000100,
2216 0x00000000, 0x00000c00, 0x00001000, 0x00000c00,
2217 0x00190a00, 0x00336200, 0x00346263, 0x62003461,
2218 0x34630034, 0x35626300, 0x00356100, 0x63003562,
2219 0x62630035, 0x36610036, 0x00366200, 0x63003663,
2220 0x61003762, 0x37620037, 0x00376300, 0x00386263,
2221 0x62003861, 0x6c660038, 0x3474616f, 0x0000ce00,
2222 0x00000100, 0x00000000, 0x00001000, 0x00001000,
2223 0x00001000, 0x00210a00, 0x00386300, 0x00396263,
2224 0x62003961, 0x39630039, 0x31626300, 0x31610030,
2225 0x62630030, 0x3c003131, 0x616e6e75, 0x3e64656d,
2226 0x31316100, 0x31316200, 0x00010f00, 0x00000300,
2227 0x00000000, 0x00001400, 0x00002000, 0x00001400,
2228 0x00000200, 0x00011900, 0x00000000, 0x00000000,
2229 0x0000d500, 0x00011d00, 0x00000000, 0x00001000,
2230 0x00000e00, 0x31317300, 0x31316300, 0x31626300,
2231 0x31630032, 0x31620032, 0x31610032, 0x010f0032,
2232 0x00030000, 0x00000000, 0x00200000, 0x00200000,
2233 0x00140000, 0x00020000, 0x016e0000, 0x00000000,
2234 0x00000000, 0x000e0000, 0x01720000, 0x00000000,
2235 0x00100000, 0x00d50000, 0x31730000, 0x62630032,
2236 0x61003331, 0x62003331, 0x0f003331, 0x03000001,
2237 0x00000000, 0x04000000, 0x10000000, 0x04000000,
2238 0x01000000, 0xbf000000, 0x00000001, 0x00000000,
2239 0x0e000000, 0x73000000, 0x63003331, 0x00343162,
2240 0x00343161, 0x0000010f, 0x00000003, 0x00000000,
2241 0x00000004, 0x00000010, 0x00000004, 0x00000001,
2242 0x000001f8, 0x00000000, 0x00000000, 0x0000000e,
2243 0x00343173, 0x00343162, 0x0000010f, 0x00000003,
2244 0x00000000, 0x00000004, 0x00000010, 0x00000004,
2245 0x00000001, 0x0000022c, 0x00000000, 0x00000000,
2246 0x0000000e, 0x00343174, 0x35316263, 0x00003d00,
2247 0x00000100, 0x00000200, 0x00001800, 0x00001000,
2248 0x00001000, 0x00110a00, 0x35316100, 0x00000400,
2249 0x00001000, 0x00000000, 0x00000400, 0xffffff00,
2250 0x000000ff, 0x00002a00, 0x00000e00, 0x00000000,
2251 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2252 0x00002d00, 0x00000e00, 0x00000000, 0x00000400,
2253 0x00000000, 0x00000000, 0x00000000, 0x00003000,
2254 0x00000e00, 0x00000000, 0x00000800, 0x00000000,
2255 0x00000000, 0x00000000, 0x00003300, 0x00000e00,
2256 0x00000000, 0x00000c00, 0x00000000, 0x00000000,
2257 0x00000000, 0x00003600, 0x00001000, 0x00000000,
2258 0x00000200, 0xffffff00, 0x000000ff, 0x00003a00,
2259 0x00000e00, 0x00000000, 0x00000000, 0x00000000,
2260 0x00000000, 0x00000000, 0x00006000, 0x00004400,
2261 0x00000000, 0x00000400, 0x00000000, 0x00000000,
2262 0x00000000, 0x00006300, 0x00002000, 0x00000000,
2263 0x00000200, 0xffffff00, 0x000000ff, 0x00006700,
2264 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2265 0x00000000, 0x00000000, 0x00008d00, 0x00007100,
2266 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2267 0x00000000, 0x00009000, 0x00003000, 0x00000000,
2268 0x00000300, 0xffffff00, 0x000000ff, 0x00009400,
2269 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2270 0x00000000, 0x00000000, 0x00009700, 0x00007100,
2271 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2272 0x00000000, 0x00009a00, 0x00004400, 0x00000000,
2273 0x00002000, 0x00000000, 0x00000000, 0x00000000,
2274 0x00009d00, 0x00002000, 0x00000000, 0x00000300,
2275 0xffffff00, 0x000000ff, 0x0000a100, 0x00004400,
2276 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2277 0x00000000, 0x0000a400, 0x00004400, 0x00000000,
2278 0x00000800, 0x00000000, 0x00000000, 0x00000000,
2279 0x0000a700, 0x00007100, 0x00000000, 0x00001000,
2280 0x00000000, 0x00000000, 0x00000000, 0x0000aa00,
2281 0x00002000, 0x00000000, 0x00000300, 0xffffff00,
2282 0x000000ff, 0x0000ae00, 0x00004400, 0x00000000,
2283 0x00000000, 0x00000000, 0x00000400, 0x00000000,
2284 0x0000b100, 0x00007100, 0x00000000, 0x00001000,
2285 0x00000000, 0x00000400, 0x00000000, 0x0000b400,
2286 0x00004400, 0x00000000, 0x00000800, 0x00000000,
2287 0x00000400, 0x00000000, 0x0000b700, 0x00003000,
2288 0x00000000, 0x00000300, 0xffffff00, 0x000000ff,
2289 0x0000bb00, 0x00004400, 0x00000000, 0x00000000,
2290 0x00000000, 0x00000400, 0x00000000, 0x0000be00,
2291 0x00007100, 0x00000000, 0x00001000, 0x00000000,
2292 0x00000400, 0x00000000, 0x0000c100, 0x00004400,
2293 0x00000000, 0x00002000, 0x00000000, 0x00000400,
2294 0x00000000, 0x0000c400, 0x00003000, 0x00000000,
2295 0x00000300, 0xffffff00, 0x000000ff, 0x0000c800,
2296 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2297 0x00000400, 0x00000000, 0x0000cb00, 0x00007100,
2298 0x00000000, 0x00000400, 0x00000000, 0x00000400,
2299 0x00000000, 0x0000f100, 0x0000d500, 0x00000000,
2300 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2301 0x0000f400, 0x00001000, 0x00000000, 0x00000300,
2302 0xffffff00, 0x000000ff, 0x0000f800, 0x00004400,
2303 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2304 0x00000000, 0x0000fb00, 0x00004400, 0x00000000,
2305 0x00000400, 0x00000000, 0x00000400, 0x00000000,
2306 0x0000fe00, 0x00004400, 0x00000000, 0x00000800,
2307 0x00000000, 0x00000400, 0x00000000, 0x00010100,
2308 0x00003000, 0x00000000, 0x00000100, 0xffffff00,
2309 0x000000ff, 0x00010600, 0x0000d500, 0x00000000,
2310 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2311 0x00010a00, 0x00002000, 0x00000000, 0x00000200,
2312 0xffffff00, 0x000000ff, 0x00015d00, 0x00012100,
2313 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2314 0x00000000, 0x00016100, 0x00000e00, 0x00000000,
2315 0x00001400, 0x00000000, 0x00000000, 0x00000000,
2316 0x00016500, 0x00003000, 0x00000000, 0x00000200,
2317 0xffffff00, 0x000000ff, 0x00016a00, 0x00000e00,
2318 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2319 0x00000000, 0x0001b200, 0x00017600, 0x00000000,
2320 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2321 0x0001b600, 0x00002000, 0x00000000, 0x00000200,
2322 0xffffff00, 0x000000ff, 0x0001bb00, 0x00000e00,
2323 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2324 0x00000000, 0x0001ef00, 0x0001c300, 0x00000000,
2325 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2326 0x0001f300, 0x00002000, 0x00000000, 0x00000200,
2327 0xffffff00, 0x000000ff, 0x00022800, 0x0001fc00,
2328 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2329 0x00000000, 0x00025c00, 0x00023000, 0x00000000,
2330 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2331 0x00026000, 0x00002000, 0x00000000, 0x00000100,
2332 0xffffff00, 0x000000ff, 0x00028100, 0x00026500,
2333 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2334 0x00000000, 0x00000000,
2337 static void test_effect_constant_buffer_stride(ID3D10Device *device)
2339 ID3D10Effect *effect;
2340 ID3D10EffectConstantBuffer *constantbuffer;
2341 ID3D10EffectType *type;
2342 D3D10_EFFECT_TYPE_DESC tdesc;
2346 static const struct {
2347 unsigned int m; /* members */
2348 unsigned int p; /* packed size */
2349 unsigned int u; /* unpacked size */
2350 unsigned int s; /* stride */
2352 {4, 0x10, 0x10, 0x10},
2353 {2, 0xc, 0x10, 0x10},
2354 {2, 0x14, 0x20, 0x20},
2355 {3, 0x1c, 0x30, 0x30},
2356 {3, 0x1c, 0x20, 0x20},
2357 {3, 0x1c, 0x20, 0x20},
2358 {3, 0x1c, 0x30, 0x30},
2359 {3, 0x24, 0x30, 0x30},
2360 {3, 0x18, 0x10, 0x10},
2361 {1, 0x10, 0x30, 0x30},
2362 {2, 0x18, 0x20, 0x20},
2363 {2, 0x18, 0x30, 0x30},
2364 {2, 0x8, 0x20, 0x20},
2365 {2, 0x8, 0x20, 0x20},
2366 {1, 0x10, 0x20, 0x20},
2369 hr = create_effect(fx_test_ecbs, 0, device, NULL, &effect);
2370 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
2372 for (i=0; i<sizeof(tv_ecbs)/sizeof(tv_ecbs[0]); i++)
2374 constantbuffer = effect->lpVtbl->GetConstantBufferByIndex(effect, i);
2375 type = constantbuffer->lpVtbl->GetType(constantbuffer);
2377 hr = type->lpVtbl->GetDesc(type, &tdesc);
2378 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2380 ok(strcmp(tdesc.TypeName, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", tdesc.TypeName);
2381 ok(tdesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", tdesc.Class, D3D10_SVC_OBJECT);
2382 ok(tdesc.Type == D3D10_SVT_CBUFFER, "Type is %x, expected %x\n", tdesc.Type, D3D10_SVT_CBUFFER);
2383 ok(tdesc.Elements == 0, "Elements is %u, expected 0\n", tdesc.Elements);
2384 ok(tdesc.Members == tv_ecbs[i].m, "Members is %u, expected %u\n", tdesc.Members, tv_ecbs[i].m);
2385 ok(tdesc.Rows == 0, "Rows is %u, expected 0\n", tdesc.Rows);
2386 ok(tdesc.Columns == 0, "Columns is %u, expected 0\n", tdesc.Columns);
2387 ok(tdesc.PackedSize == tv_ecbs[i].p, "PackedSize is %#x, expected %#x\n", tdesc.PackedSize, tv_ecbs[i].p);
2388 ok(tdesc.UnpackedSize == tv_ecbs[i].u, "UnpackedSize is %#x, expected %#x\n", tdesc.UnpackedSize, tv_ecbs[i].u);
2389 ok(tdesc.Stride == tv_ecbs[i].s, "Stride is %#x, expected %#x\n", tdesc.Stride, tv_ecbs[i].s);
2392 effect->lpVtbl->Release(effect);
2396 float4 VS( float4 Pos : POSITION ) : SV_POSITION { return Pos; }
2397 float4 VS2( int4 Pos : POSITION ) : SV_POSITION { return Pos; }
2398 float4 PS( float4 Pos : SV_POSITION ) : SV_Target { return float4( 1.0f, 1.0f, 0.0f, 1.0f ); }
2399 struct GS_OUT { float4 Pos : SV_POSITION; };
2401 void GS( triangle float4 Pos[3] : SV_POSITION, inout TriangleStream<GS_OUT> TriStream )
2405 TriStream.Append( out1 );
2407 TriStream.Append( out1 );
2409 TriStream.Append( out1 );
2410 TriStream.RestartStrip();
2412 VertexShader v0 = NULL;
2413 PixelShader p0 = NULL;
2414 GeometryShader g0 = NULL;
2415 VertexShader v[2] = { CompileShader( vs_4_0, VS() ), CompileShader( vs_4_0, VS2() ) };
2416 PixelShader p = CompileShader( ps_4_0, PS() );
2417 GeometryShader g = CompileShader( gs_4_0, GS() );
2423 SetPixelShader( NULL );
2424 SetVertexShader( NULL );
2425 SetGeometryShader( NULL );
2429 SetPixelShader( NULL );
2430 SetVertexShader( NULL );
2431 SetGeometryShader( NULL );
2435 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2436 SetVertexShader( CompileShader( vs_4_0, VS() ) );
2437 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2441 SetPixelShader( CompileShader( ps_4_0, PS() ) );
2442 SetVertexShader( CompileShader( vs_4_0, VS2() ) );
2443 SetGeometryShader( CompileShader( gs_4_0, GS() ) );
2447 SetPixelShader( p0 );
2448 SetVertexShader( v0 );
2449 SetGeometryShader( g0 );
2453 SetPixelShader( p );
2454 SetVertexShader( v[0] );
2455 SetGeometryShader( g );
2459 SetPixelShader( p );
2460 SetVertexShader( v[1] );
2461 SetGeometryShader( g );
2465 static DWORD fx_local_shader[] = {
2466 0x43425844, 0x95577e13, 0xab5facae, 0xd06d9eab, 0x8b127be0, 0x00000001, 0x00001652, 0x00000001,
2467 0x00000024, 0x30315846, 0x00001626, 0xfeff1001, 0x00000000, 0x00000000, 0x00000006, 0x00000000,
2468 0x00000000, 0x00000000, 0x00000001, 0x0000138a, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2469 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000d, 0x00000006, 0x00000000, 0x74726556,
2470 0x68537865, 0x72656461, 0x00000400, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2471 0x00000600, 0x00307600, 0x65786950, 0x6168536c, 0x00726564, 0x00000030, 0x00000002, 0x00000000,
2472 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x47003070, 0x656d6f65, 0x53797274, 0x65646168,
2473 0x005b0072, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00070000, 0x30670000,
2474 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000600, 0xb4007600,
2475 0x44000001, 0x02434258, 0x5f11b96d, 0x31cdd883, 0xade81d9f, 0x014d6a2d, 0xb4000000, 0x05000001,
2476 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000,
2477 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369,
2478 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2479 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000,
2480 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49,
2481 0x4fababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000,
2482 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000,
2483 0x0f000100, 0x5f000000, 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000,
2484 0x36000000, 0xf2050000, 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154,
2485 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000,
2486 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2487 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2488 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xb4000000, 0x44000001, 0xa4434258,
2489 0x42e88ad3, 0xcc4b1ab5, 0x5f89bf37, 0x0139edfb, 0xb4000000, 0x05000001, 0x34000000, 0x8c000000,
2490 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000, 0x00000000, 0x00000000,
2491 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820,
2492 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235,
2493 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x00000000,
2494 0x02000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49, 0x4fababab, 0x2c4e4753,
2495 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000,
2496 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000, 0x0f000100, 0x5f000000,
2497 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000, 0x2b000000, 0xf2050000,
2498 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154, 0x02000000, 0x00000000,
2499 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000,
2500 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2501 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2502 0x00000000, 0x00000000, 0x00000000, 0x70000000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2503 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2504 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2505 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2506 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2507 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2508 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2509 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2510 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2511 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2512 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2513 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2514 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2515 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2516 0x00000000, 0x10006700, 0x44000002, 0x5c434258, 0x7482cd04, 0xb6d82978, 0xe48192f2, 0x01eec6be,
2517 0x10000000, 0x05000002, 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x94000000, 0x52000001,
2518 0x50464544, 0x00000000, 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00475304, 0x1c000001,
2519 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
2520 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000,
2521 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x5300000f,
2522 0x4f505f56, 0x49544953, 0x4f004e4f, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000,
2523 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f,
2524 0x98524448, 0x40000000, 0x26000200, 0x61000000, 0xf2050000, 0x03002010, 0x00000000, 0x01000000,
2525 0x5d000000, 0x5c010018, 0x67010028, 0xf2040000, 0x00001020, 0x01000000, 0x5e000000, 0x03020000,
2526 0x36000000, 0xf2060000, 0x00001020, 0x46000000, 0x0000201e, 0x00000000, 0x13000000, 0x36010000,
2527 0xf2060000, 0x00001020, 0x46000000, 0x0100201e, 0x00000000, 0x13000000, 0x36010000, 0xf2060000,
2528 0x00001020, 0x46000000, 0x0200201e, 0x00000000, 0x13000000, 0x09010000, 0x3e010000, 0x53010000,
2529 0x74544154, 0x08000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000,
2530 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000,
2531 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2532 0x03000000, 0x05000000, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x52000000, 0x65646e65,
2533 0x30500072, 0x00315000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
2534 0x00000001, 0x00000002, 0x00000000, 0x01003250, 0x02000000, 0x00000000, 0x01000000, 0x02000000,
2535 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x50000000, 0x01b00033, 0x58440000, 0x269a4342,
2536 0x7ba57ff9, 0x728d8af1, 0x9e9d796d, 0x0001ff59, 0x01b00000, 0x00050000, 0x00340000, 0x008c0000,
2537 0x00c00000, 0x00f40000, 0x01340000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000,
2538 0x001c0000, 0x04000000, 0x0100ffff, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228,
2539 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32,
2540 0xab003434, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000,
2541 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47,
2542 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000,
2543 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00385244, 0x00400000, 0x000e0000, 0x00650000,
2544 0x20f20300, 0x00000010, 0x00360000, 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80,
2545 0x00003f80, 0x00000000, 0x003e3f80, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2546 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2547 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2548 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2549 0x00000000, 0x00000000, 0x083e0000, 0x00000000, 0x01b40000, 0x58440000, 0x6d024342, 0x835f11b9,
2550 0x9f31cdd8, 0x2dade81d, 0x00014d6a, 0x01b40000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2551 0x00f40000, 0x01380000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2552 0x04000000, 0x0100fffe, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2553 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2554 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000,
2555 0x00000000, 0x0f0f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab, 0x002c4e47, 0x00010000,
2556 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2557 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001, 0x005f0000, 0x10f20300,
2558 0x00000010, 0x00670000, 0x20f20400, 0x00000010, 0x00010000, 0x00360000, 0x20f20500, 0x00000010,
2559 0x1e460000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2560 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2561 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2562 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2563 0x00000000, 0x00000000, 0x09fa0000, 0x00000000, 0x02100000, 0x58440000, 0x045c4342, 0x787482cd,
2564 0xf2b6d829, 0xbee48192, 0x0001eec6, 0x02100000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2565 0x00f40000, 0x01940000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2566 0x04000000, 0x01004753, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2567 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2568 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000,
2569 0x00000000, 0x0f0f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47, 0x00010000,
2570 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2571 0x534f505f, 0x4f495449, 0x4853004e, 0x00985244, 0x00400000, 0x00260002, 0x00610000, 0x10f20500,
2572 0x00030020, 0x00000000, 0x00010000, 0x185d0000, 0x285c0100, 0x00670100, 0x20f20400, 0x00000010,
2573 0x00010000, 0x005e0000, 0x00030200, 0x00360000, 0x20f20600, 0x00000010, 0x1e460000, 0x00000020,
2574 0x00000000, 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00010020, 0x00000000,
2575 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00020020, 0x00000000, 0x00130000,
2576 0x00090100, 0x003e0100, 0x54530100, 0x00745441, 0x00080000, 0x00000000, 0x00000000, 0x00020000,
2577 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2578 0x00010000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2579 0x00000000, 0x00000000, 0x00000000, 0x00030000, 0x00050000, 0x00030000, 0x00000000, 0x00000000,
2580 0x00000000, 0x0bba0000, 0x00000000, 0x34500000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2581 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2582 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2583 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2584 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2585 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2586 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2587 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2588 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2589 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2590 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2591 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2592 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2593 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2594 0x00000000, 0x000dd900, 0x00000000, 0x0001b400, 0x42584400, 0x8ad3a443, 0x1ab542e8, 0xbf37cc4b,
2595 0xedfb5f89, 0x00000139, 0x0001b400, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2596 0x00013800, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0xfe040000,
2597 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2598 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2599 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2600 0x000f0f00, 0x534f5000, 0x4f495449, 0xabab004e, 0x47534fab, 0x00002c4e, 0x00000100, 0x00000800,
2601 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2602 0x4e4f4954, 0x44485300, 0x00003c52, 0x01004000, 0x00000f00, 0x00005f00, 0x1010f203, 0x00000000,
2603 0x00006700, 0x1020f204, 0x00000000, 0x00000100, 0x00002b00, 0x1020f205, 0x00000000, 0x101e4600,
2604 0x00000000, 0x00003e00, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000200,
2605 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2606 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2607 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2608 0x00000000, 0x000f9500, 0x00000000, 0x00021000, 0x42584400, 0xcd045c43, 0x29787482, 0x92f2b6d8,
2609 0xc6bee481, 0x000001ee, 0x00021000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2610 0x00019400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x53040000,
2611 0x00010047, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2612 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2613 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2614 0x000f0f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800,
2615 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2616 0x4e4f4954, 0x44485300, 0x00009852, 0x02004000, 0x00002600, 0x00006100, 0x2010f205, 0x00000300,
2617 0x00000000, 0x00000100, 0x00185d00, 0x00285c01, 0x00006701, 0x1020f204, 0x00000000, 0x00000100,
2618 0x00005e00, 0x00000302, 0x00003600, 0x1020f206, 0x00000000, 0x201e4600, 0x00000000, 0x00000000,
2619 0x00001300, 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000100, 0x00000000, 0x00001300,
2620 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000200, 0x00000000, 0x00001300, 0x00000901,
2621 0x00003e01, 0x41545301, 0x00007454, 0x00000800, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2622 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2623 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2624 0x00000000, 0x00000000, 0x00000300, 0x00000500, 0x00000300, 0x00000000, 0x00000000, 0x00000000,
2625 0x00115500, 0x00000000, 0x00355000, 0xa5003650, 0x00000000, 0x50000000, 0x00a50037, 0x00010000,
2626 0x002d0000, 0x00110000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00580000, 0x003c0000,
2627 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00860000, 0x006a0000, 0x00000000, 0xffff0000,
2628 0x0000ffff, 0x00000000, 0x00a50000, 0x00890000, 0x00000000, 0xffff0000, 0x00a7ffff, 0x025f0000,
2629 0x00000000, 0x04170000, 0x003c0000, 0x00000000, 0xffff0000, 0x0419ffff, 0x00000000, 0x05cd0000,
2630 0x006a0000, 0x00000000, 0xffff0000, 0x05cfffff, 0x00000000, 0x07e30000, 0x00080000, 0x00000000,
2631 0x07ea0000, 0x00000000, 0x00000000, 0x07ed0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000,
2632 0x00010000, 0x07f00000, 0x00060000, 0x00000000, 0x00010000, 0x07fc0000, 0x00080000, 0x00000000,
2633 0x00010000, 0x08080000, 0x08140000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00010000,
2634 0x08170000, 0x00060000, 0x00000000, 0x00010000, 0x08230000, 0x00080000, 0x00000000, 0x00010000,
2635 0x082f0000, 0x083b0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x09f20000,
2636 0x00060000, 0x00000000, 0x00070000, 0x0bb20000, 0x00080000, 0x00000000, 0x00070000, 0x0dce0000,
2637 0x0dd60000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x0f8d0000, 0x00060000,
2638 0x00000000, 0x00070000, 0x114d0000, 0x00080000, 0x00000000, 0x00070000, 0x13690000, 0x13710000,
2639 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x00580000, 0x00060000, 0x00000000,
2640 0x00020000, 0x002d0000, 0x00080000, 0x00000000, 0x00020000, 0x00860000, 0x13740000, 0x00030000,
2641 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000,
2642 0x13770000, 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x137f0000, 0x00030000, 0x00000000,
2643 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000, 0x13820000,
2644 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x00000000,
2647 static void test_effect_local_shader(ID3D10Device *device)
2651 ID3D10Effect* effect;
2652 ID3D10EffectVariable* v;
2653 ID3D10EffectPass *p, *p2, *null_pass;
2654 ID3D10EffectTechnique *t, *t2, *null_technique;
2655 D3D10_PASS_SHADER_DESC pdesc = {0};
2656 D3D10_EFFECT_VARIABLE_DESC vdesc = {0};
2657 ID3D10EffectType *type;
2658 D3D10_EFFECT_TYPE_DESC typedesc;
2659 ID3D10EffectShaderVariable *null_shader, *null_anon_vs, *null_anon_ps, *null_anon_gs,
2660 *p3_anon_vs, *p3_anon_ps, *p3_anon_gs, *p6_vs, *p6_ps, *p6_gs;
2662 hr = create_effect(fx_local_shader, 0, device, NULL, &effect);
2663 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed!\n");
2665 null_technique = effect->lpVtbl->GetTechniqueByIndex(effect, 0xffffffff);
2666 null_pass = null_technique->lpVtbl->GetPassByIndex(null_technique, 0xffffffff);
2668 /* check technique */
2669 t = effect->lpVtbl->GetTechniqueByName(effect, NULL);
2670 ok(null_technique == t, "GetTechniqueByName got %p, expected %p\n", t, null_technique);
2672 t = effect->lpVtbl->GetTechniqueByName(effect, "invalid");
2673 ok(null_technique == t, "GetTechniqueByName got %p, expected %p\n", t, null_technique);
2675 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2676 ok(null_technique != t, "GetTechniqueByIndex failed %p\n", t);
2678 t2 = effect->lpVtbl->GetTechniqueByName(effect, "Render");
2679 ok(t2 == t, "GetTechniqueByName got %p, expected %p\n", t2, t);
2681 /* check invalid pass arguments */
2682 p = null_technique->lpVtbl->GetPassByName(null_technique, NULL);
2683 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2685 p = null_technique->lpVtbl->GetPassByName(null_technique, "invalid");
2686 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2689 /* This crashes on W7/DX10, if t is a valid technique and name=NULL. */
2690 p = t->lpVtbl->GetPassByName(t, NULL);
2691 ok(null_pass == p, "GetPassByName got %p, expected %p\n", p, null_pass);
2694 p = t->lpVtbl->GetPassByIndex(t, 0xffffffff);
2695 ok(null_pass == p, "GetPassByIndex got %p, expected %p\n", p, null_pass);
2697 /* check for invalid arguments */
2698 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, NULL);
2699 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2701 hr = null_pass->lpVtbl->GetVertexShaderDesc(null_pass, &pdesc);
2702 ok(hr == E_FAIL, "GetVertexShaderDesc got %x, expected %x\n", hr, E_FAIL);
2704 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, NULL);
2705 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2707 hr = null_pass->lpVtbl->GetPixelShaderDesc(null_pass, &pdesc);
2708 ok(hr == E_FAIL, "GetPixelShaderDesc got %x, expected %x\n", hr, E_FAIL);
2710 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, NULL);
2711 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2713 hr = null_pass->lpVtbl->GetGeometryShaderDesc(null_pass, &pdesc);
2714 ok(hr == E_FAIL, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_FAIL);
2716 /* check valid pass arguments */
2717 t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
2718 p = t->lpVtbl->GetPassByIndex(t, 0);
2720 p2 = t->lpVtbl->GetPassByName(t, "P0");
2721 ok(p2 == p, "GetPassByName got %p, expected %p\n", p2, p);
2723 hr = p->lpVtbl->GetVertexShaderDesc(p, NULL);
2724 ok(hr == E_INVALIDARG, "GetVertexShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2726 hr = p->lpVtbl->GetPixelShaderDesc(p, NULL);
2727 ok(hr == E_INVALIDARG, "GetPixelShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2729 hr = p->lpVtbl->GetGeometryShaderDesc(p, NULL);
2730 ok(hr == E_INVALIDARG, "GetGeometryShaderDesc got %x, expected %x\n", hr, E_INVALIDARG);
2732 /* get the null_shader_variable */
2733 v = effect->lpVtbl->GetVariableByIndex(effect, 10000);
2734 null_shader = v->lpVtbl->AsShader(v);
2737 p = t->lpVtbl->GetPassByIndex(t, 0);
2738 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2739 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2740 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2741 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2743 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2744 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2746 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2747 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2748 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2749 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2751 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2752 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2754 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2755 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2756 ok(pdesc.pShaderVariable == null_shader, "Got %p, expected %p\n", pdesc.pShaderVariable, null_shader);
2757 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2759 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2760 ok(hr == E_FAIL, "GetDesc failed (%x)\n", hr);
2763 p = t->lpVtbl->GetPassByIndex(t, 1);
2765 /* pass 1 vertexshader */
2766 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2767 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2768 null_anon_vs = pdesc.pShaderVariable;
2769 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2771 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2772 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2774 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2775 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2776 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2777 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2778 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2779 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2781 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2782 ok(ret, "IsValid() failed\n");
2784 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2785 ret = type->lpVtbl->IsValid(type);
2786 ok(ret, "IsValid() failed\n");
2788 hr = type->lpVtbl->GetDesc(type, &typedesc);
2789 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2790 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexhader\"\n", typedesc.TypeName);
2791 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2792 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2793 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2794 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2795 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2796 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2797 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2798 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2799 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2801 /* pass 1 pixelshader */
2802 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2803 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2804 null_anon_ps = pdesc.pShaderVariable;
2805 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2807 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2808 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2810 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2811 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2812 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2813 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2814 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2815 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2817 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2818 ok(ret, "IsValid() failed\n");
2820 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2821 ret = type->lpVtbl->IsValid(type);
2822 ok(ret, "IsValid() failed\n");
2824 hr = type->lpVtbl->GetDesc(type, &typedesc);
2825 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2826 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2827 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2828 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2829 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2830 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2831 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2832 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2833 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2834 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2835 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2837 /* pass 1 geometryshader */
2838 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2839 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2840 null_anon_gs = pdesc.pShaderVariable;
2841 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2843 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2844 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2846 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2847 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2848 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2849 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2850 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2851 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2853 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2854 ok(ret, "IsValid() failed\n");
2856 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2857 ret = type->lpVtbl->IsValid(type);
2858 ok(ret, "IsValid() failed\n");
2860 hr = type->lpVtbl->GetDesc(type, &typedesc);
2861 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2862 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
2863 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2864 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
2865 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2866 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2867 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2868 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2869 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2870 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2871 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2874 p = t->lpVtbl->GetPassByIndex(t, 2);
2876 /* pass 2 vertexshader */
2877 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2878 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2879 ok(pdesc.pShaderVariable == null_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_vs);
2880 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2882 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2883 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2885 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2886 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2887 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2888 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2889 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2890 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2892 /* pass 2 pixelshader */
2893 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2894 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2895 ok(pdesc.pShaderVariable == null_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_ps);
2896 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2898 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2899 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2901 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2902 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2903 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2904 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2905 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2906 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2908 /* pass 2 geometryshader */
2909 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
2910 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
2911 ok(pdesc.pShaderVariable == null_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, null_anon_gs);
2912 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2914 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2915 ok(hr == S_OK, "GetDesc failed (%x) expected %x\n", hr, S_OK);
2917 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2918 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2919 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2920 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2921 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2922 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2925 p = t->lpVtbl->GetPassByIndex(t, 3);
2927 /* pass 3 vertexshader */
2928 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
2929 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
2930 p3_anon_vs = pdesc.pShaderVariable;
2931 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2933 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2934 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2936 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2937 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2938 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2939 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2940 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2941 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2943 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2944 ok(ret, "IsValid() failed\n");
2946 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2947 ret = type->lpVtbl->IsValid(type);
2948 ok(ret, "IsValid() failed\n");
2950 hr = type->lpVtbl->GetDesc(type, &typedesc);
2951 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2952 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
2953 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2954 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
2955 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2956 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2957 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2958 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2959 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2960 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2961 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2963 /* pass 3 pixelshader */
2964 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
2965 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
2966 p3_anon_ps = pdesc.pShaderVariable;
2967 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
2969 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
2970 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
2972 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
2973 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
2974 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
2975 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
2976 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
2977 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
2979 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
2980 ok(ret, "IsValid() failed\n");
2982 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
2983 ret = type->lpVtbl->IsValid(type);
2984 ok(ret, "IsValid() failed\n");
2986 hr = type->lpVtbl->GetDesc(type, &typedesc);
2987 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
2988 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
2989 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
2990 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
2991 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
2992 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
2993 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
2994 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
2995 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
2996 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
2997 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
2999 /* pass 3 geometryshader */
3000 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3001 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3002 p3_anon_gs = pdesc.pShaderVariable;
3003 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3005 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3006 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3008 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3009 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3010 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3011 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3012 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3013 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3015 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3016 ok(ret, "IsValid() failed\n");
3018 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3019 ret = type->lpVtbl->IsValid(type);
3020 ok(ret, "IsValid() failed\n");
3022 hr = type->lpVtbl->GetDesc(type, &typedesc);
3023 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3024 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
3025 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3026 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3027 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3028 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3029 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3030 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3031 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3032 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3033 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3036 p = t->lpVtbl->GetPassByIndex(t, 4);
3038 /* pass 4 vertexshader */
3039 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3040 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3041 ok(pdesc.pShaderVariable != p3_anon_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_vs);
3042 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3044 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3045 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3047 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3048 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3049 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3050 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3051 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3052 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3054 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3055 ok(ret, "IsValid() failed\n");
3057 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3058 ret = type->lpVtbl->IsValid(type);
3059 ok(ret, "IsValid() failed\n");
3061 hr = type->lpVtbl->GetDesc(type, &typedesc);
3062 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3063 ok(strcmp(typedesc.TypeName, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc.TypeName);
3064 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3065 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3066 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3067 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3068 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3069 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3070 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3071 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3072 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3074 /* pass 4 pixelshader */
3075 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3076 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3077 ok(pdesc.pShaderVariable != p3_anon_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_ps);
3078 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3080 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3081 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3083 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3084 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3085 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3086 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3087 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3088 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3090 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3091 ok(ret, "IsValid() failed\n");
3093 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3094 ret = type->lpVtbl->IsValid(type);
3095 ok(ret, "IsValid() failed\n");
3097 hr = type->lpVtbl->GetDesc(type, &typedesc);
3098 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3099 ok(strcmp(typedesc.TypeName, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc.TypeName);
3100 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3101 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3102 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3103 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3104 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3105 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3106 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3107 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3108 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3110 /* pass 4 geometryshader */
3111 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3112 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3113 ok(pdesc.pShaderVariable != p3_anon_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p3_anon_gs);
3114 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %x\n", pdesc.ShaderIndex, 0);
3116 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3117 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3119 ok(strcmp(vdesc.Name, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc.Name);
3120 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3121 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3122 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3123 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3124 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected 0\n", vdesc.ExplicitBindPoint);
3126 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3127 ok(ret, "IsValid() failed\n");
3129 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3130 ret = type->lpVtbl->IsValid(type);
3131 ok(ret, "IsValid() failed\n");
3133 hr = type->lpVtbl->GetDesc(type, &typedesc);
3134 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3135 ok(strcmp(typedesc.TypeName, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc.TypeName);
3136 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3137 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3138 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3139 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3140 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3141 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3142 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3143 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3144 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3147 p = t->lpVtbl->GetPassByIndex(t, 5);
3149 /* pass 5 vertexshader */
3150 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3151 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3152 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3154 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3155 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3157 ok(strcmp(vdesc.Name, "v0") == 0, "Name is \"%s\", expected \"v0\"\n", vdesc.Name);
3158 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3159 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3160 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3161 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3162 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3164 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3165 ok(ret, "IsValid() failed\n");
3167 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3168 ret = type->lpVtbl->IsValid(type);
3169 ok(ret, "IsValid() failed\n");
3171 hr = type->lpVtbl->GetDesc(type, &typedesc);
3172 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3173 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3174 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3175 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3176 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3177 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3178 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3179 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3180 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3181 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3182 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3184 /* pass 5 pixelshader */
3185 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3186 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3187 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3189 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3190 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3192 ok(strcmp(vdesc.Name, "p0") == 0, "Name is \"%s\", expected \"p0\"\n", vdesc.Name);
3193 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3194 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3195 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3196 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3197 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3199 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3200 ok(ret, "IsValid() failed\n");
3202 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3203 ret = type->lpVtbl->IsValid(type);
3204 ok(ret, "IsValid() failed\n");
3206 hr = type->lpVtbl->GetDesc(type, &typedesc);
3207 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3208 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3209 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3210 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3211 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3212 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3213 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3214 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3215 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3216 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3217 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3219 /* pass 5 geometryshader */
3220 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3221 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3222 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3224 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3225 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3227 ok(strcmp(vdesc.Name, "g0") == 0, "Name is \"%s\", expected \"g0\"\n", vdesc.Name);
3228 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3229 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3230 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3231 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3232 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3234 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3235 ok(ret, "IsValid() failed\n");
3237 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3238 ret = type->lpVtbl->IsValid(type);
3239 ok(ret, "IsValid() failed\n");
3241 hr = type->lpVtbl->GetDesc(type, &typedesc);
3242 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3243 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3244 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3245 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3246 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3247 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3248 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3249 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3250 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3251 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3252 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3255 p = t->lpVtbl->GetPassByIndex(t, 6);
3257 /* pass 6 vertexshader */
3258 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3259 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3260 p6_vs = pdesc.pShaderVariable;
3261 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3263 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3264 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3266 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3267 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3268 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3269 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3270 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3271 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3273 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3274 ok(ret, "IsValid() failed\n");
3276 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3277 ret = type->lpVtbl->IsValid(type);
3278 ok(ret, "IsValid() failed\n");
3280 hr = type->lpVtbl->GetDesc(type, &typedesc);
3281 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3282 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3283 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3284 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3285 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3286 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3287 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3288 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3289 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3290 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3291 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3293 /* pass 6 pixelshader */
3294 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3295 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3296 p6_ps = pdesc.pShaderVariable;
3297 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3299 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3300 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3302 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3303 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3304 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3305 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3306 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3307 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3309 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3310 ok(ret, "IsValid() failed\n");
3312 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3313 ret = type->lpVtbl->IsValid(type);
3314 ok(ret, "IsValid() failed\n");
3316 hr = type->lpVtbl->GetDesc(type, &typedesc);
3317 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3318 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3319 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3320 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3321 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3322 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3323 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3324 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3325 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3326 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3327 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3329 /* pass 6 geometryshader */
3330 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3331 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3332 p6_gs = pdesc.pShaderVariable;
3333 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3335 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3336 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3338 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3339 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3340 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3341 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3342 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3343 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3345 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3346 ok(ret, "IsValid() failed\n");
3348 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3349 ret = type->lpVtbl->IsValid(type);
3350 ok(ret, "IsValid() failed\n");
3352 hr = type->lpVtbl->GetDesc(type, &typedesc);
3353 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3354 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3355 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3356 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3357 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3358 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3359 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3360 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3361 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3362 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3363 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3366 p = t->lpVtbl->GetPassByIndex(t, 7);
3368 /* pass 7 vertexshader */
3369 hr = p->lpVtbl->GetVertexShaderDesc(p, &pdesc);
3370 ok(hr == S_OK, "GetVertexShaderDesc got %x, expected %x\n", hr, S_OK);
3371 ok(pdesc.pShaderVariable == p6_vs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_vs);
3372 ok(pdesc.ShaderIndex == 1, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 1);
3374 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3375 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3377 ok(strcmp(vdesc.Name, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc.Name);
3378 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3379 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3380 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3381 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3382 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3384 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3385 ok(ret, "IsValid() failed\n");
3387 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3388 ret = type->lpVtbl->IsValid(type);
3389 ok(ret, "IsValid() failed\n");
3391 hr = type->lpVtbl->GetDesc(type, &typedesc);
3392 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3393 ok(strcmp(typedesc.TypeName, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc.TypeName);
3394 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3395 ok(typedesc.Type == D3D10_SVT_VERTEXSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_VERTEXSHADER);
3396 ok(typedesc.Elements == 2, "Elements is %u, expected 2\n", typedesc.Elements);
3397 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3398 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3399 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3400 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3401 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3402 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3404 /* pass 7 pixelshader */
3405 hr = p->lpVtbl->GetPixelShaderDesc(p, &pdesc);
3406 ok(hr == S_OK, "GetPixelShaderDesc got %x, expected %x\n", hr, S_OK);
3407 ok(pdesc.pShaderVariable == p6_ps, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_ps);
3408 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3410 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3411 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3413 ok(strcmp(vdesc.Name, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc.Name);
3414 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3415 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3416 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3417 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3418 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3420 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3421 ok(ret, "IsValid() failed\n");
3423 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3424 ret = type->lpVtbl->IsValid(type);
3425 ok(ret, "IsValid() failed\n");
3427 hr = type->lpVtbl->GetDesc(type, &typedesc);
3428 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3429 ok(strcmp(typedesc.TypeName, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc.TypeName);
3430 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3431 ok(typedesc.Type == D3D10_SVT_PIXELSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_PIXELSHADER);
3432 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3433 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3434 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3435 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3436 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3437 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3438 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3440 /* pass 7 geometryshader */
3441 hr = p->lpVtbl->GetGeometryShaderDesc(p, &pdesc);
3442 ok(hr == S_OK, "GetGeometryShaderDesc got %x, expected %x\n", hr, S_OK);
3443 ok(pdesc.pShaderVariable == p6_gs, "Got %p, expected %p\n", pdesc.pShaderVariable, p6_gs);
3444 ok(pdesc.ShaderIndex == 0, "ShaderIndex is %u, expected %u\n", pdesc.ShaderIndex, 0);
3446 hr = pdesc.pShaderVariable->lpVtbl->GetDesc(pdesc.pShaderVariable, &vdesc);
3447 ok(SUCCEEDED(hr), "GetDesc failed (%x)\n", hr);
3449 ok(strcmp(vdesc.Name, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc.Name);
3450 ok(vdesc.Semantic == NULL, "Semantic is \"%s\", expected NULL\n", vdesc.Semantic);
3451 ok(vdesc.Flags == 0, "Flags is %u, expected 0\n", vdesc.Flags);
3452 ok(vdesc.Annotations == 0, "Annotations is %u, expected 0\n", vdesc.Annotations);
3453 ok(vdesc.BufferOffset == 0, "BufferOffset is %u, expected 0\n", vdesc.BufferOffset);
3454 ok(vdesc.ExplicitBindPoint == 0, "ExplicitBindPoint is %u, expected %u\n", vdesc.ExplicitBindPoint, 0);
3456 ret = pdesc.pShaderVariable->lpVtbl->IsValid(pdesc.pShaderVariable);
3457 ok(ret, "IsValid() failed\n");
3459 type = pdesc.pShaderVariable->lpVtbl->GetType(pdesc.pShaderVariable);
3460 ret = type->lpVtbl->IsValid(type);
3461 ok(ret, "IsValid() failed\n");
3463 hr = type->lpVtbl->GetDesc(type, &typedesc);
3464 ok(hr == S_OK, "GetDesc failed (%x)\n", hr);
3465 ok(strcmp(typedesc.TypeName, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc.TypeName);
3466 ok(typedesc.Class == D3D10_SVC_OBJECT, "Class is %x, expected %x\n", typedesc.Class, D3D10_SVC_OBJECT);
3467 ok(typedesc.Type == D3D10_SVT_GEOMETRYSHADER, "Type is %x, expected %x\n", typedesc.Type, D3D10_SVT_GEOMETRYSHADER);
3468 ok(typedesc.Elements == 0, "Elements is %u, expected 0\n", typedesc.Elements);
3469 ok(typedesc.Members == 0, "Members is %u, expected 0\n", typedesc.Members);
3470 ok(typedesc.Rows == 0, "Rows is %u, expected 0\n", typedesc.Rows);
3471 ok(typedesc.Columns == 0, "Columns is %u, expected 0\n", typedesc.Columns);
3472 ok(typedesc.PackedSize == 0x0, "PackedSize is %#x, expected 0x0\n", typedesc.PackedSize);
3473 ok(typedesc.UnpackedSize == 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc.UnpackedSize);
3474 ok(typedesc.Stride == 0x0, "Stride is %#x, expected 0x0\n", typedesc.Stride);
3476 effect->lpVtbl->Release(effect);
3480 * test_effect_get_variable_by
3485 float f1 : SV_POSITION;
3490 float f3 : SV_POSITION;
3493 Texture1D tex1 : COLOR2;
3494 Texture1D tex2 : COLOR1;
3496 static DWORD fx_test_egvb[] = {
3497 0x43425844, 0x63d60ede, 0xf75a09d1, 0x47da5604, 0x7ef6e331, 0x00000001, 0x000001ca, 0x00000001,
3498 0x00000024, 0x30315846, 0x0000019e, 0xfeff1001, 0x00000002, 0x00000004, 0x00000002, 0x00000000,
3499 0x00000000, 0x00000000, 0x00000000, 0x0000008a, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3500 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
3501 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
3502 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032,
3503 0x00346600, 0x4f4c4f43, 0x54003152, 0x75747865, 0x44316572, 0x00005300, 0x00000200, 0x00000000,
3504 0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x78657400, 0x4f430031, 0x32524f4c, 0x78657400,
3505 0x00040032, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x00290000, 0x000d0000,
3506 0x002c0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x000d0000, 0x003b0000,
3507 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00420000, 0x00100000, 0x00000000, 0x00020000,
3508 0xffff0000, 0x0000ffff, 0x00460000, 0x000d0000, 0x002c0000, 0x00000000, 0x00000000, 0x00000000,
3509 0x00000000, 0x00490000, 0x000d0000, 0x004c0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000,
3510 0x00790000, 0x005d0000, 0x007e0000, 0xffff0000, 0x0000ffff, 0x00850000, 0x005d0000, 0x004c0000,
3511 0xffff0000, 0x0000ffff, 0x00000000,
3514 static void test_effect_get_variable_by(ID3D10Device *device)
3516 ID3D10Effect *effect;
3517 ID3D10EffectVariable *variable_by_index, *variable, *null_variable;
3520 hr = create_effect(fx_test_egvb, 0, device, NULL, &effect);
3521 ok(SUCCEEDED(hr), "D3D10CreateEffectFromMemory failed (%x)\n", hr);
3523 /* get the null variable */
3524 null_variable = effect->lpVtbl->GetVariableByIndex(effect, 0xffffffff);
3526 /* check for invalid arguments */
3527 variable = effect->lpVtbl->GetVariableByName(effect, NULL);
3528 ok(null_variable == variable, "GetVariableByName got %p, expected %p\n", variable, null_variable);
3530 variable = effect->lpVtbl->GetVariableBySemantic(effect, NULL);
3531 ok(null_variable == variable, "GetVariableBySemantic got %p, expected %p\n", variable, null_variable);
3533 variable = effect->lpVtbl->GetVariableByName(effect, "invalid");
3534 ok(null_variable == variable, "GetVariableByName got %p, expected %p\n", variable, null_variable);
3536 variable = effect->lpVtbl->GetVariableBySemantic(effect, "invalid");
3537 ok(null_variable == variable, "GetVariableBySemantic got %p, expected %p\n", variable, null_variable);
3540 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 0);
3541 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3543 variable = effect->lpVtbl->GetVariableByName(effect, "f1");
3544 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3546 variable = effect->lpVtbl->GetVariableBySemantic(effect, "SV_POSITION");
3547 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3550 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 1);
3551 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3553 variable = effect->lpVtbl->GetVariableByName(effect, "f2");
3554 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3556 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR0");
3557 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3560 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 2);
3561 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3563 variable = effect->lpVtbl->GetVariableByName(effect, "f3");
3564 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3566 variable = effect->lpVtbl->GetVariableBySemantic(effect, "SV_POSITION");
3567 ok(variable != null_variable, "GetVariableBySemantic failed %p\n", variable);
3568 ok(variable != variable_by_index, "GetVariableBySemantic failed %p\n", variable);
3571 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 3);
3572 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3574 variable = effect->lpVtbl->GetVariableByName(effect, "f4");
3575 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3577 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR1");
3578 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3581 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 4);
3582 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3584 variable = effect->lpVtbl->GetVariableByName(effect, "tex1");
3585 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3587 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR2");
3588 ok(variable_by_index == variable, "GetVariableBySemantic got %p, expected %p\n", variable, variable_by_index);
3591 variable_by_index = effect->lpVtbl->GetVariableByIndex(effect, 5);
3592 ok(null_variable != variable_by_index, "GetVariableByIndex failed %p\n", variable_by_index);
3594 variable = effect->lpVtbl->GetVariableByName(effect, "tex2");
3595 ok(variable_by_index == variable, "GetVariableByName got %p, expected %p\n", variable, variable_by_index);
3597 variable = effect->lpVtbl->GetVariableBySemantic(effect, "COLOR1");
3598 ok(variable != null_variable, "GetVariableBySemantic failed %p\n", variable);
3599 ok(variable != variable_by_index, "GetVariableBySemantic failed %p\n", variable);
3601 effect->lpVtbl->Release(effect);
3605 RasterizerState rast_state
3607 FillMode = wireframe; /* 0x0c */
3608 CullMode = front; /* 0x0d */
3609 FrontCounterClockwise = true; /* 0x0e */
3610 DepthBias = -4; /* 0x0f */
3611 DepthBiasClamp = 0.5f; /* 0x10 */
3612 SlopeScaledDepthBias = 0.25f; /* 0x11 */
3613 DepthClipEnable = false; /* 0x12 */
3614 ScissorEnable = true; /* 0x13 */
3615 MultisampleEnable = true; /* 0x14 */
3616 AntialiasedLineEnable = true; /* 0x15 */
3619 DepthStencilState ds_state
3621 DepthEnable = false; /* 0x16 */
3622 DepthWriteMask = zero; /* 0x17 */
3623 DepthFunc = equal; /* 0x18 */
3624 StencilEnable = true; /* 0x19 */
3625 StencilReadMask = 0x4; /* 0x1a */
3626 StencilWriteMask = 0x5; /* 0x1b */
3627 FrontFaceStencilFail = invert; /* 0x1c */
3628 FrontFaceStencilDepthFail = incr; /* 0x1d */
3629 FrontFaceStencilPass = decr; /* 0x1e */
3630 FrontFaceStencilFunc = less_equal; /* 0x1f */
3631 BackFaceStencilFail = replace; /* 0x20 */
3632 BackFaceStencilDepthFail = incr_sat; /* 0x21 */
3633 BackFaceStencilPass = decr_sat; /* 0x22 */
3634 BackFaceStencilFunc = greater_equal; /* 0x23 */
3637 BlendState blend_state
3639 AlphaToCoverageEnable = false; /* 0x24 */
3640 BlendEnable[0] = true; /* 0x25[0] */
3641 BlendEnable[7] = false; /* 0x25[7] */
3642 SrcBlend = one; /* 0x26 */
3643 DestBlend = src_color; /* 0x27 */
3644 BlendOp = min; /* 0x28 */
3645 SrcBlendAlpha = src_alpha; /* 0x29 */
3646 DestBlendAlpha = inv_src_alpha; /* 0x2a */
3647 BlendOpAlpha = max; /* 0x2b */
3648 RenderTargetWriteMask[0] = 0x8; /* 0x2c[0] */
3649 RenderTargetWriteMask[7] = 0x7; /* 0x2c[7] */
3652 SamplerState sampler0
3654 Filter = min_mag_mip_linear; /* 0x2d */
3655 AddressU = wrap; /* 0x2e */
3656 AddressV = mirror; /* 0x2f */
3657 AddressW = clamp; /* 0x30 */
3658 MipMapLODBias = -1; /* 0x31 */
3659 MaxAnisotropy = 4u; /* 0x32 */
3660 ComparisonFunc = always; /* 0x33 */
3661 BorderColor = float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */
3662 MinLOD = 6u; /* 0x35 */
3663 MaxLOD = 5u; /* 0x36 */
3670 SetBlendState(blend_state, float4(0.5f, 0.6f, 0.7f, 0.8f), 0xffff);
3671 SetDepthStencilState(ds_state, 1.0f);
3672 SetRasterizerState(rast_state);
3676 static DWORD fx_test_state_groups[] =
3678 0x43425844, 0x519ef0cc, 0x85962b86, 0x3c2272fb,
3679 0x17942172, 0x00000001, 0x00000794, 0x00000001,
3680 0x00000024, 0x30315846, 0x00000768, 0xfeff1001,
3681 0x00000001, 0x00000000, 0x00000004, 0x00000000,
3682 0x00000000, 0x00000000, 0x00000001, 0x0000035c,
3683 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3684 0x00000001, 0x00000001, 0x00000000, 0x00000000,
3685 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
3686 0x736c6162, 0x73615200, 0x69726574, 0x5372657a,
3687 0x65746174, 0x00000d00, 0x00000200, 0x00000000,
3688 0x00000000, 0x00000000, 0x00000000, 0x00000400,
3689 0x73617200, 0x74735f74, 0x00657461, 0x00000001,
3690 0x00000002, 0x00000002, 0x00000001, 0x00000002,
3691 0x00000002, 0x00000001, 0x00000004, 0x00000001,
3692 0x00000001, 0x00000002, 0xfffffffc, 0x00000001,
3693 0x00000001, 0x3f000000, 0x00000001, 0x00000001,
3694 0x3e800000, 0x00000001, 0x00000004, 0x00000000,
3695 0x00000001, 0x00000004, 0x00000001, 0x00000001,
3696 0x00000004, 0x00000001, 0x00000001, 0x00000004,
3697 0x00000001, 0x74706544, 0x65745368, 0x6c69636e,
3698 0x74617453, 0x00bc0065, 0x00020000, 0x00000000,
3699 0x00000000, 0x00000000, 0x00000000, 0x00030000,
3700 0x73640000, 0x6174735f, 0x01006574, 0x04000000,
3701 0x00000000, 0x01000000, 0x02000000, 0x00000000,
3702 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3703 0x04000000, 0x01000000, 0x01000000, 0x02000000,
3704 0x04000000, 0x01000000, 0x02000000, 0x05000000,
3705 0x01000000, 0x02000000, 0x06000000, 0x01000000,
3706 0x02000000, 0x07000000, 0x01000000, 0x02000000,
3707 0x08000000, 0x01000000, 0x02000000, 0x04000000,
3708 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3709 0x02000000, 0x04000000, 0x01000000, 0x02000000,
3710 0x05000000, 0x01000000, 0x02000000, 0x07000000,
3711 0x42000000, 0x646e656c, 0x74617453, 0x019b0065,
3712 0x00020000, 0x00000000, 0x00000000, 0x00000000,
3713 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65,
3714 0x74617473, 0x00010065, 0x00040000, 0x00000000,
3715 0x00010000, 0x00040000, 0x00010000, 0x00010000,
3716 0x00040000, 0x00000000, 0x00010000, 0x00020000,
3717 0x00020000, 0x00010000, 0x00020000, 0x00030000,
3718 0x00010000, 0x00020000, 0x00040000, 0x00010000,
3719 0x00020000, 0x00050000, 0x00010000, 0x00020000,
3720 0x00060000, 0x00010000, 0x00020000, 0x00050000,
3721 0x00010000, 0x00020000, 0x00080000, 0x00010000,
3722 0x00020000, 0x00070000, 0x61530000, 0x656c706d,
3723 0x61745372, 0x52006574, 0x02000002, 0x00000000,
3724 0x00000000, 0x00000000, 0x00000000, 0x15000000,
3725 0x73000000, 0x6c706d61, 0x00307265, 0x00000001,
3726 0x00000002, 0x00000015, 0x00000001, 0x00000002,
3727 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3728 0x00000001, 0x00000002, 0x00000003, 0x00000001,
3729 0x00000002, 0xffffffff, 0x00000001, 0x00000002,
3730 0x00000004, 0x00000001, 0x00000002, 0x00000008,
3731 0x00000004, 0x00000001, 0x3f800000, 0x00000001,
3732 0x40000000, 0x00000001, 0x40400000, 0x00000001,
3733 0x40800000, 0x00000001, 0x00000002, 0x00000006,
3734 0x00000001, 0x00000002, 0x00000005, 0x68636574,
3735 0x61700030, 0x00307373, 0x00000004, 0x00000001,
3736 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001,
3737 0x3f333333, 0x00000001, 0x3f4ccccd, 0x00000001,
3738 0x00000002, 0x0000ffff, 0x00000001, 0x00000001,
3739 0x3f800000, 0x00000004, 0x00000000, 0x00000000,
3740 0x00000000, 0xffffffff, 0x00000000, 0x00000039,
3741 0x0000001d, 0x00000000, 0xffffffff, 0x0000000a,
3742 0x0000000c, 0x00000000, 0x00000001, 0x00000044,
3743 0x0000000d, 0x00000000, 0x00000001, 0x00000050,
3744 0x0000000e, 0x00000000, 0x00000001, 0x0000005c,
3745 0x0000000f, 0x00000000, 0x00000001, 0x00000068,
3746 0x00000010, 0x00000000, 0x00000001, 0x00000074,
3747 0x00000011, 0x00000000, 0x00000001, 0x00000080,
3748 0x00000012, 0x00000000, 0x00000001, 0x0000008c,
3749 0x00000013, 0x00000000, 0x00000001, 0x00000098,
3750 0x00000014, 0x00000000, 0x00000001, 0x000000a4,
3751 0x00000015, 0x00000000, 0x00000001, 0x000000b0,
3752 0x00000000, 0x000000ea, 0x000000ce, 0x00000000,
3753 0xffffffff, 0x0000000e, 0x00000016, 0x00000000,
3754 0x00000001, 0x000000f3, 0x00000017, 0x00000000,
3755 0x00000001, 0x000000ff, 0x00000018, 0x00000000,
3756 0x00000001, 0x0000010b, 0x00000019, 0x00000000,
3757 0x00000001, 0x00000117, 0x0000001a, 0x00000000,
3758 0x00000001, 0x00000123, 0x0000001b, 0x00000000,
3759 0x00000001, 0x0000012f, 0x0000001c, 0x00000000,
3760 0x00000001, 0x0000013b, 0x0000001d, 0x00000000,
3761 0x00000001, 0x00000147, 0x0000001e, 0x00000000,
3762 0x00000001, 0x00000153, 0x0000001f, 0x00000000,
3763 0x00000001, 0x0000015f, 0x00000020, 0x00000000,
3764 0x00000001, 0x0000016b, 0x00000021, 0x00000000,
3765 0x00000001, 0x00000177, 0x00000022, 0x00000000,
3766 0x00000001, 0x00000183, 0x00000023, 0x00000000,
3767 0x00000001, 0x0000018f, 0x00000000, 0x000001c2,
3768 0x000001a6, 0x00000000, 0xffffffff, 0x0000000b,
3769 0x00000024, 0x00000000, 0x00000001, 0x000001ce,
3770 0x00000025, 0x00000000, 0x00000001, 0x000001da,
3771 0x00000025, 0x00000007, 0x00000001, 0x000001e6,
3772 0x00000026, 0x00000000, 0x00000001, 0x000001f2,
3773 0x00000027, 0x00000000, 0x00000001, 0x000001fe,
3774 0x00000028, 0x00000000, 0x00000001, 0x0000020a,
3775 0x00000029, 0x00000000, 0x00000001, 0x00000216,
3776 0x0000002a, 0x00000000, 0x00000001, 0x00000222,
3777 0x0000002b, 0x00000000, 0x00000001, 0x0000022e,
3778 0x0000002c, 0x00000000, 0x00000001, 0x0000023a,
3779 0x0000002c, 0x00000007, 0x00000001, 0x00000246,
3780 0x00000000, 0x0000027b, 0x0000025f, 0x00000000,
3781 0xffffffff, 0x0000000a, 0x0000002d, 0x00000000,
3782 0x00000001, 0x00000284, 0x0000002e, 0x00000000,
3783 0x00000001, 0x00000290, 0x0000002f, 0x00000000,
3784 0x00000001, 0x0000029c, 0x00000030, 0x00000000,
3785 0x00000001, 0x000002a8, 0x00000031, 0x00000000,
3786 0x00000001, 0x000002b4, 0x00000032, 0x00000000,
3787 0x00000001, 0x000002c0, 0x00000033, 0x00000000,
3788 0x00000001, 0x000002cc, 0x00000034, 0x00000000,
3789 0x00000001, 0x000002d8, 0x00000035, 0x00000000,
3790 0x00000001, 0x000002fc, 0x00000036, 0x00000000,
3791 0x00000001, 0x00000308, 0x00000000, 0x00000314,
3792 0x00000001, 0x00000000, 0x0000031a, 0x00000006,
3793 0x00000000, 0x0000000a, 0x00000000, 0x00000001,
3794 0x00000320, 0x0000000b, 0x00000000, 0x00000001,
3795 0x00000344, 0x00000002, 0x00000000, 0x00000002,
3796 0x000001c2, 0x00000009, 0x00000000, 0x00000001,
3797 0x00000350, 0x00000001, 0x00000000, 0x00000002,
3798 0x000000ea, 0x00000000, 0x00000000, 0x00000002,
3802 static void test_effect_state_groups(ID3D10Device *device)
3804 ID3D10EffectDepthStencilVariable *d;
3805 ID3D10EffectRasterizerVariable *r;
3806 ID3D10DepthStencilState *ds_state;
3807 ID3D10RasterizerState *rast_state;
3808 ID3D10EffectTechnique *technique;
3809 D3D10_DEPTH_STENCIL_DESC ds_desc;
3810 D3D10_RASTERIZER_DESC rast_desc;
3811 D3D10_SAMPLER_DESC sampler_desc;
3812 ID3D10EffectSamplerVariable *s;
3813 ID3D10BlendState *blend_state;
3814 UINT sample_mask, stencil_ref;
3815 ID3D10EffectBlendVariable *b;
3816 D3D10_BLEND_DESC blend_desc;
3817 D3D10_PASS_DESC pass_desc;
3818 ID3D10EffectVariable *v;
3819 ID3D10EffectPass *pass;
3820 float blend_factor[4];
3821 ID3D10Effect *effect;
3824 hr = create_effect(fx_test_state_groups, 0, device, NULL, &effect);
3825 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 todo_wine ok(SUCCEEDED(hr), "Failed to apply pass, hr %#x.\n", hr);
3928 effect->lpVtbl->Release(effect);
3932 ID3D10Device_OMGetBlendState(device, &blend_state, blend_factor, &sample_mask);
3933 ID3D10BlendState_GetDesc(blend_state, &blend_desc);
3934 ok(!blend_desc.AlphaToCoverageEnable, "Got unexpected AlphaToCoverageEnable %#x.\n",
3935 blend_desc.AlphaToCoverageEnable);
3936 ok(blend_desc.BlendEnable[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc.BlendEnable[0]);
3937 ok(!blend_desc.BlendEnable[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc.BlendEnable[7]);
3938 ok(blend_desc.SrcBlend == D3D10_BLEND_ONE, "Got unexpected SrcBlend %#x.\n", blend_desc.SrcBlend);
3939 ok(blend_desc.DestBlend == D3D10_BLEND_SRC_COLOR, "Got unexpected DestBlend %#x.\n", blend_desc.DestBlend);
3940 ok(blend_desc.BlendOp == D3D10_BLEND_OP_MIN, "Got unexpected BlendOp %#x.\n", blend_desc.BlendOp);
3941 ok(blend_desc.SrcBlendAlpha == D3D10_BLEND_SRC_ALPHA, "Got unexpected SrcBlendAlpha %#x.\n",
3942 blend_desc.SrcBlendAlpha);
3943 ok(blend_desc.DestBlendAlpha == D3D10_BLEND_INV_SRC_ALPHA, "Got unexpected DestBlendAlpha %#x.\n",
3944 blend_desc.DestBlendAlpha);
3945 ok(blend_desc.BlendOpAlpha == D3D10_BLEND_OP_MAX, "Got unexpected BlendOpAlpha %#x.\n", blend_desc.BlendOpAlpha);
3946 ok(blend_desc.RenderTargetWriteMask[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
3947 blend_desc.RenderTargetWriteMask[0]);
3948 ok(blend_desc.RenderTargetWriteMask[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
3949 blend_desc.RenderTargetWriteMask[7]);
3950 ok(blend_factor[0] == 0.5f, "Got unexpected blend_factor[0] %.8e.\n", blend_factor[0]);
3951 ok(blend_factor[1] == 0.6f, "Got unexpected blend_factor[1] %.8e.\n", blend_factor[1]);
3952 ok(blend_factor[2] == 0.7f, "Got unexpected blend_factor[2] %.8e.\n", blend_factor[2]);
3953 ok(blend_factor[3] == 0.8f, "Got unexpected blend_factor[3] %.8e.\n", blend_factor[3]);
3954 ok(sample_mask == 0xffff, "Got unexpected sample_mask %#x.\n", sample_mask);
3956 ID3D10Device_OMGetDepthStencilState(device, &ds_state, &stencil_ref);
3957 ID3D10DepthStencilState_GetDesc(ds_state, &ds_desc);
3958 ok(!ds_desc.DepthEnable, "Got unexpected DepthEnable %#x.\n", ds_desc.DepthEnable);
3959 ok(ds_desc.DepthWriteMask == D3D10_DEPTH_WRITE_MASK_ZERO, "Got unexpected DepthWriteMask %#x.\n",
3960 ds_desc.DepthWriteMask);
3961 ok(ds_desc.DepthFunc == D3D10_COMPARISON_NEVER, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
3962 ok(ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
3963 ok(ds_desc.StencilReadMask == 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc.StencilReadMask);
3964 ok(ds_desc.StencilWriteMask == 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc.StencilWriteMask);
3965 ok(ds_desc.FrontFace.StencilFailOp == D3D10_STENCIL_OP_INVERT, "Got unexpected FrontFaceStencilFail %#x.\n",
3966 ds_desc.FrontFace.StencilFailOp);
3967 ok(ds_desc.FrontFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR,
3968 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc.FrontFace.StencilDepthFailOp);
3969 ok(ds_desc.FrontFace.StencilPassOp == D3D10_STENCIL_OP_DECR, "Got unexpected FrontFaceStencilPass %#x.\n",
3970 ds_desc.FrontFace.StencilPassOp);
3971 ok(ds_desc.FrontFace.StencilFunc == D3D10_COMPARISON_LESS_EQUAL, "Got unexpected FrontFaceStencilFunc %#x.\n",
3972 ds_desc.FrontFace.StencilFunc);
3973 ok(ds_desc.BackFace.StencilFailOp == D3D10_STENCIL_OP_REPLACE, "Got unexpected BackFaceStencilFail %#x.\n",
3974 ds_desc.BackFace.StencilFailOp);
3975 ok(ds_desc.BackFace.StencilDepthFailOp == D3D10_STENCIL_OP_INCR_SAT,
3976 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc.BackFace.StencilDepthFailOp);
3977 ok(ds_desc.BackFace.StencilPassOp == D3D10_STENCIL_OP_DECR_SAT, "Got unexpected BackFaceStencilPass %#x.\n",
3978 ds_desc.BackFace.StencilPassOp);
3979 ok(ds_desc.BackFace.StencilFunc == D3D10_COMPARISON_GREATER_EQUAL, "Got unexpected BackFaceStencilFunc %#x.\n",
3980 ds_desc.BackFace.StencilFunc);
3981 ok(stencil_ref == 1, "Got unexpected stencil_ref %#x.\n", stencil_ref);
3983 ID3D10Device_RSGetState(device, &rast_state);
3984 ID3D10RasterizerState_GetDesc(rast_state, &rast_desc);
3985 ok(rast_desc.FillMode == D3D10_FILL_WIREFRAME, "Got unexpected FillMode %#x.\n", rast_desc.FillMode);
3986 ok(rast_desc.CullMode == D3D10_CULL_FRONT, "Got unexpected CullMode %#x.\n", rast_desc.CullMode);
3987 ok(rast_desc.FrontCounterClockwise, "Got unexpected FrontCounterClockwise %#x.\n",
3988 rast_desc.FrontCounterClockwise);
3989 ok(rast_desc.DepthBias == -4, "Got unexpected DepthBias %#x.\n", rast_desc.DepthBias);
3990 ok(rast_desc.DepthBiasClamp == 0.5f, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc.DepthBiasClamp);
3991 ok(rast_desc.SlopeScaledDepthBias == 0.25f, "Got unexpected SlopeScaledDepthBias %.8e.\n",
3992 rast_desc.SlopeScaledDepthBias);
3993 ok(!rast_desc.DepthClipEnable, "Got unexpected DepthClipEnable %#x.\n", rast_desc.DepthClipEnable);
3994 ok(rast_desc.ScissorEnable, "Got unexpected ScissorEnable %#x.\n", rast_desc.ScissorEnable);
3995 ok(rast_desc.MultisampleEnable, "Got unexpected MultisampleEnable %#x.\n", rast_desc.MultisampleEnable);
3996 ok(rast_desc.AntialiasedLineEnable, "Got unexpected AntialiasedLineEnable %#x.\n",
3997 rast_desc.AntialiasedLineEnable);
3999 ID3D10RasterizerState_Release(rast_state);
4000 ID3D10DepthStencilState_Release(ds_state);
4001 ID3D10BlendState_Release(blend_state);
4002 effect->lpVtbl->Release(effect);
4006 RasterizerState rast_state {};
4007 DepthStencilState ds_state {};
4008 BlendState blend_state {};
4009 SamplerState sampler0 {};
4018 static DWORD fx_test_state_group_defaults[] =
4020 0x43425844, 0x920e6905, 0x58225fcd, 0x3b65b423,
4021 0x67e96b6c, 0x00000001, 0x000001f4, 0x00000001,
4022 0x00000024, 0x30315846, 0x000001c8, 0xfeff1001,
4023 0x00000001, 0x00000000, 0x00000004, 0x00000000,
4024 0x00000000, 0x00000000, 0x00000001, 0x000000ec,
4025 0x00000000, 0x00000000, 0x00000001, 0x00000001,
4026 0x00000001, 0x00000001, 0x00000000, 0x00000000,
4027 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
4028 0x736c6162, 0x73615200, 0x69726574, 0x5372657a,
4029 0x65746174, 0x00000d00, 0x00000200, 0x00000000,
4030 0x00000000, 0x00000000, 0x00000000, 0x00000400,
4031 0x73617200, 0x74735f74, 0x00657461, 0x74706544,
4032 0x65745368, 0x6c69636e, 0x74617453, 0x00440065,
4033 0x00020000, 0x00000000, 0x00000000, 0x00000000,
4034 0x00000000, 0x00030000, 0x73640000, 0x6174735f,
4035 0x42006574, 0x646e656c, 0x74617453, 0x007b0065,
4036 0x00020000, 0x00000000, 0x00000000, 0x00000000,
4037 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65,
4038 0x74617473, 0x61530065, 0x656c706d, 0x61745372,
4039 0xae006574, 0x02000000, 0x00000000, 0x00000000,
4040 0x00000000, 0x00000000, 0x15000000, 0x73000000,
4041 0x6c706d61, 0x00307265, 0x68636574, 0x61700030,
4042 0x00307373, 0x00000004, 0x00000000, 0x00000000,
4043 0x00000000, 0xffffffff, 0x00000000, 0x00000039,
4044 0x0000001d, 0x00000000, 0xffffffff, 0x00000000,
4045 0x00000000, 0x00000072, 0x00000056, 0x00000000,
4046 0xffffffff, 0x00000000, 0x00000000, 0x000000a2,
4047 0x00000086, 0x00000000, 0xffffffff, 0x00000000,
4048 0x00000000, 0x000000d7, 0x000000bb, 0x00000000,
4049 0xffffffff, 0x00000000, 0x00000000, 0x000000e0,
4050 0x00000001, 0x00000000, 0x000000e6, 0x00000000,
4054 static void test_effect_state_group_defaults(ID3D10Device *device)
4056 ID3D10EffectDepthStencilVariable *d;
4057 ID3D10EffectRasterizerVariable *r;
4058 ID3D10EffectTechnique *technique;
4059 D3D10_DEPTH_STENCIL_DESC ds_desc;
4060 D3D10_RASTERIZER_DESC rast_desc;
4061 D3D10_SAMPLER_DESC sampler_desc;
4062 ID3D10EffectSamplerVariable *s;
4063 ID3D10EffectBlendVariable *b;
4064 D3D10_BLEND_DESC blend_desc;
4065 D3D10_PASS_DESC pass_desc;
4066 ID3D10EffectVariable *v;
4067 ID3D10EffectPass *pass;
4068 ID3D10Effect *effect;
4071 hr = create_effect(fx_test_state_group_defaults, 0, device, NULL, &effect);
4072 ok(SUCCEEDED(hr), "Failed to create effect, hr %#x.\n", hr);
4074 v = effect->lpVtbl->GetVariableByName(effect, "sampler0");
4075 s = v->lpVtbl->AsSampler(v);
4076 memset(&sampler_desc, 0, sizeof(sampler_desc));
4077 s->lpVtbl->GetBackingStore(s, 0, &sampler_desc);
4078 ok(sampler_desc.Filter == D3D10_FILTER_MIN_MAG_MIP_POINT, "Got unexpected Filter %#x.\n", sampler_desc.Filter);
4079 ok(sampler_desc.AddressU == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected AddressU %#x.\n", sampler_desc.AddressU);
4080 ok(sampler_desc.AddressV == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected AddressV %#x.\n", sampler_desc.AddressV);
4081 ok(sampler_desc.AddressW == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected AddressW %#x.\n", sampler_desc.AddressW);
4082 ok(sampler_desc.MipLODBias == 0.0f, "Got unexpected MipLODBias %.8e.\n", sampler_desc.MipLODBias);
4083 ok(sampler_desc.MaxAnisotropy == 16, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc.MaxAnisotropy);
4084 ok(sampler_desc.ComparisonFunc == D3D10_COMPARISON_NEVER, "Got unexpected ComparisonFunc %#x.\n",
4085 sampler_desc.ComparisonFunc);
4086 ok(sampler_desc.BorderColor[0] == 0.0f, "Got unexpected BorderColor[0] %.8e.\n", sampler_desc.BorderColor[0]);
4087 ok(sampler_desc.BorderColor[1] == 0.0f, "Got unexpected BorderColor[1] %.8e.\n", sampler_desc.BorderColor[1]);
4088 ok(sampler_desc.BorderColor[2] == 0.0f, "Got unexpected BorderColor[2] %.8e.\n", sampler_desc.BorderColor[2]);
4089 ok(sampler_desc.BorderColor[3] == 0.0f, "Got unexpected BorderColor[3] %.8e.\n", sampler_desc.BorderColor[3]);
4090 ok(sampler_desc.MinLOD == 0.0f, "Got unexpected MinLOD %.8e.\n", sampler_desc.MinLOD);
4091 ok(sampler_desc.MaxLOD == FLT_MAX, "Got unexpected MaxLOD %.8e.\n", sampler_desc.MaxLOD);
4093 v = effect->lpVtbl->GetVariableByName(effect, "blend_state");
4094 b = v->lpVtbl->AsBlend(v);
4095 memset(&blend_desc, 0, sizeof(blend_desc));
4096 b->lpVtbl->GetBackingStore(b, 0, &blend_desc);
4097 ok(!blend_desc.AlphaToCoverageEnable, "Got unexpected AlphaToCoverageEnable %#x.\n",
4098 blend_desc.AlphaToCoverageEnable);
4099 ok(!blend_desc.BlendEnable[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc.BlendEnable[0]);
4100 ok(!blend_desc.BlendEnable[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc.BlendEnable[7]);
4101 ok(blend_desc.SrcBlend == D3D10_BLEND_SRC_ALPHA, "Got unexpected SrcBlend %#x.\n", blend_desc.SrcBlend);
4102 ok(blend_desc.DestBlend == D3D10_BLEND_INV_SRC_ALPHA, "Got unexpected DestBlend %#x.\n", blend_desc.DestBlend);
4103 ok(blend_desc.BlendOp == D3D10_BLEND_OP_ADD, "Got unexpected BlendOp %#x.\n", blend_desc.BlendOp);
4104 ok(blend_desc.SrcBlendAlpha == D3D10_BLEND_SRC_ALPHA, "Got unexpected SrcBlendAlpha %#x.\n",
4105 blend_desc.SrcBlendAlpha);
4106 ok(blend_desc.DestBlendAlpha == D3D10_BLEND_INV_SRC_ALPHA, "Got unexpected DestBlendAlpha %#x.\n",
4107 blend_desc.DestBlendAlpha);
4108 ok(blend_desc.BlendOpAlpha == D3D10_BLEND_OP_ADD, "Got unexpected BlendOpAlpha %#x.\n", blend_desc.BlendOpAlpha);
4109 ok(blend_desc.RenderTargetWriteMask[0] == 0xf, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4110 blend_desc.RenderTargetWriteMask[0]);
4111 ok(blend_desc.RenderTargetWriteMask[7] == 0xf, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4112 blend_desc.RenderTargetWriteMask[7]);
4114 v = effect->lpVtbl->GetVariableByName(effect, "ds_state");
4115 d = v->lpVtbl->AsDepthStencil(v);
4116 d->lpVtbl->GetBackingStore(d, 0, &ds_desc);
4117 ok(ds_desc.DepthEnable, "Got unexpected DepthEnable %#x.\n", ds_desc.DepthEnable);
4118 ok(ds_desc.DepthWriteMask == D3D10_DEPTH_WRITE_MASK_ALL, "Got unexpected DepthWriteMask %#x.\n",
4119 ds_desc.DepthWriteMask);
4120 ok(ds_desc.DepthFunc == D3D10_COMPARISON_LESS, "Got unexpected DepthFunc %#x.\n", ds_desc.DepthFunc);
4121 ok(!ds_desc.StencilEnable, "Got unexpected StencilEnable %#x.\n", ds_desc.StencilEnable);
4122 ok(ds_desc.StencilReadMask == 0xff, "Got unexpected StencilReadMask %#x.\n", ds_desc.StencilReadMask);
4123 ok(ds_desc.StencilWriteMask == 0xff, "Got unexpected StencilWriteMask %#x.\n", ds_desc.StencilWriteMask);
4124 ok(ds_desc.FrontFace.StencilFailOp == D3D10_STENCIL_OP_KEEP, "Got unexpected FrontFaceStencilFail %#x.\n",
4125 ds_desc.FrontFace.StencilFailOp);
4126 ok(ds_desc.FrontFace.StencilDepthFailOp == D3D10_STENCIL_OP_KEEP,
4127 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc.FrontFace.StencilDepthFailOp);
4128 ok(ds_desc.FrontFace.StencilPassOp == D3D10_STENCIL_OP_KEEP, "Got unexpected FrontFaceStencilPass %#x.\n",
4129 ds_desc.FrontFace.StencilPassOp);
4130 ok(ds_desc.FrontFace.StencilFunc == D3D10_COMPARISON_ALWAYS, "Got unexpected FrontFaceStencilFunc %#x.\n",
4131 ds_desc.FrontFace.StencilFunc);
4132 ok(ds_desc.BackFace.StencilFailOp == D3D10_STENCIL_OP_KEEP, "Got unexpected BackFaceStencilFail %#x.\n",
4133 ds_desc.BackFace.StencilFailOp);
4134 ok(ds_desc.BackFace.StencilDepthFailOp == D3D10_STENCIL_OP_KEEP,
4135 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc.BackFace.StencilDepthFailOp);
4136 ok(ds_desc.BackFace.StencilPassOp == D3D10_STENCIL_OP_KEEP, "Got unexpected BackFaceStencilPass %#x.\n",
4137 ds_desc.BackFace.StencilPassOp);
4138 ok(ds_desc.BackFace.StencilFunc == D3D10_COMPARISON_ALWAYS, "Got unexpected BackFaceStencilFunc %#x.\n",
4139 ds_desc.BackFace.StencilFunc);
4141 v = effect->lpVtbl->GetVariableByName(effect, "rast_state");
4142 r = v->lpVtbl->AsRasterizer(v);
4143 r->lpVtbl->GetBackingStore(r, 0, &rast_desc);
4144 ok(rast_desc.FillMode == D3D10_FILL_SOLID, "Got unexpected FillMode %#x.\n", rast_desc.FillMode);
4145 ok(rast_desc.CullMode == D3D10_CULL_BACK, "Got unexpected CullMode %#x.\n", rast_desc.CullMode);
4146 ok(!rast_desc.FrontCounterClockwise, "Got unexpected FrontCounterClockwise %#x.\n",
4147 rast_desc.FrontCounterClockwise);
4148 ok(rast_desc.DepthBias == 0, "Got unexpected DepthBias %#x.\n", rast_desc.DepthBias);
4149 ok(rast_desc.DepthBiasClamp == 0.0f, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc.DepthBiasClamp);
4150 ok(rast_desc.SlopeScaledDepthBias == 0.0f, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4151 rast_desc.SlopeScaledDepthBias);
4152 ok(rast_desc.DepthClipEnable, "Got unexpected DepthClipEnable %#x.\n", rast_desc.DepthClipEnable);
4153 ok(!rast_desc.ScissorEnable, "Got unexpected ScissorEnable %#x.\n", rast_desc.ScissorEnable);
4154 ok(!rast_desc.MultisampleEnable, "Got unexpected MultisampleEnable %#x.\n", rast_desc.MultisampleEnable);
4155 ok(!rast_desc.AntialiasedLineEnable, "Got unexpected AntialiasedLineEnable %#x.\n",
4156 rast_desc.AntialiasedLineEnable);
4158 technique = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
4159 ok(!!technique, "Failed to get technique.\n");
4160 pass = technique->lpVtbl->GetPassByName(technique, "pass0");
4161 ok(!!pass, "Failed to get pass.\n");
4162 hr = pass->lpVtbl->GetDesc(pass, &pass_desc);
4163 ok(SUCCEEDED(hr), "Failed to get pass desc, hr %#x.\n", hr);
4164 ok(!strcmp(pass_desc.Name, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc.Name);
4165 ok(!pass_desc.Annotations, "Got unexpected Annotations %#x.\n", pass_desc.Annotations);
4166 ok(!pass_desc.pIAInputSignature, "Got unexpected pIAInputSignature %p.\n", pass_desc.pIAInputSignature);
4167 ok(pass_desc.StencilRef == 0, "Got unexpected StencilRef %#x.\n", pass_desc.StencilRef);
4168 ok(pass_desc.SampleMask == 0, "Got unexpected SampleMask %#x.\n", pass_desc.SampleMask);
4169 ok(pass_desc.BlendFactor[0] == 0.0f, "Got unexpected BlendFactor[0] %.8e.\n", pass_desc.BlendFactor[0]);
4170 ok(pass_desc.BlendFactor[1] == 0.0f, "Got unexpected BlendFactor[1] %.8e.\n", pass_desc.BlendFactor[1]);
4171 ok(pass_desc.BlendFactor[2] == 0.0f, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc.BlendFactor[2]);
4172 ok(pass_desc.BlendFactor[3] == 0.0f, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc.BlendFactor[3]);
4174 effect->lpVtbl->Release(effect);
4179 ID3D10Device *device;
4182 device = create_device();
4185 skip("Failed to create device, skipping tests\n");
4189 test_effect_constant_buffer_type(device);
4190 test_effect_variable_type(device);
4191 test_effect_variable_member(device);
4192 test_effect_variable_element(device);
4193 test_effect_variable_type_class(device);
4194 test_effect_constant_buffer_stride(device);
4195 test_effect_local_shader(device);
4196 test_effect_get_variable_by(device);
4197 test_effect_state_groups(device);
4198 test_effect_state_group_defaults(device);
4200 refcount = ID3D10Device_Release(device);
4201 ok(!refcount, "Device has %u references left\n", refcount);