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 if (SUCCEEDED(D3D10CreateDevice(NULL
, D3D10_DRIVER_TYPE_WARP
, NULL
, 0, D3D10_SDK_VERSION
, &device
)))
34 if (SUCCEEDED(D3D10CreateDevice(NULL
, D3D10_DRIVER_TYPE_REFERENCE
, NULL
, 0, D3D10_SDK_VERSION
, &device
)))
40 static inline HRESULT
create_effect(DWORD
*data
, UINT flags
, ID3D10Device
*device
, ID3D10EffectPool
*effect_pool
, ID3D10Effect
**effect
)
43 * Don't use sizeof(data), use data[6] as size,
44 * because the DWORD data[] has only complete DWORDs and
45 * so it could happen that there are padded bytes at the end.
47 * The fx size (data[6]) could be up to 3 BYTEs smaller
48 * than the sizeof(data).
50 return D3D10CreateEffectFromMemory(data
, data
[6], flags
, device
, effect_pool
, effect
);
54 * test_effect_constant_buffer_type
59 float f1
: SV_POSITION
;
63 static DWORD fx_test_ecbt
[] = {
64 0x43425844, 0xc92a4732, 0xbd0d68c0, 0x877f71ee,
65 0x871fc277, 0x00000001, 0x0000010a, 0x00000001,
66 0x00000024, 0x30315846, 0x000000de, 0xfeff1001,
67 0x00000001, 0x00000002, 0x00000000, 0x00000000,
68 0x00000000, 0x00000000, 0x00000000, 0x00000042,
69 0x00000000, 0x00000000, 0x00000000, 0x00000000,
70 0x00000000, 0x00000000, 0x00000000, 0x00000000,
71 0x00000000, 0x00000000, 0x00000000, 0x66006263,
72 0x74616f6c, 0x00000700, 0x00000100, 0x00000000,
73 0x00000400, 0x00001000, 0x00000400, 0x00090900,
74 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49,
75 0x43003266, 0x524f4c4f, 0x00040030, 0x00100000,
76 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff,
77 0x00290000, 0x000d0000, 0x002c0000, 0x00000000,
78 0x00000000, 0x00000000, 0x00000000, 0x00380000,
79 0x000d0000, 0x003b0000, 0x00040000, 0x00000000,
80 0x00000000, 0x00000000, 0x52590000,
83 static void test_effect_constant_buffer_type(void)
86 ID3D10EffectConstantBuffer
*constantbuffer
;
87 ID3D10EffectType
*type
, *type2
, *null_type
;
88 D3D10_EFFECT_TYPE_DESC type_desc
;
95 if (!(device
= create_device()))
97 skip("Failed to create device, skipping tests.\n");
101 hr
= create_effect(fx_test_ecbt
, 0, device
, NULL
, &effect
);
102 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
104 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
105 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
107 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
108 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
110 ok(strcmp(type_desc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc
.TypeName
);
111 ok(type_desc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_OBJECT
);
112 ok(type_desc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_CBUFFER
);
113 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
114 ok(type_desc
.Members
== 2, "Members is %u, expected 2\n", type_desc
.Members
);
115 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
116 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
117 ok(type_desc
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", type_desc
.PackedSize
);
118 ok(type_desc
.UnpackedSize
== 0x10, "UnpackedSize is %#x, expected 0x10\n", type_desc
.UnpackedSize
);
119 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
121 string
= type
->lpVtbl
->GetMemberName(type
, 0);
122 ok(strcmp(string
, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string
);
124 string
= type
->lpVtbl
->GetMemberSemantic(type
, 0);
125 ok(strcmp(string
, "SV_POSITION") == 0, "GetMemberSemantic is \"%s\", expected \"SV_POSITION\"\n", string
);
127 string
= type
->lpVtbl
->GetMemberName(type
, 1);
128 ok(strcmp(string
, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string
);
130 string
= type
->lpVtbl
->GetMemberSemantic(type
, 1);
131 ok(strcmp(string
, "COLOR0") == 0, "GetMemberSemantic is \"%s\", expected \"COLOR0\"\n", string
);
133 for (i
= 0; i
< 3; ++i
)
135 if (i
== 0) type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
136 else if (i
== 1) type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "f1");
137 else type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "SV_POSITION");
139 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
140 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
142 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
143 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
144 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
145 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
146 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
147 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
148 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
149 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
150 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
151 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
153 if (i
== 0) type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 1);
154 else if (i
== 1) type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "f2");
155 else type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "COLOR0");
157 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
158 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
160 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
161 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
162 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
163 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
164 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
165 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
166 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
167 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
168 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
169 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
172 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
173 hr
= type2
->lpVtbl
->GetDesc(type2
, NULL
);
174 ok(hr
== E_INVALIDARG
, "GetDesc got %x, expected %x\n", hr
, E_INVALIDARG
);
176 null_type
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 3);
177 hr
= null_type
->lpVtbl
->GetDesc(null_type
, &type_desc
);
178 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
180 hr
= null_type
->lpVtbl
->GetDesc(null_type
, NULL
);
181 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
183 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "invalid");
184 ok(type2
== null_type
, "GetMemberTypeByName got wrong type %p, expected %p\n", type2
, null_type
);
186 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, NULL
);
187 ok(type2
== null_type
, "GetMemberTypeByName got wrong type %p, expected %p\n", type2
, null_type
);
189 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "invalid");
190 ok(type2
== null_type
, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2
, null_type
);
192 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, NULL
);
193 ok(type2
== null_type
, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2
, null_type
);
195 string
= type
->lpVtbl
->GetMemberName(type
, 3);
196 ok(string
== NULL
, "GetMemberName is \"%s\", expected \"NULL\"\n", string
);
198 string
= type
->lpVtbl
->GetMemberSemantic(type
, 3);
199 ok(string
== NULL
, "GetMemberSemantic is \"%s\", expected \"NULL\"\n", string
);
201 effect
->lpVtbl
->Release(effect
);
203 refcount
= ID3D10Device_Release(device
);
204 ok(!refcount
, "Device has %u references left.\n", refcount
);
208 * test_effect_variable_type
213 float f3
: SV_POSITION
;
227 static DWORD fx_test_evt
[] = {
228 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
229 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
230 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
231 0x00000001, 0x00000001, 0x00000000, 0x00000000,
232 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
233 0x00000000, 0x00000000, 0x00000000, 0x00000000,
234 0x00000000, 0x00000000, 0x00000000, 0x00000000,
235 0x00000000, 0x00000000, 0x00000000, 0x74006263,
236 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
237 0x00010000, 0x00000000, 0x00040000, 0x00100000,
238 0x00040000, 0x09090000, 0x32660000, 0x74007400,
239 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
240 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
241 0x00000300, 0x00000000, 0x00000800, 0x00001000,
242 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
243 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
244 0x00000400, 0x00001600, 0x00000700, 0x00000300,
245 0x00000000, 0x00001800, 0x00002000, 0x00001000,
246 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
247 0x00001600, 0x00003200, 0x00000000, 0x00000400,
248 0x00001600, 0x00003500, 0x00000000, 0x00001000,
249 0x00005500, 0x00317400, 0x00000004, 0x00000020,
250 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
251 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
252 0x00000000, 0x00000000, 0x00000000,
255 static void test_effect_variable_type(void)
257 ID3D10Effect
*effect
;
258 ID3D10EffectConstantBuffer
*constantbuffer
;
259 ID3D10EffectVariable
*variable
;
260 ID3D10EffectType
*type
, *type2
, *type3
;
261 D3D10_EFFECT_TYPE_DESC type_desc
;
262 ID3D10Device
*device
;
268 if (!(device
= create_device()))
270 skip("Failed to create device, skipping tests.\n");
274 hr
= create_effect(fx_test_evt
, 0, device
, NULL
, &effect
);
275 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
277 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
278 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
279 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
280 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
282 ok(strcmp(type_desc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc
.TypeName
);
283 ok(type_desc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_OBJECT
);
284 ok(type_desc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_CBUFFER
);
285 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
286 ok(type_desc
.Members
== 1, "Members is %u, expected 1\n", type_desc
.Members
);
287 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
288 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
289 ok(type_desc
.PackedSize
== 0x10, "PackedSize is %#x, expected 0x10\n", type_desc
.PackedSize
);
290 ok(type_desc
.UnpackedSize
== 0x20, "UnpackedSize is %#x, expected 0x20\n", type_desc
.UnpackedSize
);
291 ok(type_desc
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", type_desc
.Stride
);
293 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
294 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
295 type
= variable
->lpVtbl
->GetType(variable
);
296 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
297 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
299 ok(strcmp(type_desc
.TypeName
, "test1") == 0, "TypeName is \"%s\", expected \"test1\"\n", type_desc
.TypeName
);
300 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
301 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
302 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
303 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
304 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
305 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
306 ok(type_desc
.PackedSize
== 0x10, "PackedSize is %#x, expected 0x10\n", type_desc
.PackedSize
);
307 ok(type_desc
.UnpackedSize
== 0x18, "UnpackedSize is %#x, expected 0x18\n", type_desc
.UnpackedSize
);
308 ok(type_desc
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", type_desc
.Stride
);
310 string
= type
->lpVtbl
->GetMemberName(type
, 0);
311 ok(strcmp(string
, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string
);
313 string
= type
->lpVtbl
->GetMemberName(type
, 1);
314 ok(strcmp(string
, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string
);
316 string
= type
->lpVtbl
->GetMemberName(type
, 2);
317 ok(strcmp(string
, "t") == 0, "GetMemberName is \"%s\", expected \"t\"\n", string
);
319 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
320 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
321 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
323 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
324 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
325 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
326 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
327 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
328 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
329 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
330 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
331 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
332 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
334 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 1);
335 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
336 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
338 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
339 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
340 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
341 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
342 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
343 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
344 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
345 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
346 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
347 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
349 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 2);
350 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
351 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
353 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
354 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
355 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
356 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
357 ok(type_desc
.Members
== 2, "Members is %u, expected 2\n", type_desc
.Members
);
358 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
359 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
360 ok(type_desc
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", type_desc
.PackedSize
);
361 ok(type_desc
.UnpackedSize
== 0x8, "UnpackedSize is %#x, expected 0x8\n", type_desc
.UnpackedSize
);
362 ok(type_desc
.Stride
== 0x10, "Stride is %x, expected 0x10\n", type_desc
.Stride
);
364 for (i
= 0; i
< 3; ++i
)
366 if (i
== 0) type3
= type2
->lpVtbl
->GetMemberTypeByIndex(type2
, 0);
367 else if (i
== 1) type3
= type2
->lpVtbl
->GetMemberTypeByName(type2
, "f3");
368 else type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "SV_POSITION");
370 hr
= type3
->lpVtbl
->GetDesc(type3
, &type_desc
);
371 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
373 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
375 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
376 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
377 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
378 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
379 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
380 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
381 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
382 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
383 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
385 if (i
== 0) type3
= type2
->lpVtbl
->GetMemberTypeByIndex(type2
, 1);
386 else if (i
== 1) type3
= type2
->lpVtbl
->GetMemberTypeByName(type2
, "f4");
387 else type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "COLOR0");
389 hr
= type3
->lpVtbl
->GetDesc(type3
, &type_desc
);
390 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
392 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
394 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
395 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
396 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
397 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
398 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
399 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
400 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
401 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
402 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
405 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
406 hr
= type2
->lpVtbl
->GetDesc(type2
, NULL
);
407 ok(hr
== E_INVALIDARG
, "GetDesc got %x, expected %x\n", hr
, E_INVALIDARG
);
409 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 4);
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
->GetMemberTypeByName(type
, "invalid");
414 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
415 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
417 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, NULL
);
418 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
419 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
421 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "invalid");
422 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
423 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
425 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, NULL
);
426 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
427 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
429 string
= type
->lpVtbl
->GetMemberName(type
, 4);
430 ok(string
== NULL
, "GetMemberName is \"%s\", expected NULL\n", string
);
432 string
= type
->lpVtbl
->GetMemberSemantic(type
, 4);
433 ok(string
== NULL
, "GetMemberSemantic is \"%s\", expected NULL\n", string
);
435 effect
->lpVtbl
->Release(effect
);
437 refcount
= ID3D10Device_Release(device
);
438 ok(!refcount
, "Device has %u references left.\n", refcount
);
442 * test_effect_variable_member
447 float f3
: SV_POSITION
;
461 static DWORD fx_test_evm
[] = {
462 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
463 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
464 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
465 0x00000001, 0x00000001, 0x00000000, 0x00000000,
466 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
467 0x00000000, 0x00000000, 0x00000000, 0x00000000,
468 0x00000000, 0x00000000, 0x00000000, 0x00000000,
469 0x00000000, 0x00000000, 0x00000000, 0x74006263,
470 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
471 0x00010000, 0x00000000, 0x00040000, 0x00100000,
472 0x00040000, 0x09090000, 0x32660000, 0x74007400,
473 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
474 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
475 0x00000300, 0x00000000, 0x00000800, 0x00001000,
476 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
477 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
478 0x00000400, 0x00001600, 0x00000700, 0x00000300,
479 0x00000000, 0x00001800, 0x00002000, 0x00001000,
480 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
481 0x00001600, 0x00003200, 0x00000000, 0x00000400,
482 0x00001600, 0x00003500, 0x00000000, 0x00001000,
483 0x00005500, 0x00317400, 0x00000004, 0x00000020,
484 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
485 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
486 0x00000000, 0x00000000, 0x00000000,
489 static void test_effect_variable_member(void)
491 ID3D10Effect
*effect
;
492 ID3D10EffectConstantBuffer
*constantbuffer
;
493 ID3D10EffectVariable
*variable
, *variable2
, *variable3
, *null_variable
;
494 D3D10_EFFECT_VARIABLE_DESC desc
;
495 ID3D10Device
*device
;
499 if (!(device
= create_device()))
501 skip("Failed to create device, skipping tests.\n");
505 hr
= create_effect(fx_test_evm
, 0, device
, NULL
, &effect
);
506 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
508 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
509 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &desc
);
510 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
512 ok(strcmp(desc
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc
.Name
);
513 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
514 ok(desc
.Flags
== 0, "Type is %u, expected 0\n", desc
.Flags
);
515 ok(desc
.Annotations
== 0, "Elements is %u, expected 0\n", desc
.Annotations
);
516 ok(desc
.BufferOffset
== 0, "Members is %u, expected 0\n", desc
.BufferOffset
);
517 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
519 null_variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 1);
520 hr
= null_variable
->lpVtbl
->GetDesc(null_variable
, &desc
);
521 ok(hr
== E_FAIL
, "GetDesc got %x, expected %x\n", hr
, E_FAIL
);
523 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
524 hr
= variable
->lpVtbl
->GetDesc(variable
, &desc
);
525 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
527 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "t1");
528 ok(variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, variable
);
529 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
530 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
532 ok(strcmp(desc
.Name
, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", desc
.Name
);
533 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
534 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
535 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
536 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
537 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
539 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "invalid");
540 ok(null_variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, null_variable
);
542 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, NULL
);
543 ok(null_variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, null_variable
);
545 variable2
= constantbuffer
->lpVtbl
->GetMemberBySemantic(constantbuffer
, "invalid");
546 ok(null_variable
== variable2
, "GetMemberBySemantic got %p, expected %p\n", variable2
, null_variable
);
548 variable2
= constantbuffer
->lpVtbl
->GetMemberBySemantic(constantbuffer
, NULL
);
549 ok(null_variable
== variable2
, "GetMemberBySemantic got %p, expected %p\n", variable2
, null_variable
);
551 /* check members of "t1" */
552 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "f1");
553 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
554 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
556 ok(strcmp(desc
.Name
, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc
.Name
);
557 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
558 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
559 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
560 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
561 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
563 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 0);
564 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
566 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "f2");
567 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
568 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
570 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
571 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
572 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
573 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
574 ok(desc
.BufferOffset
== 4, "BufferOffset is %u, expected 4\n", desc
.BufferOffset
);
575 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
577 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 1);
578 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
580 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "t");
581 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
582 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
584 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
585 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
586 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
587 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
588 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
589 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
591 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 2);
592 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
594 /* check members of "t" */
595 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f3");
596 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
597 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
599 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
600 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
601 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
602 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
603 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
604 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
606 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "SV_POSITION");
607 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
609 variable
= variable2
->lpVtbl
->GetMemberByIndex(variable2
, 0);
610 ok(variable
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable
, variable3
);
612 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f4");
613 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
614 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
616 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
617 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
618 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
619 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
620 ok(desc
.BufferOffset
== 20, "BufferOffset is %u, expected 20\n", desc
.BufferOffset
);
621 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
623 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "COLOR0");
624 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
626 variable
= variable2
->lpVtbl
->GetMemberByIndex(variable2
, 1);
627 ok(variable
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable
, variable3
);
629 effect
->lpVtbl
->Release(effect
);
631 refcount
= ID3D10Device_Release(device
);
632 ok(!refcount
, "Device has %u references left.\n", refcount
);
636 * test_effect_variable_element
641 float f3
: SV_POSITION
;
656 static DWORD fx_test_eve
[] = {
657 0x43425844, 0x6ea69fd9, 0x9b4e6390, 0x006f9f71,
658 0x57ad58f4, 0x00000001, 0x000001c2, 0x00000001,
659 0x00000024, 0x30315846, 0x00000196, 0xfeff1001,
660 0x00000001, 0x00000001, 0x00000000, 0x00000000,
661 0x00000000, 0x00000000, 0x00000000, 0x00000116,
662 0x00000000, 0x00000000, 0x00000000, 0x00000000,
663 0x00000000, 0x00000000, 0x00000000, 0x00000000,
664 0x00000000, 0x00000000, 0x00000000, 0x74006263,
665 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
666 0x00010000, 0x00000000, 0x00040000, 0x00100000,
667 0x00040000, 0x09090000, 0x32660000, 0x00001000,
668 0x00000100, 0x00000300, 0x00002400, 0x00001000,
669 0x00000c00, 0x00090900, 0x74007400, 0x00747365,
670 0x53003366, 0x4f505f56, 0x49544953, 0x66004e4f,
671 0x4f430034, 0x30524f4c, 0x00356600, 0x4f4c4f43,
672 0x53003152, 0x03000000, 0x02000000, 0x1c000000,
673 0x10000000, 0x18000000, 0x03000000, 0x58000000,
674 0x5b000000, 0x00000000, 0x16000000, 0x67000000,
675 0x6a000000, 0x04000000, 0x16000000, 0x71000000,
676 0x74000000, 0x08000000, 0x16000000, 0x07000000,
677 0x03000000, 0x00000000, 0x5c000000, 0x60000000,
678 0x28000000, 0x03000000, 0x0d000000, 0x00000000,
679 0x00000000, 0x16000000, 0x32000000, 0x00000000,
680 0x10000000, 0x35000000, 0x51000000, 0x00000000,
681 0x40000000, 0x7b000000, 0x74000000, 0x00040031,
682 0x00600000, 0x00000000, 0x00010000, 0xffff0000,
683 0x0000ffff, 0x01130000, 0x00c70000, 0x00000000,
684 0x00000000, 0x00000000, 0x00000000, 0x00000000,
688 static void test_effect_variable_element(void)
690 ID3D10Effect
*effect
;
691 ID3D10EffectConstantBuffer
*constantbuffer
, *parent
;
692 ID3D10EffectVariable
*variable
, *variable2
, *variable3
, *variable4
, *variable5
;
693 ID3D10EffectType
*type
, *type2
;
694 D3D10_EFFECT_VARIABLE_DESC desc
;
695 D3D10_EFFECT_TYPE_DESC type_desc
;
696 ID3D10Device
*device
;
700 if (!(device
= create_device()))
702 skip("Failed to create device, skipping tests.\n");
706 hr
= create_effect(fx_test_eve
, 0, device
, NULL
, &effect
);
707 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
709 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
710 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &desc
);
711 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
713 ok(strcmp(desc
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc
.Name
);
714 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
715 ok(desc
.Flags
== 0, "Type is %u, expected 0\n", desc
.Flags
);
716 ok(desc
.Annotations
== 0, "Elements is %u, expected 0\n", desc
.Annotations
);
717 ok(desc
.BufferOffset
== 0, "Members is %u, expected 0\n", desc
.BufferOffset
);
718 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
720 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
721 hr
= variable
->lpVtbl
->GetDesc(variable
, &desc
);
722 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
724 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
725 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
726 parent
, constantbuffer
);
728 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "t1");
729 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
730 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
732 parent
= variable2
->lpVtbl
->GetParentConstantBuffer(variable2
);
733 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
735 /* check variable f1 */
736 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f1");
737 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
738 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
740 ok(strcmp(desc
.Name
, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc
.Name
);
741 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
742 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
743 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
744 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
745 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
747 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
748 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
749 parent
, constantbuffer
);
751 type
= variable3
->lpVtbl
->GetType(variable3
);
752 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
753 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
755 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
756 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
757 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
758 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
759 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
760 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
761 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
762 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
763 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
764 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
766 /* check variable f2 */
767 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f2");
768 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
769 ok(SUCCEEDED(hr
), "GetDesc failed (%x)!\n", hr
);
771 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
772 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
773 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
774 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
775 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
776 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
778 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
779 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
780 parent
, constantbuffer
);
782 type
= variable3
->lpVtbl
->GetType(variable3
);
783 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
784 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
786 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
787 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
788 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
789 ok(type_desc
.Elements
== 3, "Elements is %u, expected 3\n", type_desc
.Elements
);
790 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
791 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
792 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
793 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
794 ok(type_desc
.UnpackedSize
== 0x24, "UnpackedSize is %#x, expected 0x24\n", type_desc
.UnpackedSize
);
795 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
797 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 0);
798 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
799 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
801 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
802 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
803 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
804 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
805 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
806 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
808 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
809 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
810 parent
, constantbuffer
);
812 type
= variable4
->lpVtbl
->GetType(variable4
);
813 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
814 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
816 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
817 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
818 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
819 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
820 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
821 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
822 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
823 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
824 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
825 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
827 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 1);
828 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
829 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
831 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
832 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
833 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
834 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
835 ok(desc
.BufferOffset
== 32, "BufferOffset is %u, expected 32\n", desc
.BufferOffset
);
836 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
838 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
839 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
840 parent
, constantbuffer
);
842 type2
= variable4
->lpVtbl
->GetType(variable4
);
843 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
844 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
845 ok(type
== type2
, "type(%p) != type2(%p)\n", type
, type2
);
847 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
848 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
849 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
850 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
851 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
852 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
853 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
854 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
855 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
856 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
858 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 2);
859 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
860 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
862 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
863 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
864 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
865 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
866 ok(desc
.BufferOffset
== 48, "BufferOffset is %u, expected 48\n", desc
.BufferOffset
);
867 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
869 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
870 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
871 parent
, constantbuffer
);
873 type2
= variable4
->lpVtbl
->GetType(variable4
);
874 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
875 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
876 ok(type
== type2
, "type(%p) != type2(%p)\n", type
, type2
);
878 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
879 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
880 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
881 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
882 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
883 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
884 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
885 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
886 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
887 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
889 /* check variable t */
890 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "t");
891 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
892 ok(SUCCEEDED(hr
), "GetDesc failed (%x)!\n", hr
);
894 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
895 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
896 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
897 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
898 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
899 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
901 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
902 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
903 parent
, constantbuffer
);
905 type
= variable3
->lpVtbl
->GetType(variable3
);
906 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
907 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
909 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
910 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
911 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
912 ok(type_desc
.Elements
== 2, "Elements is %u, expected 2\n", type_desc
.Elements
);
913 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
914 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
915 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
916 ok(type_desc
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", type_desc
.PackedSize
);
917 ok(type_desc
.UnpackedSize
== 0x1c, "UnpackedSize is %#x, expected 0x1c\n", type_desc
.UnpackedSize
);
918 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
920 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 0);
921 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
922 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
924 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
925 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
926 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
927 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
928 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
929 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
931 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
932 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
933 parent
, constantbuffer
);
935 type
= variable4
->lpVtbl
->GetType(variable4
);
936 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
937 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
939 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
940 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
941 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
942 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
943 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
944 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
945 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
946 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
947 ok(type_desc
.UnpackedSize
== 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc
.UnpackedSize
);
948 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
950 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 0);
951 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
952 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
954 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
955 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
956 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
957 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
958 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
959 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
961 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
962 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
964 type
= variable5
->lpVtbl
->GetType(variable5
);
965 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
966 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
968 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
969 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
970 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
971 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
972 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
973 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
974 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
975 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
976 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
977 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
979 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 1);
980 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
981 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
983 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
984 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
985 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
986 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
987 ok(desc
.BufferOffset
== 68, "BufferOffset is %u, expected 68\n", desc
.BufferOffset
);
988 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
990 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
991 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
993 type
= variable5
->lpVtbl
->GetType(variable5
);
994 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
995 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
997 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
998 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
999 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1000 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1001 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1002 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1003 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1004 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1005 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1006 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1008 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 2);
1009 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1010 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1012 ok(strcmp(desc
.Name
, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc
.Name
);
1013 ok(strcmp(desc
.Semantic
, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc
.Semantic
);
1014 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1015 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1016 ok(desc
.BufferOffset
== 72, "BufferOffset is %u, expected 72\n", desc
.BufferOffset
);
1017 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1019 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1020 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1022 type
= variable5
->lpVtbl
->GetType(variable5
);
1023 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1024 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1026 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1027 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1028 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1029 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1030 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1031 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1032 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1033 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1034 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1035 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1037 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 1);
1038 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
1039 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1041 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
1042 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
1043 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1044 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1045 ok(desc
.BufferOffset
== 80, "BufferOffset is %u, expected 80\n", desc
.BufferOffset
);
1046 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1048 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
1049 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
1050 parent
, constantbuffer
);
1052 type
= variable4
->lpVtbl
->GetType(variable4
);
1053 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1054 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1056 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
1057 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
1058 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
1059 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1060 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
1061 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
1062 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
1063 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
1064 ok(type_desc
.UnpackedSize
== 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc
.UnpackedSize
);
1065 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1067 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 0);
1068 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1069 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1071 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
1072 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
1073 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1074 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1075 ok(desc
.BufferOffset
== 80, "BufferOffset is %u, expected 80\n", desc
.BufferOffset
);
1076 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1078 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1079 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1081 type
= variable5
->lpVtbl
->GetType(variable5
);
1082 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1083 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1085 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1086 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1087 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1088 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1089 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1090 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1091 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1092 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1093 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1094 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1096 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 1);
1097 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1098 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1100 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
1101 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
1102 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1103 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1104 ok(desc
.BufferOffset
== 84, "BufferOffset is %u, expected 84\n", desc
.BufferOffset
);
1105 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1107 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1108 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1110 type
= variable5
->lpVtbl
->GetType(variable5
);
1111 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1112 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1114 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1115 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1116 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1117 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1118 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1119 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1120 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1121 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1122 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1123 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1125 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 2);
1126 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1127 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1129 ok(strcmp(desc
.Name
, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc
.Name
);
1130 ok(strcmp(desc
.Semantic
, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc
.Semantic
);
1131 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1132 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1133 ok(desc
.BufferOffset
== 88, "BufferOffset is %u, expected 88\n", desc
.BufferOffset
);
1134 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1136 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1137 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1139 type
= variable5
->lpVtbl
->GetType(variable5
);
1140 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1141 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1143 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1144 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1145 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1146 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1147 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1148 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1149 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1150 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1151 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1152 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1154 effect
->lpVtbl
->Release(effect
);
1156 refcount
= ID3D10Device_Release(device
);
1157 ok(!refcount
, "Device has %u references left.\n", refcount
);
1161 * test_effect_variable_type_class
1164 cbuffer cb
<String s
= "STRING";>
1168 matrix
<uint
, 2, 3> u
;
1169 row_major matrix
<bool, 2, 3> b
;
1172 DepthStencilState depthstencil
;
1173 RasterizerState rast
;
1175 RenderTargetView rtv
;
1176 DepthStencilView dsv
;
1180 Texture2DMS
<float4
, 4> t2dms
;
1182 Texture2DMSArray
<float4
, 4> t2dmsa
;
1185 GeometryShader gs
[2];
1189 static DWORD fx_test_evtc
[] = {
1190 0x43425844, 0xc04c50cb, 0x0afeb4ef, 0xbb93f346,
1191 0x97a29499, 0x00000001, 0x00000659, 0x00000001,
1192 0x00000024, 0x30315846, 0x0000062d, 0xfeff1001,
1193 0x00000001, 0x00000004, 0x00000011, 0x00000000,
1194 0x00000000, 0x00000000, 0x00000000, 0x000003d9,
1195 0x00000000, 0x00000008, 0x00000001, 0x00000001,
1196 0x00000001, 0x00000001, 0x00000001, 0x00000001,
1197 0x00000004, 0x00000000, 0x00000000, 0x53006263,
1198 0x6e697274, 0x00070067, 0x00020000, 0x00000000,
1199 0x00000000, 0x00000000, 0x00000000, 0x00010000,
1200 0x00730000, 0x49525453, 0x6600474e, 0x74616f6c,
1201 0x00003300, 0x00000100, 0x00000000, 0x00000400,
1202 0x00001000, 0x00000400, 0x00090900, 0x69006600,
1203 0x0032746e, 0x00000057, 0x00000001, 0x00000000,
1204 0x00000008, 0x00000010, 0x00000008, 0x00001112,
1205 0x69750069, 0x7832746e, 0x007a0033, 0x00010000,
1206 0x00000000, 0x00280000, 0x00300000, 0x00180000,
1207 0x5a1b0000, 0x00750000, 0x6c6f6f62, 0x00337832,
1208 0x000000a0, 0x00000001, 0x00000000, 0x0000001c,
1209 0x00000020, 0x00000018, 0x00001a23, 0x6c420062,
1210 0x53646e65, 0x65746174, 0x0000c600, 0x00000200,
1211 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1212 0x00000200, 0x656c6200, 0x4400646e, 0x68747065,
1213 0x6e657453, 0x536c6963, 0x65746174, 0x0000f300,
1214 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1215 0x00000000, 0x00000300, 0x70656400, 0x74736874,
1216 0x69636e65, 0x6152006c, 0x72657473, 0x72657a69,
1217 0x74617453, 0x012e0065, 0x00020000, 0x00000000,
1218 0x00000000, 0x00000000, 0x00000000, 0x00040000,
1219 0x61720000, 0x53007473, 0x6c706d61, 0x74537265,
1220 0x00657461, 0x0000015f, 0x00000002, 0x00000000,
1221 0x00000000, 0x00000000, 0x00000000, 0x00000015,
1222 0x006d6173, 0x646e6552, 0x61547265, 0x74656772,
1223 0x77656956, 0x00018c00, 0x00000200, 0x00000000,
1224 0x00000000, 0x00000000, 0x00000000, 0x00001300,
1225 0x76747200, 0x70654400, 0x74536874, 0x69636e65,
1226 0x6569566c, 0x01bd0077, 0x00020000, 0x00000000,
1227 0x00000000, 0x00000000, 0x00000000, 0x00140000,
1228 0x73640000, 0x65540076, 0x72757478, 0x00443165,
1229 0x000001ee, 0x00000002, 0x00000000, 0x00000000,
1230 0x00000000, 0x00000000, 0x0000000a, 0x54003174,
1231 0x75747865, 0x44316572, 0x61727241, 0x02170079,
1232 0x00020000, 0x00000000, 0x00000000, 0x00000000,
1233 0x00000000, 0x000b0000, 0x31740000, 0x65540061,
1234 0x72757478, 0x00443265, 0x00000246, 0x00000002,
1235 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1236 0x0000000c, 0x54003274, 0x75747865, 0x44326572,
1237 0x6f00534d, 0x02000002, 0x00000000, 0x00000000,
1238 0x00000000, 0x00000000, 0x0e000000, 0x74000000,
1239 0x736d6432, 0x78655400, 0x65727574, 0x72414432,
1240 0x00796172, 0x0000029d, 0x00000002, 0x00000000,
1241 0x00000000, 0x00000000, 0x00000000, 0x0000000d,
1242 0x00613274, 0x74786554, 0x32657275, 0x41534d44,
1243 0x79617272, 0x0002cc00, 0x00000200, 0x00000000,
1244 0x00000000, 0x00000000, 0x00000000, 0x00000f00,
1245 0x64327400, 0x0061736d, 0x74786554, 0x33657275,
1246 0x03000044, 0x00020000, 0x00000000, 0x00000000,
1247 0x00000000, 0x00000000, 0x00100000, 0x33740000,
1248 0x78655400, 0x65727574, 0x65627543, 0x00032900,
1249 0x00000200, 0x00000000, 0x00000000, 0x00000000,
1250 0x00000000, 0x00001100, 0x00717400, 0x6d6f6547,
1251 0x79727465, 0x64616853, 0x54007265, 0x02000003,
1252 0x02000000, 0x00000000, 0x00000000, 0x00000000,
1253 0x07000000, 0x67000000, 0x69500073, 0x536c6578,
1254 0x65646168, 0x03820072, 0x00020000, 0x00000000,
1255 0x00000000, 0x00000000, 0x00000000, 0x00050000,
1256 0x73700000, 0x72655600, 0x53786574, 0x65646168,
1257 0x03ad0072, 0x00020000, 0x00010000, 0x00000000,
1258 0x00000000, 0x00000000, 0x00060000, 0x73760000,
1259 0x00000400, 0x00006000, 0x00000000, 0x00000400,
1260 0xffffff00, 0x000001ff, 0x00002a00, 0x00000e00,
1261 0x00002c00, 0x00005500, 0x00003900, 0x00000000,
1262 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1263 0x00007800, 0x00005c00, 0x00000000, 0x00000400,
1264 0x00000000, 0x00000000, 0x00000000, 0x00009e00,
1265 0x00008200, 0x00000000, 0x00001000, 0x00000000,
1266 0x00000000, 0x00000000, 0x0000c400, 0x0000a800,
1267 0x00000000, 0x00004000, 0x00000000, 0x00000000,
1268 0x00000000, 0x0000ed00, 0x0000d100, 0x00000000,
1269 0xffffff00, 0x000000ff, 0x00000000, 0x00012100,
1270 0x00010500, 0x00000000, 0xffffff00, 0x000000ff,
1271 0x00000000, 0x00015a00, 0x00013e00, 0x00000000,
1272 0xffffff00, 0x000000ff, 0x00000000, 0x00018800,
1273 0x00016c00, 0x00000000, 0xffffff00, 0x000000ff,
1274 0x00000000, 0x0001b900, 0x00019d00, 0x00000000,
1275 0xffffff00, 0x000000ff, 0x0001ea00, 0x0001ce00,
1276 0x00000000, 0xffffff00, 0x000000ff, 0x00021400,
1277 0x0001f800, 0x00000000, 0xffffff00, 0x000000ff,
1278 0x00024200, 0x00022600, 0x00000000, 0xffffff00,
1279 0x000000ff, 0x00026c00, 0x00025000, 0x00000000,
1280 0xffffff00, 0x000000ff, 0x00029700, 0x00027b00,
1281 0x00000000, 0xffffff00, 0x000000ff, 0x0002c800,
1282 0x0002ac00, 0x00000000, 0xffffff00, 0x000000ff,
1283 0x0002f900, 0x0002dd00, 0x00000000, 0xffffff00,
1284 0x000000ff, 0x00032600, 0x00030a00, 0x00000000,
1285 0xffffff00, 0x000000ff, 0x00035100, 0x00033500,
1286 0x00000000, 0xffffff00, 0x000000ff, 0x00037f00,
1287 0x00036300, 0x00000000, 0xffffff00, 0x000000ff,
1288 0x00000000, 0x00000000, 0x0003aa00, 0x00038e00,
1289 0x00000000, 0xffffff00, 0x000000ff, 0x00000000,
1290 0x0003d600, 0x0003ba00, 0x00000000, 0xffffff00,
1291 0x000000ff, 0x00000000, 0x00000000,
1294 static BOOL
is_valid_check(BOOL a
, BOOL b
)
1296 return (a
&& b
) || (!a
&& !b
);
1299 static void check_as(ID3D10EffectVariable
*variable
)
1301 ID3D10EffectVariable
*variable2
;
1302 ID3D10EffectType
*type
;
1303 D3D10_EFFECT_TYPE_DESC td
;
1307 type
= variable
->lpVtbl
->GetType(variable
);
1308 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1309 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1311 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsConstantBuffer(variable
);
1312 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1313 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_CBUFFER
);
1314 ok(ret
, "AsConstantBuffer valid check failed (Type is %x)\n", td
.Type
);
1316 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsString(variable
);
1317 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1318 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_STRING
);
1319 ok(ret
, "AsString valid check failed (Type is %x)\n", td
.Type
);
1321 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsScalar(variable
);
1322 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1323 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_SCALAR
);
1324 ok(ret
, "AsScalar valid check failed (Class is %x)\n", td
.Class
);
1326 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsVector(variable
);
1327 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1328 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_VECTOR
);
1329 ok(ret
, "AsVector valid check failed (Class is %x)\n", td
.Class
);
1331 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsMatrix(variable
);
1332 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1333 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_MATRIX_ROWS
1334 || td
.Class
== D3D10_SVC_MATRIX_COLUMNS
);
1335 ok(ret
, "AsMatrix valid check failed (Class is %x)\n", td
.Class
);
1337 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsBlend(variable
);
1338 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1339 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_BLEND
);
1340 ok(ret
, "AsBlend valid check failed (Type is %x)\n", td
.Type
);
1342 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsDepthStencil(variable
);
1343 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1344 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_DEPTHSTENCIL
);
1345 ok(ret
, "AsDepthStencil valid check failed (Type is %x)\n", td
.Type
);
1347 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsRasterizer(variable
);
1348 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1349 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_RASTERIZER
);
1350 ok(ret
, "AsRasterizer valid check failed (Type is %x)\n", td
.Type
);
1352 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsSampler(variable
);
1353 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1354 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_SAMPLER
);
1355 ok(ret
, "AsSampler valid check failed (Type is %x)\n", td
.Type
);
1357 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsDepthStencilView(variable
);
1358 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1359 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_DEPTHSTENCILVIEW
);
1360 ok(ret
, "AsDepthStencilView valid check failed (Type is %x)\n", td
.Type
);
1362 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsRenderTargetView(variable
);
1363 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1364 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_RENDERTARGETVIEW
);
1365 ok(ret
, "AsRenderTargetView valid check failed (Type is %x)\n", td
.Type
);
1367 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsShaderResource(variable
);
1368 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1369 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_TEXTURE1D
1370 || td
.Type
== D3D10_SVT_TEXTURE1DARRAY
|| td
.Type
== D3D10_SVT_TEXTURE2D
1371 || td
.Type
== D3D10_SVT_TEXTURE2DMS
|| td
.Type
== D3D10_SVT_TEXTURE2DARRAY
1372 || td
.Type
== D3D10_SVT_TEXTURE2DMSARRAY
|| td
.Type
== D3D10_SVT_TEXTURE3D
1373 || td
.Type
== D3D10_SVT_TEXTURECUBE
);
1374 ok(ret
, "AsShaderResource valid check failed (Type is %x)\n", td
.Type
);
1376 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsShader(variable
);
1377 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1378 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_GEOMETRYSHADER
1379 || td
.Type
== D3D10_SVT_PIXELSHADER
|| td
.Type
== D3D10_SVT_VERTEXSHADER
);
1380 ok(ret
, "AsShader valid check failed (Type is %x)\n", td
.Type
);
1383 static void test_effect_variable_type_class(void)
1385 ID3D10Effect
*effect
;
1386 ID3D10EffectConstantBuffer
*constantbuffer
, *null_buffer
, *parent
;
1387 ID3D10EffectVariable
*variable
;
1388 ID3D10EffectType
*type
;
1389 D3D10_EFFECT_VARIABLE_DESC vd
;
1390 D3D10_EFFECT_TYPE_DESC td
;
1391 ID3D10Device
*device
;
1394 unsigned int variable_nr
= 0;
1396 if (!(device
= create_device()))
1398 skip("Failed to create device, skipping tests.\n");
1402 hr
= create_effect(fx_test_evtc
, 0, device
, NULL
, &effect
);
1403 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
1405 /* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
1406 null_buffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 1);
1408 /* check constantbuffer cb */
1409 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
1410 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &vd
);
1411 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1413 ok(strcmp(vd
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", vd
.Name
);
1414 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1415 ok(vd
.Flags
== 0, "Type is %u, expected 0\n", vd
.Flags
);
1416 ok(vd
.Annotations
== 1, "Elements is %u, expected 1\n", vd
.Annotations
);
1417 ok(vd
.BufferOffset
== 0, "Members is %u, expected 0\n", vd
.BufferOffset
);
1418 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1420 check_as((ID3D10EffectVariable
*)constantbuffer
);
1422 parent
= constantbuffer
->lpVtbl
->GetParentConstantBuffer(constantbuffer
);
1423 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1425 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
1426 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1427 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1429 ok(strcmp(td
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", td
.TypeName
);
1430 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1431 ok(td
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_CBUFFER
);
1432 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1433 ok(td
.Members
== 4, "Members is %u, expected 4\n", td
.Members
);
1434 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1435 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1436 ok(td
.PackedSize
== 0x3c, "PackedSize is %#x, expected 0x3c\n", td
.PackedSize
);
1437 ok(td
.UnpackedSize
== 0x60, "UnpackedSize is %#x, expected 0x60\n", td
.UnpackedSize
);
1438 ok(td
.Stride
== 0x60, "Stride is %#x, expected 0x60\n", td
.Stride
);
1440 /* check annotation a */
1441 variable
= constantbuffer
->lpVtbl
->GetAnnotationByIndex(constantbuffer
, 0);
1442 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1443 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1445 ok(strcmp(vd
.Name
, "s") == 0, "Name is \"%s\", expected \"s\"\n", vd
.Name
);
1446 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1447 ok(vd
.Flags
== 2, "Flags is %u, expected 2\n", vd
.Flags
);
1448 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1449 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1450 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1454 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1455 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1457 type
= variable
->lpVtbl
->GetType(variable
);
1458 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1459 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1461 ok(strcmp(td
.TypeName
, "String") == 0, "TypeName is \"%s\", expected \"String\"\n", td
.TypeName
);
1462 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1463 ok(td
.Type
== D3D10_SVT_STRING
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_STRING
);
1464 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1465 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1466 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1467 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1468 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1469 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1470 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1473 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1474 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1475 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1477 ok(strcmp(vd
.Name
, "f") == 0, "Name is \"%s\", expected \"f\"\n", vd
.Name
);
1478 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1479 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1480 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1481 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1482 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1486 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1487 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1489 type
= variable
->lpVtbl
->GetType(variable
);
1490 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1491 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1493 ok(strcmp(td
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", td
.TypeName
);
1494 ok(td
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_SCALAR
);
1495 ok(td
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_FLOAT
);
1496 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1497 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1498 ok(td
.Rows
== 1, "Rows is %u, expected 1\n", td
.Rows
);
1499 ok(td
.Columns
== 1, "Columns is %u, expected 1\n", td
.Columns
);
1500 ok(td
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", td
.PackedSize
);
1501 ok(td
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", td
.UnpackedSize
);
1502 ok(td
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", td
.Stride
);
1505 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1506 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1507 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1509 ok(strcmp(vd
.Name
, "i") == 0, "Name is \"%s\", expected \"i\"\n", vd
.Name
);
1510 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1511 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1512 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1513 ok(vd
.BufferOffset
== 4, "BufferOffset is %u, expected 4\n", vd
.BufferOffset
);
1514 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1518 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1519 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1521 type
= variable
->lpVtbl
->GetType(variable
);
1522 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1523 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1525 ok(strcmp(td
.TypeName
, "int2") == 0, "TypeName is \"%s\", expected \"int2\"\n", td
.TypeName
);
1526 ok(td
.Class
== D3D10_SVC_VECTOR
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_VECTOR
);
1527 ok(td
.Type
== D3D10_SVT_INT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_INT
);
1528 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1529 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1530 ok(td
.Rows
== 1, "Rows is %u, expected 1\n", td
.Rows
);
1531 ok(td
.Columns
== 2, "Columns is %u, expected 2\n", td
.Columns
);
1532 ok(td
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", td
.PackedSize
);
1533 ok(td
.UnpackedSize
== 0x8, "UnpackedSize is %#x, expected 0x8\n", td
.UnpackedSize
);
1534 ok(td
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", td
.Stride
);
1536 /* check uint2x3 u */
1537 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1538 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1539 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1541 ok(strcmp(vd
.Name
, "u") == 0, "Name is \"%s\", expected \"u\"\n", vd
.Name
);
1542 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1543 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1544 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1545 ok(vd
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", vd
.BufferOffset
);
1546 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1550 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1551 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1553 type
= variable
->lpVtbl
->GetType(variable
);
1554 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1555 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1557 ok(strcmp(td
.TypeName
, "uint2x3") == 0, "TypeName is \"%s\", expected \"uint2x3\"\n", td
.TypeName
);
1558 ok(td
.Class
== D3D10_SVC_MATRIX_COLUMNS
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_MATRIX_COLUMNS
);
1559 ok(td
.Type
== D3D10_SVT_UINT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_UINT
);
1560 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1561 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1562 ok(td
.Rows
== 2, "Rows is %u, expected 2\n", td
.Rows
);
1563 ok(td
.Columns
== 3, "Columns is %u, expected 3\n", td
.Columns
);
1564 ok(td
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", td
.PackedSize
);
1565 ok(td
.UnpackedSize
== 0x28, "UnpackedSize is %#x, expected 0x28\n", td
.UnpackedSize
);
1566 ok(td
.Stride
== 0x30, "Stride is %#x, expected 0x30\n", td
.Stride
);
1568 /* check bool2x3 b */
1569 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1570 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1571 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1573 ok(strcmp(vd
.Name
, "b") == 0, "Name is \"%s\", expected \"b\"\n", vd
.Name
);
1574 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1575 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1576 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1577 ok(vd
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", vd
.BufferOffset
);
1578 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1582 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1583 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1585 type
= variable
->lpVtbl
->GetType(variable
);
1586 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1587 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1589 ok(strcmp(td
.TypeName
, "bool2x3") == 0, "TypeName is \"%s\", expected \"bool2x3\"\n", td
.TypeName
);
1590 ok(td
.Class
== D3D10_SVC_MATRIX_ROWS
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_MATRIX_ROWS
);
1591 ok(td
.Type
== D3D10_SVT_BOOL
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_BOOL
);
1592 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1593 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1594 ok(td
.Rows
== 2, "Rows is %u, expected 2\n", td
.Rows
);
1595 ok(td
.Columns
== 3, "Columns is %u, expected 3\n", td
.Columns
);
1596 ok(td
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", td
.PackedSize
);
1597 ok(td
.UnpackedSize
== 0x1c, "UnpackedSize is %#x, expected 0x1c\n", td
.UnpackedSize
);
1598 ok(td
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", td
.Stride
);
1600 /* check BlendState blend */
1601 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1602 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1603 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1605 ok(strcmp(vd
.Name
, "blend") == 0, "Name is \"%s\", expected \"blend\"\n", vd
.Name
);
1606 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1607 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1608 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1609 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1610 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1614 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1615 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1617 type
= variable
->lpVtbl
->GetType(variable
);
1618 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1619 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1621 ok(strcmp(td
.TypeName
, "BlendState") == 0, "TypeName is \"%s\", expected \"BlendState\"\n", td
.TypeName
);
1622 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1623 ok(td
.Type
== D3D10_SVT_BLEND
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_BLEND
);
1624 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1625 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1626 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1627 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1628 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1629 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1630 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1632 /* check DepthStencilState depthstencil */
1633 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1634 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1635 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1637 ok(strcmp(vd
.Name
, "depthstencil") == 0, "Name is \"%s\", expected \"depthstencil\"\n", vd
.Name
);
1638 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1639 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1640 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1641 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1642 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1646 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1647 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1649 type
= variable
->lpVtbl
->GetType(variable
);
1650 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1651 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1653 ok(strcmp(td
.TypeName
, "DepthStencilState") == 0, "TypeName is \"%s\", expected \"DepthStencilState\"\n", td
.TypeName
);
1654 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1655 ok(td
.Type
== D3D10_SVT_DEPTHSTENCIL
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_DEPTHSTENCIL
);
1656 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1657 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1658 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1659 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1660 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1661 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1662 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1664 /* check RasterizerState rast */
1665 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1666 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1667 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1669 ok(strcmp(vd
.Name
, "rast") == 0, "Name is \"%s\", expected \"rast\"\n", vd
.Name
);
1670 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1671 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1672 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1673 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1674 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1678 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1679 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1681 type
= variable
->lpVtbl
->GetType(variable
);
1682 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1683 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1685 ok(strcmp(td
.TypeName
, "RasterizerState") == 0, "TypeName is \"%s\", expected \"RasterizerState\"\n", td
.TypeName
);
1686 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1687 ok(td
.Type
== D3D10_SVT_RASTERIZER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_RASTERIZER
);
1688 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1689 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1690 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1691 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1692 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1693 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1694 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1696 /* check SamplerState sam */
1697 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1698 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1699 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1701 ok(strcmp(vd
.Name
, "sam") == 0, "Name is \"%s\", expected \"sam\"\n", vd
.Name
);
1702 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1703 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1704 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1705 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1706 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1710 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1711 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1713 type
= variable
->lpVtbl
->GetType(variable
);
1714 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1715 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1717 ok(strcmp(td
.TypeName
, "SamplerState") == 0, "TypeName is \"%s\", expected \"SamplerState\"\n", td
.TypeName
);
1718 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1719 ok(td
.Type
== D3D10_SVT_SAMPLER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_SAMPLER
);
1720 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1721 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1722 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1723 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1724 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1725 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1726 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1728 /* check RenderTargetView rtv */
1729 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1730 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1731 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1733 ok(strcmp(vd
.Name
, "rtv") == 0, "Name is \"%s\", expected \"rtv\"\n", vd
.Name
);
1734 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1735 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1736 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1737 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1738 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1742 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1743 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1745 type
= variable
->lpVtbl
->GetType(variable
);
1746 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1747 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1749 ok(strcmp(td
.TypeName
, "RenderTargetView") == 0, "TypeName is \"%s\", expected \"RenderTargetView\"\n", td
.TypeName
);
1750 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1751 ok(td
.Type
== D3D10_SVT_RENDERTARGETVIEW
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_RENDERTARGETVIEW
);
1752 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1753 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1754 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1755 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1756 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1757 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1758 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1760 /* check DepthStencilView dsv */
1761 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1762 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1763 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1765 ok(strcmp(vd
.Name
, "dsv") == 0, "Name is \"%s\", expected \"dsv\"\n", vd
.Name
);
1766 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1767 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1768 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1769 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1770 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1774 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1775 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1777 type
= variable
->lpVtbl
->GetType(variable
);
1778 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1779 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1781 ok(strcmp(td
.TypeName
, "DepthStencilView") == 0, "TypeName is \"%s\", expected \"DepthStencilView\"\n", td
.TypeName
);
1782 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1783 ok(td
.Type
== D3D10_SVT_DEPTHSTENCILVIEW
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_DEPTHSTENCILVIEW
);
1784 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1785 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1786 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1787 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1788 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1789 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1790 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1792 /* check Texture1D t1 */
1793 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1794 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1795 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1797 ok(strcmp(vd
.Name
, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", vd
.Name
);
1798 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1799 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1800 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1801 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1802 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1806 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1807 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1809 type
= variable
->lpVtbl
->GetType(variable
);
1810 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1811 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1813 ok(strcmp(td
.TypeName
, "Texture1D") == 0, "TypeName is \"%s\", expected \"Texture1D\"\n", td
.TypeName
);
1814 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1815 ok(td
.Type
== D3D10_SVT_TEXTURE1D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE1D
);
1816 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1817 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1818 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1819 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1820 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1821 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1822 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1824 /* check Texture1DArray t1a */
1825 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1826 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1827 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1829 ok(strcmp(vd
.Name
, "t1a") == 0, "Name is \"%s\", expected \"t1a\"\n", vd
.Name
);
1830 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1831 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1832 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1833 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1834 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1838 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1839 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1841 type
= variable
->lpVtbl
->GetType(variable
);
1842 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1843 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1845 ok(strcmp(td
.TypeName
, "Texture1DArray") == 0, "TypeName is \"%s\", expected \"Texture1DArray\"\n", td
.TypeName
);
1846 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1847 ok(td
.Type
== D3D10_SVT_TEXTURE1DARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE1DARRAY
);
1848 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1849 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1850 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1851 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1852 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1853 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1854 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1856 /* check Texture2D t2 */
1857 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1858 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1859 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1861 ok(strcmp(vd
.Name
, "t2") == 0, "Name is \"%s\", expected \"t2\"\n", vd
.Name
);
1862 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1863 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1864 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1865 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1866 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1870 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1871 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1873 type
= variable
->lpVtbl
->GetType(variable
);
1874 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1875 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1877 ok(strcmp(td
.TypeName
, "Texture2D") == 0, "TypeName is \"%s\", expected \"Texture2D\"\n", td
.TypeName
);
1878 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1879 ok(td
.Type
== D3D10_SVT_TEXTURE2D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2D
);
1880 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1881 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1882 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1883 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1884 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1885 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1886 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1888 /* check Texture2DMS t2dms */
1889 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1890 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1891 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1893 ok(strcmp(vd
.Name
, "t2dms") == 0, "Name is \"%s\", expected \"t2dms\"\n", vd
.Name
);
1894 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1895 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1896 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1897 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1898 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1902 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1903 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1905 type
= variable
->lpVtbl
->GetType(variable
);
1906 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1907 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1909 ok(strcmp(td
.TypeName
, "Texture2DMS") == 0, "TypeName is \"%s\", expected \"Texture2DMS\"\n", td
.TypeName
);
1910 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1911 ok(td
.Type
== D3D10_SVT_TEXTURE2DMS
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DMS
);
1912 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1913 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1914 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1915 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1916 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1917 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1918 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1920 /* check Texture2DArray t2a */
1921 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1922 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1923 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1925 ok(strcmp(vd
.Name
, "t2a") == 0, "Name is \"%s\", expected \"t2a\"\n", vd
.Name
);
1926 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1927 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1928 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1929 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1930 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1934 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1935 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1937 type
= variable
->lpVtbl
->GetType(variable
);
1938 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1939 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1941 ok(strcmp(td
.TypeName
, "Texture2DArray") == 0, "TypeName is \"%s\", expected \"Texture2DArray\"\n", td
.TypeName
);
1942 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1943 ok(td
.Type
== D3D10_SVT_TEXTURE2DARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DARRAY
);
1944 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1945 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1946 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1947 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1948 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1949 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1950 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1952 /* check Texture2DMSArray t2dmsa */
1953 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1954 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1955 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1957 ok(strcmp(vd
.Name
, "t2dmsa") == 0, "Name is \"%s\", expected \"t2dmsa\"\n", vd
.Name
);
1958 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1959 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1960 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1961 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1962 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1966 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1967 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1969 type
= variable
->lpVtbl
->GetType(variable
);
1970 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1971 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1973 ok(strcmp(td
.TypeName
, "Texture2DMSArray") == 0, "TypeName is \"%s\", expected \"TTexture2DMSArray\"\n", td
.TypeName
);
1974 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1975 ok(td
.Type
== D3D10_SVT_TEXTURE2DMSARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DMSARRAY
);
1976 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1977 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1978 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1979 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1980 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1981 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1982 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1984 /* check Texture3D t3 */
1985 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1986 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1987 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
1989 ok(strcmp(vd
.Name
, "t3") == 0, "Name is \"%s\", expected \"t3\"\n", vd
.Name
);
1990 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1991 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1992 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1993 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1994 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1998 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1999 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2001 type
= variable
->lpVtbl
->GetType(variable
);
2002 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2003 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2005 ok(strcmp(td
.TypeName
, "Texture3D") == 0, "TypeName is \"%s\", expected \"Texture3D\"\n", td
.TypeName
);
2006 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2007 ok(td
.Type
== D3D10_SVT_TEXTURE3D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE3D
);
2008 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2009 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2010 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2011 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2012 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2013 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2014 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2016 /* check TextureCube tq */
2017 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2018 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2019 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2021 ok(strcmp(vd
.Name
, "tq") == 0, "Name is \"%s\", expected \"tq\"\n", vd
.Name
);
2022 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2023 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2024 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2025 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2026 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2030 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2031 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2033 type
= variable
->lpVtbl
->GetType(variable
);
2034 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2035 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2037 ok(strcmp(td
.TypeName
, "TextureCube") == 0, "TypeName is \"%s\", expected \"TextureCube\"\n", td
.TypeName
);
2038 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2039 ok(td
.Type
== D3D10_SVT_TEXTURECUBE
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURECUBE
);
2040 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2041 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2042 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2043 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2044 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2045 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2046 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2048 /* check GeometryShader gs[2] */
2049 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2050 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2051 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2053 ok(strcmp(vd
.Name
, "gs") == 0, "Name is \"%s\", expected \"gs\"\n", vd
.Name
);
2054 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2055 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2056 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2057 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2058 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2062 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2063 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2065 type
= variable
->lpVtbl
->GetType(variable
);
2066 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2067 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2069 ok(strcmp(td
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", td
.TypeName
);
2070 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2071 ok(td
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_GEOMETRYSHADER
);
2072 ok(td
.Elements
== 2, "Elements is %u, expected 2\n", td
.Elements
);
2073 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2074 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2075 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2076 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2077 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2078 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2080 /* check PixelShader ps */
2081 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2082 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2083 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2085 ok(strcmp(vd
.Name
, "ps") == 0, "Name is \"%s\", expected \"ps\"\n", vd
.Name
);
2086 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2087 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2088 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2089 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2090 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2094 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2095 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2097 type
= variable
->lpVtbl
->GetType(variable
);
2098 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2099 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2101 ok(strcmp(td
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", td
.TypeName
);
2102 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2103 ok(td
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_PIXELSHADER
);
2104 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2105 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2106 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2107 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2108 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2109 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2110 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2112 /* check VertexShader vs[1] */
2113 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2114 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2115 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2117 ok(strcmp(vd
.Name
, "vs") == 0, "Name is \"%s\", expected \"vs\"\n", vd
.Name
);
2118 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2119 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2120 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2121 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2122 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2126 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2127 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2129 type
= variable
->lpVtbl
->GetType(variable
);
2130 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2131 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2133 ok(strcmp(td
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", td
.TypeName
);
2134 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2135 ok(td
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_VERTEXSHADER
);
2136 ok(td
.Elements
== 1, "Elements is %u, expected 1\n", td
.Elements
);
2137 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2138 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2139 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2140 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2141 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2142 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2144 effect
->lpVtbl
->Release(effect
);
2146 refcount
= ID3D10Device_Release(device
);
2147 ok(!refcount
, "Device has %u references left.\n", refcount
);
2151 * test_effect_constant_buffer_stride
2185 float2 a6
: packoffset(c0
);
2186 float3 b6
: packoffset(c1
);
2187 float2 c6
: packoffset(c0
.z
);
2191 float2 a7
: packoffset(c0
);
2192 float3 b7
: packoffset(c1
);
2193 float2 c7
: packoffset(c2
);
2197 float2 a8
: packoffset(c0
);
2198 float3 b8
: packoffset(c0
.y
);
2199 float4 c8
: packoffset(c2
);
2203 float2 a9
: packoffset(c0
);
2204 float2 b9
: packoffset(c0
.y
);
2205 float2 c9
: packoffset(c0
.z
);
2209 float4 a10
: packoffset(c2
);
2245 float2 a15
[2] : packoffset(c0
);
2248 static DWORD fx_test_ecbs
[] = {
2249 0x43425844, 0x615d7d77, 0x21289d92, 0xe9e8d98e,
2250 0xcae7b74e, 0x00000001, 0x00000855, 0x00000001,
2251 0x00000024, 0x30315846, 0x00000829, 0xfeff1001,
2252 0x0000000f, 0x00000024, 0x00000000, 0x00000000,
2253 0x00000000, 0x00000000, 0x00000000, 0x00000285,
2254 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2255 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2256 0x00000000, 0x00000000, 0x00000000, 0x00316263,
2257 0x616f6c66, 0x00080074, 0x00010000, 0x00000000,
2258 0x00040000, 0x00100000, 0x00040000, 0x09090000,
2259 0x31610000, 0x00316200, 0x64003163, 0x62630031,
2260 0x32610032, 0x6f6c6600, 0x00327461, 0x0000003d,
2261 0x00000001, 0x00000000, 0x00000008, 0x00000010,
2262 0x00000008, 0x0000110a, 0x63003262, 0x61003362,
2263 0x6c660033, 0x3374616f, 0x00006a00, 0x00000100,
2264 0x00000000, 0x00000c00, 0x00001000, 0x00000c00,
2265 0x00190a00, 0x00336200, 0x00346263, 0x62003461,
2266 0x34630034, 0x35626300, 0x00356100, 0x63003562,
2267 0x62630035, 0x36610036, 0x00366200, 0x63003663,
2268 0x61003762, 0x37620037, 0x00376300, 0x00386263,
2269 0x62003861, 0x6c660038, 0x3474616f, 0x0000ce00,
2270 0x00000100, 0x00000000, 0x00001000, 0x00001000,
2271 0x00001000, 0x00210a00, 0x00386300, 0x00396263,
2272 0x62003961, 0x39630039, 0x31626300, 0x31610030,
2273 0x62630030, 0x3c003131, 0x616e6e75, 0x3e64656d,
2274 0x31316100, 0x31316200, 0x00010f00, 0x00000300,
2275 0x00000000, 0x00001400, 0x00002000, 0x00001400,
2276 0x00000200, 0x00011900, 0x00000000, 0x00000000,
2277 0x0000d500, 0x00011d00, 0x00000000, 0x00001000,
2278 0x00000e00, 0x31317300, 0x31316300, 0x31626300,
2279 0x31630032, 0x31620032, 0x31610032, 0x010f0032,
2280 0x00030000, 0x00000000, 0x00200000, 0x00200000,
2281 0x00140000, 0x00020000, 0x016e0000, 0x00000000,
2282 0x00000000, 0x000e0000, 0x01720000, 0x00000000,
2283 0x00100000, 0x00d50000, 0x31730000, 0x62630032,
2284 0x61003331, 0x62003331, 0x0f003331, 0x03000001,
2285 0x00000000, 0x04000000, 0x10000000, 0x04000000,
2286 0x01000000, 0xbf000000, 0x00000001, 0x00000000,
2287 0x0e000000, 0x73000000, 0x63003331, 0x00343162,
2288 0x00343161, 0x0000010f, 0x00000003, 0x00000000,
2289 0x00000004, 0x00000010, 0x00000004, 0x00000001,
2290 0x000001f8, 0x00000000, 0x00000000, 0x0000000e,
2291 0x00343173, 0x00343162, 0x0000010f, 0x00000003,
2292 0x00000000, 0x00000004, 0x00000010, 0x00000004,
2293 0x00000001, 0x0000022c, 0x00000000, 0x00000000,
2294 0x0000000e, 0x00343174, 0x35316263, 0x00003d00,
2295 0x00000100, 0x00000200, 0x00001800, 0x00001000,
2296 0x00001000, 0x00110a00, 0x35316100, 0x00000400,
2297 0x00001000, 0x00000000, 0x00000400, 0xffffff00,
2298 0x000000ff, 0x00002a00, 0x00000e00, 0x00000000,
2299 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2300 0x00002d00, 0x00000e00, 0x00000000, 0x00000400,
2301 0x00000000, 0x00000000, 0x00000000, 0x00003000,
2302 0x00000e00, 0x00000000, 0x00000800, 0x00000000,
2303 0x00000000, 0x00000000, 0x00003300, 0x00000e00,
2304 0x00000000, 0x00000c00, 0x00000000, 0x00000000,
2305 0x00000000, 0x00003600, 0x00001000, 0x00000000,
2306 0x00000200, 0xffffff00, 0x000000ff, 0x00003a00,
2307 0x00000e00, 0x00000000, 0x00000000, 0x00000000,
2308 0x00000000, 0x00000000, 0x00006000, 0x00004400,
2309 0x00000000, 0x00000400, 0x00000000, 0x00000000,
2310 0x00000000, 0x00006300, 0x00002000, 0x00000000,
2311 0x00000200, 0xffffff00, 0x000000ff, 0x00006700,
2312 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2313 0x00000000, 0x00000000, 0x00008d00, 0x00007100,
2314 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2315 0x00000000, 0x00009000, 0x00003000, 0x00000000,
2316 0x00000300, 0xffffff00, 0x000000ff, 0x00009400,
2317 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2318 0x00000000, 0x00000000, 0x00009700, 0x00007100,
2319 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2320 0x00000000, 0x00009a00, 0x00004400, 0x00000000,
2321 0x00002000, 0x00000000, 0x00000000, 0x00000000,
2322 0x00009d00, 0x00002000, 0x00000000, 0x00000300,
2323 0xffffff00, 0x000000ff, 0x0000a100, 0x00004400,
2324 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2325 0x00000000, 0x0000a400, 0x00004400, 0x00000000,
2326 0x00000800, 0x00000000, 0x00000000, 0x00000000,
2327 0x0000a700, 0x00007100, 0x00000000, 0x00001000,
2328 0x00000000, 0x00000000, 0x00000000, 0x0000aa00,
2329 0x00002000, 0x00000000, 0x00000300, 0xffffff00,
2330 0x000000ff, 0x0000ae00, 0x00004400, 0x00000000,
2331 0x00000000, 0x00000000, 0x00000400, 0x00000000,
2332 0x0000b100, 0x00007100, 0x00000000, 0x00001000,
2333 0x00000000, 0x00000400, 0x00000000, 0x0000b400,
2334 0x00004400, 0x00000000, 0x00000800, 0x00000000,
2335 0x00000400, 0x00000000, 0x0000b700, 0x00003000,
2336 0x00000000, 0x00000300, 0xffffff00, 0x000000ff,
2337 0x0000bb00, 0x00004400, 0x00000000, 0x00000000,
2338 0x00000000, 0x00000400, 0x00000000, 0x0000be00,
2339 0x00007100, 0x00000000, 0x00001000, 0x00000000,
2340 0x00000400, 0x00000000, 0x0000c100, 0x00004400,
2341 0x00000000, 0x00002000, 0x00000000, 0x00000400,
2342 0x00000000, 0x0000c400, 0x00003000, 0x00000000,
2343 0x00000300, 0xffffff00, 0x000000ff, 0x0000c800,
2344 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2345 0x00000400, 0x00000000, 0x0000cb00, 0x00007100,
2346 0x00000000, 0x00000400, 0x00000000, 0x00000400,
2347 0x00000000, 0x0000f100, 0x0000d500, 0x00000000,
2348 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2349 0x0000f400, 0x00001000, 0x00000000, 0x00000300,
2350 0xffffff00, 0x000000ff, 0x0000f800, 0x00004400,
2351 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2352 0x00000000, 0x0000fb00, 0x00004400, 0x00000000,
2353 0x00000400, 0x00000000, 0x00000400, 0x00000000,
2354 0x0000fe00, 0x00004400, 0x00000000, 0x00000800,
2355 0x00000000, 0x00000400, 0x00000000, 0x00010100,
2356 0x00003000, 0x00000000, 0x00000100, 0xffffff00,
2357 0x000000ff, 0x00010600, 0x0000d500, 0x00000000,
2358 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2359 0x00010a00, 0x00002000, 0x00000000, 0x00000200,
2360 0xffffff00, 0x000000ff, 0x00015d00, 0x00012100,
2361 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2362 0x00000000, 0x00016100, 0x00000e00, 0x00000000,
2363 0x00001400, 0x00000000, 0x00000000, 0x00000000,
2364 0x00016500, 0x00003000, 0x00000000, 0x00000200,
2365 0xffffff00, 0x000000ff, 0x00016a00, 0x00000e00,
2366 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2367 0x00000000, 0x0001b200, 0x00017600, 0x00000000,
2368 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2369 0x0001b600, 0x00002000, 0x00000000, 0x00000200,
2370 0xffffff00, 0x000000ff, 0x0001bb00, 0x00000e00,
2371 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2372 0x00000000, 0x0001ef00, 0x0001c300, 0x00000000,
2373 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2374 0x0001f300, 0x00002000, 0x00000000, 0x00000200,
2375 0xffffff00, 0x000000ff, 0x00022800, 0x0001fc00,
2376 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2377 0x00000000, 0x00025c00, 0x00023000, 0x00000000,
2378 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2379 0x00026000, 0x00002000, 0x00000000, 0x00000100,
2380 0xffffff00, 0x000000ff, 0x00028100, 0x00026500,
2381 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2382 0x00000000, 0x00000000,
2385 static void test_effect_constant_buffer_stride(void)
2387 ID3D10Effect
*effect
;
2388 ID3D10EffectConstantBuffer
*constantbuffer
;
2389 ID3D10EffectType
*type
;
2390 D3D10_EFFECT_TYPE_DESC tdesc
;
2391 ID3D10Device
*device
;
2396 static const struct {
2397 unsigned int m
; /* members */
2398 unsigned int p
; /* packed size */
2399 unsigned int u
; /* unpacked size */
2400 unsigned int s
; /* stride */
2402 {4, 0x10, 0x10, 0x10},
2403 {2, 0xc, 0x10, 0x10},
2404 {2, 0x14, 0x20, 0x20},
2405 {3, 0x1c, 0x30, 0x30},
2406 {3, 0x1c, 0x20, 0x20},
2407 {3, 0x1c, 0x20, 0x20},
2408 {3, 0x1c, 0x30, 0x30},
2409 {3, 0x24, 0x30, 0x30},
2410 {3, 0x18, 0x10, 0x10},
2411 {1, 0x10, 0x30, 0x30},
2412 {2, 0x18, 0x20, 0x20},
2413 {2, 0x18, 0x30, 0x30},
2414 {2, 0x8, 0x20, 0x20},
2415 {2, 0x8, 0x20, 0x20},
2416 {1, 0x10, 0x20, 0x20},
2419 if (!(device
= create_device()))
2421 skip("Failed to create device, skipping tests.\n");
2425 hr
= create_effect(fx_test_ecbs
, 0, device
, NULL
, &effect
);
2426 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
2428 for (i
=0; i
<ARRAY_SIZE(tv_ecbs
); i
++)
2430 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, i
);
2431 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
2433 hr
= type
->lpVtbl
->GetDesc(type
, &tdesc
);
2434 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2436 ok(strcmp(tdesc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", tdesc
.TypeName
);
2437 ok(tdesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", tdesc
.Class
, D3D10_SVC_OBJECT
);
2438 ok(tdesc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", tdesc
.Type
, D3D10_SVT_CBUFFER
);
2439 ok(tdesc
.Elements
== 0, "Elements is %u, expected 0\n", tdesc
.Elements
);
2440 ok(tdesc
.Members
== tv_ecbs
[i
].m
, "Members is %u, expected %u\n", tdesc
.Members
, tv_ecbs
[i
].m
);
2441 ok(tdesc
.Rows
== 0, "Rows is %u, expected 0\n", tdesc
.Rows
);
2442 ok(tdesc
.Columns
== 0, "Columns is %u, expected 0\n", tdesc
.Columns
);
2443 ok(tdesc
.PackedSize
== tv_ecbs
[i
].p
, "PackedSize is %#x, expected %#x\n", tdesc
.PackedSize
, tv_ecbs
[i
].p
);
2444 ok(tdesc
.UnpackedSize
== tv_ecbs
[i
].u
, "UnpackedSize is %#x, expected %#x\n", tdesc
.UnpackedSize
, tv_ecbs
[i
].u
);
2445 ok(tdesc
.Stride
== tv_ecbs
[i
].s
, "Stride is %#x, expected %#x\n", tdesc
.Stride
, tv_ecbs
[i
].s
);
2448 effect
->lpVtbl
->Release(effect
);
2450 refcount
= ID3D10Device_Release(device
);
2451 ok(!refcount
, "Device has %u references left.\n", refcount
);
2455 float4
VS( float4 Pos
: POSITION
) : SV_POSITION
{ return Pos
; }
2456 float4
VS2( int4 Pos
: POSITION
) : SV_POSITION
{ return Pos
; }
2457 float4
PS( float4 Pos
: SV_POSITION
) : SV_Target
{ return float4( 1.0f
, 1.0f
, 0.0f
, 1.0f
); }
2458 struct GS_OUT
{ float4 Pos
: SV_POSITION
; };
2460 void GS( triangle float4 Pos
[3] : SV_POSITION
, inout TriangleStream
<GS_OUT
> TriStream
)
2464 TriStream
.Append( out1
);
2466 TriStream
.Append( out1
);
2468 TriStream
.Append( out1
);
2469 TriStream
.RestartStrip();
2471 VertexShader v0
= NULL
;
2472 PixelShader p0
= NULL
;
2473 GeometryShader g0
= NULL
;
2474 VertexShader v
[2] = { CompileShader( vs_4_0
, VS() ), CompileShader( vs_4_0
, VS2() ) };
2475 PixelShader p
= CompileShader( ps_4_0
, PS() );
2476 GeometryShader g
= CompileShader( gs_4_0
, GS() );
2482 SetPixelShader( NULL
);
2483 SetVertexShader( NULL
);
2484 SetGeometryShader( NULL
);
2488 SetPixelShader( NULL
);
2489 SetVertexShader( NULL
);
2490 SetGeometryShader( NULL
);
2494 SetPixelShader( CompileShader( ps_4_0
, PS() ) );
2495 SetVertexShader( CompileShader( vs_4_0
, VS() ) );
2496 SetGeometryShader( CompileShader( gs_4_0
, GS() ) );
2500 SetPixelShader( CompileShader( ps_4_0
, PS() ) );
2501 SetVertexShader( CompileShader( vs_4_0
, VS2() ) );
2502 SetGeometryShader( CompileShader( gs_4_0
, GS() ) );
2506 SetPixelShader( p0
);
2507 SetVertexShader( v0
);
2508 SetGeometryShader( g0
);
2512 SetPixelShader( p
);
2513 SetVertexShader( v
[0] );
2514 SetGeometryShader( g
);
2518 SetPixelShader( p
);
2519 SetVertexShader( v
[1] );
2520 SetGeometryShader( g
);
2524 static DWORD fx_local_shader
[] = {
2525 0x43425844, 0x95577e13, 0xab5facae, 0xd06d9eab, 0x8b127be0, 0x00000001, 0x00001652, 0x00000001,
2526 0x00000024, 0x30315846, 0x00001626, 0xfeff1001, 0x00000000, 0x00000000, 0x00000006, 0x00000000,
2527 0x00000000, 0x00000000, 0x00000001, 0x0000138a, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2528 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000d, 0x00000006, 0x00000000, 0x74726556,
2529 0x68537865, 0x72656461, 0x00000400, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2530 0x00000600, 0x00307600, 0x65786950, 0x6168536c, 0x00726564, 0x00000030, 0x00000002, 0x00000000,
2531 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x47003070, 0x656d6f65, 0x53797274, 0x65646168,
2532 0x005b0072, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00070000, 0x30670000,
2533 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000600, 0xb4007600,
2534 0x44000001, 0x02434258, 0x5f11b96d, 0x31cdd883, 0xade81d9f, 0x014d6a2d, 0xb4000000, 0x05000001,
2535 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000,
2536 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369,
2537 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2538 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000,
2539 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49,
2540 0x4fababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000,
2541 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000,
2542 0x0f000100, 0x5f000000, 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000,
2543 0x36000000, 0xf2050000, 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154,
2544 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000,
2545 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2546 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2547 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xb4000000, 0x44000001, 0xa4434258,
2548 0x42e88ad3, 0xcc4b1ab5, 0x5f89bf37, 0x0139edfb, 0xb4000000, 0x05000001, 0x34000000, 0x8c000000,
2549 0xc0000000, 0xf4000000, 0x38000000, 0x52000001, 0x50464544, 0x00000000, 0x00000000, 0x00000000,
2550 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820,
2551 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235,
2552 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x00000000,
2553 0x02000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49, 0x4fababab, 0x2c4e4753,
2554 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000,
2555 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000, 0x0f000100, 0x5f000000,
2556 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000, 0x2b000000, 0xf2050000,
2557 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154, 0x02000000, 0x00000000,
2558 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000,
2559 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2560 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2561 0x00000000, 0x00000000, 0x00000000, 0x70000000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2562 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2563 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2564 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2565 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2566 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2567 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2568 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2569 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2570 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2571 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2572 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2573 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2574 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2575 0x00000000, 0x10006700, 0x44000002, 0x5c434258, 0x7482cd04, 0xb6d82978, 0xe48192f2, 0x01eec6be,
2576 0x10000000, 0x05000002, 0x34000000, 0x8c000000, 0xc0000000, 0xf4000000, 0x94000000, 0x52000001,
2577 0x50464544, 0x00000000, 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00475304, 0x1c000001,
2578 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
2579 0x656c6970, 0x2e392072, 0x392e3632, 0x322e3235, 0x00343438, 0x49ababab, 0x2c4e4753, 0x01000000,
2580 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x5300000f,
2581 0x4f505f56, 0x49544953, 0x4f004e4f, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000,
2582 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f,
2583 0x98524448, 0x40000000, 0x26000200, 0x61000000, 0xf2050000, 0x03002010, 0x00000000, 0x01000000,
2584 0x5d000000, 0x5c010018, 0x67010028, 0xf2040000, 0x00001020, 0x01000000, 0x5e000000, 0x03020000,
2585 0x36000000, 0xf2060000, 0x00001020, 0x46000000, 0x0000201e, 0x00000000, 0x13000000, 0x36010000,
2586 0xf2060000, 0x00001020, 0x46000000, 0x0100201e, 0x00000000, 0x13000000, 0x36010000, 0xf2060000,
2587 0x00001020, 0x46000000, 0x0200201e, 0x00000000, 0x13000000, 0x09010000, 0x3e010000, 0x53010000,
2588 0x74544154, 0x08000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000,
2589 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000,
2590 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2591 0x03000000, 0x05000000, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x52000000, 0x65646e65,
2592 0x30500072, 0x00315000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
2593 0x00000001, 0x00000002, 0x00000000, 0x01003250, 0x02000000, 0x00000000, 0x01000000, 0x02000000,
2594 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x50000000, 0x01b00033, 0x58440000, 0x269a4342,
2595 0x7ba57ff9, 0x728d8af1, 0x9e9d796d, 0x0001ff59, 0x01b00000, 0x00050000, 0x00340000, 0x008c0000,
2596 0x00c00000, 0x00f40000, 0x01340000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000,
2597 0x001c0000, 0x04000000, 0x0100ffff, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228,
2598 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32,
2599 0xab003434, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000,
2600 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47,
2601 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000,
2602 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00385244, 0x00400000, 0x000e0000, 0x00650000,
2603 0x20f20300, 0x00000010, 0x00360000, 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80,
2604 0x00003f80, 0x00000000, 0x003e3f80, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2605 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2606 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2607 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2608 0x00000000, 0x00000000, 0x083e0000, 0x00000000, 0x01b40000, 0x58440000, 0x6d024342, 0x835f11b9,
2609 0x9f31cdd8, 0x2dade81d, 0x00014d6a, 0x01b40000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2610 0x00f40000, 0x01380000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2611 0x04000000, 0x0100fffe, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2612 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2613 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000,
2614 0x00000000, 0x0f0f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab, 0x002c4e47, 0x00010000,
2615 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2616 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001, 0x005f0000, 0x10f20300,
2617 0x00000010, 0x00670000, 0x20f20400, 0x00000010, 0x00010000, 0x00360000, 0x20f20500, 0x00000010,
2618 0x1e460000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
2619 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
2620 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2621 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2622 0x00000000, 0x00000000, 0x09fa0000, 0x00000000, 0x02100000, 0x58440000, 0x045c4342, 0x787482cd,
2623 0xf2b6d829, 0xbee48192, 0x0001eec6, 0x02100000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
2624 0x00f40000, 0x01940000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
2625 0x04000000, 0x01004753, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
2626 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e36, 0x38322e32, 0xab003434,
2627 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000,
2628 0x00000000, 0x0f0f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47, 0x00010000,
2629 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
2630 0x534f505f, 0x4f495449, 0x4853004e, 0x00985244, 0x00400000, 0x00260002, 0x00610000, 0x10f20500,
2631 0x00030020, 0x00000000, 0x00010000, 0x185d0000, 0x285c0100, 0x00670100, 0x20f20400, 0x00000010,
2632 0x00010000, 0x005e0000, 0x00030200, 0x00360000, 0x20f20600, 0x00000010, 0x1e460000, 0x00000020,
2633 0x00000000, 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00010020, 0x00000000,
2634 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00020020, 0x00000000, 0x00130000,
2635 0x00090100, 0x003e0100, 0x54530100, 0x00745441, 0x00080000, 0x00000000, 0x00000000, 0x00020000,
2636 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2637 0x00010000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2638 0x00000000, 0x00000000, 0x00000000, 0x00030000, 0x00050000, 0x00030000, 0x00000000, 0x00000000,
2639 0x00000000, 0x0bba0000, 0x00000000, 0x34500000, 0x0001b000, 0x42584400, 0xf9269a43, 0xf17ba57f,
2640 0x6d728d8a, 0x599e9d79, 0x000001ff, 0x0001b000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000,
2641 0x0000f400, 0x00013400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2642 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2643 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034,
2644 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300,
2645 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100,
2646 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2647 0x67726154, 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203,
2648 0x00000000, 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f,
2649 0x80000000, 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100,
2650 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2651 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2652 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2653 0x00000000, 0x000dd900, 0x00000000, 0x0001b400, 0x42584400, 0x8ad3a443, 0x1ab542e8, 0xbf37cc4b,
2654 0xedfb5f89, 0x00000139, 0x0001b400, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2655 0x00013800, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0xfe040000,
2656 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2657 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2658 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2659 0x000f0f00, 0x534f5000, 0x4f495449, 0xabab004e, 0x47534fab, 0x00002c4e, 0x00000100, 0x00000800,
2660 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2661 0x4e4f4954, 0x44485300, 0x00003c52, 0x01004000, 0x00000f00, 0x00005f00, 0x1010f203, 0x00000000,
2662 0x00006700, 0x1020f204, 0x00000000, 0x00000100, 0x00002b00, 0x1020f205, 0x00000000, 0x101e4600,
2663 0x00000000, 0x00003e00, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000200,
2664 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2665 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2666 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2667 0x00000000, 0x000f9500, 0x00000000, 0x00021000, 0x42584400, 0xcd045c43, 0x29787482, 0x92f2b6d8,
2668 0xc6bee481, 0x000001ee, 0x00021000, 0x00000500, 0x00003400, 0x00008c00, 0x0000c000, 0x0000f400,
2669 0x00019400, 0x45445200, 0x00005046, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x53040000,
2670 0x00010047, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2671 0x43207265, 0x69706d6f, 0x2072656c, 0x36322e39, 0x3235392e, 0x3438322e, 0xabab0034, 0x475349ab,
2672 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2673 0x000f0f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800,
2674 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2675 0x4e4f4954, 0x44485300, 0x00009852, 0x02004000, 0x00002600, 0x00006100, 0x2010f205, 0x00000300,
2676 0x00000000, 0x00000100, 0x00185d00, 0x00285c01, 0x00006701, 0x1020f204, 0x00000000, 0x00000100,
2677 0x00005e00, 0x00000302, 0x00003600, 0x1020f206, 0x00000000, 0x201e4600, 0x00000000, 0x00000000,
2678 0x00001300, 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000100, 0x00000000, 0x00001300,
2679 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000200, 0x00000000, 0x00001300, 0x00000901,
2680 0x00003e01, 0x41545301, 0x00007454, 0x00000800, 0x00000000, 0x00000000, 0x00000200, 0x00000000,
2681 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2682 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2683 0x00000000, 0x00000000, 0x00000300, 0x00000500, 0x00000300, 0x00000000, 0x00000000, 0x00000000,
2684 0x00115500, 0x00000000, 0x00355000, 0xa5003650, 0x00000000, 0x50000000, 0x00a50037, 0x00010000,
2685 0x002d0000, 0x00110000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00580000, 0x003c0000,
2686 0x00000000, 0xffff0000, 0x0000ffff, 0x00000000, 0x00860000, 0x006a0000, 0x00000000, 0xffff0000,
2687 0x0000ffff, 0x00000000, 0x00a50000, 0x00890000, 0x00000000, 0xffff0000, 0x00a7ffff, 0x025f0000,
2688 0x00000000, 0x04170000, 0x003c0000, 0x00000000, 0xffff0000, 0x0419ffff, 0x00000000, 0x05cd0000,
2689 0x006a0000, 0x00000000, 0xffff0000, 0x05cfffff, 0x00000000, 0x07e30000, 0x00080000, 0x00000000,
2690 0x07ea0000, 0x00000000, 0x00000000, 0x07ed0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000,
2691 0x00010000, 0x07f00000, 0x00060000, 0x00000000, 0x00010000, 0x07fc0000, 0x00080000, 0x00000000,
2692 0x00010000, 0x08080000, 0x08140000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00010000,
2693 0x08170000, 0x00060000, 0x00000000, 0x00010000, 0x08230000, 0x00080000, 0x00000000, 0x00010000,
2694 0x082f0000, 0x083b0000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x09f20000,
2695 0x00060000, 0x00000000, 0x00070000, 0x0bb20000, 0x00080000, 0x00000000, 0x00070000, 0x0dce0000,
2696 0x0dd60000, 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x0f8d0000, 0x00060000,
2697 0x00000000, 0x00070000, 0x114d0000, 0x00080000, 0x00000000, 0x00070000, 0x13690000, 0x13710000,
2698 0x00030000, 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x00580000, 0x00060000, 0x00000000,
2699 0x00020000, 0x002d0000, 0x00080000, 0x00000000, 0x00020000, 0x00860000, 0x13740000, 0x00030000,
2700 0x00000000, 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000,
2701 0x13770000, 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x137f0000, 0x00030000, 0x00000000,
2702 0x00070000, 0x00000000, 0x00020000, 0x04170000, 0x00060000, 0x00000000, 0x00030000, 0x13820000,
2703 0x00080000, 0x00000000, 0x00020000, 0x05cd0000, 0x00000000,
2706 static void test_effect_local_shader(void)
2710 ID3D10Effect
* effect
;
2711 ID3D10EffectVariable
* v
;
2712 ID3D10EffectPass
*p
, *p2
, *null_pass
;
2713 ID3D10EffectTechnique
*t
, *t2
, *null_technique
;
2714 D3D10_PASS_SHADER_DESC pdesc
= {0};
2715 D3D10_EFFECT_VARIABLE_DESC vdesc
= {0};
2716 ID3D10EffectType
*type
;
2717 D3D10_EFFECT_TYPE_DESC typedesc
;
2718 ID3D10EffectShaderVariable
*null_shader
, *null_anon_vs
, *null_anon_ps
, *null_anon_gs
,
2719 *p3_anon_vs
, *p3_anon_ps
, *p3_anon_gs
, *p6_vs
, *p6_ps
, *p6_gs
;
2720 ID3D10Device
*device
;
2723 if (!(device
= create_device()))
2725 skip("Failed to create device, skipping tests.\n");
2729 hr
= create_effect(fx_local_shader
, 0, device
, NULL
, &effect
);
2730 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed!\n");
2732 null_technique
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0xffffffff);
2733 null_pass
= null_technique
->lpVtbl
->GetPassByIndex(null_technique
, 0xffffffff);
2735 /* check technique */
2736 t
= effect
->lpVtbl
->GetTechniqueByName(effect
, NULL
);
2737 ok(null_technique
== t
, "GetTechniqueByName got %p, expected %p\n", t
, null_technique
);
2739 t
= effect
->lpVtbl
->GetTechniqueByName(effect
, "invalid");
2740 ok(null_technique
== t
, "GetTechniqueByName got %p, expected %p\n", t
, null_technique
);
2742 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
2743 ok(null_technique
!= t
, "GetTechniqueByIndex failed %p\n", t
);
2745 t2
= effect
->lpVtbl
->GetTechniqueByName(effect
, "Render");
2746 ok(t2
== t
, "GetTechniqueByName got %p, expected %p\n", t2
, t
);
2748 /* check invalid pass arguments */
2749 p
= null_technique
->lpVtbl
->GetPassByName(null_technique
, NULL
);
2750 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
2752 p
= null_technique
->lpVtbl
->GetPassByName(null_technique
, "invalid");
2753 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
2757 /* This crashes on W7/DX10, if t is a valid technique and name=NULL. */
2758 p
= t
->lpVtbl
->GetPassByName(t
, NULL
);
2759 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
2762 p
= t
->lpVtbl
->GetPassByIndex(t
, 0xffffffff);
2763 ok(null_pass
== p
, "GetPassByIndex got %p, expected %p\n", p
, null_pass
);
2765 /* check for invalid arguments */
2766 hr
= null_pass
->lpVtbl
->GetVertexShaderDesc(null_pass
, NULL
);
2767 ok(hr
== E_FAIL
, "GetVertexShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2769 hr
= null_pass
->lpVtbl
->GetVertexShaderDesc(null_pass
, &pdesc
);
2770 ok(hr
== E_FAIL
, "GetVertexShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2772 hr
= null_pass
->lpVtbl
->GetPixelShaderDesc(null_pass
, NULL
);
2773 ok(hr
== E_FAIL
, "GetPixelShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2775 hr
= null_pass
->lpVtbl
->GetPixelShaderDesc(null_pass
, &pdesc
);
2776 ok(hr
== E_FAIL
, "GetPixelShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2778 hr
= null_pass
->lpVtbl
->GetGeometryShaderDesc(null_pass
, NULL
);
2779 ok(hr
== E_FAIL
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2781 hr
= null_pass
->lpVtbl
->GetGeometryShaderDesc(null_pass
, &pdesc
);
2782 ok(hr
== E_FAIL
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, E_FAIL
);
2784 /* check valid pass arguments */
2785 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
2786 p
= t
->lpVtbl
->GetPassByIndex(t
, 0);
2788 p2
= t
->lpVtbl
->GetPassByName(t
, "P0");
2789 ok(p2
== p
, "GetPassByName got %p, expected %p\n", p2
, p
);
2791 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, NULL
);
2792 ok(hr
== E_INVALIDARG
, "GetVertexShaderDesc got %x, expected %x\n", hr
, E_INVALIDARG
);
2794 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, NULL
);
2795 ok(hr
== E_INVALIDARG
, "GetPixelShaderDesc got %x, expected %x\n", hr
, E_INVALIDARG
);
2797 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, NULL
);
2798 ok(hr
== E_INVALIDARG
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, E_INVALIDARG
);
2800 /* get the null_shader_variable */
2801 v
= effect
->lpVtbl
->GetVariableByIndex(effect
, 10000);
2802 null_shader
= v
->lpVtbl
->AsShader(v
);
2805 p
= t
->lpVtbl
->GetPassByIndex(t
, 0);
2806 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
2807 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
2808 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
2809 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2811 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2812 ok(hr
== E_FAIL
, "GetDesc failed (%x)\n", hr
);
2814 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
2815 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
2816 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
2817 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2819 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2820 ok(hr
== E_FAIL
, "GetDesc failed (%x)\n", hr
);
2822 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
2823 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
2824 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
2825 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2827 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2828 ok(hr
== E_FAIL
, "GetDesc failed (%x)\n", hr
);
2831 p
= t
->lpVtbl
->GetPassByIndex(t
, 1);
2833 /* pass 1 vertexshader */
2834 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
2835 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
2836 null_anon_vs
= pdesc
.pShaderVariable
;
2837 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2839 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2840 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2842 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2843 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2844 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2845 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2846 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2847 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2849 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
2850 ok(ret
, "IsValid() failed\n");
2852 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
2853 ret
= type
->lpVtbl
->IsValid(type
);
2854 ok(ret
, "IsValid() failed\n");
2856 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
2857 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
2858 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexhader\"\n", typedesc
.TypeName
);
2859 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
2860 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
2861 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
2862 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
2863 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
2864 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
2865 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
2866 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
2867 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
2869 /* pass 1 pixelshader */
2870 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
2871 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
2872 null_anon_ps
= pdesc
.pShaderVariable
;
2873 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2875 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2876 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2878 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2879 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2880 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2881 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2882 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2883 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2885 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
2886 ok(ret
, "IsValid() failed\n");
2888 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
2889 ret
= type
->lpVtbl
->IsValid(type
);
2890 ok(ret
, "IsValid() failed\n");
2892 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
2893 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
2894 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
2895 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
2896 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
2897 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
2898 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
2899 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
2900 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
2901 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
2902 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
2903 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
2905 /* pass 1 geometryshader */
2906 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
2907 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
2908 null_anon_gs
= pdesc
.pShaderVariable
;
2909 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2911 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2912 ok(hr
== S_OK
, "GetDesc failed (%x) expected %x\n", hr
, S_OK
);
2914 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2915 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2916 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2917 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2918 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2919 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2921 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
2922 ok(ret
, "IsValid() failed\n");
2924 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
2925 ret
= type
->lpVtbl
->IsValid(type
);
2926 ok(ret
, "IsValid() failed\n");
2928 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
2929 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
2930 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
2931 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
2932 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
2933 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
2934 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
2935 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
2936 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
2937 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
2938 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
2939 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
2942 p
= t
->lpVtbl
->GetPassByIndex(t
, 2);
2944 /* pass 2 vertexshader */
2945 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
2946 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
2947 ok(pdesc
.pShaderVariable
== null_anon_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_vs
);
2948 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2950 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2951 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2953 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2954 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2955 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2956 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2957 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2958 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2960 /* pass 2 pixelshader */
2961 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
2962 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
2963 ok(pdesc
.pShaderVariable
== null_anon_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_ps
);
2964 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2966 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2967 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
2969 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2970 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2971 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2972 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2973 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2974 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2976 /* pass 2 geometryshader */
2977 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
2978 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
2979 ok(pdesc
.pShaderVariable
== null_anon_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_gs
);
2980 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
2982 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
2983 ok(hr
== S_OK
, "GetDesc failed (%x) expected %x\n", hr
, S_OK
);
2985 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
2986 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
2987 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
2988 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
2989 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
2990 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
2993 p
= t
->lpVtbl
->GetPassByIndex(t
, 3);
2995 /* pass 3 vertexshader */
2996 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
2997 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
2998 p3_anon_vs
= pdesc
.pShaderVariable
;
2999 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3001 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3002 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3004 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3005 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3006 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3007 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3008 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3009 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3011 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3012 ok(ret
, "IsValid() failed\n");
3014 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3015 ret
= type
->lpVtbl
->IsValid(type
);
3016 ok(ret
, "IsValid() failed\n");
3018 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3019 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3020 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc
.TypeName
);
3021 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3022 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3023 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3024 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3025 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3026 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3027 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3028 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3029 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3031 /* pass 3 pixelshader */
3032 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3033 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
3034 p3_anon_ps
= pdesc
.pShaderVariable
;
3035 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3037 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3038 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3040 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3041 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3042 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3043 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3044 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3045 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3047 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3048 ok(ret
, "IsValid() failed\n");
3050 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3051 ret
= type
->lpVtbl
->IsValid(type
);
3052 ok(ret
, "IsValid() failed\n");
3054 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3055 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3056 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
3057 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3058 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3059 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3060 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3061 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3062 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3063 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3064 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3065 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3067 /* pass 3 geometryshader */
3068 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3069 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
3070 p3_anon_gs
= pdesc
.pShaderVariable
;
3071 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3073 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3074 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3076 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3077 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3078 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3079 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3080 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3081 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3083 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3084 ok(ret
, "IsValid() failed\n");
3086 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3087 ret
= type
->lpVtbl
->IsValid(type
);
3088 ok(ret
, "IsValid() failed\n");
3090 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3091 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3092 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
3093 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3094 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3095 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3096 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3097 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3098 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3099 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3100 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3101 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3104 p
= t
->lpVtbl
->GetPassByIndex(t
, 4);
3106 /* pass 4 vertexshader */
3107 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3108 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
3109 ok(pdesc
.pShaderVariable
!= p3_anon_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_vs
);
3110 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3112 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3113 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3115 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3116 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3117 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3118 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3119 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3120 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3122 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3123 ok(ret
, "IsValid() failed\n");
3125 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3126 ret
= type
->lpVtbl
->IsValid(type
);
3127 ok(ret
, "IsValid() failed\n");
3129 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3130 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3131 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc
.TypeName
);
3132 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3133 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3134 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3135 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3136 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3137 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3138 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3139 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3140 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3142 /* pass 4 pixelshader */
3143 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3144 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
3145 ok(pdesc
.pShaderVariable
!= p3_anon_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_ps
);
3146 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3148 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3149 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3151 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3152 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3153 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3154 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3155 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3156 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3158 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3159 ok(ret
, "IsValid() failed\n");
3161 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3162 ret
= type
->lpVtbl
->IsValid(type
);
3163 ok(ret
, "IsValid() failed\n");
3165 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3166 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3167 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
3168 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3169 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3170 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3171 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3172 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3173 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3174 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3175 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3176 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3178 /* pass 4 geometryshader */
3179 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3180 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
3181 ok(pdesc
.pShaderVariable
!= p3_anon_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_gs
);
3182 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %x\n", pdesc
.ShaderIndex
, 0);
3184 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3185 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3187 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3188 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3189 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3190 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3191 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3192 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3194 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3195 ok(ret
, "IsValid() failed\n");
3197 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3198 ret
= type
->lpVtbl
->IsValid(type
);
3199 ok(ret
, "IsValid() failed\n");
3201 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3202 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3203 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
3204 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3205 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3206 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3207 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3208 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3209 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3210 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3211 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3212 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3215 p
= t
->lpVtbl
->GetPassByIndex(t
, 5);
3217 /* pass 5 vertexshader */
3218 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3219 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
3220 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3222 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3223 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3225 ok(strcmp(vdesc
.Name
, "v0") == 0, "Name is \"%s\", expected \"v0\"\n", vdesc
.Name
);
3226 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3227 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3228 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3229 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3230 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3232 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3233 ok(ret
, "IsValid() failed\n");
3235 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3236 ret
= type
->lpVtbl
->IsValid(type
);
3237 ok(ret
, "IsValid() failed\n");
3239 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3240 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3241 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3242 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3243 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3244 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3245 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3246 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3247 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3248 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3249 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3250 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3252 /* pass 5 pixelshader */
3253 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3254 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
3255 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3257 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3258 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3260 ok(strcmp(vdesc
.Name
, "p0") == 0, "Name is \"%s\", expected \"p0\"\n", vdesc
.Name
);
3261 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3262 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3263 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3264 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3265 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3267 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3268 ok(ret
, "IsValid() failed\n");
3270 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3271 ret
= type
->lpVtbl
->IsValid(type
);
3272 ok(ret
, "IsValid() failed\n");
3274 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3275 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3276 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3277 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3278 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3279 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3280 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3281 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3282 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3283 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3284 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3285 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3287 /* pass 5 geometryshader */
3288 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3289 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
3290 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3292 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3293 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3295 ok(strcmp(vdesc
.Name
, "g0") == 0, "Name is \"%s\", expected \"g0\"\n", vdesc
.Name
);
3296 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3297 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3298 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3299 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3300 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3302 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3303 ok(ret
, "IsValid() failed\n");
3305 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3306 ret
= type
->lpVtbl
->IsValid(type
);
3307 ok(ret
, "IsValid() failed\n");
3309 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3310 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3311 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3312 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3313 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3314 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3315 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3316 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3317 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3318 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3319 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3320 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3323 p
= t
->lpVtbl
->GetPassByIndex(t
, 6);
3325 /* pass 6 vertexshader */
3326 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3327 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
3328 p6_vs
= pdesc
.pShaderVariable
;
3329 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3331 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3332 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3334 ok(strcmp(vdesc
.Name
, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc
.Name
);
3335 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3336 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3337 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3338 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3339 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3341 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3342 ok(ret
, "IsValid() failed\n");
3344 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3345 ret
= type
->lpVtbl
->IsValid(type
);
3346 ok(ret
, "IsValid() failed\n");
3348 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3349 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3350 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3351 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3352 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3353 ok(typedesc
.Elements
== 2, "Elements is %u, expected 2\n", typedesc
.Elements
);
3354 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3355 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3356 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3357 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3358 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3359 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3361 /* pass 6 pixelshader */
3362 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3363 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
3364 p6_ps
= pdesc
.pShaderVariable
;
3365 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3367 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3368 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3370 ok(strcmp(vdesc
.Name
, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc
.Name
);
3371 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3372 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3373 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3374 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3375 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3377 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3378 ok(ret
, "IsValid() failed\n");
3380 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3381 ret
= type
->lpVtbl
->IsValid(type
);
3382 ok(ret
, "IsValid() failed\n");
3384 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3385 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3386 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3387 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3388 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3389 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3390 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3391 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3392 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3393 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3394 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3395 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3397 /* pass 6 geometryshader */
3398 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3399 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
3400 p6_gs
= pdesc
.pShaderVariable
;
3401 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3403 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3404 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3406 ok(strcmp(vdesc
.Name
, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc
.Name
);
3407 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3408 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3409 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3410 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3411 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3413 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3414 ok(ret
, "IsValid() failed\n");
3416 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3417 ret
= type
->lpVtbl
->IsValid(type
);
3418 ok(ret
, "IsValid() failed\n");
3420 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3421 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3422 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3423 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3424 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3425 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3426 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3427 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3428 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3429 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3430 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3431 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3434 p
= t
->lpVtbl
->GetPassByIndex(t
, 7);
3436 /* pass 7 vertexshader */
3437 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3438 ok(hr
== S_OK
, "GetVertexShaderDesc got %x, expected %x\n", hr
, S_OK
);
3439 ok(pdesc
.pShaderVariable
== p6_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_vs
);
3440 ok(pdesc
.ShaderIndex
== 1, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 1);
3442 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3443 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3445 ok(strcmp(vdesc
.Name
, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc
.Name
);
3446 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3447 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3448 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3449 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3450 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3452 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3453 ok(ret
, "IsValid() failed\n");
3455 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3456 ret
= type
->lpVtbl
->IsValid(type
);
3457 ok(ret
, "IsValid() failed\n");
3459 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3460 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3461 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3462 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3463 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3464 ok(typedesc
.Elements
== 2, "Elements is %u, expected 2\n", typedesc
.Elements
);
3465 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3466 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3467 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3468 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3469 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3470 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3472 /* pass 7 pixelshader */
3473 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3474 ok(hr
== S_OK
, "GetPixelShaderDesc got %x, expected %x\n", hr
, S_OK
);
3475 ok(pdesc
.pShaderVariable
== p6_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_ps
);
3476 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3478 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3479 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3481 ok(strcmp(vdesc
.Name
, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc
.Name
);
3482 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3483 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3484 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3485 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3486 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3488 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3489 ok(ret
, "IsValid() failed\n");
3491 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3492 ret
= type
->lpVtbl
->IsValid(type
);
3493 ok(ret
, "IsValid() failed\n");
3495 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3496 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3497 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3498 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3499 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3500 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3501 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3502 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3503 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3504 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3505 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3506 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3508 /* pass 7 geometryshader */
3509 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3510 ok(hr
== S_OK
, "GetGeometryShaderDesc got %x, expected %x\n", hr
, S_OK
);
3511 ok(pdesc
.pShaderVariable
== p6_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_gs
);
3512 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3514 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3515 ok(SUCCEEDED(hr
), "GetDesc failed (%x)\n", hr
);
3517 ok(strcmp(vdesc
.Name
, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc
.Name
);
3518 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3519 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3520 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3521 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3522 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3524 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3525 ok(ret
, "IsValid() failed\n");
3527 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3528 ret
= type
->lpVtbl
->IsValid(type
);
3529 ok(ret
, "IsValid() failed\n");
3531 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3532 ok(hr
== S_OK
, "GetDesc failed (%x)\n", hr
);
3533 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3534 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3535 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3536 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3537 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3538 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3539 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3540 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3541 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3542 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3544 effect
->lpVtbl
->Release(effect
);
3546 refcount
= ID3D10Device_Release(device
);
3547 ok(!refcount
, "Device has %u references left.\n", refcount
);
3551 * test_effect_get_variable_by
3556 float f1
: SV_POSITION
;
3561 float f3
: SV_POSITION
;
3564 Texture1D tex1
: COLOR2
;
3565 Texture1D tex2
: COLOR1
;
3567 static DWORD fx_test_egvb
[] = {
3568 0x43425844, 0x63d60ede, 0xf75a09d1, 0x47da5604, 0x7ef6e331, 0x00000001, 0x000001ca, 0x00000001,
3569 0x00000024, 0x30315846, 0x0000019e, 0xfeff1001, 0x00000002, 0x00000004, 0x00000002, 0x00000000,
3570 0x00000000, 0x00000000, 0x00000000, 0x0000008a, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3571 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
3572 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
3573 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032,
3574 0x00346600, 0x4f4c4f43, 0x54003152, 0x75747865, 0x44316572, 0x00005300, 0x00000200, 0x00000000,
3575 0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x78657400, 0x4f430031, 0x32524f4c, 0x78657400,
3576 0x00040032, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x00290000, 0x000d0000,
3577 0x002c0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x000d0000, 0x003b0000,
3578 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00420000, 0x00100000, 0x00000000, 0x00020000,
3579 0xffff0000, 0x0000ffff, 0x00460000, 0x000d0000, 0x002c0000, 0x00000000, 0x00000000, 0x00000000,
3580 0x00000000, 0x00490000, 0x000d0000, 0x004c0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000,
3581 0x00790000, 0x005d0000, 0x007e0000, 0xffff0000, 0x0000ffff, 0x00850000, 0x005d0000, 0x004c0000,
3582 0xffff0000, 0x0000ffff, 0x00000000,
3585 static void test_effect_get_variable_by(void)
3587 ID3D10Effect
*effect
;
3588 ID3D10EffectVariable
*variable_by_index
, *variable
, *null_variable
;
3589 ID3D10Device
*device
;
3593 if (!(device
= create_device()))
3595 skip("Failed to create device, skipping tests.\n");
3599 hr
= create_effect(fx_test_egvb
, 0, device
, NULL
, &effect
);
3600 ok(SUCCEEDED(hr
), "D3D10CreateEffectFromMemory failed (%x)\n", hr
);
3602 /* get the null variable */
3603 null_variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, 0xffffffff);
3605 /* check for invalid arguments */
3606 variable
= effect
->lpVtbl
->GetVariableByName(effect
, NULL
);
3607 ok(null_variable
== variable
, "GetVariableByName got %p, expected %p\n", variable
, null_variable
);
3609 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, NULL
);
3610 ok(null_variable
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, null_variable
);
3612 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "invalid");
3613 ok(null_variable
== variable
, "GetVariableByName got %p, expected %p\n", variable
, null_variable
);
3615 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "invalid");
3616 ok(null_variable
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, null_variable
);
3619 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 0);
3620 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3622 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f1");
3623 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3625 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "SV_POSITION");
3626 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
3629 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 1);
3630 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3632 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f2");
3633 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3635 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR0");
3636 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
3639 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 2);
3640 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3642 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f3");
3643 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3645 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "SV_POSITION");
3646 ok(variable
!= null_variable
, "GetVariableBySemantic failed %p\n", variable
);
3647 ok(variable
!= variable_by_index
, "GetVariableBySemantic failed %p\n", variable
);
3650 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 3);
3651 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3653 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f4");
3654 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3656 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR1");
3657 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
3660 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 4);
3661 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3663 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "tex1");
3664 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3666 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR2");
3667 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
3670 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 5);
3671 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
3673 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "tex2");
3674 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
3676 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR1");
3677 ok(variable
!= null_variable
, "GetVariableBySemantic failed %p\n", variable
);
3678 ok(variable
!= variable_by_index
, "GetVariableBySemantic failed %p\n", variable
);
3680 effect
->lpVtbl
->Release(effect
);
3682 refcount
= ID3D10Device_Release(device
);
3683 ok(!refcount
, "Device has %u references left.\n", refcount
);
3687 RasterizerState rast_state
3689 FillMode
= wireframe
; /* 0x0c */
3690 CullMode
= front
; /* 0x0d */
3691 FrontCounterClockwise
= true; /* 0x0e */
3692 DepthBias
= -4; /* 0x0f */
3693 DepthBiasClamp
= 0.5f
; /* 0x10 */
3694 SlopeScaledDepthBias
= 0.25f
; /* 0x11 */
3695 DepthClipEnable
= false; /* 0x12 */
3696 ScissorEnable
= true; /* 0x13 */
3697 MultisampleEnable
= true; /* 0x14 */
3698 AntialiasedLineEnable
= true; /* 0x15 */
3701 DepthStencilState ds_state
3703 DepthEnable
= true; /* 0x16 */
3704 DepthWriteMask
= zero
; /* 0x17 */
3705 DepthFunc
= equal
; /* 0x18 */
3706 StencilEnable
= true; /* 0x19 */
3707 StencilReadMask
= 0x4; /* 0x1a */
3708 StencilWriteMask
= 0x5; /* 0x1b */
3709 FrontFaceStencilFail
= invert
; /* 0x1c */
3710 FrontFaceStencilDepthFail
= incr
; /* 0x1d */
3711 FrontFaceStencilPass
= decr
; /* 0x1e */
3712 FrontFaceStencilFunc
= less_equal
; /* 0x1f */
3713 BackFaceStencilFail
= replace
; /* 0x20 */
3714 BackFaceStencilDepthFail
= incr_sat
; /* 0x21 */
3715 BackFaceStencilPass
= decr_sat
; /* 0x22 */
3716 BackFaceStencilFunc
= greater_equal
; /* 0x23 */
3719 BlendState blend_state
3721 AlphaToCoverageEnable
= false; /* 0x24 */
3722 BlendEnable
[0] = true; /* 0x25[0] */
3723 BlendEnable
[7] = false; /* 0x25[7] */
3724 SrcBlend
= one
; /* 0x26 */
3725 DestBlend
= src_color
; /* 0x27 */
3726 BlendOp
= min
; /* 0x28 */
3727 SrcBlendAlpha
= src_alpha
; /* 0x29 */
3728 DestBlendAlpha
= inv_src_alpha
; /* 0x2a */
3729 BlendOpAlpha
= max
; /* 0x2b */
3730 RenderTargetWriteMask
[0] = 0x8; /* 0x2c[0] */
3731 RenderTargetWriteMask
[7] = 0x7; /* 0x2c[7] */
3734 SamplerState sampler0
3736 Filter
= min_mag_mip_linear
; /* 0x2d */
3737 AddressU
= wrap
; /* 0x2e */
3738 AddressV
= mirror
; /* 0x2f */
3739 AddressW
= clamp
; /* 0x30 */
3740 MipMapLODBias
= -1; /* 0x31 */
3741 MaxAnisotropy
= 4u; /* 0x32 */
3742 ComparisonFunc
= always
; /* 0x33 */
3743 BorderColor
= float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */
3744 MinLOD
= 6u; /* 0x35 */
3745 MaxLOD
= 5u; /* 0x36 */
3752 SetBlendState(blend_state
, float4(0.5f
, 0.6f
, 0.7f
, 0.8f
), 0xffff);
3753 SetDepthStencilState(ds_state
, 1.0f
);
3754 SetRasterizerState(rast_state
);
3758 static DWORD fx_test_state_groups
[] =
3760 0x43425844, 0xbf7e3418, 0xd2838ea5, 0x8012c315,
3761 0x7dd76ca7, 0x00000001, 0x00000794, 0x00000001,
3762 0x00000024, 0x30315846, 0x00000768, 0xfeff1001,
3763 0x00000001, 0x00000000, 0x00000004, 0x00000000,
3764 0x00000000, 0x00000000, 0x00000001, 0x0000035c,
3765 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3766 0x00000001, 0x00000001, 0x00000000, 0x00000000,
3767 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
3768 0x736c6162, 0x73615200, 0x69726574, 0x5372657a,
3769 0x65746174, 0x00000d00, 0x00000200, 0x00000000,
3770 0x00000000, 0x00000000, 0x00000000, 0x00000400,
3771 0x73617200, 0x74735f74, 0x00657461, 0x00000001,
3772 0x00000002, 0x00000002, 0x00000001, 0x00000002,
3773 0x00000002, 0x00000001, 0x00000004, 0x00000001,
3774 0x00000001, 0x00000002, 0xfffffffc, 0x00000001,
3775 0x00000001, 0x3f000000, 0x00000001, 0x00000001,
3776 0x3e800000, 0x00000001, 0x00000004, 0x00000000,
3777 0x00000001, 0x00000004, 0x00000001, 0x00000001,
3778 0x00000004, 0x00000001, 0x00000001, 0x00000004,
3779 0x00000001, 0x74706544, 0x65745368, 0x6c69636e,
3780 0x74617453, 0x00bc0065, 0x00020000, 0x00000000,
3781 0x00000000, 0x00000000, 0x00000000, 0x00030000,
3782 0x73640000, 0x6174735f, 0x01006574, 0x04000000,
3783 0x01000000, 0x01000000, 0x02000000, 0x00000000,
3784 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3785 0x04000000, 0x01000000, 0x01000000, 0x02000000,
3786 0x04000000, 0x01000000, 0x02000000, 0x05000000,
3787 0x01000000, 0x02000000, 0x06000000, 0x01000000,
3788 0x02000000, 0x07000000, 0x01000000, 0x02000000,
3789 0x08000000, 0x01000000, 0x02000000, 0x04000000,
3790 0x01000000, 0x02000000, 0x03000000, 0x01000000,
3791 0x02000000, 0x04000000, 0x01000000, 0x02000000,
3792 0x05000000, 0x01000000, 0x02000000, 0x07000000,
3793 0x42000000, 0x646e656c, 0x74617453, 0x019b0065,
3794 0x00020000, 0x00000000, 0x00000000, 0x00000000,
3795 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65,
3796 0x74617473, 0x00010065, 0x00040000, 0x00000000,
3797 0x00010000, 0x00040000, 0x00010000, 0x00010000,
3798 0x00040000, 0x00000000, 0x00010000, 0x00020000,
3799 0x00020000, 0x00010000, 0x00020000, 0x00030000,
3800 0x00010000, 0x00020000, 0x00040000, 0x00010000,
3801 0x00020000, 0x00050000, 0x00010000, 0x00020000,
3802 0x00060000, 0x00010000, 0x00020000, 0x00050000,
3803 0x00010000, 0x00020000, 0x00080000, 0x00010000,
3804 0x00020000, 0x00070000, 0x61530000, 0x656c706d,
3805 0x61745372, 0x52006574, 0x02000002, 0x00000000,
3806 0x00000000, 0x00000000, 0x00000000, 0x15000000,
3807 0x73000000, 0x6c706d61, 0x00307265, 0x00000001,
3808 0x00000002, 0x00000015, 0x00000001, 0x00000002,
3809 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3810 0x00000001, 0x00000002, 0x00000003, 0x00000001,
3811 0x00000002, 0xffffffff, 0x00000001, 0x00000002,
3812 0x00000004, 0x00000001, 0x00000002, 0x00000008,
3813 0x00000004, 0x00000001, 0x3f800000, 0x00000001,
3814 0x40000000, 0x00000001, 0x40400000, 0x00000001,
3815 0x40800000, 0x00000001, 0x00000002, 0x00000006,
3816 0x00000001, 0x00000002, 0x00000005, 0x68636574,
3817 0x61700030, 0x00307373, 0x00000004, 0x00000001,
3818 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001,
3819 0x3f333333, 0x00000001, 0x3f4ccccd, 0x00000001,
3820 0x00000002, 0x0000ffff, 0x00000001, 0x00000001,
3821 0x3f800000, 0x00000004, 0x00000000, 0x00000000,
3822 0x00000000, 0xffffffff, 0x00000000, 0x00000039,
3823 0x0000001d, 0x00000000, 0xffffffff, 0x0000000a,
3824 0x0000000c, 0x00000000, 0x00000001, 0x00000044,
3825 0x0000000d, 0x00000000, 0x00000001, 0x00000050,
3826 0x0000000e, 0x00000000, 0x00000001, 0x0000005c,
3827 0x0000000f, 0x00000000, 0x00000001, 0x00000068,
3828 0x00000010, 0x00000000, 0x00000001, 0x00000074,
3829 0x00000011, 0x00000000, 0x00000001, 0x00000080,
3830 0x00000012, 0x00000000, 0x00000001, 0x0000008c,
3831 0x00000013, 0x00000000, 0x00000001, 0x00000098,
3832 0x00000014, 0x00000000, 0x00000001, 0x000000a4,
3833 0x00000015, 0x00000000, 0x00000001, 0x000000b0,
3834 0x00000000, 0x000000ea, 0x000000ce, 0x00000000,
3835 0xffffffff, 0x0000000e, 0x00000016, 0x00000000,
3836 0x00000001, 0x000000f3, 0x00000017, 0x00000000,
3837 0x00000001, 0x000000ff, 0x00000018, 0x00000000,
3838 0x00000001, 0x0000010b, 0x00000019, 0x00000000,
3839 0x00000001, 0x00000117, 0x0000001a, 0x00000000,
3840 0x00000001, 0x00000123, 0x0000001b, 0x00000000,
3841 0x00000001, 0x0000012f, 0x0000001c, 0x00000000,
3842 0x00000001, 0x0000013b, 0x0000001d, 0x00000000,
3843 0x00000001, 0x00000147, 0x0000001e, 0x00000000,
3844 0x00000001, 0x00000153, 0x0000001f, 0x00000000,
3845 0x00000001, 0x0000015f, 0x00000020, 0x00000000,
3846 0x00000001, 0x0000016b, 0x00000021, 0x00000000,
3847 0x00000001, 0x00000177, 0x00000022, 0x00000000,
3848 0x00000001, 0x00000183, 0x00000023, 0x00000000,
3849 0x00000001, 0x0000018f, 0x00000000, 0x000001c2,
3850 0x000001a6, 0x00000000, 0xffffffff, 0x0000000b,
3851 0x00000024, 0x00000000, 0x00000001, 0x000001ce,
3852 0x00000025, 0x00000000, 0x00000001, 0x000001da,
3853 0x00000025, 0x00000007, 0x00000001, 0x000001e6,
3854 0x00000026, 0x00000000, 0x00000001, 0x000001f2,
3855 0x00000027, 0x00000000, 0x00000001, 0x000001fe,
3856 0x00000028, 0x00000000, 0x00000001, 0x0000020a,
3857 0x00000029, 0x00000000, 0x00000001, 0x00000216,
3858 0x0000002a, 0x00000000, 0x00000001, 0x00000222,
3859 0x0000002b, 0x00000000, 0x00000001, 0x0000022e,
3860 0x0000002c, 0x00000000, 0x00000001, 0x0000023a,
3861 0x0000002c, 0x00000007, 0x00000001, 0x00000246,
3862 0x00000000, 0x0000027b, 0x0000025f, 0x00000000,
3863 0xffffffff, 0x0000000a, 0x0000002d, 0x00000000,
3864 0x00000001, 0x00000284, 0x0000002e, 0x00000000,
3865 0x00000001, 0x00000290, 0x0000002f, 0x00000000,
3866 0x00000001, 0x0000029c, 0x00000030, 0x00000000,
3867 0x00000001, 0x000002a8, 0x00000031, 0x00000000,
3868 0x00000001, 0x000002b4, 0x00000032, 0x00000000,
3869 0x00000001, 0x000002c0, 0x00000033, 0x00000000,
3870 0x00000001, 0x000002cc, 0x00000034, 0x00000000,
3871 0x00000001, 0x000002d8, 0x00000035, 0x00000000,
3872 0x00000001, 0x000002fc, 0x00000036, 0x00000000,
3873 0x00000001, 0x00000308, 0x00000000, 0x00000314,
3874 0x00000001, 0x00000000, 0x0000031a, 0x00000006,
3875 0x00000000, 0x0000000a, 0x00000000, 0x00000001,
3876 0x00000320, 0x0000000b, 0x00000000, 0x00000001,
3877 0x00000344, 0x00000002, 0x00000000, 0x00000002,
3878 0x000001c2, 0x00000009, 0x00000000, 0x00000001,
3879 0x00000350, 0x00000001, 0x00000000, 0x00000002,
3880 0x000000ea, 0x00000000, 0x00000000, 0x00000002,
3884 static void test_effect_state_groups(void)
3886 ID3D10EffectDepthStencilVariable
*d
;
3887 ID3D10EffectRasterizerVariable
*r
;
3888 ID3D10DepthStencilState
*ds_state
;
3889 ID3D10RasterizerState
*rast_state
;
3890 ID3D10EffectTechnique
*technique
;
3891 D3D10_DEPTH_STENCIL_DESC ds_desc
;
3892 D3D10_RASTERIZER_DESC rast_desc
;
3893 D3D10_SAMPLER_DESC sampler_desc
;
3894 ID3D10EffectSamplerVariable
*s
;
3895 ID3D10BlendState
*blend_state
;
3896 UINT sample_mask
, stencil_ref
;
3897 ID3D10EffectBlendVariable
*b
;
3898 D3D10_BLEND_DESC blend_desc
;
3899 D3D10_PASS_DESC pass_desc
;
3900 ID3D10EffectVariable
*v
;
3901 ID3D10EffectPass
*pass
;
3902 float blend_factor
[4];
3903 ID3D10Effect
*effect
;
3904 ID3D10Device
*device
;
3908 if (!(device
= create_device()))
3910 skip("Failed to create device, skipping tests.\n");
3914 hr
= create_effect(fx_test_state_groups
, 0, device
, NULL
, &effect
);
3915 ok(SUCCEEDED(hr
), "Failed to create effect, hr %#x.\n", hr
);
3917 v
= effect
->lpVtbl
->GetVariableByName(effect
, "sampler0");
3918 s
= v
->lpVtbl
->AsSampler(v
);
3919 s
->lpVtbl
->GetBackingStore(s
, 0, &sampler_desc
);
3920 ok(sampler_desc
.Filter
== D3D10_FILTER_MIN_MAG_MIP_LINEAR
, "Got unexpected Filter %#x.\n", sampler_desc
.Filter
);
3921 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
3922 ok(sampler_desc
.AddressV
== D3D10_TEXTURE_ADDRESS_MIRROR
, "Got unexpected AddressV %#x.\n", sampler_desc
.AddressV
);
3923 ok(sampler_desc
.AddressW
== D3D10_TEXTURE_ADDRESS_CLAMP
, "Got unexpected AddressW %#x.\n", sampler_desc
.AddressW
);
3924 ok(sampler_desc
.MipLODBias
== -1.0f
, "Got unexpected MipLODBias %.8e.\n", sampler_desc
.MipLODBias
);
3925 ok(sampler_desc
.MaxAnisotropy
== 4, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc
.MaxAnisotropy
);
3926 ok(sampler_desc
.ComparisonFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected ComparisonFunc %#x.\n",
3927 sampler_desc
.ComparisonFunc
);
3928 ok(sampler_desc
.BorderColor
[0] == 1.0f
, "Got unexpected BorderColor[0] %.8e.\n", sampler_desc
.BorderColor
[0]);
3929 ok(sampler_desc
.BorderColor
[1] == 2.0f
, "Got unexpected BorderColor[1] %.8e.\n", sampler_desc
.BorderColor
[1]);
3930 ok(sampler_desc
.BorderColor
[2] == 3.0f
, "Got unexpected BorderColor[2] %.8e.\n", sampler_desc
.BorderColor
[2]);
3931 ok(sampler_desc
.BorderColor
[3] == 4.0f
, "Got unexpected BorderColor[3] %.8e.\n", sampler_desc
.BorderColor
[3]);
3932 ok(sampler_desc
.MinLOD
== 6.0f
, "Got unexpected MinLOD %.8e.\n", sampler_desc
.MinLOD
);
3933 ok(sampler_desc
.MaxLOD
== 5.0f
, "Got unexpected MaxLOD %.8e.\n", sampler_desc
.MaxLOD
);
3935 v
= effect
->lpVtbl
->GetVariableByName(effect
, "blend_state");
3936 b
= v
->lpVtbl
->AsBlend(v
);
3937 b
->lpVtbl
->GetBackingStore(b
, 0, &blend_desc
);
3938 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
3939 blend_desc
.AlphaToCoverageEnable
);
3940 ok(blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
3941 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
3942 ok(blend_desc
.SrcBlend
== D3D10_BLEND_ONE
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
3943 ok(blend_desc
.DestBlend
== D3D10_BLEND_SRC_COLOR
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
3944 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_MIN
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
3945 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
3946 blend_desc
.SrcBlendAlpha
);
3947 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
3948 blend_desc
.DestBlendAlpha
);
3949 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_MAX
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
3950 ok(blend_desc
.RenderTargetWriteMask
[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
3951 blend_desc
.RenderTargetWriteMask
[0]);
3952 ok(blend_desc
.RenderTargetWriteMask
[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
3953 blend_desc
.RenderTargetWriteMask
[7]);
3955 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ds_state");
3956 d
= v
->lpVtbl
->AsDepthStencil(v
);
3957 d
->lpVtbl
->GetBackingStore(d
, 0, &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_EQUAL
, "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
);
3982 v
= effect
->lpVtbl
->GetVariableByName(effect
, "rast_state");
3983 r
= v
->lpVtbl
->AsRasterizer(v
);
3984 r
->lpVtbl
->GetBackingStore(r
, 0, &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 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "tech0");
4000 ok(!!technique
, "Failed to get technique.\n");
4001 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass0");
4002 ok(!!pass
, "Failed to get pass.\n");
4003 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
4004 ok(SUCCEEDED(hr
), "Failed to get pass desc, hr %#x.\n", hr
);
4005 ok(!strcmp(pass_desc
.Name
, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc
.Name
);
4006 ok(!pass_desc
.Annotations
, "Got unexpected Annotations %#x.\n", pass_desc
.Annotations
);
4007 ok(!pass_desc
.pIAInputSignature
, "Got unexpected pIAInputSignature %p.\n", pass_desc
.pIAInputSignature
);
4008 ok(pass_desc
.StencilRef
== 1, "Got unexpected StencilRef %#x.\n", pass_desc
.StencilRef
);
4009 ok(pass_desc
.SampleMask
== 0xffff, "Got unexpected SampleMask %#x.\n", pass_desc
.SampleMask
);
4010 ok(pass_desc
.BlendFactor
[0] == 0.5f
, "Got unexpected BlendFactor[0] %.8e.\n", pass_desc
.BlendFactor
[0]);
4011 ok(pass_desc
.BlendFactor
[1] == 0.6f
, "Got unexpected BlendFactor[1] %.8e.\n", pass_desc
.BlendFactor
[1]);
4012 ok(pass_desc
.BlendFactor
[2] == 0.7f
, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc
.BlendFactor
[2]);
4013 ok(pass_desc
.BlendFactor
[3] == 0.8f
, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc
.BlendFactor
[3]);
4014 hr
= pass
->lpVtbl
->Apply(pass
, 0);
4015 ok(SUCCEEDED(hr
), "Failed to apply pass, hr %#x.\n", hr
);
4017 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
4018 ID3D10BlendState_GetDesc(blend_state
, &blend_desc
);
4019 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
4020 blend_desc
.AlphaToCoverageEnable
);
4021 ok(blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4022 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
4023 ok(blend_desc
.SrcBlend
== D3D10_BLEND_ONE
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4024 ok(blend_desc
.DestBlend
== D3D10_BLEND_SRC_COLOR
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
4025 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_MIN
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
4026 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
4027 blend_desc
.SrcBlendAlpha
);
4028 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
4029 blend_desc
.DestBlendAlpha
);
4030 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_MAX
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
4031 ok(blend_desc
.RenderTargetWriteMask
[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4032 blend_desc
.RenderTargetWriteMask
[0]);
4033 ok(blend_desc
.RenderTargetWriteMask
[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4034 blend_desc
.RenderTargetWriteMask
[7]);
4035 ok(blend_factor
[0] == 0.5f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
4036 ok(blend_factor
[1] == 0.6f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
4037 ok(blend_factor
[2] == 0.7f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
4038 ok(blend_factor
[3] == 0.8f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
4039 ok(sample_mask
== 0xffff, "Got unexpected sample_mask %#x.\n", sample_mask
);
4041 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
4042 ID3D10DepthStencilState_GetDesc(ds_state
, &ds_desc
);
4043 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4044 ok(ds_desc
.DepthWriteMask
== D3D10_DEPTH_WRITE_MASK_ZERO
, "Got unexpected DepthWriteMask %#x.\n",
4045 ds_desc
.DepthWriteMask
);
4046 ok(ds_desc
.DepthFunc
== D3D10_COMPARISON_EQUAL
, "Got unexpected DepthFunc %#x.\n", ds_desc
.DepthFunc
);
4047 ok(ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
4048 ok(ds_desc
.StencilReadMask
== 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc
.StencilReadMask
);
4049 ok(ds_desc
.StencilWriteMask
== 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc
.StencilWriteMask
);
4050 ok(ds_desc
.FrontFace
.StencilFailOp
== D3D10_STENCIL_OP_INVERT
, "Got unexpected FrontFaceStencilFail %#x.\n",
4051 ds_desc
.FrontFace
.StencilFailOp
);
4052 ok(ds_desc
.FrontFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR
,
4053 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc
.FrontFace
.StencilDepthFailOp
);
4054 ok(ds_desc
.FrontFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR
, "Got unexpected FrontFaceStencilPass %#x.\n",
4055 ds_desc
.FrontFace
.StencilPassOp
);
4056 ok(ds_desc
.FrontFace
.StencilFunc
== D3D10_COMPARISON_LESS_EQUAL
, "Got unexpected FrontFaceStencilFunc %#x.\n",
4057 ds_desc
.FrontFace
.StencilFunc
);
4058 ok(ds_desc
.BackFace
.StencilFailOp
== D3D10_STENCIL_OP_REPLACE
, "Got unexpected BackFaceStencilFail %#x.\n",
4059 ds_desc
.BackFace
.StencilFailOp
);
4060 ok(ds_desc
.BackFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR_SAT
,
4061 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc
.BackFace
.StencilDepthFailOp
);
4062 ok(ds_desc
.BackFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR_SAT
, "Got unexpected BackFaceStencilPass %#x.\n",
4063 ds_desc
.BackFace
.StencilPassOp
);
4064 ok(ds_desc
.BackFace
.StencilFunc
== D3D10_COMPARISON_GREATER_EQUAL
, "Got unexpected BackFaceStencilFunc %#x.\n",
4065 ds_desc
.BackFace
.StencilFunc
);
4066 ok(stencil_ref
== 1, "Got unexpected stencil_ref %#x.\n", stencil_ref
);
4068 ID3D10Device_RSGetState(device
, &rast_state
);
4069 ID3D10RasterizerState_GetDesc(rast_state
, &rast_desc
);
4070 ok(rast_desc
.FillMode
== D3D10_FILL_WIREFRAME
, "Got unexpected FillMode %#x.\n", rast_desc
.FillMode
);
4071 ok(rast_desc
.CullMode
== D3D10_CULL_FRONT
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4072 ok(rast_desc
.FrontCounterClockwise
, "Got unexpected FrontCounterClockwise %#x.\n",
4073 rast_desc
.FrontCounterClockwise
);
4074 ok(rast_desc
.DepthBias
== -4, "Got unexpected DepthBias %#x.\n", rast_desc
.DepthBias
);
4075 ok(rast_desc
.DepthBiasClamp
== 0.5f
, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc
.DepthBiasClamp
);
4076 ok(rast_desc
.SlopeScaledDepthBias
== 0.25f
, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4077 rast_desc
.SlopeScaledDepthBias
);
4078 ok(!rast_desc
.DepthClipEnable
, "Got unexpected DepthClipEnable %#x.\n", rast_desc
.DepthClipEnable
);
4079 ok(rast_desc
.ScissorEnable
, "Got unexpected ScissorEnable %#x.\n", rast_desc
.ScissorEnable
);
4080 ok(rast_desc
.MultisampleEnable
, "Got unexpected MultisampleEnable %#x.\n", rast_desc
.MultisampleEnable
);
4081 ok(rast_desc
.AntialiasedLineEnable
, "Got unexpected AntialiasedLineEnable %#x.\n",
4082 rast_desc
.AntialiasedLineEnable
);
4084 ID3D10RasterizerState_Release(rast_state
);
4085 ID3D10DepthStencilState_Release(ds_state
);
4086 ID3D10BlendState_Release(blend_state
);
4087 effect
->lpVtbl
->Release(effect
);
4089 refcount
= ID3D10Device_Release(device
);
4090 ok(!refcount
, "Device has %u references left.\n", refcount
);
4094 RasterizerState rast_state
{};
4095 DepthStencilState ds_state
{};
4096 BlendState blend_state
{};
4097 SamplerState sampler0
{};
4106 static DWORD fx_test_state_group_defaults
[] =
4108 0x43425844, 0x920e6905, 0x58225fcd, 0x3b65b423,
4109 0x67e96b6c, 0x00000001, 0x000001f4, 0x00000001,
4110 0x00000024, 0x30315846, 0x000001c8, 0xfeff1001,
4111 0x00000001, 0x00000000, 0x00000004, 0x00000000,
4112 0x00000000, 0x00000000, 0x00000001, 0x000000ec,
4113 0x00000000, 0x00000000, 0x00000001, 0x00000001,
4114 0x00000001, 0x00000001, 0x00000000, 0x00000000,
4115 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
4116 0x736c6162, 0x73615200, 0x69726574, 0x5372657a,
4117 0x65746174, 0x00000d00, 0x00000200, 0x00000000,
4118 0x00000000, 0x00000000, 0x00000000, 0x00000400,
4119 0x73617200, 0x74735f74, 0x00657461, 0x74706544,
4120 0x65745368, 0x6c69636e, 0x74617453, 0x00440065,
4121 0x00020000, 0x00000000, 0x00000000, 0x00000000,
4122 0x00000000, 0x00030000, 0x73640000, 0x6174735f,
4123 0x42006574, 0x646e656c, 0x74617453, 0x007b0065,
4124 0x00020000, 0x00000000, 0x00000000, 0x00000000,
4125 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65,
4126 0x74617473, 0x61530065, 0x656c706d, 0x61745372,
4127 0xae006574, 0x02000000, 0x00000000, 0x00000000,
4128 0x00000000, 0x00000000, 0x15000000, 0x73000000,
4129 0x6c706d61, 0x00307265, 0x68636574, 0x61700030,
4130 0x00307373, 0x00000004, 0x00000000, 0x00000000,
4131 0x00000000, 0xffffffff, 0x00000000, 0x00000039,
4132 0x0000001d, 0x00000000, 0xffffffff, 0x00000000,
4133 0x00000000, 0x00000072, 0x00000056, 0x00000000,
4134 0xffffffff, 0x00000000, 0x00000000, 0x000000a2,
4135 0x00000086, 0x00000000, 0xffffffff, 0x00000000,
4136 0x00000000, 0x000000d7, 0x000000bb, 0x00000000,
4137 0xffffffff, 0x00000000, 0x00000000, 0x000000e0,
4138 0x00000001, 0x00000000, 0x000000e6, 0x00000000,
4142 static void test_effect_state_group_defaults(void)
4144 ID3D10EffectDepthStencilVariable
*d
;
4145 ID3D10EffectRasterizerVariable
*r
;
4146 ID3D10EffectTechnique
*technique
;
4147 D3D10_DEPTH_STENCIL_DESC ds_desc
;
4148 D3D10_RASTERIZER_DESC rast_desc
;
4149 D3D10_SAMPLER_DESC sampler_desc
;
4150 ID3D10EffectSamplerVariable
*s
;
4151 ID3D10EffectBlendVariable
*b
;
4152 D3D10_BLEND_DESC blend_desc
;
4153 D3D10_PASS_DESC pass_desc
;
4154 ID3D10EffectVariable
*v
;
4155 ID3D10EffectPass
*pass
;
4156 ID3D10Effect
*effect
;
4157 ID3D10Device
*device
;
4161 if (!(device
= create_device()))
4163 skip("Failed to create device, skipping tests.\n");
4167 hr
= create_effect(fx_test_state_group_defaults
, 0, device
, NULL
, &effect
);
4168 ok(SUCCEEDED(hr
), "Failed to create effect, hr %#x.\n", hr
);
4170 v
= effect
->lpVtbl
->GetVariableByName(effect
, "sampler0");
4171 s
= v
->lpVtbl
->AsSampler(v
);
4172 memset(&sampler_desc
, 0, sizeof(sampler_desc
));
4173 s
->lpVtbl
->GetBackingStore(s
, 0, &sampler_desc
);
4174 ok(sampler_desc
.Filter
== D3D10_FILTER_MIN_MAG_MIP_POINT
, "Got unexpected Filter %#x.\n", sampler_desc
.Filter
);
4175 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
4176 ok(sampler_desc
.AddressV
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressV %#x.\n", sampler_desc
.AddressV
);
4177 ok(sampler_desc
.AddressW
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressW %#x.\n", sampler_desc
.AddressW
);
4178 ok(sampler_desc
.MipLODBias
== 0.0f
, "Got unexpected MipLODBias %.8e.\n", sampler_desc
.MipLODBias
);
4179 ok(sampler_desc
.MaxAnisotropy
== 16, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc
.MaxAnisotropy
);
4180 ok(sampler_desc
.ComparisonFunc
== D3D10_COMPARISON_NEVER
, "Got unexpected ComparisonFunc %#x.\n",
4181 sampler_desc
.ComparisonFunc
);
4182 ok(sampler_desc
.BorderColor
[0] == 0.0f
, "Got unexpected BorderColor[0] %.8e.\n", sampler_desc
.BorderColor
[0]);
4183 ok(sampler_desc
.BorderColor
[1] == 0.0f
, "Got unexpected BorderColor[1] %.8e.\n", sampler_desc
.BorderColor
[1]);
4184 ok(sampler_desc
.BorderColor
[2] == 0.0f
, "Got unexpected BorderColor[2] %.8e.\n", sampler_desc
.BorderColor
[2]);
4185 ok(sampler_desc
.BorderColor
[3] == 0.0f
, "Got unexpected BorderColor[3] %.8e.\n", sampler_desc
.BorderColor
[3]);
4186 ok(sampler_desc
.MinLOD
== 0.0f
, "Got unexpected MinLOD %.8e.\n", sampler_desc
.MinLOD
);
4187 ok(sampler_desc
.MaxLOD
== FLT_MAX
, "Got unexpected MaxLOD %.8e.\n", sampler_desc
.MaxLOD
);
4189 v
= effect
->lpVtbl
->GetVariableByName(effect
, "blend_state");
4190 b
= v
->lpVtbl
->AsBlend(v
);
4191 memset(&blend_desc
, 0, sizeof(blend_desc
));
4192 b
->lpVtbl
->GetBackingStore(b
, 0, &blend_desc
);
4193 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
4194 blend_desc
.AlphaToCoverageEnable
);
4195 ok(!blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4196 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
4197 ok(blend_desc
.SrcBlend
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4198 ok(blend_desc
.DestBlend
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
4199 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_ADD
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
4200 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
4201 blend_desc
.SrcBlendAlpha
);
4202 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
4203 blend_desc
.DestBlendAlpha
);
4204 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_ADD
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
4205 ok(blend_desc
.RenderTargetWriteMask
[0] == 0xf, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4206 blend_desc
.RenderTargetWriteMask
[0]);
4207 ok(blend_desc
.RenderTargetWriteMask
[7] == 0xf, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4208 blend_desc
.RenderTargetWriteMask
[7]);
4210 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ds_state");
4211 d
= v
->lpVtbl
->AsDepthStencil(v
);
4212 d
->lpVtbl
->GetBackingStore(d
, 0, &ds_desc
);
4213 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4214 ok(ds_desc
.DepthWriteMask
== D3D10_DEPTH_WRITE_MASK_ALL
, "Got unexpected DepthWriteMask %#x.\n",
4215 ds_desc
.DepthWriteMask
);
4216 ok(ds_desc
.DepthFunc
== D3D10_COMPARISON_LESS
, "Got unexpected DepthFunc %#x.\n", ds_desc
.DepthFunc
);
4217 ok(!ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
4218 ok(ds_desc
.StencilReadMask
== 0xff, "Got unexpected StencilReadMask %#x.\n", ds_desc
.StencilReadMask
);
4219 ok(ds_desc
.StencilWriteMask
== 0xff, "Got unexpected StencilWriteMask %#x.\n", ds_desc
.StencilWriteMask
);
4220 ok(ds_desc
.FrontFace
.StencilFailOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected FrontFaceStencilFail %#x.\n",
4221 ds_desc
.FrontFace
.StencilFailOp
);
4222 ok(ds_desc
.FrontFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_KEEP
,
4223 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc
.FrontFace
.StencilDepthFailOp
);
4224 ok(ds_desc
.FrontFace
.StencilPassOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected FrontFaceStencilPass %#x.\n",
4225 ds_desc
.FrontFace
.StencilPassOp
);
4226 ok(ds_desc
.FrontFace
.StencilFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected FrontFaceStencilFunc %#x.\n",
4227 ds_desc
.FrontFace
.StencilFunc
);
4228 ok(ds_desc
.BackFace
.StencilFailOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected BackFaceStencilFail %#x.\n",
4229 ds_desc
.BackFace
.StencilFailOp
);
4230 ok(ds_desc
.BackFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_KEEP
,
4231 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc
.BackFace
.StencilDepthFailOp
);
4232 ok(ds_desc
.BackFace
.StencilPassOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected BackFaceStencilPass %#x.\n",
4233 ds_desc
.BackFace
.StencilPassOp
);
4234 ok(ds_desc
.BackFace
.StencilFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected BackFaceStencilFunc %#x.\n",
4235 ds_desc
.BackFace
.StencilFunc
);
4237 v
= effect
->lpVtbl
->GetVariableByName(effect
, "rast_state");
4238 r
= v
->lpVtbl
->AsRasterizer(v
);
4239 r
->lpVtbl
->GetBackingStore(r
, 0, &rast_desc
);
4240 ok(rast_desc
.FillMode
== D3D10_FILL_SOLID
, "Got unexpected FillMode %#x.\n", rast_desc
.FillMode
);
4241 ok(rast_desc
.CullMode
== D3D10_CULL_BACK
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4242 ok(!rast_desc
.FrontCounterClockwise
, "Got unexpected FrontCounterClockwise %#x.\n",
4243 rast_desc
.FrontCounterClockwise
);
4244 ok(rast_desc
.DepthBias
== 0, "Got unexpected DepthBias %#x.\n", rast_desc
.DepthBias
);
4245 ok(rast_desc
.DepthBiasClamp
== 0.0f
, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc
.DepthBiasClamp
);
4246 ok(rast_desc
.SlopeScaledDepthBias
== 0.0f
, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4247 rast_desc
.SlopeScaledDepthBias
);
4248 ok(rast_desc
.DepthClipEnable
, "Got unexpected DepthClipEnable %#x.\n", rast_desc
.DepthClipEnable
);
4249 ok(!rast_desc
.ScissorEnable
, "Got unexpected ScissorEnable %#x.\n", rast_desc
.ScissorEnable
);
4250 ok(!rast_desc
.MultisampleEnable
, "Got unexpected MultisampleEnable %#x.\n", rast_desc
.MultisampleEnable
);
4251 ok(!rast_desc
.AntialiasedLineEnable
, "Got unexpected AntialiasedLineEnable %#x.\n",
4252 rast_desc
.AntialiasedLineEnable
);
4254 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "tech0");
4255 ok(!!technique
, "Failed to get technique.\n");
4256 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass0");
4257 ok(!!pass
, "Failed to get pass.\n");
4258 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
4259 ok(SUCCEEDED(hr
), "Failed to get pass desc, hr %#x.\n", hr
);
4260 ok(!strcmp(pass_desc
.Name
, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc
.Name
);
4261 ok(!pass_desc
.Annotations
, "Got unexpected Annotations %#x.\n", pass_desc
.Annotations
);
4262 ok(!pass_desc
.pIAInputSignature
, "Got unexpected pIAInputSignature %p.\n", pass_desc
.pIAInputSignature
);
4263 ok(pass_desc
.StencilRef
== 0, "Got unexpected StencilRef %#x.\n", pass_desc
.StencilRef
);
4264 ok(pass_desc
.SampleMask
== 0, "Got unexpected SampleMask %#x.\n", pass_desc
.SampleMask
);
4265 ok(pass_desc
.BlendFactor
[0] == 0.0f
, "Got unexpected BlendFactor[0] %.8e.\n", pass_desc
.BlendFactor
[0]);
4266 ok(pass_desc
.BlendFactor
[1] == 0.0f
, "Got unexpected BlendFactor[1] %.8e.\n", pass_desc
.BlendFactor
[1]);
4267 ok(pass_desc
.BlendFactor
[2] == 0.0f
, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc
.BlendFactor
[2]);
4268 ok(pass_desc
.BlendFactor
[3] == 0.0f
, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc
.BlendFactor
[3]);
4270 effect
->lpVtbl
->Release(effect
);
4272 refcount
= ID3D10Device_Release(device
);
4273 ok(!refcount
, "Device has %u references left.\n", refcount
);
4277 * test_effect_scalar_variable
4287 static DWORD fx_test_scalar_variable
[] =
4289 0x43425844, 0xe4da4aa6, 0x1380ddc5, 0x445edad5,
4290 0x08581666, 0x00000001, 0x0000020b, 0x00000001,
4291 0x00000024, 0x30315846, 0x000001df, 0xfeff1001,
4292 0x00000001, 0x00000006, 0x00000000, 0x00000000,
4293 0x00000000, 0x00000000, 0x00000000, 0x000000d3,
4294 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4295 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4296 0x00000000, 0x00000000, 0x00000000, 0x66006263,
4297 0x74616f6c, 0x00000700, 0x00000100, 0x00000000,
4298 0x00000400, 0x00001000, 0x00000400, 0x00090900,
4299 0x00306600, 0x00000007, 0x00000001, 0x00000002,
4300 0x00000014, 0x00000010, 0x00000008, 0x00000909,
4301 0x00615f66, 0x00746e69, 0x0000004c, 0x00000001,
4302 0x00000000, 0x00000004, 0x00000010, 0x00000004,
4303 0x00000911, 0x4c003069, 0x01000000, 0x02000000,
4304 0x14000000, 0x10000000, 0x08000000, 0x11000000,
4305 0x69000009, 0x6200615f, 0x006c6f6f, 0x0000008f,
4306 0x00000001, 0x00000000, 0x00000004, 0x00000010,
4307 0x00000004, 0x00000921, 0x8f003062, 0x01000000,
4308 0x02000000, 0x14000000, 0x10000000, 0x08000000,
4309 0x21000000, 0x62000009, 0x0400615f, 0x70000000,
4310 0x00000000, 0x06000000, 0xff000000, 0x00ffffff,
4311 0x29000000, 0x0d000000, 0x00000000, 0x00000000,
4312 0x00000000, 0x00000000, 0x00000000, 0x48000000,
4313 0x2c000000, 0x00000000, 0x10000000, 0x00000000,
4314 0x00000000, 0x00000000, 0x6c000000, 0x50000000,
4315 0x00000000, 0x24000000, 0x00000000, 0x00000000,
4316 0x00000000, 0x8b000000, 0x6f000000, 0x00000000,
4317 0x30000000, 0x00000000, 0x00000000, 0x00000000,
4318 0xb0000000, 0x94000000, 0x00000000, 0x44000000,
4319 0x00000000, 0x00000000, 0x00000000, 0xcf000000,
4320 0xb3000000, 0x00000000, 0x50000000, 0x00000000,
4321 0x00000000, 0x00000000, 0x00000000,
4324 static void test_scalar_methods(ID3D10EffectScalarVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
4327 float ret_f
, expected_f
;
4328 int ret_i
, expected_i
;
4329 BOOL ret_b
, expected_b
;
4332 hr
= var
->lpVtbl
->SetFloat(var
, 5.0f
);
4333 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4335 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
4336 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4337 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: 5.0f
;
4338 ok(ret_f
== expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
4340 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
4341 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4342 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 5;
4343 ok(ret_i
== expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
4345 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
4346 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4347 ok(ret_b
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
4349 hr
= var
->lpVtbl
->SetInt(var
, 2);
4350 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4352 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
4353 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4354 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: 2.0f
;
4355 ok(ret_f
== expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
4357 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
4358 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4359 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 2;
4360 ok(ret_i
== expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
4362 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
4363 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4364 ok(ret_b
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
4366 hr
= var
->lpVtbl
->SetBool(var
, 1);
4367 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4369 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
4370 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4371 ok(ret_f
== -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
4373 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
4374 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4375 ok(ret_i
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
4377 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
4378 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4379 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
4380 ok(ret_b
== expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
4382 hr
= var
->lpVtbl
->SetBool(var
, 32);
4383 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4385 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
4386 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4387 ok(ret_f
== -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
4389 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
4390 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4391 ok(ret_i
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
4393 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
4394 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4395 expected_b
= type
== D3D10_SVT_BOOL
? 32 : -1;
4396 ok(ret_b
== expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
4399 static void test_scalar_array_methods(ID3D10EffectScalarVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
4402 float set_f
[2], ret_f
[2], expected_f
;
4403 int set_i
[6], ret_i
[6], expected_i
, expected_i_a
[2];
4404 BOOL set_b
[2], ret_b
[2], expected_b
, expected_b_a
[6];
4408 set_f
[0] = 10.0f
; set_f
[1] = 20.0f
;
4409 hr
= var
->lpVtbl
->SetFloatArray(var
, set_f
, 0, 2);
4410 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4412 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
4413 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4414 for (i
= 0; i
< 2; ++i
)
4416 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
4417 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4420 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
4421 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4422 for (i
= 0; i
< 2; ++i
)
4424 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
4425 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4428 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
4429 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4430 for (i
= 0; i
< 2; ++i
)
4431 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4433 set_i
[0] = 5; set_i
[1] = 6;
4434 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
4435 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4437 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
4438 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4439 for (i
= 0; i
< 2; ++i
)
4441 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
4442 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4445 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
4446 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4447 for (i
= 0; i
< 2; ++i
)
4449 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
4450 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4453 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
4454 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4455 for (i
= 0; i
< 2; ++i
)
4456 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4458 set_b
[0] = 1; set_b
[1] = 1;
4459 hr
= var
->lpVtbl
->SetBoolArray(var
, set_b
, 0, 2);
4460 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4462 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
4463 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4464 for (i
= 0; i
< 2; ++i
)
4465 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4467 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
4468 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4469 for (i
= 0; i
< 2; ++i
)
4470 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4472 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
4473 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4474 for (i
= 0; i
< 2; ++i
)
4476 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
4477 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4480 set_b
[0] = 10; set_b
[1] = 20;
4481 hr
= var
->lpVtbl
->SetBoolArray(var
, set_b
, 0, 2);
4482 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4484 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
4485 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4486 for (i
= 0; i
< 2; ++i
)
4487 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4489 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
4490 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4491 for (i
= 0; i
< 2; ++i
)
4492 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4494 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
4495 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4496 for (i
= 0; i
< 2; ++i
)
4498 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
4499 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4502 /* Array offset tests. Offset argument goes unused for scalar arrays. */
4503 set_i
[0] = 0; set_i
[1] = 0;
4504 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
4505 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4507 /* After this, if offset is in use, return should be { 0, 5 }. */
4509 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 1, 1);
4510 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4512 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
4513 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4514 expected_b_a
[0] = -1; expected_b_a
[1] = 0;
4515 expected_i_a
[0] = 5; expected_i_a
[1] = 0;
4516 for (i
= 0; i
< 2; ++i
)
4518 expected_i
= type
== D3D10_SVT_BOOL
? expected_b_a
[i
] : expected_i_a
[i
];
4519 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4522 /* Test the offset on GetArray methods. If offset was in use, we'd get
4523 * back 5 given that the variable was previously set to { 0, 5 }. */
4524 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 1, 1);
4525 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4526 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 5;
4527 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
4529 /* Try setting offset larger than number of elements. */
4530 set_i
[0] = 0; set_i
[1] = 0;
4531 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
4532 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4535 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 6, 1);
4536 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4538 /* Since offset goes unused, a larger offset than the number of elements
4539 * in the array should have no effect. */
4540 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 1);
4541 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4542 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 1;
4543 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
4545 memset(ret_i
, 0, sizeof(ret_i
));
4546 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 6, 1);
4547 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4548 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 1;
4549 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
4553 /* Windows array setting function has no bounds checking, so this test
4554 * ends up writing over into the adjacent variables in the local buffer. */
4555 set_i
[0] = 1; set_i
[1] = 2; set_i
[2] = 3; set_i
[3] = 4; set_i
[4] = 5; set_i
[5] = 6;
4556 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 6);
4557 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4559 memset(ret_i
, 0, sizeof(ret_i
));
4560 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 6);
4561 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4563 expected_i_a
[0] = 1; expected_i_a
[1] = 2; expected_i_a
[2] = 0; expected_i_a
[3] = 0;
4564 expected_i_a
[4] = 0; expected_i_a
[5] = 0;
4565 expected_b_a
[0] = -1; expected_b_a
[1] = -1; expected_b_a
[2] = 0; expected_b_a
[3] = 0;
4566 expected_b_a
[4] = 0; expected_b_a
[5] = 0;
4567 for (i
= 0; i
< 6; ++i
)
4569 expected_i
= type
== D3D10_SVT_BOOL
? expected_b_a
[i
] : expected_i_a
[i
];
4570 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4575 static void test_effect_scalar_variable(void)
4580 D3D_SHADER_VARIABLE_TYPE type
;
4585 {"f0", D3D10_SVT_FLOAT
},
4586 {"i0", D3D10_SVT_INT
},
4587 {"b0", D3D10_SVT_BOOL
},
4588 {"f_a", D3D10_SVT_FLOAT
, TRUE
},
4589 {"i_a", D3D10_SVT_INT
, TRUE
},
4590 {"b_a", D3D10_SVT_BOOL
, TRUE
},
4592 D3D10_EFFECT_TYPE_DESC type_desc
;
4593 ID3D10EffectScalarVariable
*s_v
;
4594 ID3D10EffectVariable
*var
;
4595 ID3D10EffectType
*type
;
4596 ID3D10Device
*device
;
4597 ID3D10Effect
*effect
;
4602 if (!(device
= create_device()))
4604 skip("Failed to create device.\n");
4608 hr
= create_effect(fx_test_scalar_variable
, 0, device
, NULL
, &effect
);
4609 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
4611 /* Check each different scalar type, make sure the variable returned is
4612 * valid, set it to a value, and make sure what we get back is the same
4613 * as what we set it to. */
4614 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
4616 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
4617 type
= var
->lpVtbl
->GetType(var
);
4618 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
4619 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", tests
[i
].name
, hr
);
4620 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
4621 tests
[i
].name
, type_desc
.Type
);
4622 s_v
= var
->lpVtbl
->AsScalar(var
);
4623 test_scalar_methods(s_v
, tests
[i
].type
, tests
[i
].name
);
4625 test_scalar_array_methods(s_v
, tests
[i
].type
, tests
[i
].name
);
4628 effect
->lpVtbl
->Release(effect
);
4630 refcount
= ID3D10Device_Release(device
);
4631 ok(!refcount
, "Device has %u references left.\n", refcount
);
4635 * test_effect_vector_variable
4640 float4 v_f0
, v_f_a
[2];
4641 int3 v_i0
, v_i_a
[3];
4642 bool2 v_b0
, v_b_a
[4];
4645 static DWORD fx_test_vector_variable
[] =
4647 0x43425844, 0x581ae0ae, 0xa906b020, 0x26bba03e,
4648 0x5d7dfba2, 0x00000001, 0x0000021a, 0x00000001,
4649 0x00000024, 0x30315846, 0x000001ee, 0xfeff1001,
4650 0x00000001, 0x00000006, 0x00000000, 0x00000000,
4651 0x00000000, 0x00000000, 0x00000000, 0x000000e2,
4652 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4653 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4654 0x00000000, 0x00000000, 0x00000000, 0x66006263,
4655 0x74616f6c, 0x00070034, 0x00010000, 0x00000000,
4656 0x00100000, 0x00100000, 0x00100000, 0x210a0000,
4657 0x5f760000, 0x07003066, 0x01000000, 0x02000000,
4658 0x20000000, 0x10000000, 0x20000000, 0x0a000000,
4659 0x76000021, 0x615f665f, 0x746e6900, 0x00510033,
4660 0x00010000, 0x00000000, 0x000c0000, 0x00100000,
4661 0x000c0000, 0x19120000, 0x5f760000, 0x51003069,
4662 0x01000000, 0x03000000, 0x2c000000, 0x10000000,
4663 0x24000000, 0x12000000, 0x76000019, 0x615f695f,
4664 0x6f6f6200, 0x9900326c, 0x01000000, 0x00000000,
4665 0x08000000, 0x10000000, 0x08000000, 0x22000000,
4666 0x76000011, 0x0030625f, 0x00000099, 0x00000001,
4667 0x00000004, 0x00000038, 0x00000010, 0x00000020,
4668 0x00001122, 0x5f625f76, 0x00040061, 0x00c00000,
4669 0x00000000, 0x00060000, 0xffff0000, 0x0000ffff,
4670 0x002a0000, 0x000e0000, 0x00000000, 0x00000000,
4671 0x00000000, 0x00000000, 0x00000000, 0x004b0000,
4672 0x002f0000, 0x00000000, 0x00100000, 0x00000000,
4673 0x00000000, 0x00000000, 0x00720000, 0x00560000,
4674 0x00000000, 0x00300000, 0x00000000, 0x00000000,
4675 0x00000000, 0x00930000, 0x00770000, 0x00000000,
4676 0x00400000, 0x00000000, 0x00000000, 0x00000000,
4677 0x00bb0000, 0x009f0000, 0x00000000, 0x00700000,
4678 0x00000000, 0x00000000, 0x00000000, 0x00dc0000,
4679 0x00c00000, 0x00000000, 0x00800000, 0x00000000,
4680 0x00000000, 0x00000000, 0x00000000,
4683 static void test_vector_methods(ID3D10EffectVectorVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
4684 const char *name
, unsigned int components
)
4686 float set_f
[4], ret_f
[4], expected_f
, expected_f_v
[4];
4687 int set_i
[4], ret_i
[4], expected_i
, expected_i_v
[4];
4688 BOOL set_b
[4], ret_b
[4], expected_b
;
4692 set_f
[0] = 1.0f
; set_f
[1] = 2.0f
; set_f
[2] = 3.0f
; set_f
[3] = 4.0f
;
4693 hr
= var
->lpVtbl
->SetFloatVector(var
, set_f
);
4694 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4696 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
4697 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4698 for (i
= 0; i
< components
; ++i
)
4700 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
4701 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4704 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
4705 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4706 for (i
= 0; i
< components
; ++i
)
4708 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
4709 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4712 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
4713 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4714 for (i
= 0; i
< components
; ++i
)
4715 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4717 set_i
[0] = 5; set_i
[1] = 6; set_i
[2] = 7; set_i
[3] = 8;
4718 hr
= var
->lpVtbl
->SetIntVector(var
, set_i
);
4719 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4721 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
4722 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4723 for (i
= 0; i
< components
; ++i
)
4725 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
4726 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4729 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
4730 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4731 for (i
= 0; i
< components
; ++i
)
4733 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
4734 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4737 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
4738 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4739 for (i
= 0; i
< components
; ++i
)
4740 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4742 set_b
[0] = 1; set_b
[1] = 0; set_b
[2] = 1; set_b
[3] = 0;
4743 hr
= var
->lpVtbl
->SetBoolVector(var
, set_b
);
4744 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4746 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
4747 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4748 expected_f_v
[0] = -1.0f
; expected_f_v
[1] = 0.0f
; expected_f_v
[2] = -1.0f
; expected_f_v
[3] = 0.0f
;
4749 for (i
= 0; i
< components
; ++i
)
4750 ok(ret_f
[i
] == expected_f_v
[i
], "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4752 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
4753 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4754 expected_i_v
[0] = -1; expected_i_v
[1] = 0; expected_i_v
[2] = -1; expected_i_v
[3] = 0;
4755 for (i
= 0; i
< components
; ++i
)
4756 ok(ret_i
[i
] == expected_i_v
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4758 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
4759 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4760 for (i
= 0; i
< components
; ++i
)
4762 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : expected_i_v
[i
];
4763 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4766 set_b
[0] = 5; set_b
[1] = 10; set_b
[2] = 15; set_b
[3] = 20;
4767 hr
= var
->lpVtbl
->SetBoolVector(var
, set_b
);
4768 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4770 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
4771 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4772 for (i
= 0; i
< components
; ++i
)
4773 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4775 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
4776 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4777 for (i
= 0; i
< components
; ++i
)
4778 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4780 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
4781 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4782 for (i
= 0; i
< components
; ++i
)
4784 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
4785 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4789 static void test_vector_array_methods(ID3D10EffectVectorVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
4790 const char *name
, unsigned int components
, unsigned int elements
)
4792 float set_f
[9], ret_f
[9], expected_f
, expected_f_a
[9];
4793 int set_i
[9], ret_i
[9], expected_i
, expected_i_a
[9];
4794 BOOL set_b
[9], ret_b
[9], expected_b
;
4798 set_f
[0] = 1.0f
; set_f
[1] = 2.0f
; set_f
[2] = 3.0f
; set_f
[3] = 4.0f
;
4799 set_f
[4] = 5.0f
; set_f
[5] = 6.0f
; set_f
[6] = 7.0f
; set_f
[7] = 8.0f
;
4801 hr
= var
->lpVtbl
->SetFloatVectorArray(var
, set_f
, 0, elements
);
4802 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4804 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
4805 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4806 for (i
= 0; i
< components
* elements
; ++i
)
4808 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
4809 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4812 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
4813 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4814 for (i
= 0; i
< components
* elements
; ++i
)
4816 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
4817 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4820 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
4821 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4822 for (i
= 0; i
< components
* elements
; ++i
)
4823 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4825 set_i
[0] = 10; set_i
[1] = 11; set_i
[2] = 12; set_i
[3] = 13;
4826 set_i
[4] = 14; set_i
[5] = 15; set_i
[6] = 16; set_i
[7] = 17;
4828 hr
= var
->lpVtbl
->SetIntVectorArray(var
, set_i
, 0, elements
);
4829 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4831 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
4832 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4833 for (i
= 0; i
< components
* elements
; ++i
)
4835 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
4836 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4839 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
4840 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4841 for (i
= 0; i
< components
* elements
; ++i
)
4843 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
4844 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4847 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
4848 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4849 for (i
= 0; i
< components
* elements
; ++i
)
4850 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4852 set_b
[0] = 1; set_b
[1] = 0; set_b
[2] = 1; set_b
[3] = 1;
4853 set_b
[4] = 1; set_b
[5] = 0; set_b
[6] = 0; set_b
[7] = 1;
4855 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
4856 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4858 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
4859 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4860 expected_f_a
[0] = -1.0f
; expected_f_a
[1] = 0.0f
; expected_f_a
[2] = -1.0f
; expected_f_a
[3] = -1.0f
;
4861 expected_f_a
[4] = -1.0f
; expected_f_a
[5] = 0.0f
; expected_f_a
[6] = 0.0f
; expected_f_a
[7] = -1.0f
;
4862 expected_f_a
[8] = -1.0f
;
4863 for (i
= 0; i
< components
* elements
; ++i
)
4864 ok(ret_f
[i
] == expected_f_a
[i
], "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4866 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
4867 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4868 expected_i_a
[0] = -1; expected_i_a
[1] = 0; expected_i_a
[2] = -1; expected_i_a
[3] = -1;
4869 expected_i_a
[4] = -1; expected_i_a
[5] = 0; expected_i_a
[6] = 0; expected_i_a
[7] = -1;
4870 expected_i_a
[8] = -1;
4871 for (i
= 0; i
< components
* elements
; ++i
)
4872 ok(ret_i
[i
] == expected_i_a
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4874 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
4875 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4876 for (i
= 0; i
< components
* elements
; ++i
)
4878 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : expected_i_a
[i
];
4879 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4882 set_b
[0] = 5; set_b
[1] = 10; set_b
[2] = 15; set_b
[3] = 20;
4883 set_b
[4] = 25; set_b
[5] = 30; set_b
[6] = 35; set_b
[7] = 40;
4885 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
4886 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4888 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
4889 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4890 for (i
= 0; i
< components
* elements
; ++i
)
4891 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4893 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
4894 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4895 for (i
= 0; i
< components
* elements
; ++i
)
4896 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4898 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
4899 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4900 for (i
= 0; i
< components
* elements
; ++i
)
4902 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
4903 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4906 /* According to MSDN, the offset argument goes unused for VectorArray
4907 * methods, same as the ScalarArray methods. This test shows that's not
4909 set_b
[0] = 0; set_b
[1] = 0; set_b
[2] = 0; set_b
[3] = 0;
4910 set_b
[4] = 0; set_b
[5] = 0; set_b
[6] = 0; set_b
[7] = 0;
4912 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
4913 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4915 set_b
[0] = 1; set_b
[1] = 1; set_b
[2] = 1; set_b
[3] = 1;
4916 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 1, 1);
4917 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4919 /* If the previous offset of 1 worked, then the first vector value of the
4920 * array should still be false. */
4921 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, 1);
4922 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4923 for (i
= 0; i
< components
; ++i
)
4924 ok(ret_f
[i
] == 0, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4926 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, 1);
4927 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4928 for (i
= 0; i
< components
; ++i
)
4929 ok(ret_i
[i
] == 0, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4931 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, 1);
4932 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4933 for (i
= 0; i
< components
; ++i
)
4934 ok(!ret_b
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4936 /* Test the GetFloatVectorArray offset argument. If it works, we should
4937 * get a vector with all values set to true. */
4938 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 1, 1);
4939 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4940 for (i
= 0; i
< components
; ++i
)
4941 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
4943 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 1, 1);
4944 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4945 for (i
= 0; i
< components
; ++i
)
4946 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
4948 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 1, 1);
4949 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4950 for (i
= 0; i
< components
; ++i
)
4952 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
4953 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4958 /* Windows array setting function has no bounds checking on offset values
4959 * either, so this ends up writing into adjacent variables. */
4960 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, elements
+ 1, 1);
4961 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4963 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, elements
+ 1, 1);
4964 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
4965 for (i
= 0; i
< components
; ++i
)
4967 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
4968 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
4973 static void test_effect_vector_variable(void)
4978 D3D_SHADER_VARIABLE_TYPE type
;
4979 unsigned int components
;
4980 unsigned int elements
;
4984 {"v_f0", D3D10_SVT_FLOAT
, 4, 1},
4985 {"v_i0", D3D10_SVT_INT
, 3, 1},
4986 {"v_b0", D3D10_SVT_BOOL
, 2, 1},
4987 {"v_f_a", D3D10_SVT_FLOAT
, 4, 2},
4988 {"v_i_a", D3D10_SVT_INT
, 3, 3},
4989 {"v_b_a", D3D10_SVT_BOOL
, 2, 4},
4991 ID3D10EffectVectorVariable
*v_var
;
4992 D3D10_EFFECT_TYPE_DESC type_desc
;
4993 ID3D10EffectVariable
*var
;
4994 ID3D10EffectType
*type
;
4995 ID3D10Device
*device
;
4996 ID3D10Effect
*effect
;
5001 if (!(device
= create_device()))
5003 skip("Failed to create device.\n");
5007 hr
= create_effect(fx_test_vector_variable
, 0, device
, NULL
, &effect
);
5008 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5010 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
5012 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
5013 type
= var
->lpVtbl
->GetType(var
);
5014 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
5015 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", tests
[i
].name
, hr
);
5016 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
5017 tests
[i
].name
, type_desc
.Type
);
5018 v_var
= var
->lpVtbl
->AsVector(var
);
5019 test_vector_methods(v_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].components
);
5020 if (tests
[i
].elements
> 1)
5021 test_vector_array_methods(v_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].components
, tests
[i
].elements
);
5024 effect
->lpVtbl
->Release(effect
);
5026 refcount
= ID3D10Device_Release(device
);
5027 ok(!refcount
, "Device has %u references left.\n", refcount
);
5031 * test_effect_matrix_variable
5039 row_major int2x3 m_i0
;
5046 static DWORD fx_test_matrix_variable
[] =
5048 0x43425844, 0xc95a5c42, 0xa138d3cb, 0x8a4ef493,
5049 0x3515b7ee, 0x00000001, 0x000001e2, 0x00000001,
5050 0x00000024, 0x30315846, 0x000001b6, 0xfeff1001,
5051 0x00000001, 0x00000005, 0x00000000, 0x00000000,
5052 0x00000000, 0x00000000, 0x00000000, 0x000000c6,
5053 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5054 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5055 0x00000000, 0x00000000, 0x00000000, 0x66006263,
5056 0x74616f6c, 0x00347834, 0x00000007, 0x00000001,
5057 0x00000000, 0x00000040, 0x00000040, 0x00000040,
5058 0x0000640b, 0x30665f6d, 0x00000700, 0x00000100,
5059 0x00000200, 0x00008000, 0x00004000, 0x00008000,
5060 0x00640b00, 0x665f6d00, 0x6900615f, 0x7832746e,
5061 0x00530033, 0x00010000, 0x00000000, 0x001c0000,
5062 0x00200000, 0x00180000, 0x1a130000, 0x5f6d0000,
5063 0x62003069, 0x336c6f6f, 0x7b003278, 0x01000000,
5064 0x00000000, 0x1c000000, 0x20000000, 0x18000000,
5065 0x23000000, 0x6d000053, 0x0030625f, 0x0000007b,
5066 0x00000001, 0x00000002, 0x0000003c, 0x00000020,
5067 0x00000030, 0x00005323, 0x5f625f6d, 0x00040061,
5068 0x01400000, 0x00000000, 0x00050000, 0xffff0000,
5069 0x0000ffff, 0x002c0000, 0x00100000, 0x00000000,
5070 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5071 0x004d0000, 0x00310000, 0x00000000, 0x00400000,
5072 0x00000000, 0x00000000, 0x00000000, 0x00760000,
5073 0x005a0000, 0x00000000, 0x00c00000, 0x00000000,
5074 0x00000000, 0x00000000, 0x009f0000, 0x00830000,
5075 0x00000000, 0x00e00000, 0x00000000, 0x00000000,
5076 0x00000000, 0x00c00000, 0x00a40000, 0x00000000,
5077 0x01000000, 0x00000000, 0x00000000, 0x00000000,
5086 static void set_test_matrix(struct d3d10_matrix
*m
, D3D10_SHADER_VARIABLE_TYPE type
,
5087 unsigned int row_count
, unsigned int col_count
, unsigned int elements
)
5089 unsigned int row
, col
, elem
;
5094 memset(m
, 0, elements
* sizeof(*m
));
5097 case D3D10_SVT_FLOAT
:
5099 for (elem
= 0; elem
< elements
; ++elem
)
5101 for (row
= 0; row
< row_count
; ++row
)
5103 for (col
= 0; col
< col_count
; ++col
)
5105 m
[elem
].m
[row
][col
] = tmp_f
;
5114 for (elem
= 0; elem
< elements
; ++elem
)
5116 for (row
= 0; row
< row_count
; ++row
)
5118 for (col
= 0; col
< col_count
; ++col
)
5120 m
[elem
].m
[row
][col
] = *(float *)&tmp_i
;
5127 case D3D10_SVT_BOOL
:
5129 for (elem
= 0; elem
< elements
; ++elem
)
5132 for (row
= 0; row
< row_count
; ++row
)
5134 for (col
= 0; col
< col_count
; ++col
)
5136 m
[elem
].m
[row
][col
] = *(float *)&tmp_b
;
5148 static void transpose_matrix(struct d3d10_matrix
*src
, struct d3d10_matrix
*dst
,
5149 unsigned int row_count
, unsigned int col_count
)
5151 unsigned int row
, col
;
5153 for (row
= 0; row
< col_count
; ++row
)
5155 for (col
= 0; col
< row_count
; ++col
)
5156 dst
->m
[row
][col
] = src
->m
[col
][row
];
5160 static void compare_matrix(const char *name
, unsigned int line
, struct d3d10_matrix
*a
,
5161 struct d3d10_matrix
*b
, unsigned int row_count
, unsigned int col_count
, BOOL transpose
)
5163 unsigned int row
, col
;
5166 for (row
= 0; row
< row_count
; ++row
)
5168 for (col
= 0; col
< col_count
; ++col
)
5170 tmp
= !transpose
? b
->m
[row
][col
] : b
->m
[col
][row
];
5171 ok_(__FILE__
, line
)(a
->m
[row
][col
] == tmp
,
5172 "Variable %s (%u, %u), got unexpected value 0x%08x.\n", name
, row
, col
,
5173 *(unsigned int *)&tmp
);
5178 static void test_matrix_methods(ID3D10EffectMatrixVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5179 const char *name
, unsigned int row_count
, unsigned int col_count
)
5181 struct d3d10_matrix m_set
, m_ret
, m_expected
;
5184 set_test_matrix(&m_set
, type
, row_count
, col_count
, 1);
5186 hr
= var
->lpVtbl
->SetMatrix(var
, &m_set
.m
[0][0]);
5187 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5189 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5190 hr
= var
->lpVtbl
->GetMatrix(var
, &m_ret
.m
[0][0]);
5191 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5192 compare_matrix(name
, __LINE__
, &m_set
, &m_ret
, row_count
, col_count
, FALSE
);
5194 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5195 hr
= var
->lpVtbl
->GetMatrixTranspose(var
, &m_ret
.m
[0][0]);
5196 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5197 compare_matrix(name
, __LINE__
, &m_set
, &m_ret
, row_count
, col_count
, TRUE
);
5199 hr
= var
->lpVtbl
->SetMatrixTranspose(var
, &m_set
.m
[0][0]);
5200 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5202 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5203 hr
= var
->lpVtbl
->GetMatrix(var
, &m_ret
.m
[0][0]);
5204 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5205 compare_matrix(name
, __LINE__
, &m_ret
, &m_set
, row_count
, col_count
, TRUE
);
5207 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5208 memset(&m_expected
.m
[0][0], 0, sizeof(m_expected
));
5209 hr
= var
->lpVtbl
->GetMatrixTranspose(var
, &m_ret
.m
[0][0]);
5210 transpose_matrix(&m_set
, &m_expected
, row_count
, col_count
);
5211 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5212 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
, row_count
, col_count
, TRUE
);
5215 static void test_matrix_array_methods(ID3D10EffectMatrixVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5216 const char *name
, unsigned int row_count
, unsigned int col_count
, unsigned int elements
)
5218 struct d3d10_matrix m_set
[2], m_ret
[2], m_expected
;
5222 set_test_matrix(&m_set
[0], type
, row_count
, col_count
, elements
);
5224 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], 0, elements
);
5225 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5227 memset(m_ret
, 0, sizeof(m_ret
));
5228 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5229 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5230 for (i
= 0; i
< elements
; ++i
)
5231 compare_matrix(name
, __LINE__
, &m_set
[i
], &m_ret
[i
], row_count
, col_count
, FALSE
);
5233 memset(m_ret
, 0, sizeof(m_ret
));
5234 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5235 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5236 for (i
= 0; i
< elements
; ++i
)
5237 compare_matrix(name
, __LINE__
, &m_set
[i
], &m_ret
[i
], row_count
, col_count
, TRUE
);
5239 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], 0, elements
);
5240 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5242 memset(m_ret
, 0, sizeof(m_ret
));
5243 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5244 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5245 for (i
= 0; i
< elements
; ++i
)
5246 compare_matrix(name
, __LINE__
, &m_ret
[i
], &m_set
[i
], row_count
, col_count
, TRUE
);
5248 memset(m_ret
, 0, sizeof(m_ret
));
5249 memset(&m_expected
, 0, sizeof(m_expected
));
5250 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5251 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5252 for (i
= 0; i
< elements
; ++i
)
5254 memset(&m_expected
, 0, sizeof(m_expected
));
5255 transpose_matrix(&m_set
[i
], &m_expected
, row_count
, col_count
);
5256 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[i
], row_count
, col_count
, TRUE
);
5260 memset(m_ret
, 0, sizeof(m_ret
));
5261 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5263 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], 1, 1);
5264 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5266 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 1, 1);
5267 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5268 compare_matrix(name
, __LINE__
, &m_ret
[0], &m_set
[0], row_count
, col_count
, FALSE
);
5270 memset(m_ret
, 0, sizeof(m_ret
));
5271 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5273 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], 1, 1);
5274 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5276 memset(&m_expected
, 0, sizeof(m_expected
));
5277 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 1, 1);
5278 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5279 transpose_matrix(&m_set
[0], &m_expected
, row_count
, col_count
);
5280 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
5284 /* Like vector array functions, matrix array functions will allow for
5285 * writing out of bounds into adjacent memory. */
5286 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], elements
+ 1, 1);
5287 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5289 memset(m_ret
, 0, sizeof(m_ret
));
5290 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], elements
+ 1, 1);
5291 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5292 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
5294 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], elements
+ 1, 1);
5295 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5297 memset(&m_expected
, 0, sizeof(m_expected
));
5298 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], elements
+ 1, 1);
5299 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", name
, hr
);
5300 transpose_matrix(&m_set
[0], &m_expected
, row_count
, col_count
);
5301 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
5305 static void test_effect_matrix_variable(void)
5310 D3D_SHADER_VARIABLE_TYPE type
;
5312 unsigned int columns
;
5313 unsigned int elements
;
5317 {"m_f0", D3D10_SVT_FLOAT
, 4, 4, 1},
5318 {"m_i0", D3D10_SVT_INT
, 2, 3, 1},
5319 {"m_b0", D3D10_SVT_BOOL
, 3, 2, 1},
5320 {"m_f_a", D3D10_SVT_FLOAT
, 4, 4, 2},
5321 {"m_b_a", D3D10_SVT_BOOL
, 3, 2, 2},
5323 ID3D10EffectMatrixVariable
*m_var
;
5324 D3D10_EFFECT_TYPE_DESC type_desc
;
5325 ID3D10EffectVariable
*var
;
5326 ID3D10EffectType
*type
;
5327 ID3D10Device
*device
;
5328 ID3D10Effect
*effect
;
5333 if (!(device
= create_device()))
5335 skip("Failed to create device, skipping tests.\n");
5339 hr
= create_effect(fx_test_matrix_variable
, 0, device
, NULL
, &effect
);
5340 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5342 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
5344 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
5345 type
= var
->lpVtbl
->GetType(var
);
5346 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
5347 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#x.\n", tests
[i
].name
, hr
);
5348 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
5349 tests
[i
].name
, type_desc
.Type
);
5350 m_var
= var
->lpVtbl
->AsMatrix(var
);
5351 test_matrix_methods(m_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].rows
, tests
[i
].columns
);
5352 if (tests
[i
].elements
> 1)
5353 test_matrix_array_methods(m_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].rows
, tests
[i
].columns
,
5357 effect
->lpVtbl
->Release(effect
);
5359 refcount
= ID3D10Device_Release(device
);
5360 ok(!refcount
, "Device has %u references left.\n", refcount
);
5364 * test_effect_resource_variable
5370 float4
VS( float4 Pos
: POSITION
) : SV_POSITION
{ return float4(1.0f
, 1.0f
, 1.0f
, 1.0f
); }
5372 float4
PS( float4 Pos
: SV_POSITION
) : SV_Target
5376 tmp
= t0
.Load(int3(0, 0, 0));
5377 tmp
= t_a
[0].Load(int4(0, 0, 0, 0));
5378 tmp
= t_a
[1].Load(int4(0, 0, 0, 0));
5379 return float4(1.0f
, 1.0f
, 0.0f
, 1.0f
) + tmp
;
5382 technique10 rsrc_test
5386 SetVertexShader(CompileShader(vs_4_0
, VS()));
5387 SetPixelShader(CompileShader(ps_4_0
, PS()));
5391 static DWORD fx_test_resource_variable
[] =
5393 0x43425844, 0x767a8421, 0xdcbfffe6, 0x83df123d, 0x189ce72a, 0x00000001, 0x0000065a, 0x00000001,
5394 0x00000024, 0x30315846, 0x0000062e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000,
5395 0x00000000, 0x00000000, 0x00000001, 0x00000582, 0x00000000, 0x00000003, 0x00000000, 0x00000000,
5396 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x74786554,
5397 0x32657275, 0x00040044, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000,
5398 0x30740000, 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000c00,
5399 0x615f7400, 0x72737200, 0x65745f63, 0x70007473, 0x01b40030, 0x58440000, 0x338d4342, 0xc5a69f46,
5400 0x56883ae5, 0xa98fccc2, 0x00018ead, 0x01b40000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
5401 0x00f40000, 0x01380000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
5402 0x04000000, 0x0100fffe, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
5403 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131,
5404 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000,
5405 0x00000000, 0x000f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab, 0x002c4e47, 0x00010000,
5406 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
5407 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001, 0x00670000, 0x20f20400,
5408 0x00000010, 0x00010000, 0x00360000, 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80,
5409 0x00003f80, 0x00003f80, 0x003e3f80, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
5410 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
5411 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5412 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5413 0x00000000, 0x00000000, 0x005a0000, 0x00000000, 0x035c0000, 0x58440000, 0xe3754342, 0x3e477f40,
5414 0xed6f143f, 0xf16d26ce, 0x00010c3a, 0x035c0000, 0x00050000, 0x00340000, 0x00d00000, 0x01040000,
5415 0x01380000, 0x02e00000, 0x44520000, 0x00944645, 0x00000000, 0x00000000, 0x00020000, 0x001c0000,
5416 0x04000000, 0x0100ffff, 0x00630000, 0x005c0000, 0x00020000, 0x00050000, 0x00040000, 0xffff0000,
5417 0x0000ffff, 0x00010000, 0x000c0000, 0x005f0000, 0x00020000, 0x00050000, 0x00040000, 0xffff0000,
5418 0x0001ffff, 0x00020000, 0x000c0000, 0x30740000, 0x615f7400, 0x63694d00, 0x6f736f72, 0x28207466,
5419 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e,
5420 0x3131332e, 0x53490031, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000,
5421 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47,
5422 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000,
5423 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x01a05244, 0x00400000, 0x00680000, 0x18580000,
5424 0x70000400, 0x00000010, 0x55550000, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x18580000,
5425 0x70000400, 0x00020010, 0x55550000, 0x00650000, 0x20f20300, 0x00000010, 0x00680000, 0x00020200,
5426 0x002d0000, 0x00f20a00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5427 0x7e460000, 0x00000010, 0x001c0000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x00560000,
5428 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x002d0000, 0x00f20a00, 0x00010010, 0x40020000,
5429 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x00000000, 0x00f20700,
5430 0x00000010, 0x0e460000, 0x00000010, 0x0e460000, 0x00010010, 0x001c0000, 0x00f20500, 0x00000010,
5431 0x0e460000, 0x00000010, 0x00560000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x002d0000,
5432 0x00f20a00, 0x00010010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7e460000,
5433 0x00020010, 0x00000000, 0x00f20700, 0x00000010, 0x0e460000, 0x00000010, 0x0e460000, 0x00010010,
5434 0x001c0000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x00560000, 0x00f20500, 0x00000010,
5435 0x0e460000, 0x00000010, 0x00000000, 0x20f20a00, 0x00000010, 0x0e460000, 0x00000010, 0x40020000,
5436 0x00000000, 0x00003f80, 0x00003f80, 0x00000000, 0x003e3f80, 0x54530100, 0x00745441, 0x000d0000,
5437 0x00020000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x00000000, 0x00010000, 0x00000000,
5438 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5439 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00060000, 0x00000000, 0x00000000, 0x00000000,
5440 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x021a0000, 0x00000000, 0x002a0000, 0x000e0000,
5441 0x00000000, 0xffff0000, 0x0000ffff, 0x00490000, 0x002d0000, 0x00000000, 0xffff0000, 0x0000ffff,
5442 0x004d0000, 0x00010000, 0x00000000, 0x00570000, 0x00020000, 0x00000000, 0x00060000, 0x00000000,
5443 0x00070000, 0x02120000, 0x00070000, 0x00000000, 0x00070000, 0x057a0000, 0x00000000,
5446 static void create_effect_texture_resource(ID3D10Device
*device
, ID3D10ShaderResourceView
**srv
,
5447 ID3D10Texture2D
**tex
)
5449 D3D10_TEXTURE2D_DESC tex_desc
;
5452 tex_desc
.Format
= DXGI_FORMAT_R8G8B8A8_UNORM
;
5454 tex_desc
.Height
= 8;
5455 tex_desc
.ArraySize
= 1;
5456 tex_desc
.MipLevels
= 0;
5457 tex_desc
.BindFlags
= D3D10_BIND_SHADER_RESOURCE
;
5458 tex_desc
.Usage
= D3D10_USAGE_DEFAULT
;
5459 tex_desc
.CPUAccessFlags
= 0;
5460 tex_desc
.SampleDesc
.Count
= 1;
5461 tex_desc
.SampleDesc
.Quality
= 0;
5462 tex_desc
.MiscFlags
= 0;
5464 hr
= ID3D10Device_CreateTexture2D(device
, &tex_desc
, NULL
, tex
);
5465 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5466 hr
= ID3D10Device_CreateShaderResourceView(device
, (ID3D10Resource
*)*tex
, NULL
, srv
);
5467 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5470 #define get_effect_shader_resource_variable(a) get_effect_shader_resource_variable_(__LINE__, a)
5471 static ID3D10EffectShaderResourceVariable
*get_effect_shader_resource_variable_(unsigned int line
,
5472 ID3D10EffectVariable
*var
)
5474 D3D10_EFFECT_TYPE_DESC type_desc
;
5475 ID3D10EffectType
*type
;
5478 type
= var
->lpVtbl
->GetType(var
);
5479 ok_(__FILE__
, line
)(!!type
, "Got unexpected type %p.\n", type
);
5480 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
5481 ok_(__FILE__
, line
)(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5482 ok_(__FILE__
, line
)(type_desc
.Type
== D3D10_SVT_TEXTURE2D
, "Type is %x, expected %x.\n",
5483 type_desc
.Type
, D3D10_SVT_TEXTURE2D
);
5484 return var
->lpVtbl
->AsShaderResource(var
);
5487 static void test_effect_resource_variable(void)
5489 ID3D10ShaderResourceView
*srv0
, *srv_a
[2], *srv_tmp
[2];
5490 ID3D10EffectShaderResourceVariable
*t0
, *t_a
, *t_a_0
;
5491 ID3D10EffectTechnique
*technique
;
5492 ID3D10Texture2D
*tex0
, *tex_a
[2];
5493 ID3D10EffectVariable
*var
;
5494 ID3D10EffectPass
*pass
;
5495 ID3D10Device
*device
;
5496 ID3D10Effect
*effect
;
5501 if (!(device
= create_device()))
5503 skip("Failed to create device.\n");
5507 hr
= create_effect(fx_test_resource_variable
, 0, device
, NULL
, &effect
);
5508 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5510 var
= effect
->lpVtbl
->GetVariableByName(effect
, "t0");
5511 t0
= get_effect_shader_resource_variable(var
);
5512 create_effect_texture_resource(device
, &srv0
, &tex0
);
5513 hr
= t0
->lpVtbl
->SetResource(t0
, srv0
);
5514 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5516 var
= effect
->lpVtbl
->GetVariableByName(effect
, "t_a");
5517 t_a
= get_effect_shader_resource_variable(var
);
5518 for (i
= 0; i
< 2; ++i
)
5519 create_effect_texture_resource(device
, &srv_a
[i
], &tex_a
[i
]);
5520 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 0, 2);
5521 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5523 /* Apply the pass to bind the resource to the shader. */
5524 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "rsrc_test");
5525 ok(!!technique
, "Got unexpected technique %p.\n", technique
);
5526 pass
= technique
->lpVtbl
->GetPassByName(technique
, "p0");
5527 ok(!!pass
, "Got unexpected pass %p.\n", pass
);
5528 hr
= pass
->lpVtbl
->Apply(pass
, 0);
5529 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5531 ID3D10Device_PSGetShaderResources(device
, 0, 1, &srv_tmp
[0]);
5532 ok(srv_tmp
[0] == srv0
, "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
5533 ID3D10ShaderResourceView_Release(srv_tmp
[0]);
5535 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
5536 for (i
= 0; i
< 2; ++i
)
5538 ok(srv_tmp
[i
] == srv_a
[i
], "Got unexpected shader resource view %p.\n", srv_tmp
[i
]);
5539 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
5542 /* Test individual array element variable SetResource. */
5543 var
= t_a
->lpVtbl
->GetElement(t_a
, 1);
5544 t_a_0
= get_effect_shader_resource_variable(var
);
5545 hr
= t_a_0
->lpVtbl
->SetResource(t_a_0
, srv0
);
5546 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5548 hr
= pass
->lpVtbl
->Apply(pass
, 0);
5549 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5551 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
5552 ok(srv_tmp
[0] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
5553 ok(srv_tmp
[1] == srv0
, "Got unexpected shader resource view %p.\n", srv_tmp
[1]);
5554 for (i
= 0; i
< 2; ++i
)
5555 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
5558 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 1, 1);
5559 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5561 hr
= pass
->lpVtbl
->Apply(pass
, 0);
5562 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5564 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
5565 ok(srv_tmp
[0] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
5566 ok(srv_tmp
[1] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[1]);
5567 for (i
= 0; i
< 2; ++i
)
5568 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
5572 /* This crashes on Windows. */
5573 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 2, 2);
5574 ok(hr
== S_OK
, "Got unexpected hr %#x.\n", hr
);
5577 ID3D10ShaderResourceView_Release(srv0
);
5578 ID3D10Texture2D_Release(tex0
);
5579 for (i
= 0; i
< 2; ++i
)
5581 ID3D10ShaderResourceView_Release(srv_a
[i
]);
5582 ID3D10Texture2D_Release(tex_a
[i
]);
5585 effect
->lpVtbl
->Release(effect
);
5587 refcount
= ID3D10Device_Release(device
);
5588 ok(!refcount
, "Device has %u references left.\n", refcount
);
5593 test_effect_constant_buffer_type();
5594 test_effect_variable_type();
5595 test_effect_variable_member();
5596 test_effect_variable_element();
5597 test_effect_variable_type_class();
5598 test_effect_constant_buffer_stride();
5599 test_effect_local_shader();
5600 test_effect_get_variable_by();
5601 test_effect_state_groups();
5602 test_effect_state_group_defaults();
5603 test_effect_scalar_variable();
5604 test_effect_vector_variable();
5605 test_effect_matrix_variable();
5606 test_effect_resource_variable();