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"
27 #define D3DERR_INVALIDCALL 0x8876086c
29 static void set_vec4(float *v
, float x
, float y
, float z
, float w
)
37 static void set_int4(int *v
, int x
, int y
, int z
, int w
)
45 static ULONG
get_refcount(void *iface
)
47 IUnknown
*unknown
= iface
;
48 IUnknown_AddRef(unknown
);
49 return IUnknown_Release(unknown
);
52 static ID3D10Device
*create_device(void)
56 if (SUCCEEDED(D3D10CreateDevice(NULL
, D3D10_DRIVER_TYPE_HARDWARE
, NULL
, 0, D3D10_SDK_VERSION
, &device
)))
58 if (SUCCEEDED(D3D10CreateDevice(NULL
, D3D10_DRIVER_TYPE_WARP
, NULL
, 0, D3D10_SDK_VERSION
, &device
)))
60 if (SUCCEEDED(D3D10CreateDevice(NULL
, D3D10_DRIVER_TYPE_REFERENCE
, NULL
, 0, D3D10_SDK_VERSION
, &device
)))
66 static inline HRESULT
create_effect(DWORD
*data
, UINT flags
, ID3D10Device
*device
, ID3D10EffectPool
*effect_pool
, ID3D10Effect
**effect
)
69 * Don't use sizeof(data), use data[6] as size,
70 * because the DWORD data[] has only complete DWORDs and
71 * so it could happen that there are padded bytes at the end.
73 * The fx size (data[6]) could be up to 3 BYTEs smaller
74 * than the sizeof(data).
76 return D3D10CreateEffectFromMemory(data
, data
[6], flags
, device
, effect_pool
, effect
);
79 static HRESULT
create_effect_pool(DWORD
*data
, ID3D10Device
*device
, ID3D10EffectPool
**pool
)
81 return D3D10CreateEffectPoolFromMemory(data
, data
[6], 0, device
, pool
);
85 * test_effect_constant_buffer_type
88 cbuffer cb
: register(b1
)
90 float f1
: SV_POSITION
;
94 cbuffer cb2
: register(b0
)
96 float f3
: packoffset(c2
);
99 static DWORD fx_test_ecbt
[] =
101 0x43425844, 0x7cfb8cde, 0x31ec2d95, 0x38500042, 0xa9330c67, 0x00000001, 0x00000145, 0x00000001,
102 0x00000024, 0x30315846, 0x00000119, 0xfeff1001, 0x00000002, 0x00000003, 0x00000000, 0x00000000,
103 0x00000000, 0x00000000, 0x00000000, 0x00000049, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
104 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
105 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
106 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032,
107 0x00000400, 0x00001000, 0x00000000, 0x00000200, 0x00000100, 0x00000000, 0x00002900, 0x00000d00,
108 0x00002c00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00003800, 0x00000d00, 0x00003b00,
109 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00004200, 0x00003000, 0x00000000, 0x00000100,
110 0x00000000, 0x00000000, 0x00004600, 0x00000d00, 0x00000000, 0x00002000, 0x00000000, 0x00000400,
111 0x00000000, 0x00000000,
114 static void test_effect_constant_buffer_type(void)
116 ID3D10Effect
*effect
;
117 ID3D10EffectConstantBuffer
*constantbuffer
;
118 ID3D10EffectType
*type
, *type2
, *null_type
;
119 D3D10_EFFECT_VARIABLE_DESC var_desc
;
120 D3D10_EFFECT_TYPE_DESC type_desc
;
121 D3D10_BUFFER_DESC buffer_desc
;
122 ID3D10ShaderResourceView
*srv
;
123 ID3D10EffectVariable
*v
;
124 D3D10_EFFECT_DESC desc
;
125 ID3D10Device
*device
;
126 ID3D10Buffer
*buffer
;
132 if (!(device
= create_device()))
134 skip("Failed to create device, skipping tests.\n");
138 hr
= create_effect(fx_test_ecbt
, 0, NULL
, NULL
, &effect
);
139 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
141 hr
= create_effect(fx_test_ecbt
, 0, device
, NULL
, &effect
);
142 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
144 hr
= effect
->lpVtbl
->GetDesc(effect
, NULL
);
145 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
147 hr
= effect
->lpVtbl
->GetDesc(effect
, &desc
);
148 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
149 ok(!desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
150 ok(desc
.ConstantBuffers
== 2, "Unexpected constant buffers count %u.\n", desc
.ConstantBuffers
);
151 ok(desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
152 desc
.SharedConstantBuffers
);
153 ok(desc
.GlobalVariables
== 3, "Unexpected global variables count %u.\n", desc
.GlobalVariables
);
154 ok(desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
155 desc
.SharedGlobalVariables
);
156 ok(desc
.Techniques
== 0, "Unexpected techniques count %u.\n", desc
.Techniques
);
158 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
160 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &var_desc
);
161 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
162 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
, "Unexpected variable flags %#x.\n", var_desc
.Flags
);
163 ok(var_desc
.ExplicitBindPoint
== 1, "Unexpected bind point %#x.\n", var_desc
.ExplicitBindPoint
);
165 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
167 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
168 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
170 ok(strcmp(type_desc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc
.TypeName
);
171 ok(type_desc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_OBJECT
);
172 ok(type_desc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_CBUFFER
);
173 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
174 ok(type_desc
.Members
== 2, "Members is %u, expected 2\n", type_desc
.Members
);
175 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
176 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
177 ok(type_desc
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", type_desc
.PackedSize
);
178 ok(type_desc
.UnpackedSize
== 0x10, "UnpackedSize is %#x, expected 0x10\n", type_desc
.UnpackedSize
);
179 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
181 hr
= constantbuffer
->lpVtbl
->GetConstantBuffer(constantbuffer
, &buffer
);
182 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
183 ID3D10Buffer_GetDesc(buffer
, &buffer_desc
);
184 ok(buffer_desc
.ByteWidth
== type_desc
.UnpackedSize
, "Unexpected buffer size %u.\n", buffer_desc
.ByteWidth
);
185 ok(!buffer_desc
.Usage
, "Unexpected buffer usage %u.\n", buffer_desc
.Usage
);
186 ok(buffer_desc
.BindFlags
== D3D10_BIND_CONSTANT_BUFFER
, "Unexpected bind flags %#x.\n",
187 buffer_desc
.BindFlags
);
188 ok(!buffer_desc
.CPUAccessFlags
, "Unexpected CPU access flags %#x.\n", buffer_desc
.CPUAccessFlags
);
189 ok(!buffer_desc
.MiscFlags
, "Unexpected misc flags %#x.\n", buffer_desc
.MiscFlags
);
190 ID3D10Buffer_Release(buffer
);
192 hr
= constantbuffer
->lpVtbl
->GetTextureBuffer(constantbuffer
, &srv
);
193 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
195 string
= type
->lpVtbl
->GetMemberName(type
, 0);
196 ok(strcmp(string
, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string
);
198 string
= type
->lpVtbl
->GetMemberSemantic(type
, 0);
199 ok(strcmp(string
, "SV_POSITION") == 0, "GetMemberSemantic is \"%s\", expected \"SV_POSITION\"\n", string
);
201 string
= type
->lpVtbl
->GetMemberName(type
, 1);
202 ok(strcmp(string
, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string
);
204 string
= type
->lpVtbl
->GetMemberSemantic(type
, 1);
205 ok(strcmp(string
, "COLOR0") == 0, "GetMemberSemantic is \"%s\", expected \"COLOR0\"\n", string
);
207 for (i
= 0; i
< 3; ++i
)
209 if (i
== 0) type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
210 else if (i
== 1) type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "f1");
211 else type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "SV_POSITION");
213 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
214 ok(hr
== S_OK
, "%u: Got unexpected hr %#lx.\n", i
, hr
);
216 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
217 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
218 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
219 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
220 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
221 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
222 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
223 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
224 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
225 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
227 if (i
== 0) type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 1);
228 else if (i
== 1) type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "f2");
229 else type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "COLOR0");
231 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
232 ok(hr
== S_OK
, "%u: Got unexpected hr %#lx.\n", i
, hr
);
234 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
235 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
236 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
237 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
238 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
239 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
240 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
241 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
242 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
243 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
246 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
247 hr
= type2
->lpVtbl
->GetDesc(type2
, NULL
);
248 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
250 null_type
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 3);
251 hr
= null_type
->lpVtbl
->GetDesc(null_type
, &type_desc
);
252 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
254 hr
= null_type
->lpVtbl
->GetDesc(null_type
, NULL
);
255 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
257 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "invalid");
258 ok(type2
== null_type
, "GetMemberTypeByName got wrong type %p, expected %p\n", type2
, null_type
);
260 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, NULL
);
261 ok(type2
== null_type
, "GetMemberTypeByName got wrong type %p, expected %p\n", type2
, null_type
);
263 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "invalid");
264 ok(type2
== null_type
, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2
, null_type
);
266 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, NULL
);
267 ok(type2
== null_type
, "GetMemberTypeBySemantic got wrong type %p, expected %p\n", type2
, null_type
);
269 string
= type
->lpVtbl
->GetMemberName(type
, 3);
270 ok(string
== NULL
, "GetMemberName is \"%s\", expected \"NULL\"\n", string
);
272 string
= type
->lpVtbl
->GetMemberSemantic(type
, 3);
273 ok(string
== NULL
, "GetMemberSemantic is \"%s\", expected \"NULL\"\n", string
);
275 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 1);
276 v
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
277 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
278 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
279 ok(!strcmp(var_desc
.Name
, "f3"), "Unexpected name %s.\n", var_desc
.Name
);
280 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
, "Unexpected variable flags %#x.\n", var_desc
.Flags
);
281 ok(var_desc
.BufferOffset
== 0x20, "Unexpected buffer offset %#x.\n", var_desc
.BufferOffset
);
282 ok(var_desc
.ExplicitBindPoint
== 0x20, "Unexpected bind point %#x.\n", var_desc
.ExplicitBindPoint
);
284 /* Invalid buffer variable */
285 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 100);
286 hr
= constantbuffer
->lpVtbl
->GetConstantBuffer(constantbuffer
, &buffer
);
287 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
288 hr
= constantbuffer
->lpVtbl
->GetTextureBuffer(constantbuffer
, &srv
);
289 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
291 effect
->lpVtbl
->Release(effect
);
293 refcount
= ID3D10Device_Release(device
);
294 ok(!refcount
, "Device has %lu references left.\n", refcount
);
298 * test_effect_variable_type
303 float f3
: SV_POSITION
;
317 static DWORD fx_test_evt
[] = {
318 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
319 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
320 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
321 0x00000001, 0x00000001, 0x00000000, 0x00000000,
322 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
323 0x00000000, 0x00000000, 0x00000000, 0x00000000,
324 0x00000000, 0x00000000, 0x00000000, 0x00000000,
325 0x00000000, 0x00000000, 0x00000000, 0x74006263,
326 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
327 0x00010000, 0x00000000, 0x00040000, 0x00100000,
328 0x00040000, 0x09090000, 0x32660000, 0x74007400,
329 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
330 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
331 0x00000300, 0x00000000, 0x00000800, 0x00001000,
332 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
333 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
334 0x00000400, 0x00001600, 0x00000700, 0x00000300,
335 0x00000000, 0x00001800, 0x00002000, 0x00001000,
336 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
337 0x00001600, 0x00003200, 0x00000000, 0x00000400,
338 0x00001600, 0x00003500, 0x00000000, 0x00001000,
339 0x00005500, 0x00317400, 0x00000004, 0x00000020,
340 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
341 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
342 0x00000000, 0x00000000, 0x00000000,
345 static void test_effect_variable_type(void)
347 ID3D10Effect
*effect
;
348 ID3D10EffectConstantBuffer
*constantbuffer
;
349 ID3D10EffectVariable
*variable
;
350 ID3D10EffectType
*type
, *type2
, *type3
;
351 D3D10_EFFECT_TYPE_DESC type_desc
;
352 D3D10_EFFECT_DESC desc
;
353 ID3D10Device
*device
;
359 if (!(device
= create_device()))
361 skip("Failed to create device, skipping tests.\n");
365 hr
= create_effect(fx_test_evt
, 0, device
, NULL
, &effect
);
366 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
368 hr
= effect
->lpVtbl
->GetDesc(effect
, &desc
);
369 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
370 ok(!desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
371 ok(desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n", desc
.ConstantBuffers
);
372 ok(desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
373 desc
.SharedConstantBuffers
);
374 ok(desc
.GlobalVariables
== 1, "Unexpected global variables count %u.\n", desc
.GlobalVariables
);
375 ok(desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
376 desc
.SharedGlobalVariables
);
377 ok(desc
.Techniques
== 0, "Unexpected techniques count %u.\n", desc
.Techniques
);
379 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
380 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
381 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
382 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
384 ok(strcmp(type_desc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", type_desc
.TypeName
);
385 ok(type_desc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_OBJECT
);
386 ok(type_desc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_CBUFFER
);
387 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
388 ok(type_desc
.Members
== 1, "Members is %u, expected 1\n", type_desc
.Members
);
389 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
390 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
391 ok(type_desc
.PackedSize
== 0x10, "PackedSize is %#x, expected 0x10\n", type_desc
.PackedSize
);
392 ok(type_desc
.UnpackedSize
== 0x20, "UnpackedSize is %#x, expected 0x20\n", type_desc
.UnpackedSize
);
393 ok(type_desc
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", type_desc
.Stride
);
395 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
396 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
397 type
= variable
->lpVtbl
->GetType(variable
);
398 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
399 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
401 ok(strcmp(type_desc
.TypeName
, "test1") == 0, "TypeName is \"%s\", expected \"test1\"\n", type_desc
.TypeName
);
402 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
403 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
404 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
405 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
406 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
407 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
408 ok(type_desc
.PackedSize
== 0x10, "PackedSize is %#x, expected 0x10\n", type_desc
.PackedSize
);
409 ok(type_desc
.UnpackedSize
== 0x18, "UnpackedSize is %#x, expected 0x18\n", type_desc
.UnpackedSize
);
410 ok(type_desc
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", type_desc
.Stride
);
412 string
= type
->lpVtbl
->GetMemberName(type
, 0);
413 ok(strcmp(string
, "f1") == 0, "GetMemberName is \"%s\", expected \"f1\"\n", string
);
415 string
= type
->lpVtbl
->GetMemberName(type
, 1);
416 ok(strcmp(string
, "f2") == 0, "GetMemberName is \"%s\", expected \"f2\"\n", string
);
418 string
= type
->lpVtbl
->GetMemberName(type
, 2);
419 ok(strcmp(string
, "t") == 0, "GetMemberName is \"%s\", expected \"t\"\n", string
);
421 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
422 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
423 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
425 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
426 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
427 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
428 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
429 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
430 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
431 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
432 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
433 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
434 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
436 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 1);
437 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
438 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
440 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
441 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
442 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
443 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
444 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
445 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
446 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
447 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
448 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
449 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
451 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 2);
452 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
453 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
455 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
456 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
457 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
458 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
459 ok(type_desc
.Members
== 2, "Members is %u, expected 2\n", type_desc
.Members
);
460 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
461 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
462 ok(type_desc
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", type_desc
.PackedSize
);
463 ok(type_desc
.UnpackedSize
== 0x8, "UnpackedSize is %#x, expected 0x8\n", type_desc
.UnpackedSize
);
464 ok(type_desc
.Stride
== 0x10, "Stride is %x, expected 0x10\n", type_desc
.Stride
);
466 for (i
= 0; i
< 4; ++i
)
468 if (i
== 0) type3
= type2
->lpVtbl
->GetMemberTypeByIndex(type2
, 0);
469 else if (i
== 1) type3
= type2
->lpVtbl
->GetMemberTypeByName(type2
, "f3");
470 else if (i
== 2) type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "SV_POSITION");
471 else type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "sv_POSITION");
473 hr
= type3
->lpVtbl
->GetDesc(type3
, &type_desc
);
474 ok(hr
== S_OK
, "%u: Got unexpected hr %#lx.\n", i
, hr
);
476 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
478 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
479 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
480 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
481 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
482 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
483 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
484 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
485 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
486 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
488 if (i
== 0) type3
= type2
->lpVtbl
->GetMemberTypeByIndex(type2
, 1);
489 else if (i
== 1) type3
= type2
->lpVtbl
->GetMemberTypeByName(type2
, "f4");
490 else if (i
== 2) type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "COLOR0");
491 else type3
= type2
->lpVtbl
->GetMemberTypeBySemantic(type2
, "color0");
493 hr
= type3
->lpVtbl
->GetDesc(type3
, &type_desc
);
494 ok(hr
== S_OK
, "%u: Got unexpected hr %#lx.\n", i
, hr
);
496 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n",
498 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
499 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
500 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
501 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
502 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
503 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
504 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
505 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
506 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
509 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 0);
510 hr
= type2
->lpVtbl
->GetDesc(type2
, NULL
);
511 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
513 type2
= type
->lpVtbl
->GetMemberTypeByIndex(type
, 4);
514 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
515 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
517 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, "invalid");
518 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
519 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
521 type2
= type
->lpVtbl
->GetMemberTypeByName(type
, NULL
);
522 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
523 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
525 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, "invalid");
526 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
527 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
529 type2
= type
->lpVtbl
->GetMemberTypeBySemantic(type
, NULL
);
530 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
531 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
533 string
= type
->lpVtbl
->GetMemberName(type
, 4);
534 ok(string
== NULL
, "GetMemberName is \"%s\", expected NULL\n", string
);
536 string
= type
->lpVtbl
->GetMemberSemantic(type
, 4);
537 ok(string
== NULL
, "GetMemberSemantic is \"%s\", expected NULL\n", string
);
539 effect
->lpVtbl
->Release(effect
);
541 refcount
= ID3D10Device_Release(device
);
542 ok(!refcount
, "Device has %lu references left.\n", refcount
);
546 * test_effect_variable_member
551 float f3
: SV_POSITION
;
565 static DWORD fx_test_evm
[] = {
566 0x43425844, 0xe079efed, 0x90bda0f2, 0xa6e2d0b4,
567 0xd2d6c200, 0x00000001, 0x0000018c, 0x00000001,
568 0x00000024, 0x30315846, 0x00000160, 0xfeff1001,
569 0x00000001, 0x00000001, 0x00000000, 0x00000000,
570 0x00000000, 0x00000000, 0x00000000, 0x000000e0,
571 0x00000000, 0x00000000, 0x00000000, 0x00000000,
572 0x00000000, 0x00000000, 0x00000000, 0x00000000,
573 0x00000000, 0x00000000, 0x00000000, 0x74006263,
574 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
575 0x00010000, 0x00000000, 0x00040000, 0x00100000,
576 0x00040000, 0x09090000, 0x32660000, 0x74007400,
577 0x00747365, 0x53003366, 0x4f505f56, 0x49544953,
578 0x66004e4f, 0x4f430034, 0x30524f4c, 0x00003700,
579 0x00000300, 0x00000000, 0x00000800, 0x00001000,
580 0x00000800, 0x00000200, 0x00003c00, 0x00003f00,
581 0x00000000, 0x00001600, 0x00004b00, 0x00004e00,
582 0x00000400, 0x00001600, 0x00000700, 0x00000300,
583 0x00000000, 0x00001800, 0x00002000, 0x00001000,
584 0x00000300, 0x00000d00, 0x00000000, 0x00000000,
585 0x00001600, 0x00003200, 0x00000000, 0x00000400,
586 0x00001600, 0x00003500, 0x00000000, 0x00001000,
587 0x00005500, 0x00317400, 0x00000004, 0x00000020,
588 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
589 0x000000dd, 0x00000091, 0x00000000, 0x00000000,
590 0x00000000, 0x00000000, 0x00000000,
593 static void test_effect_variable_member(void)
595 ID3D10Effect
*effect
;
596 ID3D10EffectConstantBuffer
*constantbuffer
;
597 ID3D10EffectVariable
*variable
, *variable2
, *variable3
, *null_variable
;
598 D3D10_EFFECT_VARIABLE_DESC desc
;
599 D3D10_EFFECT_DESC effect_desc
;
600 ID3D10Device
*device
;
604 if (!(device
= create_device()))
606 skip("Failed to create device, skipping tests.\n");
610 hr
= create_effect(fx_test_evm
, 0, device
, NULL
, &effect
);
611 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
613 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
614 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
615 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
616 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
617 effect_desc
.ConstantBuffers
);
618 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
619 effect_desc
.SharedConstantBuffers
);
620 ok(effect_desc
.GlobalVariables
== 1, "Unexpected global variables count %u.\n",
621 effect_desc
.GlobalVariables
);
622 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
623 effect_desc
.SharedGlobalVariables
);
624 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
626 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
627 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &desc
);
628 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
630 ok(strcmp(desc
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc
.Name
);
631 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
632 ok(desc
.Flags
== 0, "Type is %u, expected 0\n", desc
.Flags
);
633 ok(desc
.Annotations
== 0, "Elements is %u, expected 0\n", desc
.Annotations
);
634 ok(desc
.BufferOffset
== 0, "Members is %u, expected 0\n", desc
.BufferOffset
);
635 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
637 null_variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 1);
638 hr
= null_variable
->lpVtbl
->GetDesc(null_variable
, &desc
);
639 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
641 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
642 hr
= variable
->lpVtbl
->GetDesc(variable
, &desc
);
643 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
645 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "t1");
646 ok(variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, variable
);
647 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
648 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
650 ok(strcmp(desc
.Name
, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", desc
.Name
);
651 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
652 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
653 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
654 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
655 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
657 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "invalid");
658 ok(null_variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, null_variable
);
660 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, NULL
);
661 ok(null_variable
== variable2
, "GetMemberByName got %p, expected %p\n", variable2
, null_variable
);
663 variable2
= constantbuffer
->lpVtbl
->GetMemberBySemantic(constantbuffer
, "invalid");
664 ok(null_variable
== variable2
, "GetMemberBySemantic got %p, expected %p\n", variable2
, null_variable
);
666 variable2
= constantbuffer
->lpVtbl
->GetMemberBySemantic(constantbuffer
, NULL
);
667 ok(null_variable
== variable2
, "GetMemberBySemantic got %p, expected %p\n", variable2
, null_variable
);
669 /* check members of "t1" */
670 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "f1");
671 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
672 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
674 ok(strcmp(desc
.Name
, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc
.Name
);
675 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
676 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
677 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
678 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
679 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
681 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 0);
682 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
684 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "f2");
685 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
686 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
688 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
689 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
690 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
691 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
692 ok(desc
.BufferOffset
== 4, "BufferOffset is %u, expected 4\n", desc
.BufferOffset
);
693 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
695 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 1);
696 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
698 variable2
= variable
->lpVtbl
->GetMemberByName(variable
, "t");
699 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
700 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
702 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
703 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
704 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
705 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
706 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
707 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
709 variable3
= variable
->lpVtbl
->GetMemberByIndex(variable
, 2);
710 ok(variable2
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable3
, variable2
);
712 /* check members of "t" */
713 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f3");
714 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
715 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
717 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
718 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
719 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
720 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
721 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
722 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
724 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "SV_POSITION");
725 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
727 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "sv_POSITION");
728 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
730 variable
= variable2
->lpVtbl
->GetMemberByIndex(variable2
, 0);
731 ok(variable
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable
, variable3
);
733 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f4");
734 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
735 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
737 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
738 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
739 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
740 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
741 ok(desc
.BufferOffset
== 20, "BufferOffset is %u, expected 20\n", desc
.BufferOffset
);
742 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
744 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "COLOR0");
745 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
747 variable
= variable2
->lpVtbl
->GetMemberBySemantic(variable2
, "color0");
748 ok(variable
== variable3
, "GetMemberBySemantic got %p, expected %p\n", variable
, variable3
);
750 variable
= variable2
->lpVtbl
->GetMemberByIndex(variable2
, 1);
751 ok(variable
== variable3
, "GetMemberByIndex got %p, expected %p\n", variable
, variable3
);
753 effect
->lpVtbl
->Release(effect
);
755 refcount
= ID3D10Device_Release(device
);
756 ok(!refcount
, "Device has %lu references left.\n", refcount
);
760 * test_effect_variable_element
765 float f3
: SV_POSITION
;
780 static DWORD fx_test_eve
[] = {
781 0x43425844, 0x6ea69fd9, 0x9b4e6390, 0x006f9f71,
782 0x57ad58f4, 0x00000001, 0x000001c2, 0x00000001,
783 0x00000024, 0x30315846, 0x00000196, 0xfeff1001,
784 0x00000001, 0x00000001, 0x00000000, 0x00000000,
785 0x00000000, 0x00000000, 0x00000000, 0x00000116,
786 0x00000000, 0x00000000, 0x00000000, 0x00000000,
787 0x00000000, 0x00000000, 0x00000000, 0x00000000,
788 0x00000000, 0x00000000, 0x00000000, 0x74006263,
789 0x31747365, 0x00316600, 0x616f6c66, 0x00100074,
790 0x00010000, 0x00000000, 0x00040000, 0x00100000,
791 0x00040000, 0x09090000, 0x32660000, 0x00001000,
792 0x00000100, 0x00000300, 0x00002400, 0x00001000,
793 0x00000c00, 0x00090900, 0x74007400, 0x00747365,
794 0x53003366, 0x4f505f56, 0x49544953, 0x66004e4f,
795 0x4f430034, 0x30524f4c, 0x00356600, 0x4f4c4f43,
796 0x53003152, 0x03000000, 0x02000000, 0x1c000000,
797 0x10000000, 0x18000000, 0x03000000, 0x58000000,
798 0x5b000000, 0x00000000, 0x16000000, 0x67000000,
799 0x6a000000, 0x04000000, 0x16000000, 0x71000000,
800 0x74000000, 0x08000000, 0x16000000, 0x07000000,
801 0x03000000, 0x00000000, 0x5c000000, 0x60000000,
802 0x28000000, 0x03000000, 0x0d000000, 0x00000000,
803 0x00000000, 0x16000000, 0x32000000, 0x00000000,
804 0x10000000, 0x35000000, 0x51000000, 0x00000000,
805 0x40000000, 0x7b000000, 0x74000000, 0x00040031,
806 0x00600000, 0x00000000, 0x00010000, 0xffff0000,
807 0x0000ffff, 0x01130000, 0x00c70000, 0x00000000,
808 0x00000000, 0x00000000, 0x00000000, 0x00000000,
812 static void test_effect_variable_element(void)
814 ID3D10Effect
*effect
;
815 ID3D10EffectConstantBuffer
*constantbuffer
, *parent
;
816 ID3D10EffectVariable
*variable
, *variable2
, *variable3
, *variable4
, *variable5
;
817 ID3D10EffectType
*type
, *type2
;
818 D3D10_EFFECT_VARIABLE_DESC desc
;
819 D3D10_EFFECT_TYPE_DESC type_desc
;
820 D3D10_EFFECT_DESC effect_desc
;
821 ID3D10Device
*device
;
825 if (!(device
= create_device()))
827 skip("Failed to create device, skipping tests.\n");
831 hr
= create_effect(fx_test_eve
, 0, device
, NULL
, &effect
);
832 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
834 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
835 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
836 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
837 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
838 effect_desc
.ConstantBuffers
);
839 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
840 effect_desc
.SharedConstantBuffers
);
841 ok(effect_desc
.GlobalVariables
== 1, "Unexpected global variables count %u.\n",
842 effect_desc
.GlobalVariables
);
843 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
844 effect_desc
.SharedGlobalVariables
);
845 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
847 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
848 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &desc
);
849 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
851 ok(strcmp(desc
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", desc
.Name
);
852 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
853 ok(desc
.Flags
== 0, "Type is %u, expected 0\n", desc
.Flags
);
854 ok(desc
.Annotations
== 0, "Elements is %u, expected 0\n", desc
.Annotations
);
855 ok(desc
.BufferOffset
== 0, "Members is %u, expected 0\n", desc
.BufferOffset
);
856 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
858 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, 0);
859 hr
= variable
->lpVtbl
->GetDesc(variable
, &desc
);
860 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
862 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
863 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
864 parent
, constantbuffer
);
866 variable2
= constantbuffer
->lpVtbl
->GetMemberByName(constantbuffer
, "t1");
867 hr
= variable2
->lpVtbl
->GetDesc(variable2
, &desc
);
868 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
870 parent
= variable2
->lpVtbl
->GetParentConstantBuffer(variable2
);
871 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
873 /* check variable f1 */
874 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f1");
875 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
876 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
878 ok(strcmp(desc
.Name
, "f1") == 0, "Name is \"%s\", expected \"f1\"\n", desc
.Name
);
879 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
880 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
881 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
882 ok(desc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", desc
.BufferOffset
);
883 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
885 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
886 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
887 parent
, constantbuffer
);
889 type
= variable3
->lpVtbl
->GetType(variable3
);
890 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
891 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
893 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
894 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
895 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
896 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
897 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
898 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
899 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
900 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
901 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
902 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
904 /* check variable f2 */
905 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "f2");
906 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
907 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
909 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
910 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
911 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
912 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
913 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
914 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
916 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
917 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
918 parent
, constantbuffer
);
920 type
= variable3
->lpVtbl
->GetType(variable3
);
921 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
922 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
924 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
925 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
926 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
927 ok(type_desc
.Elements
== 3, "Elements is %u, expected 3\n", type_desc
.Elements
);
928 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
929 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
930 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
931 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
932 ok(type_desc
.UnpackedSize
== 0x24, "UnpackedSize is %#x, expected 0x24\n", type_desc
.UnpackedSize
);
933 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
935 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 0);
936 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
937 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
939 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
940 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
941 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
942 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
943 ok(desc
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", desc
.BufferOffset
);
944 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
946 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
947 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
948 parent
, constantbuffer
);
950 type
= variable4
->lpVtbl
->GetType(variable4
);
951 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
952 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
954 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
955 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
956 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
957 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
958 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
959 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
960 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
961 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
962 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
963 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
965 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 1);
966 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
967 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
969 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
970 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
971 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
972 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
973 ok(desc
.BufferOffset
== 32, "BufferOffset is %u, expected 32\n", desc
.BufferOffset
);
974 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
976 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
977 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
978 parent
, constantbuffer
);
980 type2
= variable4
->lpVtbl
->GetType(variable4
);
981 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
982 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
983 ok(type
== type2
, "type(%p) != type2(%p)\n", type
, type2
);
985 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
986 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
987 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
988 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
989 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
990 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
991 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
992 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
993 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
994 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
996 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 2);
997 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
998 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1000 ok(strcmp(desc
.Name
, "f2") == 0, "Name is \"%s\", expected \"f2\"\n", desc
.Name
);
1001 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
1002 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1003 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1004 ok(desc
.BufferOffset
== 48, "BufferOffset is %u, expected 48\n", desc
.BufferOffset
);
1005 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1007 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
1008 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
1009 parent
, constantbuffer
);
1011 type2
= variable4
->lpVtbl
->GetType(variable4
);
1012 hr
= type2
->lpVtbl
->GetDesc(type2
, &type_desc
);
1013 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1014 ok(type
== type2
, "type(%p) != type2(%p)\n", type
, type2
);
1016 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1017 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1018 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1019 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1020 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1021 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1022 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1023 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1024 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1025 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1027 /* check variable t */
1028 variable3
= variable2
->lpVtbl
->GetMemberByName(variable2
, "t");
1029 hr
= variable3
->lpVtbl
->GetDesc(variable3
, &desc
);
1030 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1032 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
1033 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
1034 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1035 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1036 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
1037 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1039 parent
= variable3
->lpVtbl
->GetParentConstantBuffer(variable3
);
1040 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
1041 parent
, constantbuffer
);
1043 type
= variable3
->lpVtbl
->GetType(variable3
);
1044 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1045 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1047 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
1048 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
1049 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
1050 ok(type_desc
.Elements
== 2, "Elements is %u, expected 2\n", type_desc
.Elements
);
1051 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
1052 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
1053 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
1054 ok(type_desc
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", type_desc
.PackedSize
);
1055 ok(type_desc
.UnpackedSize
== 0x1c, "UnpackedSize is %#x, expected 0x1c\n", type_desc
.UnpackedSize
);
1056 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1058 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 0);
1059 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
1060 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1062 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
1063 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
1064 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1065 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1066 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
1067 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1069 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
1070 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
1071 parent
, constantbuffer
);
1073 type
= variable4
->lpVtbl
->GetType(variable4
);
1074 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1075 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1077 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
1078 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
1079 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
1080 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1081 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
1082 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
1083 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
1084 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
1085 ok(type_desc
.UnpackedSize
== 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc
.UnpackedSize
);
1086 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1088 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 0);
1089 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1090 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1092 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
1093 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
1094 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1095 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1096 ok(desc
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", desc
.BufferOffset
);
1097 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1099 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1100 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1102 type
= variable5
->lpVtbl
->GetType(variable5
);
1103 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1104 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1106 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1107 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1108 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1109 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1110 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1111 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1112 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1113 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1114 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1115 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1117 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 1);
1118 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1119 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1121 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
1122 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
1123 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1124 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1125 ok(desc
.BufferOffset
== 68, "BufferOffset is %u, expected 68\n", desc
.BufferOffset
);
1126 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1128 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1129 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1131 type
= variable5
->lpVtbl
->GetType(variable5
);
1132 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1133 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1135 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1136 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1137 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1138 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1139 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1140 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1141 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1142 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1143 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1144 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1146 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 2);
1147 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1148 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1150 ok(strcmp(desc
.Name
, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc
.Name
);
1151 ok(strcmp(desc
.Semantic
, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc
.Semantic
);
1152 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1153 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1154 ok(desc
.BufferOffset
== 72, "BufferOffset is %u, expected 72\n", desc
.BufferOffset
);
1155 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1157 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1158 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1160 type
= variable5
->lpVtbl
->GetType(variable5
);
1161 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1162 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1164 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1165 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1166 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1167 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1168 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1169 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1170 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1171 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1172 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1173 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1175 variable4
= variable3
->lpVtbl
->GetElement(variable3
, 1);
1176 hr
= variable4
->lpVtbl
->GetDesc(variable4
, &desc
);
1177 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1179 ok(strcmp(desc
.Name
, "t") == 0, "Name is \"%s\", expected \"t\"\n", desc
.Name
);
1180 ok(desc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", desc
.Semantic
);
1181 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1182 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1183 ok(desc
.BufferOffset
== 80, "BufferOffset is %u, expected 80\n", desc
.BufferOffset
);
1184 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1186 parent
= variable4
->lpVtbl
->GetParentConstantBuffer(variable4
);
1187 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n",
1188 parent
, constantbuffer
);
1190 type
= variable4
->lpVtbl
->GetType(variable4
);
1191 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1192 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1194 ok(strcmp(type_desc
.TypeName
, "test") == 0, "TypeName is \"%s\", expected \"test\"\n", type_desc
.TypeName
);
1195 ok(type_desc
.Class
== D3D10_SVC_STRUCT
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_STRUCT
);
1196 ok(type_desc
.Type
== D3D10_SVT_VOID
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_VOID
);
1197 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1198 ok(type_desc
.Members
== 3, "Members is %u, expected 3\n", type_desc
.Members
);
1199 ok(type_desc
.Rows
== 0, "Rows is %u, expected 0\n", type_desc
.Rows
);
1200 ok(type_desc
.Columns
== 0, "Columns is %u, expected 0\n", type_desc
.Columns
);
1201 ok(type_desc
.PackedSize
== 0xc, "PackedSize is %#x, expected 0xc\n", type_desc
.PackedSize
);
1202 ok(type_desc
.UnpackedSize
== 0xc, "UnpackedSize is %#x, expected 0xc\n", type_desc
.UnpackedSize
);
1203 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1205 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 0);
1206 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1207 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1209 ok(strcmp(desc
.Name
, "f3") == 0, "Name is \"%s\", expected \"f3\"\n", desc
.Name
);
1210 ok(strcmp(desc
.Semantic
, "SV_POSITION") == 0, "Semantic is \"%s\", expected \"SV_POSITION\"\n", desc
.Semantic
);
1211 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1212 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1213 ok(desc
.BufferOffset
== 80, "BufferOffset is %u, expected 80\n", desc
.BufferOffset
);
1214 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1216 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1217 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1219 type
= variable5
->lpVtbl
->GetType(variable5
);
1220 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1221 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1223 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1224 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1225 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1226 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1227 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1228 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1229 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1230 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1231 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1232 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1234 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 1);
1235 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1236 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1238 ok(strcmp(desc
.Name
, "f4") == 0, "Name is \"%s\", expected \"f4\"\n", desc
.Name
);
1239 ok(strcmp(desc
.Semantic
, "COLOR0") == 0, "Semantic is \"%s\", expected \"COLOR0\"\n", desc
.Semantic
);
1240 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1241 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1242 ok(desc
.BufferOffset
== 84, "BufferOffset is %u, expected 84\n", desc
.BufferOffset
);
1243 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1245 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1246 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1248 type
= variable5
->lpVtbl
->GetType(variable5
);
1249 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1250 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1252 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1253 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1254 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1255 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1256 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1257 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1258 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1259 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1260 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1261 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1263 variable5
= variable4
->lpVtbl
->GetMemberByIndex(variable4
, 2);
1264 hr
= variable5
->lpVtbl
->GetDesc(variable5
, &desc
);
1265 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1267 ok(strcmp(desc
.Name
, "f5") == 0, "Name is \"%s\", expected \"f5\"\n", desc
.Name
);
1268 ok(strcmp(desc
.Semantic
, "COLOR1") == 0, "Semantic is \"%s\", expected \"COLOR1\"\n", desc
.Semantic
);
1269 ok(desc
.Flags
== 0, "Flags is %u, expected 0\n", desc
.Flags
);
1270 ok(desc
.Annotations
== 0, "Annotations is %u, expected 0\n", desc
.Annotations
);
1271 ok(desc
.BufferOffset
== 88, "BufferOffset is %u, expected 88\n", desc
.BufferOffset
);
1272 ok(desc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", desc
.ExplicitBindPoint
);
1274 parent
= variable5
->lpVtbl
->GetParentConstantBuffer(variable5
);
1275 ok(parent
== constantbuffer
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1277 type
= variable5
->lpVtbl
->GetType(variable5
);
1278 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
1279 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1281 ok(strcmp(type_desc
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", type_desc
.TypeName
);
1282 ok(type_desc
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", type_desc
.Class
, D3D10_SVC_SCALAR
);
1283 ok(type_desc
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", type_desc
.Type
, D3D10_SVT_FLOAT
);
1284 ok(type_desc
.Elements
== 0, "Elements is %u, expected 0\n", type_desc
.Elements
);
1285 ok(type_desc
.Members
== 0, "Members is %u, expected 0\n", type_desc
.Members
);
1286 ok(type_desc
.Rows
== 1, "Rows is %u, expected 1\n", type_desc
.Rows
);
1287 ok(type_desc
.Columns
== 1, "Columns is %u, expected 1\n", type_desc
.Columns
);
1288 ok(type_desc
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", type_desc
.PackedSize
);
1289 ok(type_desc
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", type_desc
.UnpackedSize
);
1290 ok(type_desc
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", type_desc
.Stride
);
1292 effect
->lpVtbl
->Release(effect
);
1294 refcount
= ID3D10Device_Release(device
);
1295 ok(!refcount
, "Device has %lu references left.\n", refcount
);
1299 * test_effect_variable_type_class
1302 cbuffer cb
<String s
= "STRING"; String s2
= "STRING"; >
1306 matrix
<uint
, 2, 3> u
;
1307 row_major matrix
<bool, 2, 3> b
;
1310 DepthStencilState depthstencil
;
1311 RasterizerState rast
;
1313 RenderTargetView rtv
;
1314 DepthStencilView dsv
;
1319 Texture2DMS
<float4
, 4> t2dms
;
1321 Texture2DMSArray
<float4
, 4> t2dmsa
;
1324 GeometryShader gs
[2];
1327 BlendState blend2
[2];
1328 DepthStencilState depthstencil2
[2];
1329 RasterizerState rast2
[2];
1330 SamplerState sam2
[2];
1332 static DWORD fx_test_evtc
[] =
1334 0x43425844, 0xbcafa6f1, 0x8baf9e54, 0x8e1fd2ef, 0x115ba370, 0x00000001, 0x000007a3, 0x00000001,
1335 0x00000024, 0x30315846, 0x00000777, 0xfeff1001, 0x00000001, 0x00000004, 0x00000016, 0x00000000,
1336 0x00000000, 0x00000000, 0x00000000, 0x00000493, 0x00000000, 0x00000009, 0x00000003, 0x00000003,
1337 0x00000003, 0x00000003, 0x00000001, 0x00000001, 0x00000004, 0x00000000, 0x00000000, 0x53006263,
1338 0x6e697274, 0x00070067, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000,
1339 0x00730000, 0x49525453, 0x7300474e, 0x6c660032, 0x0074616f, 0x00000036, 0x00000001, 0x00000000,
1340 0x00000004, 0x00000010, 0x00000004, 0x00000909, 0x6e690066, 0x5a003274, 0x01000000, 0x00000000,
1341 0x08000000, 0x10000000, 0x08000000, 0x12000000, 0x69000011, 0x6e697500, 0x33783274, 0x00007d00,
1342 0x00000100, 0x00000000, 0x00002800, 0x00003000, 0x00001800, 0x005a1b00, 0x62007500, 0x326c6f6f,
1343 0xa3003378, 0x01000000, 0x00000000, 0x1c000000, 0x20000000, 0x18000000, 0x23000000, 0x6200001a,
1344 0x656c4200, 0x7453646e, 0x00657461, 0x000000c9, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
1345 0x00000000, 0x00000002, 0x6e656c62, 0x65440064, 0x53687470, 0x636e6574, 0x74536c69, 0x00657461,
1346 0x000000f6, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x74706564,
1347 0x65747368, 0x6c69636e, 0x73615200, 0x69726574, 0x5372657a, 0x65746174, 0x00013100, 0x00000200,
1348 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0x73617200, 0x61530074, 0x656c706d,
1349 0x61745372, 0x62006574, 0x02000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x15000000,
1350 0x73000000, 0x52006d61, 0x65646e65, 0x72615472, 0x56746567, 0x00776569, 0x0000018f, 0x00000002,
1351 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000013, 0x00767472, 0x74706544, 0x65745368,
1352 0x6c69636e, 0x77656956, 0x0001c000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1353 0x00001400, 0x76736400, 0x78657400, 0x65727574, 0x0001f100, 0x00000200, 0x00000000, 0x00000000,
1354 0x00000000, 0x00000000, 0x00000900, 0x00307400, 0x74786554, 0x31657275, 0x02180044, 0x00020000,
1355 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000a0000, 0x31740000, 0x78655400, 0x65727574,
1356 0x72414431, 0x00796172, 0x00000241, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1357 0x0000000b, 0x00613174, 0x74786554, 0x32657275, 0x02700044, 0x00020000, 0x00000000, 0x00000000,
1358 0x00000000, 0x00000000, 0x000c0000, 0x32740000, 0x78655400, 0x65727574, 0x534d4432, 0x00029900,
1359 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000e00, 0x64327400, 0x5400736d,
1360 0x75747865, 0x44326572, 0x61727241, 0x02c70079, 0x00020000, 0x00000000, 0x00000000, 0x00000000,
1361 0x00000000, 0x000d0000, 0x32740000, 0x65540061, 0x72757478, 0x4d443265, 0x72724153, 0xf6007961,
1362 0x02000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0f000000, 0x74000000, 0x736d6432,
1363 0x65540061, 0x72757478, 0x00443365, 0x0000032a, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
1364 0x00000000, 0x00000010, 0x54003374, 0x75747865, 0x75436572, 0x53006562, 0x02000003, 0x00000000,
1365 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x74000000, 0x65470071, 0x74656d6f, 0x68537972,
1366 0x72656461, 0x00037e00, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000700,
1367 0x00736700, 0x65786950, 0x6168536c, 0x00726564, 0x000003ac, 0x00000002, 0x00000000, 0x00000000,
1368 0x00000000, 0x00000000, 0x00000005, 0x56007370, 0x65747265, 0x61685378, 0x00726564, 0x000003d7,
1369 0x00000002, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0xc9007376, 0x02000000,
1370 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x62000000, 0x646e656c, 0x00f60032,
1371 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00030000, 0x65640000, 0x73687470,
1372 0x636e6574, 0x00326c69, 0x00000131, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
1373 0x00000004, 0x74736172, 0x01620032, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000,
1374 0x00150000, 0x61730000, 0x0400326d, 0x60000000, 0x00000000, 0x04000000, 0xff000000, 0x02ffffff,
1375 0x2a000000, 0x0e000000, 0x2c000000, 0x33000000, 0x0e000000, 0x2c000000, 0x58000000, 0x3c000000,
1376 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7b000000, 0x5f000000, 0x00000000,
1377 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0xa1000000, 0x85000000, 0x00000000, 0x10000000,
1378 0x00000000, 0x00000000, 0x00000000, 0xc7000000, 0xab000000, 0x00000000, 0x40000000, 0x00000000,
1379 0x00000000, 0x00000000, 0xf0000000, 0xd4000000, 0x00000000, 0xff000000, 0x00ffffff, 0x00000000,
1380 0x24000000, 0x08000001, 0x00000001, 0xff000000, 0x00ffffff, 0x00000000, 0x5d000000, 0x41000001,
1381 0x00000001, 0xff000000, 0x00ffffff, 0x00000000, 0x8b000000, 0x6f000001, 0x00000001, 0xff000000,
1382 0x00ffffff, 0x00000000, 0xbc000000, 0xa0000001, 0x00000001, 0xff000000, 0x00ffffff, 0xed000000,
1383 0xd1000001, 0x00000001, 0xff000000, 0x00ffffff, 0x15000000, 0xf9000002, 0x00000001, 0xff000000,
1384 0x00ffffff, 0x3e000000, 0x22000002, 0x00000002, 0xff000000, 0x00ffffff, 0x6c000000, 0x50000002,
1385 0x00000002, 0xff000000, 0x00ffffff, 0x96000000, 0x7a000002, 0x00000002, 0xff000000, 0x00ffffff,
1386 0xc1000000, 0xa5000002, 0x00000002, 0xff000000, 0x00ffffff, 0xf2000000, 0xd6000002, 0x00000002,
1387 0xff000000, 0x00ffffff, 0x23000000, 0x07000003, 0x00000003, 0xff000000, 0x00ffffff, 0x50000000,
1388 0x34000003, 0x00000003, 0xff000000, 0x00ffffff, 0x7b000000, 0x5f000003, 0x00000003, 0xff000000,
1389 0x00ffffff, 0xa9000000, 0x8d000003, 0x00000003, 0xff000000, 0x00ffffff, 0x00000000, 0x00000000,
1390 0xd4000000, 0xb8000003, 0x00000003, 0xff000000, 0x00ffffff, 0x00000000, 0x00000000, 0xe4000004,
1391 0x00000003, 0xff000000, 0x00ffffff, 0x00000000, 0x1f000000, 0x03000004, 0x00000004, 0xff000000,
1392 0x00ffffff, 0x00000000, 0x00000000, 0x42000000, 0x26000004, 0x00000004, 0xff000000, 0x00ffffff,
1393 0x00000000, 0x00000000, 0x6c000000, 0x50000004, 0x00000004, 0xff000000, 0x00ffffff, 0x00000000,
1394 0x00000000, 0x8e000000, 0x72000004, 0x00000004, 0xff000000, 0x00ffffff, 0x00000000, 0x00000000,
1398 static BOOL
is_valid_check(BOOL a
, BOOL b
)
1400 return (a
&& b
) || (!a
&& !b
);
1403 static void check_as(ID3D10EffectVariable
*variable
)
1405 ID3D10EffectVariable
*variable2
;
1406 ID3D10EffectType
*type
;
1407 D3D10_EFFECT_TYPE_DESC td
;
1411 type
= variable
->lpVtbl
->GetType(variable
);
1412 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1413 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1415 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsConstantBuffer(variable
);
1416 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1417 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_CBUFFER
);
1418 ok(ret
, "AsConstantBuffer valid check failed (Type is %x)\n", td
.Type
);
1420 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsString(variable
);
1421 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1422 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_STRING
);
1423 ok(ret
, "AsString valid check failed (Type is %x)\n", td
.Type
);
1425 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsScalar(variable
);
1426 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1427 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_SCALAR
);
1428 ok(ret
, "AsScalar valid check failed (Class is %x)\n", td
.Class
);
1430 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsVector(variable
);
1431 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1432 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_VECTOR
);
1433 ok(ret
, "AsVector valid check failed (Class is %x)\n", td
.Class
);
1435 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsMatrix(variable
);
1436 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1437 ret
= is_valid_check(is_valid
, td
.Class
== D3D10_SVC_MATRIX_ROWS
1438 || td
.Class
== D3D10_SVC_MATRIX_COLUMNS
);
1439 ok(ret
, "AsMatrix valid check failed (Class is %x)\n", td
.Class
);
1441 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsBlend(variable
);
1442 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1443 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_BLEND
);
1444 ok(ret
, "AsBlend valid check failed (Type is %x)\n", td
.Type
);
1446 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsDepthStencil(variable
);
1447 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1448 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_DEPTHSTENCIL
);
1449 ok(ret
, "AsDepthStencil valid check failed (Type is %x)\n", td
.Type
);
1451 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsRasterizer(variable
);
1452 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1453 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_RASTERIZER
);
1454 ok(ret
, "AsRasterizer valid check failed (Type is %x)\n", td
.Type
);
1456 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsSampler(variable
);
1457 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1458 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_SAMPLER
);
1459 ok(ret
, "AsSampler valid check failed (Type is %x)\n", td
.Type
);
1461 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsDepthStencilView(variable
);
1462 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1463 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_DEPTHSTENCILVIEW
);
1464 ok(ret
, "AsDepthStencilView valid check failed (Type is %x)\n", td
.Type
);
1466 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsRenderTargetView(variable
);
1467 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1468 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_RENDERTARGETVIEW
);
1469 ok(ret
, "AsRenderTargetView valid check failed (Type is %x)\n", td
.Type
);
1471 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsShaderResource(variable
);
1472 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1473 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_TEXTURE
|| td
.Type
== D3D10_SVT_TEXTURE1D
1474 || td
.Type
== D3D10_SVT_TEXTURE1DARRAY
|| td
.Type
== D3D10_SVT_TEXTURE2D
1475 || td
.Type
== D3D10_SVT_TEXTURE2DMS
|| td
.Type
== D3D10_SVT_TEXTURE2DARRAY
1476 || td
.Type
== D3D10_SVT_TEXTURE2DMSARRAY
|| td
.Type
== D3D10_SVT_TEXTURE3D
1477 || td
.Type
== D3D10_SVT_TEXTURECUBE
);
1478 ok(ret
, "AsShaderResource valid check failed (Type is %x)\n", td
.Type
);
1480 variable2
= (ID3D10EffectVariable
*)variable
->lpVtbl
->AsShader(variable
);
1481 is_valid
= variable2
->lpVtbl
->IsValid(variable2
);
1482 ret
= is_valid_check(is_valid
, td
.Type
== D3D10_SVT_GEOMETRYSHADER
1483 || td
.Type
== D3D10_SVT_PIXELSHADER
|| td
.Type
== D3D10_SVT_VERTEXSHADER
);
1484 ok(ret
, "AsShader valid check failed (Type is %x)\n", td
.Type
);
1487 static void test_effect_variable_type_class(void)
1489 ID3D10EffectStringVariable
*string_var
;
1490 ID3D10Effect
*effect
;
1491 ID3D10EffectConstantBuffer
*constantbuffer
, *null_buffer
, *parent
;
1492 ID3D10EffectVariable
*variable
;
1493 ID3D10EffectType
*type
;
1494 D3D10_EFFECT_VARIABLE_DESC vd
;
1495 D3D10_EFFECT_TYPE_DESC td
;
1496 D3D10_EFFECT_DESC effect_desc
;
1497 ID3D10Device
*device
;
1500 unsigned int variable_nr
= 0;
1501 const char *str1
, *str2
;
1503 if (!(device
= create_device()))
1505 skip("Failed to create device, skipping tests.\n");
1509 hr
= create_effect(fx_test_evtc
, 0, device
, NULL
, &effect
);
1510 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1512 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
1513 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1514 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
1515 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
1516 effect_desc
.ConstantBuffers
);
1517 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
1518 effect_desc
.SharedConstantBuffers
);
1519 ok(effect_desc
.GlobalVariables
== 26, "Unexpected global variables count %u.\n",
1520 effect_desc
.GlobalVariables
);
1521 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
1522 effect_desc
.SharedGlobalVariables
);
1523 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
1525 /* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
1526 null_buffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 1);
1528 /* check constantbuffer cb */
1529 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
1530 hr
= constantbuffer
->lpVtbl
->GetDesc(constantbuffer
, &vd
);
1531 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1533 ok(strcmp(vd
.Name
, "cb") == 0, "Name is \"%s\", expected \"cb\"\n", vd
.Name
);
1534 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1535 ok(vd
.Flags
== 0, "Type is %u, expected 0\n", vd
.Flags
);
1536 ok(vd
.Annotations
== 2, "Unexpected Annotations %u.\n", vd
.Annotations
);
1537 ok(vd
.BufferOffset
== 0, "Members is %u, expected 0\n", vd
.BufferOffset
);
1538 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1540 check_as((ID3D10EffectVariable
*)constantbuffer
);
1542 parent
= constantbuffer
->lpVtbl
->GetParentConstantBuffer(constantbuffer
);
1543 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1545 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
1546 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1547 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1549 ok(strcmp(td
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", td
.TypeName
);
1550 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1551 ok(td
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_CBUFFER
);
1552 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1553 ok(td
.Members
== 4, "Members is %u, expected 4\n", td
.Members
);
1554 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1555 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1556 ok(td
.PackedSize
== 0x3c, "PackedSize is %#x, expected 0x3c\n", td
.PackedSize
);
1557 ok(td
.UnpackedSize
== 0x60, "UnpackedSize is %#x, expected 0x60\n", td
.UnpackedSize
);
1558 ok(td
.Stride
== 0x60, "Stride is %#x, expected 0x60\n", td
.Stride
);
1560 variable
= constantbuffer
->lpVtbl
->GetAnnotationByIndex(constantbuffer
, 0);
1561 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1562 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1564 ok(strcmp(vd
.Name
, "s") == 0, "Name is \"%s\", expected \"s\"\n", vd
.Name
);
1565 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1566 ok(vd
.Flags
== D3D10_EFFECT_VARIABLE_ANNOTATION
, "Unexpected flags %#x.\n", vd
.Flags
);
1567 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1568 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1569 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1573 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1574 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1576 type
= variable
->lpVtbl
->GetType(variable
);
1577 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1578 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1580 ok(strcmp(td
.TypeName
, "String") == 0, "TypeName is \"%s\", expected \"String\"\n", td
.TypeName
);
1581 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1582 ok(td
.Type
== D3D10_SVT_STRING
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_STRING
);
1583 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1584 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1585 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1586 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1587 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1588 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1589 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1591 string_var
= variable
->lpVtbl
->AsString(variable
);
1592 hr
= string_var
->lpVtbl
->GetString(string_var
, NULL
);
1593 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
1594 hr
= string_var
->lpVtbl
->GetString(string_var
, &str1
);
1595 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1596 ok(!strcmp(str1
, "STRING"), "Unexpected value %s.\n", str1
);
1598 variable
= constantbuffer
->lpVtbl
->GetAnnotationByIndex(constantbuffer
, 1);
1599 string_var
= variable
->lpVtbl
->AsString(variable
);
1600 hr
= string_var
->lpVtbl
->GetString(string_var
, &str2
);
1601 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1602 ok(str2
!= str1
, "Unexpected string pointer.\n");
1603 ok(!strcmp(str2
, "STRING"), "Unexpected value %s.\n", str1
);
1605 /* Only two annotations */
1606 variable
= constantbuffer
->lpVtbl
->GetAnnotationByIndex(constantbuffer
, 2);
1607 string_var
= variable
->lpVtbl
->AsString(variable
);
1608 hr
= string_var
->lpVtbl
->GetString(string_var
, NULL
);
1609 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
1610 str1
= (void *)0xdeadbeef;
1611 hr
= string_var
->lpVtbl
->GetString(string_var
, &str1
);
1612 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
1613 ok(str1
== (void *)0xdeadbeef, "Unexpected pointer.\n");
1616 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1617 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1618 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1620 ok(strcmp(vd
.Name
, "f") == 0, "Name is \"%s\", expected \"f\"\n", vd
.Name
);
1621 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1622 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1623 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1624 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1625 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1629 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1630 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1632 type
= variable
->lpVtbl
->GetType(variable
);
1633 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1634 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1636 ok(strcmp(td
.TypeName
, "float") == 0, "TypeName is \"%s\", expected \"float\"\n", td
.TypeName
);
1637 ok(td
.Class
== D3D10_SVC_SCALAR
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_SCALAR
);
1638 ok(td
.Type
== D3D10_SVT_FLOAT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_FLOAT
);
1639 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1640 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1641 ok(td
.Rows
== 1, "Rows is %u, expected 1\n", td
.Rows
);
1642 ok(td
.Columns
== 1, "Columns is %u, expected 1\n", td
.Columns
);
1643 ok(td
.PackedSize
== 0x4, "PackedSize is %#x, expected 0x4\n", td
.PackedSize
);
1644 ok(td
.UnpackedSize
== 0x4, "UnpackedSize is %#x, expected 0x4\n", td
.UnpackedSize
);
1645 ok(td
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", td
.Stride
);
1648 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1649 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1650 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1652 ok(strcmp(vd
.Name
, "i") == 0, "Name is \"%s\", expected \"i\"\n", vd
.Name
);
1653 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1654 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1655 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1656 ok(vd
.BufferOffset
== 4, "BufferOffset is %u, expected 4\n", vd
.BufferOffset
);
1657 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1661 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1662 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1664 type
= variable
->lpVtbl
->GetType(variable
);
1665 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1666 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1668 ok(strcmp(td
.TypeName
, "int2") == 0, "TypeName is \"%s\", expected \"int2\"\n", td
.TypeName
);
1669 ok(td
.Class
== D3D10_SVC_VECTOR
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_VECTOR
);
1670 ok(td
.Type
== D3D10_SVT_INT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_INT
);
1671 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1672 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1673 ok(td
.Rows
== 1, "Rows is %u, expected 1\n", td
.Rows
);
1674 ok(td
.Columns
== 2, "Columns is %u, expected 2\n", td
.Columns
);
1675 ok(td
.PackedSize
== 0x8, "PackedSize is %#x, expected 0x8\n", td
.PackedSize
);
1676 ok(td
.UnpackedSize
== 0x8, "UnpackedSize is %#x, expected 0x8\n", td
.UnpackedSize
);
1677 ok(td
.Stride
== 0x10, "Stride is %#x, expected 0x10\n", td
.Stride
);
1679 /* check uint2x3 u */
1680 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1681 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1682 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1684 ok(strcmp(vd
.Name
, "u") == 0, "Name is \"%s\", expected \"u\"\n", vd
.Name
);
1685 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1686 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1687 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1688 ok(vd
.BufferOffset
== 16, "BufferOffset is %u, expected 16\n", vd
.BufferOffset
);
1689 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1693 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1694 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1696 type
= variable
->lpVtbl
->GetType(variable
);
1697 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1698 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1700 ok(strcmp(td
.TypeName
, "uint2x3") == 0, "TypeName is \"%s\", expected \"uint2x3\"\n", td
.TypeName
);
1701 ok(td
.Class
== D3D10_SVC_MATRIX_COLUMNS
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_MATRIX_COLUMNS
);
1702 ok(td
.Type
== D3D10_SVT_UINT
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_UINT
);
1703 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1704 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1705 ok(td
.Rows
== 2, "Rows is %u, expected 2\n", td
.Rows
);
1706 ok(td
.Columns
== 3, "Columns is %u, expected 3\n", td
.Columns
);
1707 ok(td
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", td
.PackedSize
);
1708 ok(td
.UnpackedSize
== 0x28, "UnpackedSize is %#x, expected 0x28\n", td
.UnpackedSize
);
1709 ok(td
.Stride
== 0x30, "Stride is %#x, expected 0x30\n", td
.Stride
);
1711 /* check bool2x3 b */
1712 variable
= constantbuffer
->lpVtbl
->GetMemberByIndex(constantbuffer
, variable_nr
++);
1713 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1714 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1716 ok(strcmp(vd
.Name
, "b") == 0, "Name is \"%s\", expected \"b\"\n", vd
.Name
);
1717 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1718 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1719 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1720 ok(vd
.BufferOffset
== 64, "BufferOffset is %u, expected 64\n", vd
.BufferOffset
);
1721 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1725 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1726 ok(constantbuffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, constantbuffer
);
1728 type
= variable
->lpVtbl
->GetType(variable
);
1729 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1730 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1732 ok(strcmp(td
.TypeName
, "bool2x3") == 0, "TypeName is \"%s\", expected \"bool2x3\"\n", td
.TypeName
);
1733 ok(td
.Class
== D3D10_SVC_MATRIX_ROWS
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_MATRIX_ROWS
);
1734 ok(td
.Type
== D3D10_SVT_BOOL
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_BOOL
);
1735 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1736 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1737 ok(td
.Rows
== 2, "Rows is %u, expected 2\n", td
.Rows
);
1738 ok(td
.Columns
== 3, "Columns is %u, expected 3\n", td
.Columns
);
1739 ok(td
.PackedSize
== 0x18, "PackedSize is %#x, expected 0x18\n", td
.PackedSize
);
1740 ok(td
.UnpackedSize
== 0x1c, "UnpackedSize is %#x, expected 0x1c\n", td
.UnpackedSize
);
1741 ok(td
.Stride
== 0x20, "Stride is %#x, expected 0x20\n", td
.Stride
);
1743 /* check BlendState blend */
1744 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1745 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1746 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1748 ok(strcmp(vd
.Name
, "blend") == 0, "Name is \"%s\", expected \"blend\"\n", vd
.Name
);
1749 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1750 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1751 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1752 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1753 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1757 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1758 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1760 type
= variable
->lpVtbl
->GetType(variable
);
1761 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1762 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1764 ok(strcmp(td
.TypeName
, "BlendState") == 0, "TypeName is \"%s\", expected \"BlendState\"\n", td
.TypeName
);
1765 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1766 ok(td
.Type
== D3D10_SVT_BLEND
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_BLEND
);
1767 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1768 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1769 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1770 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1771 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1772 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1773 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1775 /* check DepthStencilState depthstencil */
1776 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1777 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1778 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1780 ok(strcmp(vd
.Name
, "depthstencil") == 0, "Name is \"%s\", expected \"depthstencil\"\n", vd
.Name
);
1781 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1782 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1783 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1784 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1785 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1789 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1790 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1792 type
= variable
->lpVtbl
->GetType(variable
);
1793 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1794 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1796 ok(strcmp(td
.TypeName
, "DepthStencilState") == 0, "TypeName is \"%s\", expected \"DepthStencilState\"\n", td
.TypeName
);
1797 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1798 ok(td
.Type
== D3D10_SVT_DEPTHSTENCIL
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_DEPTHSTENCIL
);
1799 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1800 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1801 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1802 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1803 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1804 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1805 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1807 /* check RasterizerState rast */
1808 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1809 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1810 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1812 ok(strcmp(vd
.Name
, "rast") == 0, "Name is \"%s\", expected \"rast\"\n", vd
.Name
);
1813 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1814 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1815 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1816 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1817 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1821 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1822 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1824 type
= variable
->lpVtbl
->GetType(variable
);
1825 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1826 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1828 ok(strcmp(td
.TypeName
, "RasterizerState") == 0, "TypeName is \"%s\", expected \"RasterizerState\"\n", td
.TypeName
);
1829 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1830 ok(td
.Type
== D3D10_SVT_RASTERIZER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_RASTERIZER
);
1831 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1832 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1833 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1834 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1835 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1836 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1837 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1839 /* check SamplerState sam */
1840 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1841 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1842 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1844 ok(strcmp(vd
.Name
, "sam") == 0, "Name is \"%s\", expected \"sam\"\n", vd
.Name
);
1845 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1846 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1847 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1848 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1849 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1853 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1854 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1856 type
= variable
->lpVtbl
->GetType(variable
);
1857 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1858 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1860 ok(strcmp(td
.TypeName
, "SamplerState") == 0, "TypeName is \"%s\", expected \"SamplerState\"\n", td
.TypeName
);
1861 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1862 ok(td
.Type
== D3D10_SVT_SAMPLER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_SAMPLER
);
1863 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1864 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1865 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1866 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1867 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1868 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1869 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1871 /* check RenderTargetView rtv */
1872 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1873 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1874 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1876 ok(strcmp(vd
.Name
, "rtv") == 0, "Name is \"%s\", expected \"rtv\"\n", vd
.Name
);
1877 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1878 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1879 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1880 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1881 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1885 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1886 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1888 type
= variable
->lpVtbl
->GetType(variable
);
1889 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1890 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1892 ok(strcmp(td
.TypeName
, "RenderTargetView") == 0, "TypeName is \"%s\", expected \"RenderTargetView\"\n", td
.TypeName
);
1893 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1894 ok(td
.Type
== D3D10_SVT_RENDERTARGETVIEW
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_RENDERTARGETVIEW
);
1895 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1896 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1897 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1898 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1899 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1900 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1901 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1903 /* check DepthStencilView dsv */
1904 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1905 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1906 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1908 ok(strcmp(vd
.Name
, "dsv") == 0, "Name is \"%s\", expected \"dsv\"\n", vd
.Name
);
1909 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1910 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1911 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1912 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1913 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1917 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1918 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1920 type
= variable
->lpVtbl
->GetType(variable
);
1921 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1922 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1924 ok(strcmp(td
.TypeName
, "DepthStencilView") == 0, "TypeName is \"%s\", expected \"DepthStencilView\"\n", td
.TypeName
);
1925 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1926 ok(td
.Type
== D3D10_SVT_DEPTHSTENCILVIEW
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_DEPTHSTENCILVIEW
);
1927 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1928 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1929 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1930 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1931 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1932 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1933 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1935 /* check Texture t0 */
1936 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1937 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1938 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1940 ok(!strcmp(vd
.Name
, "t0"), "Unexpected Name \"%s\".\n", vd
.Name
);
1941 ok(!vd
.Semantic
, "Unexpected Semantic \"%s\".\n", vd
.Semantic
);
1942 ok(!vd
.Flags
, "Unexpected Flags %u.\n", vd
.Flags
);
1943 ok(!vd
.Annotations
, "Unexpected Annotations %u.\n", vd
.Annotations
);
1944 ok(!vd
.BufferOffset
, "Unexpected BufferOffset %u.\n", vd
.BufferOffset
);
1945 ok(!vd
.ExplicitBindPoint
, "Unexpected ExplicitBindPoint %u.\n", vd
.ExplicitBindPoint
);
1949 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1950 ok(null_buffer
== parent
, "Unexpected parent %p.\n", parent
);
1952 type
= variable
->lpVtbl
->GetType(variable
);
1953 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1954 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1956 ok(!strcmp(td
.TypeName
, "texture"), "Unexpected TypeName \"%s\".\n", td
.TypeName
);
1957 ok(td
.Class
== D3D10_SVC_OBJECT
, "Unexpected Class %x.\n", td
.Class
);
1958 ok(td
.Type
== D3D10_SVT_TEXTURE
, "Unexpected Type %x.\n", td
.Type
);
1959 ok(!td
.Elements
, "Unexpected Elements %u.\n", td
.Elements
);
1960 ok(!td
.Members
, "Unexpected Members %u.\n", td
.Members
);
1961 ok(!td
.Rows
, "Unexpected Rows %u.\n", td
.Rows
);
1962 ok(!td
.Columns
, "Unexpected Columns %u.\n", td
.Columns
);
1963 ok(!td
.PackedSize
, "Unexpected PackedSize %#x.\n", td
.PackedSize
);
1964 ok(!td
.UnpackedSize
, "Unexpected UnpackedSize %#x.\n", td
.UnpackedSize
);
1965 ok(!td
.Stride
, "Unexpected Stride %#x.\n", td
.Stride
);
1967 /* check Texture1D t1 */
1968 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
1969 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
1970 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1972 ok(strcmp(vd
.Name
, "t1") == 0, "Name is \"%s\", expected \"t1\"\n", vd
.Name
);
1973 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
1974 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
1975 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
1976 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
1977 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
1981 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
1982 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
1984 type
= variable
->lpVtbl
->GetType(variable
);
1985 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
1986 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
1988 ok(strcmp(td
.TypeName
, "Texture1D") == 0, "TypeName is \"%s\", expected \"Texture1D\"\n", td
.TypeName
);
1989 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
1990 ok(td
.Type
== D3D10_SVT_TEXTURE1D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE1D
);
1991 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
1992 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
1993 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
1994 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
1995 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
1996 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
1997 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
1999 /* check Texture1DArray t1a */
2000 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2001 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2002 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2004 ok(strcmp(vd
.Name
, "t1a") == 0, "Name is \"%s\", expected \"t1a\"\n", vd
.Name
);
2005 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2006 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2007 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2008 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2009 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2013 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2014 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2016 type
= variable
->lpVtbl
->GetType(variable
);
2017 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2018 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2020 ok(strcmp(td
.TypeName
, "Texture1DArray") == 0, "TypeName is \"%s\", expected \"Texture1DArray\"\n", td
.TypeName
);
2021 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2022 ok(td
.Type
== D3D10_SVT_TEXTURE1DARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE1DARRAY
);
2023 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2024 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2025 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2026 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2027 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2028 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2029 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2031 /* check Texture2D t2 */
2032 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2033 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2034 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2036 ok(strcmp(vd
.Name
, "t2") == 0, "Name is \"%s\", expected \"t2\"\n", vd
.Name
);
2037 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2038 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2039 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2040 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2041 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2045 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2046 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2048 type
= variable
->lpVtbl
->GetType(variable
);
2049 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2050 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2052 ok(strcmp(td
.TypeName
, "Texture2D") == 0, "TypeName is \"%s\", expected \"Texture2D\"\n", td
.TypeName
);
2053 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2054 ok(td
.Type
== D3D10_SVT_TEXTURE2D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2D
);
2055 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2056 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2057 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2058 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2059 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2060 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2061 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2063 /* check Texture2DMS t2dms */
2064 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2065 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2066 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2068 ok(strcmp(vd
.Name
, "t2dms") == 0, "Name is \"%s\", expected \"t2dms\"\n", vd
.Name
);
2069 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2070 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2071 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2072 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2073 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2077 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2078 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2080 type
= variable
->lpVtbl
->GetType(variable
);
2081 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2082 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2084 ok(strcmp(td
.TypeName
, "Texture2DMS") == 0, "TypeName is \"%s\", expected \"Texture2DMS\"\n", td
.TypeName
);
2085 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2086 ok(td
.Type
== D3D10_SVT_TEXTURE2DMS
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DMS
);
2087 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2088 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2089 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2090 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2091 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2092 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2093 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2095 /* check Texture2DArray t2a */
2096 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2097 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2098 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2100 ok(strcmp(vd
.Name
, "t2a") == 0, "Name is \"%s\", expected \"t2a\"\n", vd
.Name
);
2101 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2102 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2103 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2104 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2105 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2109 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2110 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2112 type
= variable
->lpVtbl
->GetType(variable
);
2113 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2114 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2116 ok(strcmp(td
.TypeName
, "Texture2DArray") == 0, "TypeName is \"%s\", expected \"Texture2DArray\"\n", td
.TypeName
);
2117 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2118 ok(td
.Type
== D3D10_SVT_TEXTURE2DARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DARRAY
);
2119 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2120 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2121 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2122 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2123 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2124 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2125 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2127 /* check Texture2DMSArray t2dmsa */
2128 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2129 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2130 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2132 ok(strcmp(vd
.Name
, "t2dmsa") == 0, "Name is \"%s\", expected \"t2dmsa\"\n", vd
.Name
);
2133 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2134 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2135 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2136 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2137 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2141 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2142 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2144 type
= variable
->lpVtbl
->GetType(variable
);
2145 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2146 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2148 ok(strcmp(td
.TypeName
, "Texture2DMSArray") == 0, "TypeName is \"%s\", expected \"TTexture2DMSArray\"\n", td
.TypeName
);
2149 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2150 ok(td
.Type
== D3D10_SVT_TEXTURE2DMSARRAY
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE2DMSARRAY
);
2151 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2152 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2153 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2154 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2155 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2156 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2157 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2159 /* check Texture3D t3 */
2160 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2161 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2162 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2164 ok(strcmp(vd
.Name
, "t3") == 0, "Name is \"%s\", expected \"t3\"\n", vd
.Name
);
2165 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2166 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2167 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2168 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2169 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2173 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2174 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2176 type
= variable
->lpVtbl
->GetType(variable
);
2177 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2178 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2180 ok(strcmp(td
.TypeName
, "Texture3D") == 0, "TypeName is \"%s\", expected \"Texture3D\"\n", td
.TypeName
);
2181 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2182 ok(td
.Type
== D3D10_SVT_TEXTURE3D
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURE3D
);
2183 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2184 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2185 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2186 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2187 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2188 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2189 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2191 /* check TextureCube tq */
2192 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2193 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2194 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2196 ok(strcmp(vd
.Name
, "tq") == 0, "Name is \"%s\", expected \"tq\"\n", vd
.Name
);
2197 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2198 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2199 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2200 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2201 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2205 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2206 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2208 type
= variable
->lpVtbl
->GetType(variable
);
2209 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2210 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2212 ok(strcmp(td
.TypeName
, "TextureCube") == 0, "TypeName is \"%s\", expected \"TextureCube\"\n", td
.TypeName
);
2213 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2214 ok(td
.Type
== D3D10_SVT_TEXTURECUBE
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_TEXTURECUBE
);
2215 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2216 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2217 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2218 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2219 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2220 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2221 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2223 /* check GeometryShader gs[2] */
2224 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2225 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2226 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2228 ok(strcmp(vd
.Name
, "gs") == 0, "Name is \"%s\", expected \"gs\"\n", vd
.Name
);
2229 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2230 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2231 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2232 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2233 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2237 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2238 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2240 type
= variable
->lpVtbl
->GetType(variable
);
2241 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2242 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2244 ok(strcmp(td
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", td
.TypeName
);
2245 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2246 ok(td
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_GEOMETRYSHADER
);
2247 ok(td
.Elements
== 2, "Elements is %u, expected 2\n", td
.Elements
);
2248 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2249 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2250 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2251 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2252 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2253 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2255 /* check PixelShader ps */
2256 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2257 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2258 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2260 ok(strcmp(vd
.Name
, "ps") == 0, "Name is \"%s\", expected \"ps\"\n", vd
.Name
);
2261 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2262 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2263 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2264 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2265 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2269 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2270 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2272 type
= variable
->lpVtbl
->GetType(variable
);
2273 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2274 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2276 ok(strcmp(td
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", td
.TypeName
);
2277 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2278 ok(td
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_PIXELSHADER
);
2279 ok(td
.Elements
== 0, "Elements is %u, expected 0\n", td
.Elements
);
2280 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2281 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2282 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2283 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2284 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2285 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2287 /* check VertexShader vs[1] */
2288 variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, variable_nr
++);
2289 hr
= variable
->lpVtbl
->GetDesc(variable
, &vd
);
2290 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2292 ok(strcmp(vd
.Name
, "vs") == 0, "Name is \"%s\", expected \"vs\"\n", vd
.Name
);
2293 ok(vd
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vd
.Semantic
);
2294 ok(vd
.Flags
== 0, "Flags is %u, expected 0\n", vd
.Flags
);
2295 ok(vd
.Annotations
== 0, "Annotations is %u, expected 0\n", vd
.Annotations
);
2296 ok(vd
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vd
.BufferOffset
);
2297 ok(vd
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vd
.ExplicitBindPoint
);
2301 parent
= variable
->lpVtbl
->GetParentConstantBuffer(variable
);
2302 ok(null_buffer
== parent
, "GetParentConstantBuffer got %p, expected %p\n", parent
, null_buffer
);
2304 type
= variable
->lpVtbl
->GetType(variable
);
2305 hr
= type
->lpVtbl
->GetDesc(type
, &td
);
2306 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2308 ok(strcmp(td
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", td
.TypeName
);
2309 ok(td
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", td
.Class
, D3D10_SVC_OBJECT
);
2310 ok(td
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", td
.Type
, D3D10_SVT_VERTEXSHADER
);
2311 ok(td
.Elements
== 1, "Elements is %u, expected 1\n", td
.Elements
);
2312 ok(td
.Members
== 0, "Members is %u, expected 0\n", td
.Members
);
2313 ok(td
.Rows
== 0, "Rows is %u, expected 0\n", td
.Rows
);
2314 ok(td
.Columns
== 0, "Columns is %u, expected 0\n", td
.Columns
);
2315 ok(td
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", td
.PackedSize
);
2316 ok(td
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", td
.UnpackedSize
);
2317 ok(td
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", td
.Stride
);
2319 effect
->lpVtbl
->Release(effect
);
2321 refcount
= ID3D10Device_Release(device
);
2322 ok(!refcount
, "Device has %lu references left.\n", refcount
);
2326 * test_effect_constant_buffer_stride
2360 float2 a6
: packoffset(c0
);
2361 float3 b6
: packoffset(c1
);
2362 float2 c6
: packoffset(c0
.z
);
2366 float2 a7
: packoffset(c0
);
2367 float3 b7
: packoffset(c1
);
2368 float2 c7
: packoffset(c2
);
2372 float2 a8
: packoffset(c0
);
2373 float3 b8
: packoffset(c0
.y
);
2374 float4 c8
: packoffset(c2
);
2378 float2 a9
: packoffset(c0
);
2379 float2 b9
: packoffset(c0
.y
);
2380 float2 c9
: packoffset(c0
.z
);
2384 float4 a10
: packoffset(c2
);
2420 float2 a15
[2] : packoffset(c0
);
2423 static DWORD fx_test_ecbs
[] = {
2424 0x43425844, 0x615d7d77, 0x21289d92, 0xe9e8d98e,
2425 0xcae7b74e, 0x00000001, 0x00000855, 0x00000001,
2426 0x00000024, 0x30315846, 0x00000829, 0xfeff1001,
2427 0x0000000f, 0x00000024, 0x00000000, 0x00000000,
2428 0x00000000, 0x00000000, 0x00000000, 0x00000285,
2429 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2430 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2431 0x00000000, 0x00000000, 0x00000000, 0x00316263,
2432 0x616f6c66, 0x00080074, 0x00010000, 0x00000000,
2433 0x00040000, 0x00100000, 0x00040000, 0x09090000,
2434 0x31610000, 0x00316200, 0x64003163, 0x62630031,
2435 0x32610032, 0x6f6c6600, 0x00327461, 0x0000003d,
2436 0x00000001, 0x00000000, 0x00000008, 0x00000010,
2437 0x00000008, 0x0000110a, 0x63003262, 0x61003362,
2438 0x6c660033, 0x3374616f, 0x00006a00, 0x00000100,
2439 0x00000000, 0x00000c00, 0x00001000, 0x00000c00,
2440 0x00190a00, 0x00336200, 0x00346263, 0x62003461,
2441 0x34630034, 0x35626300, 0x00356100, 0x63003562,
2442 0x62630035, 0x36610036, 0x00366200, 0x63003663,
2443 0x61003762, 0x37620037, 0x00376300, 0x00386263,
2444 0x62003861, 0x6c660038, 0x3474616f, 0x0000ce00,
2445 0x00000100, 0x00000000, 0x00001000, 0x00001000,
2446 0x00001000, 0x00210a00, 0x00386300, 0x00396263,
2447 0x62003961, 0x39630039, 0x31626300, 0x31610030,
2448 0x62630030, 0x3c003131, 0x616e6e75, 0x3e64656d,
2449 0x31316100, 0x31316200, 0x00010f00, 0x00000300,
2450 0x00000000, 0x00001400, 0x00002000, 0x00001400,
2451 0x00000200, 0x00011900, 0x00000000, 0x00000000,
2452 0x0000d500, 0x00011d00, 0x00000000, 0x00001000,
2453 0x00000e00, 0x31317300, 0x31316300, 0x31626300,
2454 0x31630032, 0x31620032, 0x31610032, 0x010f0032,
2455 0x00030000, 0x00000000, 0x00200000, 0x00200000,
2456 0x00140000, 0x00020000, 0x016e0000, 0x00000000,
2457 0x00000000, 0x000e0000, 0x01720000, 0x00000000,
2458 0x00100000, 0x00d50000, 0x31730000, 0x62630032,
2459 0x61003331, 0x62003331, 0x0f003331, 0x03000001,
2460 0x00000000, 0x04000000, 0x10000000, 0x04000000,
2461 0x01000000, 0xbf000000, 0x00000001, 0x00000000,
2462 0x0e000000, 0x73000000, 0x63003331, 0x00343162,
2463 0x00343161, 0x0000010f, 0x00000003, 0x00000000,
2464 0x00000004, 0x00000010, 0x00000004, 0x00000001,
2465 0x000001f8, 0x00000000, 0x00000000, 0x0000000e,
2466 0x00343173, 0x00343162, 0x0000010f, 0x00000003,
2467 0x00000000, 0x00000004, 0x00000010, 0x00000004,
2468 0x00000001, 0x0000022c, 0x00000000, 0x00000000,
2469 0x0000000e, 0x00343174, 0x35316263, 0x00003d00,
2470 0x00000100, 0x00000200, 0x00001800, 0x00001000,
2471 0x00001000, 0x00110a00, 0x35316100, 0x00000400,
2472 0x00001000, 0x00000000, 0x00000400, 0xffffff00,
2473 0x000000ff, 0x00002a00, 0x00000e00, 0x00000000,
2474 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2475 0x00002d00, 0x00000e00, 0x00000000, 0x00000400,
2476 0x00000000, 0x00000000, 0x00000000, 0x00003000,
2477 0x00000e00, 0x00000000, 0x00000800, 0x00000000,
2478 0x00000000, 0x00000000, 0x00003300, 0x00000e00,
2479 0x00000000, 0x00000c00, 0x00000000, 0x00000000,
2480 0x00000000, 0x00003600, 0x00001000, 0x00000000,
2481 0x00000200, 0xffffff00, 0x000000ff, 0x00003a00,
2482 0x00000e00, 0x00000000, 0x00000000, 0x00000000,
2483 0x00000000, 0x00000000, 0x00006000, 0x00004400,
2484 0x00000000, 0x00000400, 0x00000000, 0x00000000,
2485 0x00000000, 0x00006300, 0x00002000, 0x00000000,
2486 0x00000200, 0xffffff00, 0x000000ff, 0x00006700,
2487 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2488 0x00000000, 0x00000000, 0x00008d00, 0x00007100,
2489 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2490 0x00000000, 0x00009000, 0x00003000, 0x00000000,
2491 0x00000300, 0xffffff00, 0x000000ff, 0x00009400,
2492 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2493 0x00000000, 0x00000000, 0x00009700, 0x00007100,
2494 0x00000000, 0x00001000, 0x00000000, 0x00000000,
2495 0x00000000, 0x00009a00, 0x00004400, 0x00000000,
2496 0x00002000, 0x00000000, 0x00000000, 0x00000000,
2497 0x00009d00, 0x00002000, 0x00000000, 0x00000300,
2498 0xffffff00, 0x000000ff, 0x0000a100, 0x00004400,
2499 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2500 0x00000000, 0x0000a400, 0x00004400, 0x00000000,
2501 0x00000800, 0x00000000, 0x00000000, 0x00000000,
2502 0x0000a700, 0x00007100, 0x00000000, 0x00001000,
2503 0x00000000, 0x00000000, 0x00000000, 0x0000aa00,
2504 0x00002000, 0x00000000, 0x00000300, 0xffffff00,
2505 0x000000ff, 0x0000ae00, 0x00004400, 0x00000000,
2506 0x00000000, 0x00000000, 0x00000400, 0x00000000,
2507 0x0000b100, 0x00007100, 0x00000000, 0x00001000,
2508 0x00000000, 0x00000400, 0x00000000, 0x0000b400,
2509 0x00004400, 0x00000000, 0x00000800, 0x00000000,
2510 0x00000400, 0x00000000, 0x0000b700, 0x00003000,
2511 0x00000000, 0x00000300, 0xffffff00, 0x000000ff,
2512 0x0000bb00, 0x00004400, 0x00000000, 0x00000000,
2513 0x00000000, 0x00000400, 0x00000000, 0x0000be00,
2514 0x00007100, 0x00000000, 0x00001000, 0x00000000,
2515 0x00000400, 0x00000000, 0x0000c100, 0x00004400,
2516 0x00000000, 0x00002000, 0x00000000, 0x00000400,
2517 0x00000000, 0x0000c400, 0x00003000, 0x00000000,
2518 0x00000300, 0xffffff00, 0x000000ff, 0x0000c800,
2519 0x00004400, 0x00000000, 0x00000000, 0x00000000,
2520 0x00000400, 0x00000000, 0x0000cb00, 0x00007100,
2521 0x00000000, 0x00000400, 0x00000000, 0x00000400,
2522 0x00000000, 0x0000f100, 0x0000d500, 0x00000000,
2523 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2524 0x0000f400, 0x00001000, 0x00000000, 0x00000300,
2525 0xffffff00, 0x000000ff, 0x0000f800, 0x00004400,
2526 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2527 0x00000000, 0x0000fb00, 0x00004400, 0x00000000,
2528 0x00000400, 0x00000000, 0x00000400, 0x00000000,
2529 0x0000fe00, 0x00004400, 0x00000000, 0x00000800,
2530 0x00000000, 0x00000400, 0x00000000, 0x00010100,
2531 0x00003000, 0x00000000, 0x00000100, 0xffffff00,
2532 0x000000ff, 0x00010600, 0x0000d500, 0x00000000,
2533 0x00002000, 0x00000000, 0x00000400, 0x00000000,
2534 0x00010a00, 0x00002000, 0x00000000, 0x00000200,
2535 0xffffff00, 0x000000ff, 0x00015d00, 0x00012100,
2536 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2537 0x00000000, 0x00016100, 0x00000e00, 0x00000000,
2538 0x00001400, 0x00000000, 0x00000000, 0x00000000,
2539 0x00016500, 0x00003000, 0x00000000, 0x00000200,
2540 0xffffff00, 0x000000ff, 0x00016a00, 0x00000e00,
2541 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2542 0x00000000, 0x0001b200, 0x00017600, 0x00000000,
2543 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2544 0x0001b600, 0x00002000, 0x00000000, 0x00000200,
2545 0xffffff00, 0x000000ff, 0x0001bb00, 0x00000e00,
2546 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2547 0x00000000, 0x0001ef00, 0x0001c300, 0x00000000,
2548 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2549 0x0001f300, 0x00002000, 0x00000000, 0x00000200,
2550 0xffffff00, 0x000000ff, 0x00022800, 0x0001fc00,
2551 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2552 0x00000000, 0x00025c00, 0x00023000, 0x00000000,
2553 0x00001000, 0x00000000, 0x00000000, 0x00000000,
2554 0x00026000, 0x00002000, 0x00000000, 0x00000100,
2555 0xffffff00, 0x000000ff, 0x00028100, 0x00026500,
2556 0x00000000, 0x00000000, 0x00000000, 0x00000400,
2557 0x00000000, 0x00000000,
2560 static void test_effect_constant_buffer_stride(void)
2562 ID3D10Effect
*effect
;
2563 ID3D10EffectConstantBuffer
*constantbuffer
;
2564 ID3D10EffectType
*type
;
2565 D3D10_EFFECT_TYPE_DESC tdesc
;
2566 D3D10_EFFECT_DESC effect_desc
;
2567 ID3D10Device
*device
;
2572 static const struct {
2573 unsigned int m
; /* members */
2574 unsigned int p
; /* packed size */
2575 unsigned int u
; /* unpacked size */
2576 unsigned int s
; /* stride */
2578 {4, 0x10, 0x10, 0x10},
2579 {2, 0xc, 0x10, 0x10},
2580 {2, 0x14, 0x20, 0x20},
2581 {3, 0x1c, 0x30, 0x30},
2582 {3, 0x1c, 0x20, 0x20},
2583 {3, 0x1c, 0x20, 0x20},
2584 {3, 0x1c, 0x30, 0x30},
2585 {3, 0x24, 0x30, 0x30},
2586 {3, 0x18, 0x10, 0x10},
2587 {1, 0x10, 0x30, 0x30},
2588 {2, 0x18, 0x20, 0x20},
2589 {2, 0x18, 0x30, 0x30},
2590 {2, 0x8, 0x20, 0x20},
2591 {2, 0x8, 0x20, 0x20},
2592 {1, 0x10, 0x20, 0x20},
2595 if (!(device
= create_device()))
2597 skip("Failed to create device, skipping tests.\n");
2601 hr
= create_effect(fx_test_ecbs
, 0, device
, NULL
, &effect
);
2602 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2604 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
2605 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2606 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
2607 ok(effect_desc
.ConstantBuffers
== 15, "Unexpected constant buffers count %u.\n",
2608 effect_desc
.ConstantBuffers
);
2609 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
2610 effect_desc
.SharedConstantBuffers
);
2611 ok(effect_desc
.GlobalVariables
== 36, "Unexpected global variables count %u.\n",
2612 effect_desc
.GlobalVariables
);
2613 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
2614 effect_desc
.SharedGlobalVariables
);
2615 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
2617 for (i
=0; i
<ARRAY_SIZE(tv_ecbs
); i
++)
2619 constantbuffer
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, i
);
2620 type
= constantbuffer
->lpVtbl
->GetType(constantbuffer
);
2622 hr
= type
->lpVtbl
->GetDesc(type
, &tdesc
);
2623 ok(hr
== S_OK
, "%u: Got unexpected hr %#lx.\n", i
, hr
);
2625 ok(strcmp(tdesc
.TypeName
, "cbuffer") == 0, "TypeName is \"%s\", expected \"cbuffer\"\n", tdesc
.TypeName
);
2626 ok(tdesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", tdesc
.Class
, D3D10_SVC_OBJECT
);
2627 ok(tdesc
.Type
== D3D10_SVT_CBUFFER
, "Type is %x, expected %x\n", tdesc
.Type
, D3D10_SVT_CBUFFER
);
2628 ok(tdesc
.Elements
== 0, "Elements is %u, expected 0\n", tdesc
.Elements
);
2629 ok(tdesc
.Members
== tv_ecbs
[i
].m
, "Members is %u, expected %u\n", tdesc
.Members
, tv_ecbs
[i
].m
);
2630 ok(tdesc
.Rows
== 0, "Rows is %u, expected 0\n", tdesc
.Rows
);
2631 ok(tdesc
.Columns
== 0, "Columns is %u, expected 0\n", tdesc
.Columns
);
2632 ok(tdesc
.PackedSize
== tv_ecbs
[i
].p
, "PackedSize is %#x, expected %#x\n", tdesc
.PackedSize
, tv_ecbs
[i
].p
);
2633 ok(tdesc
.UnpackedSize
== tv_ecbs
[i
].u
, "UnpackedSize is %#x, expected %#x\n", tdesc
.UnpackedSize
, tv_ecbs
[i
].u
);
2634 ok(tdesc
.Stride
== tv_ecbs
[i
].s
, "Stride is %#x, expected %#x\n", tdesc
.Stride
, tv_ecbs
[i
].s
);
2637 effect
->lpVtbl
->Release(effect
);
2639 refcount
= ID3D10Device_Release(device
);
2640 ok(!refcount
, "Device has %lu references left.\n", refcount
);
2644 float4
VS( float4 Pos
: POSITION
) : SV_POSITION
{ return Pos
; }
2645 float4
VS2( int4 Pos
: POSITION
) : SV_POSITION
{ return Pos
; }
2646 float4
PS( float4 Pos
: SV_POSITION
) : SV_Target
{ return float4( 1.0f
, 1.0f
, 0.0f
, 1.0f
); }
2647 struct GS_OUT
{ float4 Pos
: SV_POSITION
; };
2649 void GS( triangle float4 Pos
[3] : SV_POSITION
, inout TriangleStream
<GS_OUT
> TriStream
)
2653 TriStream
.Append( out1
);
2655 TriStream
.Append( out1
);
2657 TriStream
.Append( out1
);
2658 TriStream
.RestartStrip();
2660 VertexShader v0
= NULL
;
2661 PixelShader p0
= NULL
;
2662 GeometryShader g0
= NULL
;
2663 VertexShader v
[2] = { CompileShader( vs_4_0
, VS() ), CompileShader( vs_4_0
, VS2() ) };
2664 PixelShader p
= CompileShader( ps_4_0
, PS() );
2665 GeometryShader g
= CompileShader( gs_4_0
, GS() );
2666 GeometryShader g_so
= ConstructGSWithSO
2668 CompileShader( gs_4_0
, GS()), "SV_POSITION.x; $Skip.x; SV_POSITION.gb"
2675 SetPixelShader( NULL
);
2676 SetVertexShader( NULL
);
2677 SetGeometryShader( NULL
);
2681 SetPixelShader( NULL
);
2682 SetVertexShader( NULL
);
2683 SetGeometryShader( NULL
);
2687 SetPixelShader( CompileShader( ps_4_0
, PS() ) );
2688 SetVertexShader( CompileShader( vs_4_0
, VS() ) );
2689 SetGeometryShader( CompileShader( gs_4_0
, GS() ) );
2693 SetPixelShader( CompileShader( ps_4_0
, PS() ) );
2694 SetVertexShader( CompileShader( vs_4_0
, VS2() ) );
2695 SetGeometryShader( CompileShader( gs_4_0
, GS() ) );
2699 SetPixelShader( p0
);
2700 SetVertexShader( v0
);
2701 SetGeometryShader( g0
);
2705 SetPixelShader( p
);
2706 SetVertexShader( v
[0] );
2707 SetGeometryShader( g
);
2711 SetPixelShader( p
);
2712 SetVertexShader( v
[1] );
2713 SetGeometryShader( g
);
2717 SetPixelShader( p
);
2718 SetVertexShader( v
[1] );
2719 SetGeometryShader( ConstructGSWithSO(CompileShader( gs_4_0
, GS()), "SV_POSITION.y") );
2723 static DWORD fx_local_shader
[] =
2725 0x43425844, 0x37f7879b, 0xb6640b9a, 0x373a9d5a, 0x84b37ed2, 0x00000001, 0x00001aab, 0x00000001,
2726 0x00000024, 0x30315846, 0x00001a7f, 0xfeff1001, 0x00000000, 0x00000000, 0x00000007, 0x00000000,
2727 0x00000000, 0x00000000, 0x00000001, 0x0000178b, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2728 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000f, 0x00000007, 0x00000000, 0x74726556,
2729 0x68537865, 0x72656461, 0x00000400, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2730 0x00000600, 0x00307600, 0x65786950, 0x6168536c, 0x00726564, 0x00000030, 0x00000002, 0x00000000,
2731 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x47003070, 0x656d6f65, 0x53797274, 0x65646168,
2732 0x005b0072, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00070000, 0x30670000,
2733 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000600, 0xa8007600,
2734 0x44000001, 0x92434258, 0xa75ea3fc, 0x13affa34, 0x46be1a21, 0x0104d04a, 0xa8000000, 0x05000001,
2735 0x34000000, 0x80000000, 0xb4000000, 0xe8000000, 0x2c000000, 0x52000001, 0x44464544, 0x00000000,
2736 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00fffe04, 0x1c000001, 0x4d000000, 0x6f726369,
2737 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
2738 0x4900312e, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x00000000, 0x03000000,
2739 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49, 0x4fababab, 0x2c4e4753, 0x01000000,
2740 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000, 0x53000000,
2741 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000, 0x0f000100, 0x5f000000, 0xf2030000,
2742 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000, 0x36000000, 0xf2050000, 0x00001020,
2743 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154, 0x02000000, 0x00000000, 0x00000000,
2744 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000,
2745 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2746 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2747 0x00000000, 0x00000000, 0xa8000000, 0x44000001, 0x84434258, 0xa05ac55b, 0x929a6a46, 0x4f0df40a,
2748 0x01a2fea3, 0xa8000000, 0x05000001, 0x34000000, 0x80000000, 0xb4000000, 0xe8000000, 0x2c000000,
2749 0x52000001, 0x44464544, 0x00000000, 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00fffe04,
2750 0x1c000001, 0x4d000000, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
2751 0x6d6f4320, 0x656c6970, 0x30312072, 0x4900312e, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000,
2752 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x0f000000, 0x5000000f, 0x5449534f, 0x004e4f49,
2753 0x4fababab, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000,
2754 0x00000000, 0x0f000000, 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x3c524448, 0x40000000,
2755 0x0f000100, 0x5f000000, 0xf2030000, 0x00001010, 0x67000000, 0xf2040000, 0x00001020, 0x01000000,
2756 0x2b000000, 0xf2050000, 0x00001020, 0x46000000, 0x0000101e, 0x3e000000, 0x53010000, 0x74544154,
2757 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000,
2758 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2759 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000,
2760 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x70000000, 0x0001a400, 0x42584400,
2761 0xf4813443, 0xb6605b8e, 0xc69999b8, 0xcb75f1b5, 0x000001eb, 0x0001a400, 0x00000500, 0x00003400,
2762 0x00008000, 0x0000b400, 0x0000e800, 0x00012800, 0x45445200, 0x00004446, 0x00000000, 0x00000000,
2763 0x00000000, 0x00001c00, 0xff040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466,
2764 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x312e3031, 0x47534900,
2765 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2766 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800,
2767 0x00002000, 0x00000000, 0x00000000, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x67726154,
2768 0xab007465, 0x444853ab, 0x00003852, 0x00004000, 0x00000e00, 0x00006500, 0x1020f203, 0x00000000,
2769 0x00003600, 0x1020f208, 0x00000000, 0x00400200, 0x80000000, 0x8000003f, 0x0000003f, 0x80000000,
2770 0x00003e3f, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000, 0x00000100, 0x00000000,
2771 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2772 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000,
2773 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2774 0x04006700, 0x44000002, 0x23434258, 0x6e8e325e, 0x5f0774e8, 0xbfe636e1, 0x01d3f67a, 0x04000000,
2775 0x05000002, 0x34000000, 0x80000000, 0xb4000000, 0xe8000000, 0x88000000, 0x52000001, 0x44464544,
2776 0x00000000, 0x00000000, 0x00000000, 0x1c000000, 0x00000000, 0x00475304, 0x1c000001, 0x4d000000,
2777 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
2778 0x30312072, 0x4900312e, 0x2c4e4753, 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000,
2779 0x03000000, 0x00000000, 0x0f000000, 0x5300000f, 0x4f505f56, 0x49544953, 0x4f004e4f, 0x2c4e4753,
2780 0x01000000, 0x08000000, 0x20000000, 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x0f000000,
2781 0x53000000, 0x4f505f56, 0x49544953, 0x53004e4f, 0x98524448, 0x40000000, 0x26000200, 0x61000000,
2782 0xf2050000, 0x03002010, 0x00000000, 0x01000000, 0x5d000000, 0x5c010018, 0x67010028, 0xf2040000,
2783 0x00001020, 0x01000000, 0x5e000000, 0x03020000, 0x36000000, 0xf2060000, 0x00001020, 0x46000000,
2784 0x0000201e, 0x00000000, 0x13000000, 0x36010000, 0xf2060000, 0x00001020, 0x46000000, 0x0100201e,
2785 0x00000000, 0x13000000, 0x36010000, 0xf2060000, 0x00001020, 0x46000000, 0x0200201e, 0x00000000,
2786 0x13000000, 0x09010000, 0x3e010000, 0x53010000, 0x74544154, 0x08000000, 0x00000000, 0x00000000,
2787 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000,
2788 0x00000000, 0x01000000, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2789 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x05000000, 0x03000000, 0x00000000,
2790 0x00000000, 0x00000000, 0x5b000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2791 0x08000000, 0x67000000, 0x006f735f, 0x00000204, 0x43425844, 0x8e325e23, 0x0774e86e, 0xe636e15f,
2792 0xd3f67abf, 0x00000001, 0x00000204, 0x00000005, 0x00000034, 0x00000080, 0x000000b4, 0x000000e8,
2793 0x00000188, 0x46454452, 0x00000044, 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x47530400,
2794 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168,
2795 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008,
2796 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x5449534f,
2797 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001,
2798 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x00000098,
2799 0x00020040, 0x00000026, 0x05000061, 0x002010f2, 0x00000003, 0x00000000, 0x00000001, 0x0100185d,
2800 0x0100285c, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x0200005e, 0x00000003, 0x06000036,
2801 0x001020f2, 0x00000000, 0x00201e46, 0x00000000, 0x00000000, 0x01000013, 0x06000036, 0x001020f2,
2802 0x00000000, 0x00201e46, 0x00000001, 0x00000000, 0x01000013, 0x06000036, 0x001020f2, 0x00000000,
2803 0x00201e46, 0x00000002, 0x00000000, 0x01000013, 0x01000009, 0x0100003e, 0x54415453, 0x00000074,
2804 0x00000008, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2805 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000000,
2806 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2807 0x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x505f5653, 0x5449534f, 0x2e4e4f49,
2808 0x24203b78, 0x70696b53, 0x203b782e, 0x505f5653, 0x5449534f, 0x2e4e4f49, 0x52006267, 0x65646e65,
2809 0x30500072, 0x00315000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
2810 0x00000001, 0x00000002, 0x00000000, 0x01003250, 0x02000000, 0x00000000, 0x01000000, 0x02000000,
2811 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x50000000, 0x01a40033, 0x58440000, 0x81344342,
2812 0x605b8ef4, 0x9999b8b6, 0x75f1b5c6, 0x0001ebcb, 0x01a40000, 0x00050000, 0x00340000, 0x00800000,
2813 0x00b40000, 0x00e80000, 0x01280000, 0x44520000, 0x00444645, 0x00000000, 0x00000000, 0x00000000,
2814 0x001c0000, 0x04000000, 0x0100ffff, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228,
2815 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120, 0x53490031, 0x002c4e47,
2816 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000,
2817 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000,
2818 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x7261545f, 0x00746567,
2819 0x4853abab, 0x00385244, 0x00400000, 0x000e0000, 0x00650000, 0x20f20300, 0x00000010, 0x00360000,
2820 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80, 0x00003f80, 0x00000000, 0x003e3f80,
2821 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000,
2822 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2823 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000,
2824 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0a5e0000,
2825 0x00000000, 0x01a80000, 0x58440000, 0xfc924342, 0x34a75ea3, 0x2113affa, 0x4a46be1a, 0x000104d0,
2826 0x01a80000, 0x00050000, 0x00340000, 0x00800000, 0x00b40000, 0x00e80000, 0x012c0000, 0x44520000,
2827 0x00444645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000, 0x04000000, 0x0100fffe, 0x001c0000,
2828 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43,
2829 0x72656c69, 0x2e303120, 0x53490031, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000,
2830 0x00000000, 0x00030000, 0x00000000, 0x0f0f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab,
2831 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000,
2832 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001,
2833 0x005f0000, 0x10f20300, 0x00000010, 0x00670000, 0x20f20400, 0x00000010, 0x00010000, 0x00360000,
2834 0x20f20500, 0x00000010, 0x1e460000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000,
2835 0x00000000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000,
2836 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2837 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2838 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0c0e0000, 0x00000000, 0x02040000, 0x58440000,
2839 0x5e234342, 0xe86e8e32, 0xe15f0774, 0x7abfe636, 0x0001d3f6, 0x02040000, 0x00050000, 0x00340000,
2840 0x00800000, 0x00b40000, 0x00e80000, 0x01880000, 0x44520000, 0x00444645, 0x00000000, 0x00000000,
2841 0x00000000, 0x001c0000, 0x04000000, 0x01004753, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f,
2842 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120, 0x53490031,
2843 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000,
2844 0x0f0f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47, 0x00010000, 0x00080000,
2845 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f,
2846 0x4f495449, 0x4853004e, 0x00985244, 0x00400000, 0x00260002, 0x00610000, 0x10f20500, 0x00030020,
2847 0x00000000, 0x00010000, 0x185d0000, 0x285c0100, 0x00670100, 0x20f20400, 0x00000010, 0x00010000,
2848 0x005e0000, 0x00030200, 0x00360000, 0x20f20600, 0x00000010, 0x1e460000, 0x00000020, 0x00000000,
2849 0x00130000, 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00010020, 0x00000000, 0x00130000,
2850 0x00360100, 0x20f20600, 0x00000010, 0x1e460000, 0x00020020, 0x00000000, 0x00130000, 0x00090100,
2851 0x003e0100, 0x54530100, 0x00745441, 0x00080000, 0x00000000, 0x00000000, 0x00020000, 0x00000000,
2852 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000,
2853 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2854 0x00000000, 0x00000000, 0x00030000, 0x00050000, 0x00030000, 0x00000000, 0x00000000, 0x00000000,
2855 0x0dc20000, 0x00000000, 0x34500000, 0x0001a400, 0x42584400, 0xf4813443, 0xb6605b8e, 0xc69999b8,
2856 0xcb75f1b5, 0x000001eb, 0x0001a400, 0x00000500, 0x00003400, 0x00008000, 0x0000b400, 0x0000e800,
2857 0x00012800, 0x45445200, 0x00004446, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0xff040000,
2858 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853,
2859 0x43207265, 0x69706d6f, 0x2072656c, 0x312e3031, 0x47534900, 0x00002c4e, 0x00000100, 0x00000800,
2860 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
2861 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000,
2862 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x67726154, 0xab007465, 0x444853ab, 0x00003852,
2863 0x00004000, 0x00000e00, 0x00006500, 0x1020f203, 0x00000000, 0x00003600, 0x1020f208, 0x00000000,
2864 0x00400200, 0x80000000, 0x8000003f, 0x0000003f, 0x80000000, 0x00003e3f, 0x41545301, 0x00007454,
2865 0x00000200, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
2866 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2867 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2868 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000fd500, 0x00000000, 0x0001a800,
2869 0x42584400, 0xc55b8443, 0x6a46a05a, 0xf40a929a, 0xfea34f0d, 0x000001a2, 0x0001a800, 0x00000500,
2870 0x00003400, 0x00008000, 0x0000b400, 0x0000e800, 0x00012c00, 0x45445200, 0x00004446, 0x00000000,
2871 0x00000000, 0x00000000, 0x00001c00, 0xfe040000, 0x000100ff, 0x00001c00, 0x63694d00, 0x6f736f72,
2872 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x312e3031,
2873 0x47534900, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000, 0x00000200,
2874 0x00000000, 0x000f0f00, 0x534f5000, 0x4f495449, 0xabab004e, 0x47534fab, 0x00002c4e, 0x00000100,
2875 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300,
2876 0x49534f50, 0x4e4f4954, 0x44485300, 0x00003c52, 0x01004000, 0x00000f00, 0x00005f00, 0x1010f203,
2877 0x00000000, 0x00006700, 0x1020f204, 0x00000000, 0x00000100, 0x00002b00, 0x1020f205, 0x00000000,
2878 0x101e4600, 0x00000000, 0x00003e00, 0x41545301, 0x00007454, 0x00000200, 0x00000000, 0x00000000,
2879 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
2880 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2881 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2882 0x00000000, 0x00000000, 0x00118500, 0x00000000, 0x00020400, 0x42584400, 0x325e2343, 0x74e86e8e,
2883 0x36e15f07, 0xf67abfe6, 0x000001d3, 0x00020400, 0x00000500, 0x00003400, 0x00008000, 0x0000b400,
2884 0x0000e800, 0x00018800, 0x45445200, 0x00004446, 0x00000000, 0x00000000, 0x00000000, 0x00001c00,
2885 0x53040000, 0x00010047, 0x00001c00, 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c,
2886 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x312e3031, 0x47534900, 0x00002c4e, 0x00000100,
2887 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x000f0f00, 0x5f565300,
2888 0x49534f50, 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000,
2889 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x44485300,
2890 0x00009852, 0x02004000, 0x00002600, 0x00006100, 0x2010f205, 0x00000300, 0x00000000, 0x00000100,
2891 0x00185d00, 0x00285c01, 0x00006701, 0x1020f204, 0x00000000, 0x00000100, 0x00005e00, 0x00000302,
2892 0x00003600, 0x1020f206, 0x00000000, 0x201e4600, 0x00000000, 0x00000000, 0x00001300, 0x00003601,
2893 0x1020f206, 0x00000000, 0x201e4600, 0x00000100, 0x00000000, 0x00001300, 0x00003601, 0x1020f206,
2894 0x00000000, 0x201e4600, 0x00000200, 0x00000000, 0x00001300, 0x00000901, 0x00003e01, 0x41545301,
2895 0x00007454, 0x00000800, 0x00000000, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000,
2896 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2897 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2898 0x00000300, 0x00000500, 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00133900, 0x00000000,
2899 0x00355000, 0xa5003650, 0x00000000, 0x50000000, 0x00a50037, 0x00010000, 0x38500000, 0x0000a500,
2900 0x00000100, 0x00020400, 0x42584400, 0x325e2343, 0x74e86e8e, 0x36e15f07, 0xf67abfe6, 0x000001d3,
2901 0x00020400, 0x00000500, 0x00003400, 0x00008000, 0x0000b400, 0x0000e800, 0x00018800, 0x45445200,
2902 0x00004446, 0x00000000, 0x00000000, 0x00000000, 0x00001c00, 0x53040000, 0x00010047, 0x00001c00,
2903 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f,
2904 0x2072656c, 0x312e3031, 0x47534900, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000,
2905 0x00000100, 0x00000300, 0x00000000, 0x000f0f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x47534f00,
2906 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000,
2907 0x00000f00, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x44485300, 0x00009852, 0x02004000, 0x00002600,
2908 0x00006100, 0x2010f205, 0x00000300, 0x00000000, 0x00000100, 0x00185d00, 0x00285c01, 0x00006701,
2909 0x1020f204, 0x00000000, 0x00000100, 0x00005e00, 0x00000302, 0x00003600, 0x1020f206, 0x00000000,
2910 0x201e4600, 0x00000000, 0x00000000, 0x00001300, 0x00003601, 0x1020f206, 0x00000000, 0x201e4600,
2911 0x00000100, 0x00000000, 0x00001300, 0x00003601, 0x1020f206, 0x00000000, 0x201e4600, 0x00000200,
2912 0x00000000, 0x00001300, 0x00000901, 0x00003e01, 0x41545301, 0x00007454, 0x00000800, 0x00000000,
2913 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
2914 0x00000000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2915 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000300, 0x00000500, 0x00000300,
2916 0x00000000, 0x00000000, 0x00000000, 0x5f565300, 0x49534f50, 0x4e4f4954, 0x6d00792e, 0x75000015,
2917 0x2d000017, 0x11000000, 0x00000000, 0xff000000, 0x00ffffff, 0x00000000, 0x58000000, 0x3c000000,
2918 0x00000000, 0xff000000, 0x00ffffff, 0x00000000, 0x86000000, 0x6a000000, 0x00000000, 0xff000000,
2919 0x00ffffff, 0x00000000, 0xa5000000, 0x89000000, 0x00000000, 0xff000000, 0xa7ffffff, 0x53000000,
2920 0x00000002, 0xff000000, 0x3c000003, 0x00000000, 0xff000000, 0x01ffffff, 0x00000004, 0xa9000000,
2921 0x6a000005, 0x00000000, 0xff000000, 0xabffffff, 0x00000005, 0xcf000000, 0xb3000007, 0x00000007,
2922 0xff000000, 0xd4ffffff, 0xdc000007, 0x00000009, 0x03000000, 0x0900000a, 0x00000000, 0x0a000000,
2923 0x0000000a, 0x00000000, 0x0d000000, 0x0300000a, 0x00000000, 0x07000000, 0x00000000, 0x01000000,
2924 0x10000000, 0x0600000a, 0x00000000, 0x01000000, 0x1c000000, 0x0800000a, 0x00000000, 0x01000000,
2925 0x28000000, 0x3400000a, 0x0300000a, 0x00000000, 0x07000000, 0x00000000, 0x01000000, 0x37000000,
2926 0x0600000a, 0x00000000, 0x01000000, 0x43000000, 0x0800000a, 0x00000000, 0x01000000, 0x4f000000,
2927 0x5b00000a, 0x0300000a, 0x00000000, 0x07000000, 0x00000000, 0x07000000, 0x06000000, 0x0600000c,
2928 0x00000000, 0x07000000, 0xba000000, 0x0800000d, 0x00000000, 0x07000000, 0xca000000, 0xd200000f,
2929 0x0300000f, 0x00000000, 0x07000000, 0x00000000, 0x07000000, 0x7d000000, 0x06000011, 0x00000000,
2930 0x07000000, 0x31000000, 0x08000013, 0x00000000, 0x07000000, 0x41000000, 0x49000015, 0x03000015,
2931 0x00000000, 0x07000000, 0x00000000, 0x02000000, 0x58000000, 0x06000000, 0x00000000, 0x02000000,
2932 0x2d000000, 0x08000000, 0x00000000, 0x02000000, 0x86000000, 0x4c000000, 0x03000015, 0x00000000,
2933 0x07000000, 0x00000000, 0x02000000, 0xff000000, 0x06000003, 0x00000000, 0x03000000, 0x4f000000,
2934 0x08000015, 0x00000000, 0x02000000, 0xa9000000, 0x57000005, 0x03000015, 0x00000000, 0x07000000,
2935 0x00000000, 0x02000000, 0xff000000, 0x06000003, 0x00000000, 0x03000000, 0x5a000000, 0x08000015,
2936 0x00000000, 0x02000000, 0xa9000000, 0x62000005, 0x03000015, 0x00000000, 0x07000000, 0x00000000,
2937 0x02000000, 0xff000000, 0x06000003, 0x00000000, 0x03000000, 0x65000000, 0x08000015, 0x00000000,
2938 0x07000000, 0x83000000, 0x00000017,
2941 static void test_effect_local_shader(void)
2945 ID3D10Effect
* effect
;
2946 ID3D10EffectVariable
* v
;
2947 ID3D10EffectPass
*p
, *p2
, *null_pass
;
2948 ID3D10EffectTechnique
*t
, *t2
, *null_technique
;
2949 D3D10_PASS_SHADER_DESC pdesc
= {0};
2950 D3D10_EFFECT_VARIABLE_DESC vdesc
= {0};
2951 ID3D10EffectType
*type
;
2952 D3D10_EFFECT_TYPE_DESC typedesc
;
2953 D3D10_EFFECT_DESC effect_desc
;
2954 ID3D10EffectShaderVariable
*null_shader
, *null_anon_vs
, *null_anon_ps
, *null_anon_gs
,
2955 *p3_anon_vs
, *p3_anon_ps
, *p3_anon_gs
, *p6_vs
, *p6_ps
, *p6_gs
, *gs
, *ps
, *vs
;
2956 ID3D10PixelShader
*ps_d3d
, *ps_d3d_2
;
2957 D3D10_EFFECT_SHADER_DESC shaderdesc
;
2958 D3D10_SIGNATURE_PARAMETER_DESC sign
;
2959 D3D10_STATE_BLOCK_MASK mask
;
2960 D3D10_PASS_DESC pass_desc
;
2961 ID3D10Device
*device
;
2964 if (!(device
= create_device()))
2966 skip("Failed to create device, skipping tests.\n");
2970 hr
= create_effect(fx_local_shader
, 0, device
, NULL
, &effect
);
2971 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2973 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
2974 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
2975 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
2976 ok(effect_desc
.ConstantBuffers
== 0, "Unexpected constant buffers count %u.\n",
2977 effect_desc
.ConstantBuffers
);
2978 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
2979 effect_desc
.SharedConstantBuffers
);
2980 ok(effect_desc
.GlobalVariables
== 7, "Unexpected global variables count %u.\n",
2981 effect_desc
.GlobalVariables
);
2982 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
2983 effect_desc
.SharedGlobalVariables
);
2984 ok(effect_desc
.Techniques
== 1, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
2986 null_technique
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0xffffffff);
2987 null_pass
= null_technique
->lpVtbl
->GetPassByIndex(null_technique
, 0xffffffff);
2989 /* check technique */
2990 t
= effect
->lpVtbl
->GetTechniqueByName(effect
, NULL
);
2991 ok(null_technique
== t
, "GetTechniqueByName got %p, expected %p\n", t
, null_technique
);
2993 t
= effect
->lpVtbl
->GetTechniqueByName(effect
, "invalid");
2994 ok(null_technique
== t
, "GetTechniqueByName got %p, expected %p\n", t
, null_technique
);
2996 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
2997 ok(null_technique
!= t
, "GetTechniqueByIndex failed %p\n", t
);
2999 t2
= effect
->lpVtbl
->GetTechniqueByName(effect
, "Render");
3000 ok(t2
== t
, "GetTechniqueByName got %p, expected %p\n", t2
, t
);
3002 /* check invalid pass arguments */
3003 p
= null_technique
->lpVtbl
->GetPassByName(null_technique
, NULL
);
3004 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
3006 p
= null_technique
->lpVtbl
->GetPassByName(null_technique
, "invalid");
3007 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
3011 /* This crashes on W7/DX10, if t is a valid technique and name=NULL. */
3012 p
= t
->lpVtbl
->GetPassByName(t
, NULL
);
3013 ok(null_pass
== p
, "GetPassByName got %p, expected %p\n", p
, null_pass
);
3016 p
= t
->lpVtbl
->GetPassByIndex(t
, 0xffffffff);
3017 ok(null_pass
== p
, "GetPassByIndex got %p, expected %p\n", p
, null_pass
);
3019 /* check for invalid arguments */
3020 hr
= null_pass
->lpVtbl
->GetVertexShaderDesc(null_pass
, NULL
);
3021 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3023 hr
= null_pass
->lpVtbl
->GetVertexShaderDesc(null_pass
, &pdesc
);
3024 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3026 hr
= null_pass
->lpVtbl
->GetPixelShaderDesc(null_pass
, NULL
);
3027 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3029 hr
= null_pass
->lpVtbl
->GetPixelShaderDesc(null_pass
, &pdesc
);
3030 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3032 hr
= null_pass
->lpVtbl
->GetGeometryShaderDesc(null_pass
, NULL
);
3033 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3035 hr
= null_pass
->lpVtbl
->GetGeometryShaderDesc(null_pass
, &pdesc
);
3036 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3038 /* check valid pass arguments */
3039 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
3040 p
= t
->lpVtbl
->GetPassByIndex(t
, 0);
3042 p2
= t
->lpVtbl
->GetPassByName(t
, "P0");
3043 ok(p2
== p
, "GetPassByName got %p, expected %p\n", p2
, p
);
3045 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, NULL
);
3046 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
3048 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, NULL
);
3049 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
3051 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, NULL
);
3052 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
3054 v
= effect
->lpVtbl
->GetVariableByName(effect
, "p");
3055 ps
= v
->lpVtbl
->AsShader(v
);
3057 hr
= ps
->lpVtbl
->GetPixelShader(ps
, 0, &ps_d3d
);
3058 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3060 /* get the null_shader_variable */
3061 v
= effect
->lpVtbl
->GetVariableByIndex(effect
, 10000);
3062 null_shader
= v
->lpVtbl
->AsShader(v
);
3065 p
= t
->lpVtbl
->GetPassByIndex(t
, 0);
3067 /* Pass without Set*Shader() instructions */
3068 hr
= D3D10StateBlockMaskDisableAll(&mask
);
3069 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3070 hr
= p
->lpVtbl
->ComputeStateBlockMask(p
, &mask
);
3071 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3072 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_VS
, 0);
3073 ok(!ret
, "Unexpected mask.\n");
3074 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_PS
, 0);
3075 ok(!ret
, "Unexpected mask.\n");
3076 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_GS
, 0);
3077 ok(!ret
, "Unexpected mask.\n");
3079 ID3D10Device_PSSetShader(device
, ps_d3d
);
3080 hr
= p
->lpVtbl
->Apply(p
, 0);
3081 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3082 ID3D10Device_PSGetShader(device
, &ps_d3d_2
);
3083 ok(ps_d3d_2
== ps_d3d
, "Unexpected shader object.\n");
3084 ID3D10PixelShader_Release(ps_d3d_2
);
3086 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3087 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3088 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
3089 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3091 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3092 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3094 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3095 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3096 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
3097 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3099 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3100 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3102 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3103 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3104 ok(pdesc
.pShaderVariable
== null_shader
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_shader
);
3105 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3107 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3108 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
3111 p
= t
->lpVtbl
->GetPassByIndex(t
, 1);
3113 ID3D10Device_PSSetShader(device
, ps_d3d
);
3114 hr
= p
->lpVtbl
->Apply(p
, 0);
3115 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3116 ID3D10Device_PSGetShader(device
, &ps_d3d_2
);
3117 ok(!ps_d3d_2
, "Unexpected shader object.\n");
3119 /* pass 1 vertexshader */
3120 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3121 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3122 null_anon_vs
= pdesc
.pShaderVariable
;
3123 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3125 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3126 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3128 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3129 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3130 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3131 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3132 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3133 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3135 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3136 ok(ret
, "IsValid() failed\n");
3138 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3139 ret
= type
->lpVtbl
->IsValid(type
);
3140 ok(ret
, "IsValid() failed\n");
3142 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3143 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3144 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexhader\"\n", typedesc
.TypeName
);
3145 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3146 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3147 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3148 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3149 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3150 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3151 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3152 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3153 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3155 /* pass 1 pixelshader */
3156 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3157 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3158 null_anon_ps
= pdesc
.pShaderVariable
;
3159 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3161 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3162 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3164 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3165 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3166 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3167 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3168 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3169 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3171 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3172 ok(ret
, "IsValid() failed\n");
3174 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3175 ret
= type
->lpVtbl
->IsValid(type
);
3176 ok(ret
, "IsValid() failed\n");
3178 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3179 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3180 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
3181 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3182 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3183 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3184 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3185 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3186 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3187 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3188 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3189 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3191 /* pass 1 geometryshader */
3192 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3193 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3194 null_anon_gs
= pdesc
.pShaderVariable
;
3195 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3197 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3198 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3200 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3201 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3202 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3203 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3204 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3205 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3207 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3208 ok(ret
, "IsValid() failed\n");
3210 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3211 ret
= type
->lpVtbl
->IsValid(type
);
3212 ok(ret
, "IsValid() failed\n");
3214 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3215 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3216 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
3217 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3218 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3219 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3220 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3221 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3222 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3223 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3224 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3225 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3227 /* Pass is using Set*Shader(NULL) */
3228 hr
= D3D10StateBlockMaskDisableAll(&mask
);
3229 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3230 hr
= p
->lpVtbl
->ComputeStateBlockMask(p
, &mask
);
3231 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3232 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_VS
, 0);
3233 ok(ret
, "Unexpected mask.\n");
3234 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_PS
, 0);
3235 ok(ret
, "Unexpected mask.\n");
3236 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_GS
, 0);
3237 ok(ret
, "Unexpected mask.\n");
3240 p
= t
->lpVtbl
->GetPassByIndex(t
, 2);
3242 /* pass 2 vertexshader */
3243 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3244 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3245 ok(pdesc
.pShaderVariable
== null_anon_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_vs
);
3246 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3248 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3249 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3251 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3252 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3253 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3254 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3255 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3256 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3258 /* pass 2 pixelshader */
3259 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3260 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3261 ok(pdesc
.pShaderVariable
== null_anon_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_ps
);
3262 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3264 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3265 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3267 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3268 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3269 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3270 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3271 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3272 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3274 /* pass 2 geometryshader */
3275 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3276 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3277 ok(pdesc
.pShaderVariable
== null_anon_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, null_anon_gs
);
3278 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3280 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3281 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3283 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3284 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3285 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3286 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3287 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3288 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3291 p
= t
->lpVtbl
->GetPassByIndex(t
, 3);
3293 /* pass 3 vertexshader */
3294 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3295 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3296 p3_anon_vs
= pdesc
.pShaderVariable
;
3297 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3299 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3300 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3302 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3303 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3304 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3305 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3306 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3307 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3309 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3310 ok(ret
, "IsValid() failed\n");
3312 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3313 ret
= type
->lpVtbl
->IsValid(type
);
3314 ok(ret
, "IsValid() failed\n");
3316 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3317 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3318 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc
.TypeName
);
3319 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3320 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3321 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3322 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3323 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3324 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3325 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3326 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3327 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3329 /* pass 3 pixelshader */
3330 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3331 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3332 p3_anon_ps
= pdesc
.pShaderVariable
;
3333 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3335 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3336 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3338 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3339 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3340 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3341 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3342 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3343 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3345 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3346 ok(ret
, "IsValid() failed\n");
3348 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3349 ret
= type
->lpVtbl
->IsValid(type
);
3350 ok(ret
, "IsValid() failed\n");
3352 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3353 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3354 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
3355 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3356 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3357 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3358 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3359 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3360 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3361 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3362 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3363 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3365 /* pass 3 geometryshader */
3366 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3367 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3368 p3_anon_gs
= pdesc
.pShaderVariable
;
3369 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3371 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3372 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3374 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3375 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3376 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3377 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3378 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3379 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3381 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3382 ok(ret
, "IsValid() failed\n");
3384 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3385 ret
= type
->lpVtbl
->IsValid(type
);
3386 ok(ret
, "IsValid() failed\n");
3388 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3389 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3390 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
3391 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3392 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3393 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3394 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3395 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3396 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3397 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3398 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3399 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3402 p
= t
->lpVtbl
->GetPassByIndex(t
, 4);
3404 /* pass 4 vertexshader */
3405 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3406 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3407 ok(pdesc
.pShaderVariable
!= p3_anon_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_vs
);
3408 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3410 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3411 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3413 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3414 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3415 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3416 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3417 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3418 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3420 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3421 ok(ret
, "IsValid() failed\n");
3423 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3424 ret
= type
->lpVtbl
->IsValid(type
);
3425 ok(ret
, "IsValid() failed\n");
3427 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3428 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3429 ok(strcmp(typedesc
.TypeName
, "vertexshader") == 0, "TypeName is \"%s\", expected \"vertexshader\"\n", typedesc
.TypeName
);
3430 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3431 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3432 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3433 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3434 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3435 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3436 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3437 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3438 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3440 /* pass 4 pixelshader */
3441 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3442 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3443 ok(pdesc
.pShaderVariable
!= p3_anon_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_ps
);
3444 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3446 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3447 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3449 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3450 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3451 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3452 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3453 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3454 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3456 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3457 ok(ret
, "IsValid() failed\n");
3459 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3460 ret
= type
->lpVtbl
->IsValid(type
);
3461 ok(ret
, "IsValid() failed\n");
3463 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3464 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3465 ok(strcmp(typedesc
.TypeName
, "pixelshader") == 0, "TypeName is \"%s\", expected \"pixelshader\"\n", typedesc
.TypeName
);
3466 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3467 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3468 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3469 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3470 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3471 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3472 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3473 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3474 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3476 /* pass 4 geometryshader */
3477 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3478 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3479 ok(pdesc
.pShaderVariable
!= p3_anon_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p3_anon_gs
);
3480 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %x\n", pdesc
.ShaderIndex
, 0);
3482 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3483 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3485 ok(strcmp(vdesc
.Name
, "$Anonymous") == 0, "Name is \"%s\", expected \"$Anonymous\"\n", vdesc
.Name
);
3486 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3487 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3488 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3489 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3490 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected 0\n", vdesc
.ExplicitBindPoint
);
3492 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3493 ok(ret
, "IsValid() failed\n");
3495 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3496 ret
= type
->lpVtbl
->IsValid(type
);
3497 ok(ret
, "IsValid() failed\n");
3499 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3500 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3501 ok(strcmp(typedesc
.TypeName
, "geometryshader") == 0, "TypeName is \"%s\", expected \"geometryshader\"\n", typedesc
.TypeName
);
3502 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3503 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3504 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3505 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3506 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3507 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3508 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3509 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3510 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3513 p
= t
->lpVtbl
->GetPassByIndex(t
, 5);
3515 /* pass 5 vertexshader */
3516 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3517 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3518 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3520 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3521 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3523 ok(strcmp(vdesc
.Name
, "v0") == 0, "Name is \"%s\", expected \"v0\"\n", vdesc
.Name
);
3524 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3525 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3526 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3527 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3528 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3530 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3531 ok(ret
, "IsValid() failed\n");
3533 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3534 ret
= type
->lpVtbl
->IsValid(type
);
3535 ok(ret
, "IsValid() failed\n");
3537 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3538 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3539 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3540 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3541 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3542 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3543 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3544 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3545 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3546 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3547 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3548 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3550 /* pass 5 pixelshader */
3551 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3552 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3553 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3555 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3556 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3558 ok(strcmp(vdesc
.Name
, "p0") == 0, "Name is \"%s\", expected \"p0\"\n", vdesc
.Name
);
3559 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3560 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3561 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3562 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3563 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3565 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3566 ok(ret
, "IsValid() failed\n");
3568 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3569 ret
= type
->lpVtbl
->IsValid(type
);
3570 ok(ret
, "IsValid() failed\n");
3572 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3573 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3574 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3575 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3576 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3577 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3578 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3579 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3580 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3581 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3582 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3583 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3585 /* pass 5 geometryshader */
3586 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3587 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3588 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3590 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3591 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3593 ok(strcmp(vdesc
.Name
, "g0") == 0, "Name is \"%s\", expected \"g0\"\n", vdesc
.Name
);
3594 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3595 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3596 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3597 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3598 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3600 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3601 ok(ret
, "IsValid() failed\n");
3603 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3604 ret
= type
->lpVtbl
->IsValid(type
);
3605 ok(ret
, "IsValid() failed\n");
3607 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3608 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3609 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3610 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3611 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3612 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3613 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3614 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3615 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3616 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3617 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3618 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3621 p
= t
->lpVtbl
->GetPassByIndex(t
, 6);
3623 /* pass 6 vertexshader */
3624 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3625 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3626 p6_vs
= pdesc
.pShaderVariable
;
3627 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3629 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3630 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3632 ok(strcmp(vdesc
.Name
, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc
.Name
);
3633 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3634 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3635 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3636 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3637 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3639 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3640 ok(ret
, "IsValid() failed\n");
3642 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3643 ret
= type
->lpVtbl
->IsValid(type
);
3644 ok(ret
, "IsValid() failed\n");
3646 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3647 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3648 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3649 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3650 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3651 ok(typedesc
.Elements
== 2, "Elements is %u, expected 2\n", typedesc
.Elements
);
3652 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3653 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3654 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3655 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3656 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3657 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3659 /* Get input signature from vertex shader set from array element. */
3660 hr
= p
->lpVtbl
->GetDesc(p
, &pass_desc
);
3661 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3662 ok(!!pass_desc
.pIAInputSignature
, "Expected input signature.\n");
3663 ok(pass_desc
.IAInputSignatureSize
== 88, "Unexpected input signature size.\n");
3665 /* pass 6 pixelshader */
3666 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3667 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3668 p6_ps
= pdesc
.pShaderVariable
;
3669 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3671 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3672 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3674 ok(strcmp(vdesc
.Name
, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc
.Name
);
3675 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3676 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3677 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3678 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3679 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3681 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3682 ok(ret
, "IsValid() failed\n");
3684 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3685 ret
= type
->lpVtbl
->IsValid(type
);
3686 ok(ret
, "IsValid() failed\n");
3688 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3689 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3690 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3691 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3692 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3693 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3694 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3695 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3696 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3697 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3698 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3699 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3701 /* pass 6 geometryshader */
3702 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3703 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3704 p6_gs
= pdesc
.pShaderVariable
;
3705 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3707 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3708 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3710 ok(strcmp(vdesc
.Name
, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc
.Name
);
3711 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3712 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3713 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3714 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3715 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3717 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3718 ok(ret
, "IsValid() failed\n");
3720 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3721 ret
= type
->lpVtbl
->IsValid(type
);
3722 ok(ret
, "IsValid() failed\n");
3724 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3725 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3726 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3727 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3728 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3729 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3730 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3731 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3732 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3733 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3734 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3735 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3738 p
= t
->lpVtbl
->GetPassByIndex(t
, 7);
3740 /* pass 7 vertexshader */
3741 hr
= p
->lpVtbl
->GetVertexShaderDesc(p
, &pdesc
);
3742 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3743 ok(pdesc
.pShaderVariable
== p6_vs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_vs
);
3744 ok(pdesc
.ShaderIndex
== 1, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 1);
3746 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3747 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3749 ok(strcmp(vdesc
.Name
, "v") == 0, "Name is \"%s\", expected \"v\"\n", vdesc
.Name
);
3750 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3751 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3752 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3753 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3754 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3756 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3757 ok(ret
, "IsValid() failed\n");
3759 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3760 ret
= type
->lpVtbl
->IsValid(type
);
3761 ok(ret
, "IsValid() failed\n");
3763 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3764 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3765 ok(strcmp(typedesc
.TypeName
, "VertexShader") == 0, "TypeName is \"%s\", expected \"VertexShader\"\n", typedesc
.TypeName
);
3766 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3767 ok(typedesc
.Type
== D3D10_SVT_VERTEXSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_VERTEXSHADER
);
3768 ok(typedesc
.Elements
== 2, "Elements is %u, expected 2\n", typedesc
.Elements
);
3769 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3770 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3771 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3772 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3773 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3774 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3776 /* pass 7 pixelshader */
3777 hr
= p
->lpVtbl
->GetPixelShaderDesc(p
, &pdesc
);
3778 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3779 ok(pdesc
.pShaderVariable
== p6_ps
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_ps
);
3780 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3782 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3783 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3785 ok(strcmp(vdesc
.Name
, "p") == 0, "Name is \"%s\", expected \"p\"\n", vdesc
.Name
);
3786 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3787 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3788 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3789 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3790 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3792 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3793 ok(ret
, "IsValid() failed\n");
3795 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3796 ret
= type
->lpVtbl
->IsValid(type
);
3797 ok(ret
, "IsValid() failed\n");
3799 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3800 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3801 ok(strcmp(typedesc
.TypeName
, "PixelShader") == 0, "TypeName is \"%s\", expected \"PixelShader\"\n", typedesc
.TypeName
);
3802 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3803 ok(typedesc
.Type
== D3D10_SVT_PIXELSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_PIXELSHADER
);
3804 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3805 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3806 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3807 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3808 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3809 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3810 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3812 /* pass 7 geometryshader */
3813 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3814 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3815 ok(pdesc
.pShaderVariable
== p6_gs
, "Got %p, expected %p\n", pdesc
.pShaderVariable
, p6_gs
);
3816 ok(pdesc
.ShaderIndex
== 0, "ShaderIndex is %u, expected %u\n", pdesc
.ShaderIndex
, 0);
3818 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetDesc(pdesc
.pShaderVariable
, &vdesc
);
3819 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3821 ok(strcmp(vdesc
.Name
, "g") == 0, "Name is \"%s\", expected \"g\"\n", vdesc
.Name
);
3822 ok(vdesc
.Semantic
== NULL
, "Semantic is \"%s\", expected NULL\n", vdesc
.Semantic
);
3823 ok(vdesc
.Flags
== 0, "Flags is %u, expected 0\n", vdesc
.Flags
);
3824 ok(vdesc
.Annotations
== 0, "Annotations is %u, expected 0\n", vdesc
.Annotations
);
3825 ok(vdesc
.BufferOffset
== 0, "BufferOffset is %u, expected 0\n", vdesc
.BufferOffset
);
3826 ok(vdesc
.ExplicitBindPoint
== 0, "ExplicitBindPoint is %u, expected %u\n", vdesc
.ExplicitBindPoint
, 0);
3828 ret
= pdesc
.pShaderVariable
->lpVtbl
->IsValid(pdesc
.pShaderVariable
);
3829 ok(ret
, "IsValid() failed\n");
3831 type
= pdesc
.pShaderVariable
->lpVtbl
->GetType(pdesc
.pShaderVariable
);
3832 ret
= type
->lpVtbl
->IsValid(type
);
3833 ok(ret
, "IsValid() failed\n");
3835 hr
= type
->lpVtbl
->GetDesc(type
, &typedesc
);
3836 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3837 ok(strcmp(typedesc
.TypeName
, "GeometryShader") == 0, "TypeName is \"%s\", expected \"GeometryShader\"\n", typedesc
.TypeName
);
3838 ok(typedesc
.Class
== D3D10_SVC_OBJECT
, "Class is %x, expected %x\n", typedesc
.Class
, D3D10_SVC_OBJECT
);
3839 ok(typedesc
.Type
== D3D10_SVT_GEOMETRYSHADER
, "Type is %x, expected %x\n", typedesc
.Type
, D3D10_SVT_GEOMETRYSHADER
);
3840 ok(typedesc
.Elements
== 0, "Elements is %u, expected 0\n", typedesc
.Elements
);
3841 ok(typedesc
.Members
== 0, "Members is %u, expected 0\n", typedesc
.Members
);
3842 ok(typedesc
.Rows
== 0, "Rows is %u, expected 0\n", typedesc
.Rows
);
3843 ok(typedesc
.Columns
== 0, "Columns is %u, expected 0\n", typedesc
.Columns
);
3844 ok(typedesc
.PackedSize
== 0x0, "PackedSize is %#x, expected 0x0\n", typedesc
.PackedSize
);
3845 ok(typedesc
.UnpackedSize
== 0x0, "UnpackedSize is %#x, expected 0x0\n", typedesc
.UnpackedSize
);
3846 ok(typedesc
.Stride
== 0x0, "Stride is %#x, expected 0x0\n", typedesc
.Stride
);
3848 /* Geometry shader with stream output */
3850 /* Inline variant */
3851 p
= t
->lpVtbl
->GetPassByName(t
, "P8");
3852 hr
= p
->lpVtbl
->GetGeometryShaderDesc(p
, &pdesc
);
3853 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3854 hr
= pdesc
.pShaderVariable
->lpVtbl
->GetShaderDesc(pdesc
.pShaderVariable
, 0, &shaderdesc
);
3855 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3856 ok(shaderdesc
.IsInline
, "Unexpected inline flag.\n");
3857 ok(!strcmp(shaderdesc
.SODecl
, "SV_POSITION.y"), "Unexpected stream output declaration %s.\n",
3860 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_so");
3861 gs
= v
->lpVtbl
->AsShader(v
);
3862 hr
= gs
->lpVtbl
->GetShaderDesc(gs
, 0, &shaderdesc
);
3863 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3864 ok(!shaderdesc
.IsInline
, "Unexpected inline flag.\n");
3865 ok(!strcmp(shaderdesc
.SODecl
, "SV_POSITION.x; $Skip.x; SV_POSITION.gb"),
3866 "Unexpected stream output declaration %s.\n", shaderdesc
.SODecl
);
3868 /* Signature description */
3869 v
= effect
->lpVtbl
->GetVariableByName(effect
, "p");
3870 ps
= v
->lpVtbl
->AsShader(v
);
3872 hr
= ps
->lpVtbl
->GetOutputSignatureElementDesc(ps
, 0, 0, &sign
);
3873 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3874 ok(!strcmp(sign
.SemanticName
, "SV_Target"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3876 ok(!sign
.SystemValueType
, "Unexpected system value type %u.\n", sign
.SystemValueType
);
3878 hr
= ps
->lpVtbl
->GetOutputSignatureElementDesc(ps
, 4, 0, &sign
);
3879 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3880 ok(!strcmp(sign
.SemanticName
, "SV_POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3881 ok(sign
.SystemValueType
== D3D10_NAME_POSITION
, "Unexpected system value type %u.\n",
3882 sign
.SystemValueType
);
3884 hr
= ps
->lpVtbl
->GetInputSignatureElementDesc(ps
, 0, 0, &sign
);
3885 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3886 ok(!strcmp(sign
.SemanticName
, "SV_POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3887 ok(sign
.SystemValueType
== D3D10_NAME_POSITION
, "Unexpected system value type %u.\n",
3888 sign
.SystemValueType
);
3890 hr
= ps
->lpVtbl
->GetInputSignatureElementDesc(ps
, 4, 0, &sign
);
3891 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3892 ok(!strcmp(sign
.SemanticName
, "POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3893 ok(!sign
.SystemValueType
, "Unexpected system value type %u.\n", sign
.SystemValueType
);
3895 v
= effect
->lpVtbl
->GetVariableByName(effect
, "v");
3896 vs
= v
->lpVtbl
->AsShader(v
);
3898 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 0, 0, &sign
);
3899 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3900 ok(!strcmp(sign
.SemanticName
, "SV_POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3901 ok(sign
.SystemValueType
== D3D10_NAME_POSITION
, "Unexpected system value type %u.\n",
3902 sign
.SystemValueType
);
3904 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 1, 0, &sign
);
3905 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3906 ok(!strcmp(sign
.SemanticName
, "SV_POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3907 ok(sign
.SystemValueType
== D3D10_NAME_POSITION
, "Unexpected system value type %u.\n",
3908 sign
.SystemValueType
);
3910 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 0, 0, &sign
);
3911 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3912 ok(!strcmp(sign
.SemanticName
, "POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3913 ok(!sign
.SystemValueType
, "Unexpected system value type %u.\n", sign
.SystemValueType
);
3915 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 1, 0, &sign
);
3916 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3917 ok(!strcmp(sign
.SemanticName
, "POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3918 ok(!sign
.SystemValueType
, "Unexpected system value type %u.\n", sign
.SystemValueType
);
3920 /* NULL shader variable */
3921 v
= effect
->lpVtbl
->GetVariableByName(effect
, "v0");
3922 vs
= v
->lpVtbl
->AsShader(v
);
3924 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 0, 0, &sign
);
3925 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3927 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 1, 0, &sign
);
3928 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3930 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 2, 0, &sign
);
3931 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3933 hr
= vs
->lpVtbl
->GetOutputSignatureElementDesc(vs
, 3, 0, &sign
);
3934 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3935 ok(!strcmp(sign
.SemanticName
, "SV_POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3936 ok(sign
.SystemValueType
== D3D10_NAME_POSITION
, "Unexpected system value type %u.\n",
3937 sign
.SystemValueType
);
3939 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 0, 0, &sign
);
3940 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3942 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 1, 0, &sign
);
3943 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3945 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 2, 0, &sign
);
3946 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
3948 hr
= vs
->lpVtbl
->GetInputSignatureElementDesc(vs
, 3, 0, &sign
);
3949 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
3950 ok(!strcmp(sign
.SemanticName
, "POSITION"), "Unexpected semantic %s.\n", sign
.SemanticName
);
3951 ok(!sign
.SystemValueType
, "Unexpected system value type %u.\n", sign
.SystemValueType
);
3953 effect
->lpVtbl
->Release(effect
);
3955 ID3D10PixelShader_Release(ps_d3d
);
3957 refcount
= ID3D10Device_Release(device
);
3958 ok(!refcount
, "Device has %lu references left.\n", refcount
);
3962 * test_effect_get_variable_by
3967 float f1
: SV_POSITION
;
3972 float f3
: SV_POSITION
;
3975 Texture1D tex1
: COLOR2
;
3976 Texture1D tex2
: COLOR1
;
3978 static DWORD fx_test_egvb
[] = {
3979 0x43425844, 0x63d60ede, 0xf75a09d1, 0x47da5604, 0x7ef6e331, 0x00000001, 0x000001ca, 0x00000001,
3980 0x00000024, 0x30315846, 0x0000019e, 0xfeff1001, 0x00000002, 0x00000004, 0x00000002, 0x00000000,
3981 0x00000000, 0x00000000, 0x00000000, 0x0000008a, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3982 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
3983 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
3984 0x00316600, 0x505f5653, 0x5449534f, 0x004e4f49, 0x43003266, 0x524f4c4f, 0x62630030, 0x33660032,
3985 0x00346600, 0x4f4c4f43, 0x54003152, 0x75747865, 0x44316572, 0x00005300, 0x00000200, 0x00000000,
3986 0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x78657400, 0x4f430031, 0x32524f4c, 0x78657400,
3987 0x00040032, 0x00100000, 0x00000000, 0x00020000, 0xffff0000, 0x0000ffff, 0x00290000, 0x000d0000,
3988 0x002c0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x000d0000, 0x003b0000,
3989 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00420000, 0x00100000, 0x00000000, 0x00020000,
3990 0xffff0000, 0x0000ffff, 0x00460000, 0x000d0000, 0x002c0000, 0x00000000, 0x00000000, 0x00000000,
3991 0x00000000, 0x00490000, 0x000d0000, 0x004c0000, 0x00040000, 0x00000000, 0x00000000, 0x00000000,
3992 0x00790000, 0x005d0000, 0x007e0000, 0xffff0000, 0x0000ffff, 0x00850000, 0x005d0000, 0x004c0000,
3993 0xffff0000, 0x0000ffff, 0x00000000,
3996 static void test_effect_get_variable_by(void)
3998 ID3D10Effect
*effect
;
3999 ID3D10EffectVariable
*variable_by_index
, *variable
, *null_variable
;
4000 D3D10_EFFECT_DESC effect_desc
;
4001 ID3D10Device
*device
;
4005 if (!(device
= create_device()))
4007 skip("Failed to create device, skipping tests.\n");
4011 hr
= create_effect(fx_test_egvb
, 0, device
, NULL
, &effect
);
4012 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4014 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
4015 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4016 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
4017 ok(effect_desc
.ConstantBuffers
== 2, "Unexpected constant buffers count %u.\n",
4018 effect_desc
.ConstantBuffers
);
4019 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
4020 effect_desc
.SharedConstantBuffers
);
4021 ok(effect_desc
.GlobalVariables
== 6, "Unexpected global variables count %u.\n",
4022 effect_desc
.GlobalVariables
);
4023 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
4024 effect_desc
.SharedGlobalVariables
);
4025 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
4027 /* get the null variable */
4028 null_variable
= effect
->lpVtbl
->GetVariableByIndex(effect
, 0xffffffff);
4030 /* check for invalid arguments */
4031 variable
= effect
->lpVtbl
->GetVariableByName(effect
, NULL
);
4032 ok(null_variable
== variable
, "GetVariableByName got %p, expected %p\n", variable
, null_variable
);
4034 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, NULL
);
4035 ok(null_variable
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, null_variable
);
4037 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "invalid");
4038 ok(null_variable
== variable
, "GetVariableByName got %p, expected %p\n", variable
, null_variable
);
4040 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "invalid");
4041 ok(null_variable
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, null_variable
);
4044 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 0);
4045 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4047 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f1");
4048 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4050 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "SV_POSITION");
4051 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4053 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "sv_POSITION");
4054 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4057 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 1);
4058 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4060 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f2");
4061 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4063 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR0");
4064 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4066 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "color0");
4067 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4070 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 2);
4071 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4073 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f3");
4074 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4076 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "SV_POSITION");
4077 ok(variable
!= null_variable
, "GetVariableBySemantic failed %p\n", variable
);
4078 ok(variable
!= variable_by_index
, "GetVariableBySemantic failed %p\n", variable
);
4081 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 3);
4082 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4084 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "f4");
4085 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4087 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR1");
4088 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4091 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 4);
4092 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4094 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "tex1");
4095 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4097 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR2");
4098 ok(variable_by_index
== variable
, "GetVariableBySemantic got %p, expected %p\n", variable
, variable_by_index
);
4101 variable_by_index
= effect
->lpVtbl
->GetVariableByIndex(effect
, 5);
4102 ok(null_variable
!= variable_by_index
, "GetVariableByIndex failed %p\n", variable_by_index
);
4104 variable
= effect
->lpVtbl
->GetVariableByName(effect
, "tex2");
4105 ok(variable_by_index
== variable
, "GetVariableByName got %p, expected %p\n", variable
, variable_by_index
);
4107 variable
= effect
->lpVtbl
->GetVariableBySemantic(effect
, "COLOR1");
4108 ok(variable
!= null_variable
, "GetVariableBySemantic failed %p\n", variable
);
4109 ok(variable
!= variable_by_index
, "GetVariableBySemantic failed %p\n", variable
);
4111 effect
->lpVtbl
->Release(effect
);
4113 refcount
= ID3D10Device_Release(device
);
4114 ok(!refcount
, "Device has %lu references left.\n", refcount
);
4118 RasterizerState rast_state
4120 FillMode
= wireframe
; /* 0x0c */
4121 CullMode
= front
; /* 0x0d */
4122 FrontCounterClockwise
= true; /* 0x0e */
4123 DepthBias
= -4; /* 0x0f */
4124 DepthBiasClamp
= 0.5f
; /* 0x10 */
4125 SlopeScaledDepthBias
= 0.25f
; /* 0x11 */
4126 DepthClipEnable
= false; /* 0x12 */
4127 ScissorEnable
= true; /* 0x13 */
4128 MultisampleEnable
= true; /* 0x14 */
4129 AntialiasedLineEnable
= true; /* 0x15 */
4132 RasterizerState rast_state2
4137 DepthStencilState ds_state
4139 DepthEnable
= true; /* 0x16 */
4140 DepthWriteMask
= zero
; /* 0x17 */
4141 DepthFunc
= equal
; /* 0x18 */
4142 StencilEnable
= true; /* 0x19 */
4143 StencilReadMask
= 0x4; /* 0x1a */
4144 StencilWriteMask
= 0x5; /* 0x1b */
4145 FrontFaceStencilFail
= invert
; /* 0x1c */
4146 FrontFaceStencilDepthFail
= incr
; /* 0x1d */
4147 FrontFaceStencilPass
= decr
; /* 0x1e */
4148 FrontFaceStencilFunc
= less_equal
; /* 0x1f */
4149 BackFaceStencilFail
= replace
; /* 0x20 */
4150 BackFaceStencilDepthFail
= incr_sat
; /* 0x21 */
4151 BackFaceStencilPass
= decr_sat
; /* 0x22 */
4152 BackFaceStencilFunc
= greater_equal
; /* 0x23 */
4155 DepthStencilState ds_state2
4157 DepthEnable
= false;
4160 BlendState blend_state
4162 AlphaToCoverageEnable
= false; /* 0x24 */
4163 BlendEnable
[0] = true; /* 0x25[0] */
4164 BlendEnable
[7] = false; /* 0x25[7] */
4165 SrcBlend
= one
; /* 0x26 */
4166 DestBlend
= src_color
; /* 0x27 */
4167 BlendOp
= min
; /* 0x28 */
4168 SrcBlendAlpha
= src_alpha
; /* 0x29 */
4169 DestBlendAlpha
= inv_src_alpha
; /* 0x2a */
4170 BlendOpAlpha
= max
; /* 0x2b */
4171 RenderTargetWriteMask
[0] = 0x8; /* 0x2c[0] */
4172 RenderTargetWriteMask
[7] = 0x7; /* 0x2c[7] */
4175 BlendState blend_state2
4177 SrcBlend
= src_color
;
4180 SamplerState sampler0
4182 Filter
= min_mag_mip_linear
; /* 0x2d */
4183 AddressU
= wrap
; /* 0x2e */
4184 AddressV
= mirror
; /* 0x2f */
4185 AddressW
= clamp
; /* 0x30 */
4186 MipLODBias
= -1; /* 0x31 */
4187 MaxAnisotropy
= 4u; /* 0x32 */
4188 ComparisonFunc
= always
; /* 0x33 */
4189 BorderColor
= float4(1.0, 2.0, 3.0, 4.0); /* 0x34 */
4190 MinLOD
= 6u; /* 0x35 */
4191 MaxLOD
= 5u; /* 0x36 */
4192 Texture
= NULL
; /* 0x37 */
4195 SamplerState sample0_1
4205 Texture2DMS
<float4
, 4> t2dms
;
4206 Texture2DMSArray
<float4
, 4> t2dmsa
;
4210 SamplerState sampler1
{ Texture
= t0
; };
4211 SamplerState sampler2
{ Texture
= t1
; };
4212 SamplerState sampler2a
{ Texture
= t1a
; };
4213 SamplerState sampler3
{ Texture
= t2
; };
4214 SamplerState sampler3a
{ Texture
= t2a
; };
4215 SamplerState sampler4
{ Texture
= t2dms
; };
4216 SamplerState sampler4a
{ Texture
= t2dmsa
; };
4217 SamplerState sampler5
{ Texture
= t3
; };
4218 SamplerState sampler6
{ Texture
= tq
; };
4222 Texture1DArray t1a_a
[3];
4224 Texture2DArray t2a_a
[3];
4225 Texture2DMS
<float4
, 4> t2dms_a
[3];
4226 Texture2DMSArray
<float4
, 4> t2dmsa_a
[3];
4228 TextureCube tq_a
[3];
4230 SamplerState sampler7
{ Texture
= t0_a
[0]; };
4231 SamplerState sampler8
{ Texture
= t1_a
[1]; };
4232 SamplerState sampler9
{ Texture
= t1a_a
[2]; };
4233 SamplerState sampler10
{ Texture
= t2_a
[0]; };
4234 SamplerState sampler11
{ Texture
= t2a_a
[1]; };
4235 SamplerState sampler12
{ Texture
= t2dms_a
[2]; };
4236 SamplerState sampler13
{ Texture
= t2dmsa_a
[0]; };
4237 SamplerState sampler14
{ Texture
= t3_a
[1]; };
4238 SamplerState sampler15
{ Texture
= tq_a
[2]; };
4240 SamplerState ss
{ Texture
= NULL
; };
4244 return tex2D( ss
, float2(0.0f
, 0.0f
) );
4251 SetBlendState(blend_state
, float4(0.5f
, 0.6f
, 0.7f
, 0.8f
), 0xffff);
4252 SetDepthStencilState(ds_state
, 1.0f
);
4253 SetRasterizerState(rast_state
);
4257 SetPixelShader( CompileShader(ps_4_0
, PS()) );
4261 SetDepthStencilState(NULL
, 0);
4262 SetBlendState(NULL
, float4(0.0f
, 0.0f
, 0.0f
, 0.0f
), 0xffff);
4266 static DWORD fx_test_state_groups
[] =
4268 0x43425844, 0x0851fd73, 0x383acb2d, 0x862fcb27, 0x66b5dc75, 0x00000001, 0x00001381, 0x00000001,
4269 0x00000024, 0x30315846, 0x00001355, 0xfeff1001, 0x00000000, 0x00000000, 0x0000002d, 0x00000000,
4270 0x00000000, 0x00000000, 0x00000001, 0x000009d9, 0x00000000, 0x00000024, 0x00000002, 0x00000002,
4271 0x00000002, 0x00000015, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74736152,
4272 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4273 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000,
4274 0x02000000, 0x02000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x02000000, 0xfc000000,
4275 0x01ffffff, 0x01000000, 0x00000000, 0x013f0000, 0x01000000, 0x00000000, 0x013e8000, 0x04000000,
4276 0x00000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000,
4277 0x04000000, 0x01000000, 0x72000000, 0x5f747361, 0x74617473, 0x01003265, 0x02000000, 0x03000000,
4278 0x44000000, 0x68747065, 0x6e657453, 0x536c6963, 0x65746174, 0x0000cb00, 0x00000200, 0x00000000,
4279 0x00000000, 0x00000000, 0x00000000, 0x00000300, 0x5f736400, 0x74617473, 0x00010065, 0x00040000,
4280 0x00010000, 0x00010000, 0x00020000, 0x00000000, 0x00010000, 0x00020000, 0x00030000, 0x00010000,
4281 0x00040000, 0x00010000, 0x00010000, 0x00030000, 0x00040000, 0x00010000, 0x00030000, 0x00050000,
4282 0x00010000, 0x00020000, 0x00060000, 0x00010000, 0x00020000, 0x00070000, 0x00010000, 0x00020000,
4283 0x00080000, 0x00010000, 0x00020000, 0x00040000, 0x00010000, 0x00020000, 0x00030000, 0x00010000,
4284 0x00020000, 0x00040000, 0x00010000, 0x00020000, 0x00050000, 0x00010000, 0x00020000, 0x00070000,
4285 0x73640000, 0x6174735f, 0x00326574, 0x00000001, 0x00000004, 0x00000000, 0x6e656c42, 0x61745364,
4286 0xc0006574, 0x02000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x62000000,
4287 0x646e656c, 0x6174735f, 0x01006574, 0x04000000, 0x00000000, 0x01000000, 0x04000000, 0x01000000,
4288 0x01000000, 0x04000000, 0x00000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000,
4289 0x03000000, 0x01000000, 0x02000000, 0x04000000, 0x01000000, 0x02000000, 0x05000000, 0x01000000,
4290 0x02000000, 0x06000000, 0x01000000, 0x02000000, 0x05000000, 0x01000000, 0x03000000, 0x08000000,
4291 0x01000000, 0x03000000, 0x07000000, 0x62000000, 0x646e656c, 0x6174735f, 0x00326574, 0x00000001,
4292 0x00000002, 0x00000003, 0x706d6153, 0x5372656c, 0x65746174, 0x00029000, 0x00000200, 0x00000000,
4293 0x00000000, 0x00000000, 0x00000000, 0x00001500, 0x6d617300, 0x72656c70, 0x00010030, 0x00020000,
4294 0x00150000, 0x00010000, 0x00020000, 0x00010000, 0x00010000, 0x00020000, 0x00020000, 0x00010000,
4295 0x00020000, 0x00030000, 0x00010000, 0x00020000, 0xffff0000, 0x0001ffff, 0x00030000, 0x00040000,
4296 0x00010000, 0x00020000, 0x00080000, 0x00040000, 0x00010000, 0x00000000, 0x00013f80, 0x00000000,
4297 0x00014000, 0x00000000, 0x00014040, 0x00000000, 0x00014080, 0x00030000, 0x00060000, 0x00010000,
4298 0x00030000, 0x00050000, 0x00010000, 0x00020000, 0x00000000, 0x61730000, 0x656c706d, 0x00315f30,
4299 0x00000001, 0x00000002, 0x00000002, 0x74786574, 0x00657275, 0x00000374, 0x00000002, 0x00000000,
4300 0x00000000, 0x00000000, 0x00000000, 0x00000009, 0x54003074, 0x75747865, 0x44316572, 0x00039b00,
4301 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000a00, 0x00317400, 0x74786554,
4302 0x31657275, 0x72724144, 0xc4007961, 0x02000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4303 0x0b000000, 0x74000000, 0x54006131, 0x75747865, 0x44326572, 0x0003f300, 0x00000200, 0x00000000,
4304 0x00000000, 0x00000000, 0x00000000, 0x00000c00, 0x00327400, 0x74786554, 0x32657275, 0x72724144,
4305 0x1c007961, 0x02000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0d000000, 0x74000000,
4306 0x54006132, 0x75747865, 0x44326572, 0x4b00534d, 0x02000004, 0x00000000, 0x00000000, 0x00000000,
4307 0x00000000, 0x0e000000, 0x74000000, 0x736d6432, 0x78655400, 0x65727574, 0x534d4432, 0x61727241,
4308 0x04790079, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000f0000, 0x32740000,
4309 0x61736d64, 0x78655400, 0x65727574, 0xad004433, 0x02000004, 0x00000000, 0x00000000, 0x00000000,
4310 0x00000000, 0x10000000, 0x74000000, 0x65540033, 0x72757478, 0x62754365, 0x04d60065, 0x00020000,
4311 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00110000, 0x71740000, 0x6d617300, 0x72656c70,
4312 0x61730031, 0x656c706d, 0x73003272, 0x6c706d61, 0x61327265, 0x6d617300, 0x72656c70, 0x61730033,
4313 0x656c706d, 0x00613372, 0x706d6173, 0x3472656c, 0x6d617300, 0x72656c70, 0x73006134, 0x6c706d61,
4314 0x00357265, 0x706d6173, 0x3672656c, 0x00037400, 0x00000200, 0x00000300, 0x00000000, 0x00000000,
4315 0x00000000, 0x00000900, 0x5f307400, 0x039b0061, 0x00020000, 0x00030000, 0x00000000, 0x00000000,
4316 0x00000000, 0x000a0000, 0x31740000, 0xc400615f, 0x02000003, 0x03000000, 0x00000000, 0x00000000,
4317 0x00000000, 0x0b000000, 0x74000000, 0x615f6131, 0x0003f300, 0x00000200, 0x00000300, 0x00000000,
4318 0x00000000, 0x00000000, 0x00000c00, 0x5f327400, 0x041c0061, 0x00020000, 0x00030000, 0x00000000,
4319 0x00000000, 0x00000000, 0x000d0000, 0x32740000, 0x00615f61, 0x0000044b, 0x00000002, 0x00000003,
4320 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x6d643274, 0x00615f73, 0x00000479, 0x00000002,
4321 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x0000000f, 0x6d643274, 0x615f6173, 0x0004ad00,
4322 0x00000200, 0x00000300, 0x00000000, 0x00000000, 0x00000000, 0x00001000, 0x5f337400, 0x04d60061,
4323 0x00020000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00110000, 0x71740000, 0x7300615f,
4324 0x6c706d61, 0x00377265, 0x00000571, 0x00000000, 0x706d6173, 0x3872656c, 0x00059200, 0x00000100,
4325 0x6d617300, 0x72656c70, 0x05b30039, 0x00020000, 0x61730000, 0x656c706d, 0x00303172, 0x000005d5,
4326 0x00000000, 0x706d6173, 0x3172656c, 0x05f60031, 0x00010000, 0x61730000, 0x656c706d, 0x00323172,
4327 0x00000618, 0x00000002, 0x706d6173, 0x3172656c, 0x063c0033, 0x00000000, 0x61730000, 0x656c706d,
4328 0x00343172, 0x00000661, 0x00000001, 0x706d6173, 0x3172656c, 0x06820035, 0x00020000, 0x73730000,
4329 0x00000100, 0x00000200, 0x00000000, 0x63657400, 0x70003068, 0x30737361, 0x00000400, 0x00000100,
4330 0x00000000, 0x0000013f, 0x19999a00, 0x0000013f, 0x33333300, 0x0000013f, 0x4ccccd00, 0x0000013f,
4331 0x00000300, 0x00ffff00, 0x00000100, 0x00000100, 0x80000000, 0x7361703f, 0xf0003173, 0x44000001,
4332 0x03434258, 0x91426d35, 0x99a1723e, 0x0d495627, 0x016c6001, 0xf0000000, 0x05000001, 0x34000000,
4333 0xc4000000, 0xd4000000, 0x08000000, 0x74000001, 0x52000001, 0x88464544, 0x00000000, 0x00000000,
4334 0x02000000, 0x1c000000, 0x00000000, 0x00ffff04, 0x5f000011, 0x5c000000, 0x03000000, 0x00000000,
4335 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x5c000000, 0x02000000, 0x05000000,
4336 0x04000000, 0xff000000, 0x00ffffff, 0x01000000, 0x0c000000, 0x73000000, 0x694d0073, 0x736f7263,
4337 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120,
4338 0x49ab0031, 0x084e4753, 0x00000000, 0x08000000, 0x4f000000, 0x2c4e4753, 0x01000000, 0x08000000,
4339 0x20000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x0f000000, 0x53000000, 0x61545f56,
4340 0x74656772, 0x53abab00, 0x64524448, 0x40000000, 0x19000000, 0x5a000000, 0x00030000, 0x00001060,
4341 0x58000000, 0x00040018, 0x00001070, 0x55000000, 0x65000055, 0xf2030000, 0x00001020, 0x45000000,
4342 0xf20c0000, 0x00001020, 0x02000000, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x46000000,
4343 0x0000107e, 0x00000000, 0x00001060, 0x3e000000, 0x53010000, 0x74544154, 0x02000000, 0x00000000,
4344 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000,
4345 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000,
4346 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4347 0x00000000, 0x00000000, 0x00000000, 0x83000000, 0x00000007, 0x70000000, 0x32737361, 0x00000100,
4348 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00000400, 0x00000100, 0x00000000,
4349 0x00000100, 0x00000000, 0x00000100, 0x00000000, 0x00000100, 0x00000000, 0x00000100, 0x00000300,
4350 0x00ffff00, 0x00000100, 0x00000200, 0x00000000, 0x00003000, 0x00001400, 0x00000000, 0xffffff00,
4351 0x00000aff, 0x00000c00, 0x00000000, 0x00000100, 0x00003b00, 0x00000d00, 0x00000000, 0x00000100,
4352 0x00004700, 0x00000e00, 0x00000000, 0x00000100, 0x00005300, 0x00000f00, 0x00000000, 0x00000100,
4353 0x00005f00, 0x00001000, 0x00000000, 0x00000100, 0x00006b00, 0x00001100, 0x00000000, 0x00000100,
4354 0x00007700, 0x00001200, 0x00000000, 0x00000100, 0x00008300, 0x00001300, 0x00000000, 0x00000100,
4355 0x00008f00, 0x00001400, 0x00000000, 0x00000100, 0x00009b00, 0x00001500, 0x00000000, 0x00000100,
4356 0x0000a700, 0x00000000, 0x0000b300, 0x00001400, 0x00000000, 0xffffff00, 0x000001ff, 0x00000d00,
4357 0x00000000, 0x00000100, 0x0000bf00, 0x00000000, 0x0000f900, 0x0000dd00, 0x00000000, 0xffffff00,
4358 0x00000eff, 0x00001600, 0x00000000, 0x00000100, 0x00010200, 0x00001700, 0x00000000, 0x00000100,
4359 0x00010e00, 0x00001800, 0x00000000, 0x00000100, 0x00011a00, 0x00001900, 0x00000000, 0x00000100,
4360 0x00012600, 0x00001a00, 0x00000000, 0x00000100, 0x00013200, 0x00001b00, 0x00000000, 0x00000100,
4361 0x00013e00, 0x00001c00, 0x00000000, 0x00000100, 0x00014a00, 0x00001d00, 0x00000000, 0x00000100,
4362 0x00015600, 0x00001e00, 0x00000000, 0x00000100, 0x00016200, 0x00001f00, 0x00000000, 0x00000100,
4363 0x00016e00, 0x00002000, 0x00000000, 0x00000100, 0x00017a00, 0x00002100, 0x00000000, 0x00000100,
4364 0x00018600, 0x00002200, 0x00000000, 0x00000100, 0x00019200, 0x00002300, 0x00000000, 0x00000100,
4365 0x00019e00, 0x00000000, 0x0001aa00, 0x0000dd00, 0x00000000, 0xffffff00, 0x000001ff, 0x00001600,
4366 0x00000000, 0x00000100, 0x0001b400, 0x00000000, 0x0001e700, 0x0001cb00, 0x00000000, 0xffffff00,
4367 0x00000bff, 0x00002400, 0x00000000, 0x00000100, 0x0001f300, 0x00002500, 0x00000000, 0x00000100,
4368 0x0001ff00, 0x00002500, 0x00000700, 0x00000100, 0x00020b00, 0x00002600, 0x00000000, 0x00000100,
4369 0x00021700, 0x00002700, 0x00000000, 0x00000100, 0x00022300, 0x00002800, 0x00000000, 0x00000100,
4370 0x00022f00, 0x00002900, 0x00000000, 0x00000100, 0x00023b00, 0x00002a00, 0x00000000, 0x00000100,
4371 0x00024700, 0x00002b00, 0x00000000, 0x00000100, 0x00025300, 0x00002c00, 0x00000000, 0x00000100,
4372 0x00025f00, 0x00002c00, 0x00000700, 0x00000100, 0x00026b00, 0x00000000, 0x00027700, 0x0001cb00,
4373 0x00000000, 0xffffff00, 0x000001ff, 0x00002600, 0x00000000, 0x00000100, 0x00028400, 0x00000000,
4374 0x0002b900, 0x00029d00, 0x00000000, 0xffffff00, 0x00000bff, 0x00002d00, 0x00000000, 0x00000100,
4375 0x0002c200, 0x00002e00, 0x00000000, 0x00000100, 0x0002ce00, 0x00002f00, 0x00000000, 0x00000100,
4376 0x0002da00, 0x00003000, 0x00000000, 0x00000100, 0x0002e600, 0x00003100, 0x00000000, 0x00000100,
4377 0x0002f200, 0x00003200, 0x00000000, 0x00000100, 0x0002fe00, 0x00003300, 0x00000000, 0x00000100,
4378 0x00030a00, 0x00003400, 0x00000000, 0x00000100, 0x00031600, 0x00003500, 0x00000000, 0x00000100,
4379 0x00033a00, 0x00003600, 0x00000000, 0x00000100, 0x00034600, 0x00003700, 0x00000000, 0x00000100,
4380 0x00035200, 0x00000000, 0x00035e00, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00002e00,
4381 0x00000000, 0x00000100, 0x00036800, 0x00000000, 0x00039800, 0x00037c00, 0x00000000, 0xffffff00,
4382 0x000000ff, 0x0003c100, 0x0003a500, 0x00000000, 0xffffff00, 0x000000ff, 0x0003ef00, 0x0003d300,
4383 0x00000000, 0xffffff00, 0x000000ff, 0x00041900, 0x0003fd00, 0x00000000, 0xffffff00, 0x000000ff,
4384 0x00044700, 0x00042b00, 0x00000000, 0xffffff00, 0x000000ff, 0x00047300, 0x00045700, 0x00000000,
4385 0xffffff00, 0x000000ff, 0x0004a600, 0x00048a00, 0x00000000, 0xffffff00, 0x000000ff, 0x0004d300,
4386 0x0004b700, 0x00000000, 0xffffff00, 0x000000ff, 0x0004fe00, 0x0004e200, 0x00000000, 0xffffff00,
4387 0x000000ff, 0x00050100, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000,
4388 0x00000200, 0x00039800, 0x00000000, 0x00050a00, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff,
4389 0x00003700, 0x00000000, 0x00000200, 0x0003c100, 0x00000000, 0x00051300, 0x00029d00, 0x00000000,
4390 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0003ef00, 0x00000000, 0x00051d00,
4391 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x00041900,
4392 0x00000000, 0x00052600, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000,
4393 0x00000200, 0x00044700, 0x00000000, 0x00053000, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff,
4394 0x00003700, 0x00000000, 0x00000200, 0x00047300, 0x00000000, 0x00053900, 0x00029d00, 0x00000000,
4395 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0004a600, 0x00000000, 0x00054300,
4396 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0004d300,
4397 0x00000000, 0x00054c00, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000,
4398 0x00000200, 0x0004fe00, 0x00000000, 0x00057100, 0x00055500, 0x00000000, 0xffffff00, 0x000000ff,
4399 0x00059200, 0x00057600, 0x00000000, 0xffffff00, 0x000000ff, 0x0005b300, 0x00059700, 0x00000000,
4400 0xffffff00, 0x000000ff, 0x0005d500, 0x0005b900, 0x00000000, 0xffffff00, 0x000000ff, 0x0005f600,
4401 0x0005da00, 0x00000000, 0xffffff00, 0x000000ff, 0x00061800, 0x0005fc00, 0x00000000, 0xffffff00,
4402 0x000000ff, 0x00063c00, 0x00062000, 0x00000000, 0xffffff00, 0x000000ff, 0x00066100, 0x00064500,
4403 0x00000000, 0xffffff00, 0x000000ff, 0x00068200, 0x00066600, 0x00000000, 0xffffff00, 0x000000ff,
4404 0x00068700, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300,
4405 0x00069000, 0x00000000, 0x00069800, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700,
4406 0x00000000, 0x00000300, 0x0006a100, 0x00000000, 0x0006a900, 0x00029d00, 0x00000000, 0xffffff00,
4407 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006b200, 0x00000000, 0x0006ba00, 0x00029d00,
4408 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006c400, 0x00000000,
4409 0x0006cc00, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300,
4410 0x0006d600, 0x00000000, 0x0006de00, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700,
4411 0x00000000, 0x00000300, 0x0006e800, 0x00000000, 0x0006f000, 0x00029d00, 0x00000000, 0xffffff00,
4412 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006fa00, 0x00000000, 0x00070200, 0x00029d00,
4413 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00070c00, 0x00000000,
4414 0x00071400, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300,
4415 0x00071e00, 0x00000000, 0x00072600, 0x00029d00, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700,
4416 0x00000000, 0x00000100, 0x00072900, 0x00000000, 0x00073500, 0x00000300, 0x00000000, 0x00073b00,
4417 0x00000600, 0x00000000, 0x00000a00, 0x00000000, 0x00000100, 0x00074100, 0x00000b00, 0x00000000,
4418 0x00000100, 0x00076500, 0x00000200, 0x00000000, 0x00000200, 0x0001e700, 0x00000900, 0x00000000,
4419 0x00000100, 0x00077100, 0x00000100, 0x00000000, 0x00000200, 0x0000f900, 0x00000000, 0x00000000,
4420 0x00000200, 0x00003000, 0x00077d00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000700,
4421 0x00097700, 0x00097f00, 0x00000500, 0x00000000, 0x00000900, 0x00000000, 0x00000100, 0x00098500,
4422 0x00000100, 0x00000000, 0x00000100, 0x00099100, 0x00000a00, 0x00000000, 0x00000100, 0x00099d00,
4423 0x00000b00, 0x00000000, 0x00000100, 0x0009c100, 0x00000200, 0x00000000, 0x00000100, 0x0009cd00,
4427 static void create_effect_texture_resource(ID3D10Device
*device
, ID3D10ShaderResourceView
**srv
,
4428 ID3D10Texture2D
**tex
)
4430 D3D10_TEXTURE2D_DESC tex_desc
;
4433 tex_desc
.Format
= DXGI_FORMAT_R8G8B8A8_UNORM
;
4435 tex_desc
.Height
= 8;
4436 tex_desc
.ArraySize
= 1;
4437 tex_desc
.MipLevels
= 0;
4438 tex_desc
.BindFlags
= D3D10_BIND_SHADER_RESOURCE
;
4439 tex_desc
.Usage
= D3D10_USAGE_DEFAULT
;
4440 tex_desc
.CPUAccessFlags
= 0;
4441 tex_desc
.SampleDesc
.Count
= 1;
4442 tex_desc
.SampleDesc
.Quality
= 0;
4443 tex_desc
.MiscFlags
= 0;
4445 hr
= ID3D10Device_CreateTexture2D(device
, &tex_desc
, NULL
, tex
);
4446 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4447 hr
= ID3D10Device_CreateShaderResourceView(device
, (ID3D10Resource
*)*tex
, NULL
, srv
);
4448 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4451 static void test_effect_state_groups(void)
4453 ID3D10DepthStencilState
*ds_state
, *ds_state2
;
4454 ID3D10BlendState
*blend_state
, *blend_state2
;
4455 ID3D10ShaderResourceView
*srv0
, *srv1
;
4456 ID3D10EffectDepthStencilVariable
*d
;
4457 ID3D10EffectRasterizerVariable
*r
;
4458 ID3D10RasterizerState
*rast_state
;
4459 ID3D10EffectTechnique
*technique
;
4460 D3D10_DEPTH_STENCIL_DESC ds_desc
;
4461 D3D10_RASTERIZER_DESC rast_desc
;
4462 D3D10_SAMPLER_DESC sampler_desc
;
4463 ID3D10EffectSamplerVariable
*s
;
4464 D3D10_EFFECT_DESC effect_desc
;
4465 UINT sample_mask
, stencil_ref
;
4466 ID3D10EffectBlendVariable
*b
;
4467 D3D10_BLEND_DESC blend_desc
;
4468 D3D10_STATE_BLOCK_MASK mask
;
4469 ID3D10SamplerState
*sampler
;
4470 D3D10_PASS_DESC pass_desc
;
4471 ID3D10EffectVariable
*v
;
4472 ID3D10EffectPass
*pass
;
4473 float blend_factor
[4];
4474 ID3D10Texture2D
*tex0
;
4475 ID3D10Effect
*effect
;
4476 ID3D10Device
*device
;
4481 if (!(device
= create_device()))
4483 skip("Failed to create device, skipping tests.\n");
4487 hr
= create_effect(fx_test_state_groups
, 0, device
, NULL
, &effect
);
4488 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4490 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
4491 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4492 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
4493 ok(!effect_desc
.ConstantBuffers
, "Unexpected constant buffers count %u.\n",
4494 effect_desc
.ConstantBuffers
);
4495 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
4496 effect_desc
.SharedConstantBuffers
);
4497 ok(effect_desc
.GlobalVariables
== 45, "Unexpected global variables count %u.\n",
4498 effect_desc
.GlobalVariables
);
4499 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
4500 effect_desc
.SharedGlobalVariables
);
4501 ok(effect_desc
.Techniques
== 1, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
4503 v
= effect
->lpVtbl
->GetVariableByName(effect
, "sampler0");
4504 s
= v
->lpVtbl
->AsSampler(v
);
4505 s
->lpVtbl
->GetBackingStore(s
, 0, &sampler_desc
);
4506 ok(sampler_desc
.Filter
== D3D10_FILTER_MIN_MAG_MIP_LINEAR
, "Got unexpected Filter %#x.\n", sampler_desc
.Filter
);
4507 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
4508 ok(sampler_desc
.AddressV
== D3D10_TEXTURE_ADDRESS_MIRROR
, "Got unexpected AddressV %#x.\n", sampler_desc
.AddressV
);
4509 ok(sampler_desc
.AddressW
== D3D10_TEXTURE_ADDRESS_CLAMP
, "Got unexpected AddressW %#x.\n", sampler_desc
.AddressW
);
4510 ok(sampler_desc
.MipLODBias
== -1.0f
, "Got unexpected MipLODBias %.8e.\n", sampler_desc
.MipLODBias
);
4511 ok(sampler_desc
.MaxAnisotropy
== 4, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc
.MaxAnisotropy
);
4512 ok(sampler_desc
.ComparisonFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected ComparisonFunc %#x.\n",
4513 sampler_desc
.ComparisonFunc
);
4514 ok(sampler_desc
.BorderColor
[0] == 1.0f
, "Got unexpected BorderColor[0] %.8e.\n", sampler_desc
.BorderColor
[0]);
4515 ok(sampler_desc
.BorderColor
[1] == 2.0f
, "Got unexpected BorderColor[1] %.8e.\n", sampler_desc
.BorderColor
[1]);
4516 ok(sampler_desc
.BorderColor
[2] == 3.0f
, "Got unexpected BorderColor[2] %.8e.\n", sampler_desc
.BorderColor
[2]);
4517 ok(sampler_desc
.BorderColor
[3] == 4.0f
, "Got unexpected BorderColor[3] %.8e.\n", sampler_desc
.BorderColor
[3]);
4518 ok(sampler_desc
.MinLOD
== 6.0f
, "Got unexpected MinLOD %.8e.\n", sampler_desc
.MinLOD
);
4519 ok(sampler_desc
.MaxLOD
== 5.0f
, "Got unexpected MaxLOD %.8e.\n", sampler_desc
.MaxLOD
);
4520 hr
= s
->lpVtbl
->GetSampler(s
, 0, &sampler
);
4521 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4522 ID3D10SamplerState_GetDesc(sampler
, &sampler_desc
);
4523 ok(sampler_desc
.Filter
== D3D10_FILTER_MIN_MAG_MIP_LINEAR
, "Got unexpected Filter %#x.\n", sampler_desc
.Filter
);
4524 ID3D10SamplerState_Release(sampler
);
4526 s
->lpVtbl
->GetBackingStore(s
, 1, &sampler_desc
);
4527 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_MIRROR
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
4528 hr
= s
->lpVtbl
->GetSampler(s
, 1, &sampler
);
4529 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4530 ID3D10SamplerState_GetDesc(sampler
, &sampler_desc
);
4531 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_MIRROR
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
4532 ID3D10SamplerState_Release(sampler
);
4534 v
= effect
->lpVtbl
->GetVariableByName(effect
, "blend_state");
4535 b
= v
->lpVtbl
->AsBlend(v
);
4536 b
->lpVtbl
->GetBackingStore(b
, 0, &blend_desc
);
4537 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
4538 blend_desc
.AlphaToCoverageEnable
);
4539 ok(blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4540 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
4541 ok(blend_desc
.SrcBlend
== D3D10_BLEND_ONE
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4542 ok(blend_desc
.DestBlend
== D3D10_BLEND_SRC_COLOR
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
4543 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_MIN
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
4544 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
4545 blend_desc
.SrcBlendAlpha
);
4546 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
4547 blend_desc
.DestBlendAlpha
);
4548 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_MAX
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
4549 ok(blend_desc
.RenderTargetWriteMask
[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4550 blend_desc
.RenderTargetWriteMask
[0]);
4551 ok(blend_desc
.RenderTargetWriteMask
[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4552 blend_desc
.RenderTargetWriteMask
[7]);
4553 hr
= b
->lpVtbl
->GetBlendState(b
, 0, &blend_state
);
4554 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4555 ID3D10BlendState_GetDesc(blend_state
, &blend_desc
);
4556 ok(blend_desc
.SrcBlend
== D3D10_BLEND_ONE
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4557 ID3D10BlendState_Release(blend_state
);
4558 b
->lpVtbl
->GetBackingStore(b
, 1, &blend_desc
);
4559 ok(blend_desc
.SrcBlend
== D3D10_BLEND_SRC_COLOR
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4560 hr
= b
->lpVtbl
->GetBlendState(b
, 1, &blend_state
);
4561 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4562 ID3D10BlendState_GetDesc(blend_state
, &blend_desc
);
4563 /* We can't check the SrcBlend value from the ID3D10BlendState object
4564 * descriptor because BlendEnable[0] is effectively false, which forces
4565 * normalization of all the other descriptor values. We can at least
4566 * confirm that we got blend_state2 by checking BlendEnable[0] itself. */
4567 ok(!blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4568 ID3D10BlendState_Release(blend_state
);
4570 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ds_state");
4571 d
= v
->lpVtbl
->AsDepthStencil(v
);
4572 d
->lpVtbl
->GetBackingStore(d
, 0, &ds_desc
);
4573 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4574 ok(ds_desc
.DepthWriteMask
== D3D10_DEPTH_WRITE_MASK_ZERO
, "Got unexpected DepthWriteMask %#x.\n",
4575 ds_desc
.DepthWriteMask
);
4576 ok(ds_desc
.DepthFunc
== D3D10_COMPARISON_EQUAL
, "Got unexpected DepthFunc %#x.\n", ds_desc
.DepthFunc
);
4577 ok(ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
4578 ok(ds_desc
.StencilReadMask
== 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc
.StencilReadMask
);
4579 ok(ds_desc
.StencilWriteMask
== 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc
.StencilWriteMask
);
4580 ok(ds_desc
.FrontFace
.StencilFailOp
== D3D10_STENCIL_OP_INVERT
, "Got unexpected FrontFaceStencilFail %#x.\n",
4581 ds_desc
.FrontFace
.StencilFailOp
);
4582 ok(ds_desc
.FrontFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR
,
4583 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc
.FrontFace
.StencilDepthFailOp
);
4584 ok(ds_desc
.FrontFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR
, "Got unexpected FrontFaceStencilPass %#x.\n",
4585 ds_desc
.FrontFace
.StencilPassOp
);
4586 ok(ds_desc
.FrontFace
.StencilFunc
== D3D10_COMPARISON_LESS_EQUAL
, "Got unexpected FrontFaceStencilFunc %#x.\n",
4587 ds_desc
.FrontFace
.StencilFunc
);
4588 ok(ds_desc
.BackFace
.StencilFailOp
== D3D10_STENCIL_OP_REPLACE
, "Got unexpected BackFaceStencilFail %#x.\n",
4589 ds_desc
.BackFace
.StencilFailOp
);
4590 ok(ds_desc
.BackFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR_SAT
,
4591 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc
.BackFace
.StencilDepthFailOp
);
4592 ok(ds_desc
.BackFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR_SAT
, "Got unexpected BackFaceStencilPass %#x.\n",
4593 ds_desc
.BackFace
.StencilPassOp
);
4594 ok(ds_desc
.BackFace
.StencilFunc
== D3D10_COMPARISON_GREATER_EQUAL
, "Got unexpected BackFaceStencilFunc %#x.\n",
4595 ds_desc
.BackFace
.StencilFunc
);
4596 hr
= d
->lpVtbl
->GetDepthStencilState(d
, 0, &ds_state
);
4597 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4598 ID3D10DepthStencilState_GetDesc(ds_state
, &ds_desc
);
4599 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4600 ID3D10DepthStencilState_Release(ds_state
);
4601 d
->lpVtbl
->GetBackingStore(d
, 1, &ds_desc
);
4602 ok(!ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4603 hr
= d
->lpVtbl
->GetDepthStencilState(d
, 1, &ds_state
);
4604 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4605 ID3D10DepthStencilState_GetDesc(ds_state
, &ds_desc
);
4606 ok(!ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4607 ID3D10DepthStencilState_Release(ds_state
);
4609 v
= effect
->lpVtbl
->GetVariableByName(effect
, "rast_state");
4610 r
= v
->lpVtbl
->AsRasterizer(v
);
4611 r
->lpVtbl
->GetBackingStore(r
, 0, &rast_desc
);
4612 ok(rast_desc
.FillMode
== D3D10_FILL_WIREFRAME
, "Got unexpected FillMode %#x.\n", rast_desc
.FillMode
);
4613 ok(rast_desc
.CullMode
== D3D10_CULL_FRONT
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4614 ok(rast_desc
.FrontCounterClockwise
, "Got unexpected FrontCounterClockwise %#x.\n",
4615 rast_desc
.FrontCounterClockwise
);
4616 ok(rast_desc
.DepthBias
== -4, "Got unexpected DepthBias %#x.\n", rast_desc
.DepthBias
);
4617 ok(rast_desc
.DepthBiasClamp
== 0.5f
, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc
.DepthBiasClamp
);
4618 ok(rast_desc
.SlopeScaledDepthBias
== 0.25f
, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4619 rast_desc
.SlopeScaledDepthBias
);
4620 ok(!rast_desc
.DepthClipEnable
, "Got unexpected DepthClipEnable %#x.\n", rast_desc
.DepthClipEnable
);
4621 ok(rast_desc
.ScissorEnable
, "Got unexpected ScissorEnable %#x.\n", rast_desc
.ScissorEnable
);
4622 ok(rast_desc
.MultisampleEnable
, "Got unexpected MultisampleEnable %#x.\n", rast_desc
.MultisampleEnable
);
4623 ok(rast_desc
.AntialiasedLineEnable
, "Got unexpected AntialiasedLineEnable %#x.\n",
4624 rast_desc
.AntialiasedLineEnable
);
4625 hr
= r
->lpVtbl
->GetRasterizerState(r
, 0, &rast_state
);
4626 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4627 ID3D10RasterizerState_GetDesc(rast_state
, &rast_desc
);
4628 ok(rast_desc
.CullMode
== D3D10_CULL_FRONT
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4629 ID3D10RasterizerState_Release(rast_state
);
4631 r
->lpVtbl
->GetBackingStore(r
, 1, &rast_desc
);
4632 ok(rast_desc
.CullMode
== D3D10_CULL_BACK
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4633 hr
= r
->lpVtbl
->GetRasterizerState(r
, 1, &rast_state
);
4634 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4635 ID3D10RasterizerState_GetDesc(rast_state
, &rast_desc
);
4636 ok(rast_desc
.CullMode
== D3D10_CULL_BACK
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4637 ID3D10RasterizerState_Release(rast_state
);
4639 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "tech0");
4640 ok(technique
->lpVtbl
->IsValid(technique
), "Expected valid technique.\n");
4641 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass0");
4642 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
4643 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
4644 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4645 ok(!strcmp(pass_desc
.Name
, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc
.Name
);
4646 ok(!pass_desc
.Annotations
, "Got unexpected Annotations %#x.\n", pass_desc
.Annotations
);
4647 ok(!pass_desc
.pIAInputSignature
, "Got unexpected pIAInputSignature %p.\n", pass_desc
.pIAInputSignature
);
4648 ok(pass_desc
.StencilRef
== 1, "Got unexpected StencilRef %#x.\n", pass_desc
.StencilRef
);
4649 ok(pass_desc
.SampleMask
== 0xffff, "Got unexpected SampleMask %#x.\n", pass_desc
.SampleMask
);
4650 ok(pass_desc
.BlendFactor
[0] == 0.5f
, "Got unexpected BlendFactor[0] %.8e.\n", pass_desc
.BlendFactor
[0]);
4651 ok(pass_desc
.BlendFactor
[1] == 0.6f
, "Got unexpected BlendFactor[1] %.8e.\n", pass_desc
.BlendFactor
[1]);
4652 ok(pass_desc
.BlendFactor
[2] == 0.7f
, "Got unexpected BlendFactor[2] %.8e.\n", pass_desc
.BlendFactor
[2]);
4653 ok(pass_desc
.BlendFactor
[3] == 0.8f
, "Got unexpected BlendFactor[3] %.8e.\n", pass_desc
.BlendFactor
[3]);
4655 hr
= D3D10StateBlockMaskDisableAll(&mask
);
4656 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4657 hr
= pass
->lpVtbl
->ComputeStateBlockMask(pass
, &mask
);
4658 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4659 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_RS_RASTERIZER_STATE
, 0);
4660 ok(ret
, "Unexpected mask.\n");
4661 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_OM_DEPTH_STENCIL_STATE
, 0);
4662 ok(ret
, "Unexpected mask.\n");
4663 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_OM_BLEND_STATE
, 0);
4664 ok(ret
, "Unexpected mask.\n");
4666 hr
= pass
->lpVtbl
->Apply(pass
, 0);
4667 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4669 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
4670 ID3D10BlendState_GetDesc(blend_state
, &blend_desc
);
4671 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
4672 blend_desc
.AlphaToCoverageEnable
);
4673 ok(blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4674 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
4675 ok(blend_desc
.SrcBlend
== D3D10_BLEND_ONE
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4676 ok(blend_desc
.DestBlend
== D3D10_BLEND_SRC_COLOR
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
4677 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_MIN
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
4678 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
4679 blend_desc
.SrcBlendAlpha
);
4680 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
4681 blend_desc
.DestBlendAlpha
);
4682 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_MAX
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
4683 ok(blend_desc
.RenderTargetWriteMask
[0] == 0x8, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4684 blend_desc
.RenderTargetWriteMask
[0]);
4685 ok(blend_desc
.RenderTargetWriteMask
[7] == 0x7, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4686 blend_desc
.RenderTargetWriteMask
[7]);
4687 ok(blend_factor
[0] == 0.5f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
4688 ok(blend_factor
[1] == 0.6f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
4689 ok(blend_factor
[2] == 0.7f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
4690 ok(blend_factor
[3] == 0.8f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
4691 ok(sample_mask
== 0xffff, "Got unexpected sample_mask %#x.\n", sample_mask
);
4693 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
4694 ID3D10DepthStencilState_GetDesc(ds_state
, &ds_desc
);
4695 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4696 ok(ds_desc
.DepthWriteMask
== D3D10_DEPTH_WRITE_MASK_ZERO
, "Got unexpected DepthWriteMask %#x.\n",
4697 ds_desc
.DepthWriteMask
);
4698 ok(ds_desc
.DepthFunc
== D3D10_COMPARISON_EQUAL
, "Got unexpected DepthFunc %#x.\n", ds_desc
.DepthFunc
);
4699 ok(ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
4700 ok(ds_desc
.StencilReadMask
== 0x4, "Got unexpected StencilReadMask %#x.\n", ds_desc
.StencilReadMask
);
4701 ok(ds_desc
.StencilWriteMask
== 0x5, "Got unexpected StencilWriteMask %#x.\n", ds_desc
.StencilWriteMask
);
4702 ok(ds_desc
.FrontFace
.StencilFailOp
== D3D10_STENCIL_OP_INVERT
, "Got unexpected FrontFaceStencilFail %#x.\n",
4703 ds_desc
.FrontFace
.StencilFailOp
);
4704 ok(ds_desc
.FrontFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR
,
4705 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc
.FrontFace
.StencilDepthFailOp
);
4706 ok(ds_desc
.FrontFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR
, "Got unexpected FrontFaceStencilPass %#x.\n",
4707 ds_desc
.FrontFace
.StencilPassOp
);
4708 ok(ds_desc
.FrontFace
.StencilFunc
== D3D10_COMPARISON_LESS_EQUAL
, "Got unexpected FrontFaceStencilFunc %#x.\n",
4709 ds_desc
.FrontFace
.StencilFunc
);
4710 ok(ds_desc
.BackFace
.StencilFailOp
== D3D10_STENCIL_OP_REPLACE
, "Got unexpected BackFaceStencilFail %#x.\n",
4711 ds_desc
.BackFace
.StencilFailOp
);
4712 ok(ds_desc
.BackFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_INCR_SAT
,
4713 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc
.BackFace
.StencilDepthFailOp
);
4714 ok(ds_desc
.BackFace
.StencilPassOp
== D3D10_STENCIL_OP_DECR_SAT
, "Got unexpected BackFaceStencilPass %#x.\n",
4715 ds_desc
.BackFace
.StencilPassOp
);
4716 ok(ds_desc
.BackFace
.StencilFunc
== D3D10_COMPARISON_GREATER_EQUAL
, "Got unexpected BackFaceStencilFunc %#x.\n",
4717 ds_desc
.BackFace
.StencilFunc
);
4718 ok(stencil_ref
== 1, "Got unexpected stencil_ref %#x.\n", stencil_ref
);
4720 ID3D10Device_RSGetState(device
, &rast_state
);
4721 ID3D10RasterizerState_GetDesc(rast_state
, &rast_desc
);
4722 ok(rast_desc
.FillMode
== D3D10_FILL_WIREFRAME
, "Got unexpected FillMode %#x.\n", rast_desc
.FillMode
);
4723 ok(rast_desc
.CullMode
== D3D10_CULL_FRONT
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4724 ok(rast_desc
.FrontCounterClockwise
, "Got unexpected FrontCounterClockwise %#x.\n",
4725 rast_desc
.FrontCounterClockwise
);
4726 ok(rast_desc
.DepthBias
== -4, "Got unexpected DepthBias %#x.\n", rast_desc
.DepthBias
);
4727 ok(rast_desc
.DepthBiasClamp
== 0.5f
, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc
.DepthBiasClamp
);
4728 ok(rast_desc
.SlopeScaledDepthBias
== 0.25f
, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4729 rast_desc
.SlopeScaledDepthBias
);
4730 ok(!rast_desc
.DepthClipEnable
, "Got unexpected DepthClipEnable %#x.\n", rast_desc
.DepthClipEnable
);
4731 ok(rast_desc
.ScissorEnable
, "Got unexpected ScissorEnable %#x.\n", rast_desc
.ScissorEnable
);
4732 ok(rast_desc
.MultisampleEnable
, "Got unexpected MultisampleEnable %#x.\n", rast_desc
.MultisampleEnable
);
4733 ok(rast_desc
.AntialiasedLineEnable
, "Got unexpected AntialiasedLineEnable %#x.\n",
4734 rast_desc
.AntialiasedLineEnable
);
4736 ID3D10RasterizerState_Release(rast_state
);
4738 /* pass 1 - uses SamplerState.Texture = NULL, resource slot is reset. */
4739 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass1");
4740 ok(pass
->lpVtbl
->IsValid(pass
), "Failed to get pass.\n");
4742 create_effect_texture_resource(device
, &srv0
, &tex0
);
4744 hr
= D3D10StateBlockMaskDisableAll(&mask
);
4745 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4746 hr
= pass
->lpVtbl
->ComputeStateBlockMask(pass
, &mask
);
4747 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4748 ret
= D3D10StateBlockMaskGetSetting(&mask
, D3D10_DST_VS_SHADER_RESOURCES
, 0);
4749 ok(!ret
, "Unexpected mask.\n");
4751 ID3D10Device_PSSetShaderResources(device
, 0, 1, &srv0
);
4752 hr
= pass
->lpVtbl
->Apply(pass
, 0);
4753 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4754 ID3D10Device_PSGetShaderResources(device
, 0, 1, &srv1
);
4755 ok(!srv1
, "Unexpected resource pointer.\n");
4757 ID3D10ShaderResourceView_Release(srv0
);
4758 ID3D10Texture2D_Release(tex0
);
4760 /* pass 2 - NULL depth stencil state */
4761 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass2");
4762 ok(pass
->lpVtbl
->IsValid(pass
), "Failed to get pass.\n");
4764 ID3D10Device_OMSetDepthStencilState(device
, ds_state
, 0);
4765 ID3D10Device_OMSetBlendState(device
, blend_state
, NULL
, 0);
4766 hr
= pass
->lpVtbl
->Apply(pass
, 0);
4767 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4768 ID3D10Device_OMGetDepthStencilState(device
, &ds_state2
, &stencil_ref
);
4769 ok(!ds_state2
, "Unexpected depth stencil state.\n");
4770 ID3D10Device_OMGetBlendState(device
, &blend_state2
, blend_factor
, &sample_mask
);
4771 ok(!blend_state2
, "Unexpected blend state.\n");
4773 ID3D10DepthStencilState_Release(ds_state
);
4774 ID3D10BlendState_Release(blend_state
);
4775 effect
->lpVtbl
->Release(effect
);
4777 refcount
= ID3D10Device_Release(device
);
4778 ok(!refcount
, "Device has %lu references left.\n", refcount
);
4782 RasterizerState rast_state
{};
4783 DepthStencilState ds_state
{};
4784 BlendState blend_state
{};
4785 SamplerState sampler0
{};
4795 static DWORD fx_test_state_group_defaults
[] =
4797 0x43425844, 0xef2bd174, 0x123794f9, 0xbea23fa0, 0x953a31dd, 0x00000001, 0x00000209, 0x00000001,
4798 0x00000024, 0x30315846, 0x000001dd, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
4799 0x00000000, 0x00000000, 0x00000001, 0x0000010d, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
4800 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152,
4801 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4802 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x44006574, 0x68747065, 0x6e657453, 0x536c6963,
4803 0x65746174, 0x00003b00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000300,
4804 0x5f736400, 0x74617473, 0x6c420065, 0x53646e65, 0x65746174, 0x00007200, 0x00000200, 0x00000000,
4805 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x656c6200, 0x735f646e, 0x65746174, 0x6d615300,
4806 0x72656c70, 0x74617453, 0x00a50065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4807 0x00150000, 0x61730000, 0x656c706d, 0x74003072, 0x30686365, 0x73617000, 0x53003073, 0x6e697274,
4808 0x00e30067, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00610000,
4809 0x74786574, 0x00003000, 0x00001400, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00006900,
4810 0x00004d00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00009900, 0x00007d00, 0x00000000,
4811 0xffffff00, 0x000000ff, 0x00000000, 0x0000ce00, 0x0000b200, 0x00000000, 0xffffff00, 0x000000ff,
4812 0x00000000, 0x0000d700, 0x00000100, 0x00000000, 0x0000dd00, 0x00000000, 0x00000100, 0x00010600,
4813 0x0000ea00, 0x00010800, 0x00000000,
4816 static void test_effect_state_group_defaults(void)
4818 ID3D10EffectDepthStencilVariable
*d
;
4819 ID3D10EffectRasterizerVariable
*r
;
4820 ID3D10EffectTechnique
*technique
;
4821 D3D10_DEPTH_STENCIL_DESC ds_desc
;
4822 D3D10_RASTERIZER_DESC rast_desc
;
4823 D3D10_SAMPLER_DESC sampler_desc
;
4824 ID3D10EffectSamplerVariable
*s
;
4825 D3D10_EFFECT_DESC effect_desc
;
4826 ID3D10EffectBlendVariable
*b
;
4827 D3D10_BLEND_DESC blend_desc
;
4828 D3D10_PASS_DESC pass_desc
;
4829 ID3D10EffectVariable
*v
;
4830 ID3D10EffectPass
*pass
;
4831 ID3D10Effect
*effect
;
4832 ID3D10Device
*device
;
4837 if (!(device
= create_device()))
4839 skip("Failed to create device, skipping tests.\n");
4843 hr
= create_effect(fx_test_state_group_defaults
, 0, device
, NULL
, &effect
);
4844 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4846 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
4847 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4848 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
4849 ok(effect_desc
.ConstantBuffers
== 0, "Unexpected constant buffers count %u.\n",
4850 effect_desc
.ConstantBuffers
);
4851 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
4852 effect_desc
.SharedConstantBuffers
);
4853 ok(effect_desc
.GlobalVariables
== 4, "Unexpected global variables count %u.\n",
4854 effect_desc
.GlobalVariables
);
4855 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
4856 effect_desc
.SharedGlobalVariables
);
4857 ok(effect_desc
.Techniques
== 1, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
4859 v
= effect
->lpVtbl
->GetVariableByName(effect
, "sampler0");
4860 s
= v
->lpVtbl
->AsSampler(v
);
4861 memset(&sampler_desc
, 0, sizeof(sampler_desc
));
4862 s
->lpVtbl
->GetBackingStore(s
, 0, &sampler_desc
);
4863 ok(sampler_desc
.Filter
== D3D10_FILTER_MIN_MAG_MIP_POINT
, "Got unexpected Filter %#x.\n", sampler_desc
.Filter
);
4864 ok(sampler_desc
.AddressU
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressU %#x.\n", sampler_desc
.AddressU
);
4865 ok(sampler_desc
.AddressV
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressV %#x.\n", sampler_desc
.AddressV
);
4866 ok(sampler_desc
.AddressW
== D3D10_TEXTURE_ADDRESS_WRAP
, "Got unexpected AddressW %#x.\n", sampler_desc
.AddressW
);
4867 ok(sampler_desc
.MipLODBias
== 0.0f
, "Got unexpected MipLODBias %.8e.\n", sampler_desc
.MipLODBias
);
4868 ok(sampler_desc
.MaxAnisotropy
== 16, "Got unexpected MaxAnisotropy %#x.\n", sampler_desc
.MaxAnisotropy
);
4869 ok(sampler_desc
.ComparisonFunc
== D3D10_COMPARISON_NEVER
, "Got unexpected ComparisonFunc %#x.\n",
4870 sampler_desc
.ComparisonFunc
);
4871 for (idx
= 0; idx
< ARRAY_SIZE(sampler_desc
.BorderColor
); ++idx
)
4872 ok(sampler_desc
.BorderColor
[idx
] == 0.0f
, "Got unexpected BorderColor[%u] %.8e.\n", idx
, sampler_desc
.BorderColor
[idx
]);
4873 ok(sampler_desc
.MinLOD
== 0.0f
, "Got unexpected MinLOD %.8e.\n", sampler_desc
.MinLOD
);
4874 ok(sampler_desc
.MaxLOD
== FLT_MAX
, "Got unexpected MaxLOD %.8e.\n", sampler_desc
.MaxLOD
);
4876 v
= effect
->lpVtbl
->GetVariableByName(effect
, "blend_state");
4877 b
= v
->lpVtbl
->AsBlend(v
);
4878 memset(&blend_desc
, 0, sizeof(blend_desc
));
4879 b
->lpVtbl
->GetBackingStore(b
, 0, &blend_desc
);
4880 ok(!blend_desc
.AlphaToCoverageEnable
, "Got unexpected AlphaToCoverageEnable %#x.\n",
4881 blend_desc
.AlphaToCoverageEnable
);
4882 ok(!blend_desc
.BlendEnable
[0], "Got unexpected BlendEnable[0] %#x.\n", blend_desc
.BlendEnable
[0]);
4883 ok(!blend_desc
.BlendEnable
[7], "Got unexpected BlendEnable[7] %#x.\n", blend_desc
.BlendEnable
[7]);
4884 ok(blend_desc
.SrcBlend
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlend %#x.\n", blend_desc
.SrcBlend
);
4885 ok(blend_desc
.DestBlend
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlend %#x.\n", blend_desc
.DestBlend
);
4886 ok(blend_desc
.BlendOp
== D3D10_BLEND_OP_ADD
, "Got unexpected BlendOp %#x.\n", blend_desc
.BlendOp
);
4887 ok(blend_desc
.SrcBlendAlpha
== D3D10_BLEND_SRC_ALPHA
, "Got unexpected SrcBlendAlpha %#x.\n",
4888 blend_desc
.SrcBlendAlpha
);
4889 ok(blend_desc
.DestBlendAlpha
== D3D10_BLEND_INV_SRC_ALPHA
, "Got unexpected DestBlendAlpha %#x.\n",
4890 blend_desc
.DestBlendAlpha
);
4891 ok(blend_desc
.BlendOpAlpha
== D3D10_BLEND_OP_ADD
, "Got unexpected BlendOpAlpha %#x.\n", blend_desc
.BlendOpAlpha
);
4892 ok(blend_desc
.RenderTargetWriteMask
[0] == 0xf, "Got unexpected RenderTargetWriteMask[0] %#x.\n",
4893 blend_desc
.RenderTargetWriteMask
[0]);
4894 ok(blend_desc
.RenderTargetWriteMask
[7] == 0xf, "Got unexpected RenderTargetWriteMask[7] %#x.\n",
4895 blend_desc
.RenderTargetWriteMask
[7]);
4897 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ds_state");
4898 d
= v
->lpVtbl
->AsDepthStencil(v
);
4899 d
->lpVtbl
->GetBackingStore(d
, 0, &ds_desc
);
4900 ok(ds_desc
.DepthEnable
, "Got unexpected DepthEnable %#x.\n", ds_desc
.DepthEnable
);
4901 ok(ds_desc
.DepthWriteMask
== D3D10_DEPTH_WRITE_MASK_ALL
, "Got unexpected DepthWriteMask %#x.\n",
4902 ds_desc
.DepthWriteMask
);
4903 ok(ds_desc
.DepthFunc
== D3D10_COMPARISON_LESS
, "Got unexpected DepthFunc %#x.\n", ds_desc
.DepthFunc
);
4904 ok(!ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
4905 ok(ds_desc
.StencilReadMask
== 0xff, "Got unexpected StencilReadMask %#x.\n", ds_desc
.StencilReadMask
);
4906 ok(ds_desc
.StencilWriteMask
== 0xff, "Got unexpected StencilWriteMask %#x.\n", ds_desc
.StencilWriteMask
);
4907 ok(ds_desc
.FrontFace
.StencilFailOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected FrontFaceStencilFail %#x.\n",
4908 ds_desc
.FrontFace
.StencilFailOp
);
4909 ok(ds_desc
.FrontFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_KEEP
,
4910 "Got unexpected FrontFaceStencilDepthFail %#x.\n", ds_desc
.FrontFace
.StencilDepthFailOp
);
4911 ok(ds_desc
.FrontFace
.StencilPassOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected FrontFaceStencilPass %#x.\n",
4912 ds_desc
.FrontFace
.StencilPassOp
);
4913 ok(ds_desc
.FrontFace
.StencilFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected FrontFaceStencilFunc %#x.\n",
4914 ds_desc
.FrontFace
.StencilFunc
);
4915 ok(ds_desc
.BackFace
.StencilFailOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected BackFaceStencilFail %#x.\n",
4916 ds_desc
.BackFace
.StencilFailOp
);
4917 ok(ds_desc
.BackFace
.StencilDepthFailOp
== D3D10_STENCIL_OP_KEEP
,
4918 "Got unexpected BackFaceStencilDepthFail %#x.\n", ds_desc
.BackFace
.StencilDepthFailOp
);
4919 ok(ds_desc
.BackFace
.StencilPassOp
== D3D10_STENCIL_OP_KEEP
, "Got unexpected BackFaceStencilPass %#x.\n",
4920 ds_desc
.BackFace
.StencilPassOp
);
4921 ok(ds_desc
.BackFace
.StencilFunc
== D3D10_COMPARISON_ALWAYS
, "Got unexpected BackFaceStencilFunc %#x.\n",
4922 ds_desc
.BackFace
.StencilFunc
);
4924 v
= effect
->lpVtbl
->GetVariableByName(effect
, "rast_state");
4925 r
= v
->lpVtbl
->AsRasterizer(v
);
4926 r
->lpVtbl
->GetBackingStore(r
, 0, &rast_desc
);
4927 ok(rast_desc
.FillMode
== D3D10_FILL_SOLID
, "Got unexpected FillMode %#x.\n", rast_desc
.FillMode
);
4928 ok(rast_desc
.CullMode
== D3D10_CULL_BACK
, "Got unexpected CullMode %#x.\n", rast_desc
.CullMode
);
4929 ok(!rast_desc
.FrontCounterClockwise
, "Got unexpected FrontCounterClockwise %#x.\n",
4930 rast_desc
.FrontCounterClockwise
);
4931 ok(rast_desc
.DepthBias
== 0, "Got unexpected DepthBias %#x.\n", rast_desc
.DepthBias
);
4932 ok(rast_desc
.DepthBiasClamp
== 0.0f
, "Got unexpected DepthBiasClamp %.8e.\n", rast_desc
.DepthBiasClamp
);
4933 ok(rast_desc
.SlopeScaledDepthBias
== 0.0f
, "Got unexpected SlopeScaledDepthBias %.8e.\n",
4934 rast_desc
.SlopeScaledDepthBias
);
4935 ok(rast_desc
.DepthClipEnable
, "Got unexpected DepthClipEnable %#x.\n", rast_desc
.DepthClipEnable
);
4936 ok(!rast_desc
.ScissorEnable
, "Got unexpected ScissorEnable %#x.\n", rast_desc
.ScissorEnable
);
4937 ok(!rast_desc
.MultisampleEnable
, "Got unexpected MultisampleEnable %#x.\n", rast_desc
.MultisampleEnable
);
4938 ok(!rast_desc
.AntialiasedLineEnable
, "Got unexpected AntialiasedLineEnable %#x.\n",
4939 rast_desc
.AntialiasedLineEnable
);
4941 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "tech0");
4942 ok(technique
->lpVtbl
->IsValid(technique
), "Expected valid technique.\n");
4943 pass
= technique
->lpVtbl
->GetPassByName(technique
, "pass0");
4944 ok(pass
->lpVtbl
->IsValid(pass
), "Failed to get pass.\n");
4945 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
4946 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
4947 ok(!strcmp(pass_desc
.Name
, "pass0"), "Got unexpected Name \"%s\".\n", pass_desc
.Name
);
4948 ok(pass_desc
.Annotations
== 1, "Got unexpected Annotations %u.\n", pass_desc
.Annotations
);
4949 ok(!pass_desc
.pIAInputSignature
, "Got unexpected pIAInputSignature %p.\n", pass_desc
.pIAInputSignature
);
4950 ok(pass_desc
.StencilRef
== 0, "Got unexpected StencilRef %#x.\n", pass_desc
.StencilRef
);
4951 ok(pass_desc
.SampleMask
== 0, "Got unexpected SampleMask %#x.\n", pass_desc
.SampleMask
);
4952 for (idx
= 0; idx
< ARRAY_SIZE(pass_desc
.BlendFactor
); ++idx
)
4953 ok(pass_desc
.BlendFactor
[idx
] == 0.0f
, "Got unexpected BlendFactor[%u] %.8e.\n", idx
, pass_desc
.BlendFactor
[idx
]);
4955 effect
->lpVtbl
->Release(effect
);
4957 refcount
= ID3D10Device_Release(device
);
4958 ok(!refcount
, "Device has %lu references left.\n", refcount
);
4962 * test_effect_scalar_variable
4973 static DWORD fx_test_scalar_variable
[] =
4975 0x43425844, 0x7d97f44c, 0x1da4b110, 0xb710407e, 0x26750c1c, 0x00000001, 0x00000288, 0x00000001,
4976 0x00000024, 0x30315846, 0x0000025c, 0xfeff1001, 0x00000001, 0x00000008, 0x00000000, 0x00000000,
4977 0x00000000, 0x00000000, 0x00000000, 0x00000118, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4978 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
4979 0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
4980 0x00306600, 0x00000007, 0x00000001, 0x00000002, 0x00000014, 0x00000010, 0x00000008, 0x00000909,
4981 0x00615f66, 0x00746e69, 0x0000004c, 0x00000001, 0x00000000, 0x00000004, 0x00000010, 0x00000004,
4982 0x00000911, 0x4c003069, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000, 0x11000000,
4983 0x69000009, 0x6200615f, 0x006c6f6f, 0x0000008f, 0x00000001, 0x00000000, 0x00000004, 0x00000010,
4984 0x00000004, 0x00000921, 0x8f003062, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000,
4985 0x21000000, 0x62000009, 0x7500615f, 0x00746e69, 0x000000d3, 0x00000001, 0x00000000, 0x00000004,
4986 0x00000010, 0x00000004, 0x00000919, 0xd3003169, 0x01000000, 0x02000000, 0x14000000, 0x10000000,
4987 0x08000000, 0x19000000, 0x69000009, 0x00615f31, 0x00000004, 0x00000090, 0x00000000, 0x00000008,
4988 0xffffffff, 0x00000000, 0x00000029, 0x0000000d, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4989 0x00000000, 0x00000048, 0x0000002c, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000,
4990 0x0000006c, 0x00000050, 0x00000000, 0x00000024, 0x00000000, 0x00000000, 0x00000000, 0x0000008b,
4991 0x0000006f, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000b0, 0x00000094,
4992 0x00000000, 0x00000044, 0x00000000, 0x00000000, 0x00000000, 0x000000cf, 0x000000b3, 0x00000000,
4993 0x00000050, 0x00000000, 0x00000000, 0x00000000, 0x000000f4, 0x000000d8, 0x00000000, 0x00000064,
4994 0x00000000, 0x00000000, 0x00000000, 0x00000113, 0x000000f7, 0x00000000, 0x00000070, 0x00000000,
4995 0x00000000, 0x00000000,
4998 static void test_scalar_methods(ID3D10EffectScalarVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5001 float ret_f
, expected_f
;
5002 int ret_i
, expected_i
;
5003 BOOL ret_b
, expected_b
;
5006 hr
= var
->lpVtbl
->SetFloat(var
, 5.0f
);
5007 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5009 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
5010 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5011 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: 5.0f
;
5012 ok(ret_f
== expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
5014 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
5015 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5016 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 5;
5017 ok(ret_i
== expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
5019 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
5020 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5021 ok(ret_b
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
5023 hr
= var
->lpVtbl
->SetInt(var
, 2);
5024 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5026 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
5027 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5028 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: 2.0f
;
5029 ok(ret_f
== expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
5031 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
5032 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5033 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 2;
5034 ok(ret_i
== expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
5036 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
5037 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5038 ok(ret_b
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
5040 hr
= var
->lpVtbl
->SetBool(var
, 1);
5041 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5043 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
5044 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5045 ok(ret_f
== -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
5047 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
5048 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5049 ok(ret_i
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
5051 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
5052 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5053 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
5054 ok(ret_b
== expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
5056 hr
= var
->lpVtbl
->SetBool(var
, 32);
5057 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5059 hr
= var
->lpVtbl
->GetFloat(var
, &ret_f
);
5060 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5061 ok(ret_f
== -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
);
5063 hr
= var
->lpVtbl
->GetInt(var
, &ret_i
);
5064 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5065 ok(ret_i
== -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
);
5067 hr
= var
->lpVtbl
->GetBool(var
, &ret_b
);
5068 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5069 expected_b
= type
== D3D10_SVT_BOOL
? 32 : -1;
5070 ok(ret_b
== expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
);
5073 static void test_scalar_array_methods(ID3D10EffectScalarVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5076 float set_f
[2], ret_f
[2], expected_f
;
5077 int set_i
[6], ret_i
[6], expected_i
, expected_i_a
[6];
5078 BOOL set_b
[2], ret_b
[2], expected_b
, expected_b_a
[6];
5082 set_f
[0] = 10.0f
; set_f
[1] = 20.0f
;
5083 hr
= var
->lpVtbl
->SetFloatArray(var
, set_f
, 0, 2);
5084 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5086 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
5087 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5088 for (i
= 0; i
< 2; ++i
)
5090 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
5091 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5094 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
5095 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5096 for (i
= 0; i
< 2; ++i
)
5098 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
5099 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5102 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
5103 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5104 for (i
= 0; i
< 2; ++i
)
5105 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5107 set_i
[0] = 5; set_i
[1] = 6;
5108 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
5109 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5111 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
5112 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5113 for (i
= 0; i
< 2; ++i
)
5115 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
5116 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5119 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
5120 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5121 for (i
= 0; i
< 2; ++i
)
5123 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
5124 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5127 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
5128 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5129 for (i
= 0; i
< 2; ++i
)
5130 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5132 set_b
[0] = 1; set_b
[1] = 1;
5133 hr
= var
->lpVtbl
->SetBoolArray(var
, set_b
, 0, 2);
5134 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5136 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
5137 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5138 for (i
= 0; i
< 2; ++i
)
5139 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5141 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
5142 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5143 for (i
= 0; i
< 2; ++i
)
5144 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5146 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
5147 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5148 for (i
= 0; i
< 2; ++i
)
5150 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
5151 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5154 set_b
[0] = 10; set_b
[1] = 20;
5155 hr
= var
->lpVtbl
->SetBoolArray(var
, set_b
, 0, 2);
5156 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5158 hr
= var
->lpVtbl
->GetFloatArray(var
, ret_f
, 0, 2);
5159 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5160 for (i
= 0; i
< 2; ++i
)
5161 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5163 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
5164 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5165 for (i
= 0; i
< 2; ++i
)
5166 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5168 hr
= var
->lpVtbl
->GetBoolArray(var
, ret_b
, 0, 2);
5169 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5170 for (i
= 0; i
< 2; ++i
)
5172 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
5173 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5176 /* Array offset tests. Offset argument goes unused for scalar arrays. */
5177 set_i
[0] = 0; set_i
[1] = 0;
5178 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
5179 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5181 /* After this, if offset is in use, return should be { 0, 5 }. */
5183 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 1, 1);
5184 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5186 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 2);
5187 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5188 expected_b_a
[0] = -1; expected_b_a
[1] = 0;
5189 expected_i_a
[0] = 5; expected_i_a
[1] = 0;
5190 for (i
= 0; i
< 2; ++i
)
5192 expected_i
= type
== D3D10_SVT_BOOL
? expected_b_a
[i
] : expected_i_a
[i
];
5193 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5196 /* Test the offset on GetArray methods. If offset was in use, we'd get
5197 * back 5 given that the variable was previously set to { 0, 5 }. */
5198 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 1, 1);
5199 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5200 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 5;
5201 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
5203 /* Try setting offset larger than number of elements. */
5204 set_i
[0] = 0; set_i
[1] = 0;
5205 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 2);
5206 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5209 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 6, 1);
5210 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5212 /* Since offset goes unused, a larger offset than the number of elements
5213 * in the array should have no effect. */
5214 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 1);
5215 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5216 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 1;
5217 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
5219 memset(ret_i
, 0, sizeof(ret_i
));
5220 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 6, 1);
5221 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5222 expected_i
= type
== D3D10_SVT_BOOL
? -1 : 1;
5223 ok(ret_i
[0] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[0]);
5227 /* Windows array setting function has no bounds checking, so this test
5228 * ends up writing over into the adjacent variables in the local buffer. */
5229 set_i
[0] = 1; set_i
[1] = 2; set_i
[2] = 3; set_i
[3] = 4; set_i
[4] = 5; set_i
[5] = 6;
5230 hr
= var
->lpVtbl
->SetIntArray(var
, set_i
, 0, 6);
5231 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5233 memset(ret_i
, 0, sizeof(ret_i
));
5234 hr
= var
->lpVtbl
->GetIntArray(var
, ret_i
, 0, 6);
5235 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5237 expected_i_a
[0] = 1; expected_i_a
[1] = 2; expected_i_a
[2] = 0; expected_i_a
[3] = 0;
5238 expected_i_a
[4] = 0; expected_i_a
[5] = 0;
5239 expected_b_a
[0] = -1; expected_b_a
[1] = -1; expected_b_a
[2] = 0; expected_b_a
[3] = 0;
5240 expected_b_a
[4] = 0; expected_b_a
[5] = 0;
5241 for (i
= 0; i
< 6; ++i
)
5243 expected_i
= type
== D3D10_SVT_BOOL
? expected_b_a
[i
] : expected_i_a
[i
];
5244 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5249 static void test_effect_scalar_variable(void)
5254 D3D_SHADER_VARIABLE_TYPE type
;
5259 {"f0", D3D10_SVT_FLOAT
},
5260 {"i0", D3D10_SVT_INT
},
5261 {"i1", D3D10_SVT_UINT
},
5262 {"b0", D3D10_SVT_BOOL
},
5263 {"f_a", D3D10_SVT_FLOAT
, TRUE
},
5264 {"i_a", D3D10_SVT_INT
, TRUE
},
5265 {"i1_a", D3D10_SVT_UINT
, TRUE
},
5266 {"b_a", D3D10_SVT_BOOL
, TRUE
},
5268 ID3D10EffectScalarVariable
*s_v
, *s_v2
;
5269 ID3D10EffectVariable
*var
, *var2
;
5270 D3D10_EFFECT_TYPE_DESC type_desc
;
5271 D3D10_EFFECT_DESC effect_desc
;
5272 ID3D10EffectType
*type
;
5273 ID3D10Device
*device
;
5274 ID3D10Effect
*effect
;
5280 if (!(device
= create_device()))
5282 skip("Failed to create device.\n");
5286 hr
= create_effect(fx_test_scalar_variable
, 0, device
, NULL
, &effect
);
5287 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5289 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
5290 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5291 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
5292 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
5293 effect_desc
.ConstantBuffers
);
5294 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
5295 effect_desc
.SharedConstantBuffers
);
5296 ok(effect_desc
.GlobalVariables
== 8, "Unexpected global variables count %u.\n",
5297 effect_desc
.GlobalVariables
);
5298 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
5299 effect_desc
.SharedGlobalVariables
);
5300 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
5302 /* Check each different scalar type, make sure the variable returned is
5303 * valid, set it to a value, and make sure what we get back is the same
5304 * as what we set it to. */
5305 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
5307 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
5308 type
= var
->lpVtbl
->GetType(var
);
5309 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
5310 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", tests
[i
].name
, hr
);
5311 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
5312 tests
[i
].name
, type_desc
.Type
);
5313 s_v
= var
->lpVtbl
->AsScalar(var
);
5314 test_scalar_methods(s_v
, tests
[i
].type
, tests
[i
].name
);
5316 test_scalar_array_methods(s_v
, tests
[i
].type
, tests
[i
].name
);
5319 /* Verify that offsets are working correctly between array elements and adjacent data. */
5320 var
= effect
->lpVtbl
->GetVariableByName(effect
, "f0");
5321 s_v
= var
->lpVtbl
->AsScalar(var
);
5322 hr
= s_v
->lpVtbl
->SetFloat(s_v
, 1.0f
);
5323 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5325 var2
= effect
->lpVtbl
->GetVariableByName(effect
, "f_a");
5326 var2
= var2
->lpVtbl
->GetElement(var2
, 0);
5327 s_v2
= var
->lpVtbl
->AsScalar(var2
);
5328 hr
= s_v2
->lpVtbl
->SetFloat(s_v2
, 2.0f
);
5329 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5331 hr
= s_v
->lpVtbl
->GetFloat(s_v
, &f
);
5332 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5333 ok(f
== 1.0f
, "Unexpected value %f.\n", f
);
5335 effect
->lpVtbl
->Release(effect
);
5337 refcount
= ID3D10Device_Release(device
);
5338 ok(!refcount
, "Device has %lu references left.\n", refcount
);
5342 * test_effect_vector_variable
5347 float4 v_f0
, v_f_a
[2];
5348 int3 v_i0
, v_i_a
[3];
5349 bool2 v_b0
, v_b_a
[4];
5352 static DWORD fx_test_vector_variable
[] =
5354 0x43425844, 0x581ae0ae, 0xa906b020, 0x26bba03e,
5355 0x5d7dfba2, 0x00000001, 0x0000021a, 0x00000001,
5356 0x00000024, 0x30315846, 0x000001ee, 0xfeff1001,
5357 0x00000001, 0x00000006, 0x00000000, 0x00000000,
5358 0x00000000, 0x00000000, 0x00000000, 0x000000e2,
5359 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5360 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5361 0x00000000, 0x00000000, 0x00000000, 0x66006263,
5362 0x74616f6c, 0x00070034, 0x00010000, 0x00000000,
5363 0x00100000, 0x00100000, 0x00100000, 0x210a0000,
5364 0x5f760000, 0x07003066, 0x01000000, 0x02000000,
5365 0x20000000, 0x10000000, 0x20000000, 0x0a000000,
5366 0x76000021, 0x615f665f, 0x746e6900, 0x00510033,
5367 0x00010000, 0x00000000, 0x000c0000, 0x00100000,
5368 0x000c0000, 0x19120000, 0x5f760000, 0x51003069,
5369 0x01000000, 0x03000000, 0x2c000000, 0x10000000,
5370 0x24000000, 0x12000000, 0x76000019, 0x615f695f,
5371 0x6f6f6200, 0x9900326c, 0x01000000, 0x00000000,
5372 0x08000000, 0x10000000, 0x08000000, 0x22000000,
5373 0x76000011, 0x0030625f, 0x00000099, 0x00000001,
5374 0x00000004, 0x00000038, 0x00000010, 0x00000020,
5375 0x00001122, 0x5f625f76, 0x00040061, 0x00c00000,
5376 0x00000000, 0x00060000, 0xffff0000, 0x0000ffff,
5377 0x002a0000, 0x000e0000, 0x00000000, 0x00000000,
5378 0x00000000, 0x00000000, 0x00000000, 0x004b0000,
5379 0x002f0000, 0x00000000, 0x00100000, 0x00000000,
5380 0x00000000, 0x00000000, 0x00720000, 0x00560000,
5381 0x00000000, 0x00300000, 0x00000000, 0x00000000,
5382 0x00000000, 0x00930000, 0x00770000, 0x00000000,
5383 0x00400000, 0x00000000, 0x00000000, 0x00000000,
5384 0x00bb0000, 0x009f0000, 0x00000000, 0x00700000,
5385 0x00000000, 0x00000000, 0x00000000, 0x00dc0000,
5386 0x00c00000, 0x00000000, 0x00800000, 0x00000000,
5387 0x00000000, 0x00000000, 0x00000000,
5390 static void test_vector_methods(ID3D10EffectVectorVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5391 const char *name
, unsigned int components
)
5393 float set_f
[4], ret_f
[4], expected_f
, expected_f_v
[4];
5394 int set_i
[4], ret_i
[4], expected_i
, expected_i_v
[4];
5395 BOOL set_b
[4], ret_b
[4], expected_b
;
5399 set_vec4(set_f
, 1.0f
, 2.0f
, 3.0f
, 4.0f
);
5400 hr
= var
->lpVtbl
->SetFloatVector(var
, set_f
);
5401 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5403 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
5404 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5405 for (i
= 0; i
< components
; ++i
)
5407 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
5408 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5411 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
5412 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5413 for (i
= 0; i
< components
; ++i
)
5415 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
5416 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5419 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
5420 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5421 for (i
= 0; i
< components
; ++i
)
5422 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5424 set_int4(set_i
, 5, 6, 7, 8);
5425 hr
= var
->lpVtbl
->SetIntVector(var
, set_i
);
5426 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5428 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
5429 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5430 for (i
= 0; i
< components
; ++i
)
5432 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
5433 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5436 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
5437 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5438 for (i
= 0; i
< components
; ++i
)
5440 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
5441 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5444 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
5445 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5446 for (i
= 0; i
< components
; ++i
)
5447 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5449 set_b
[0] = 1; set_b
[1] = 0; set_b
[2] = 1; set_b
[3] = 0;
5450 hr
= var
->lpVtbl
->SetBoolVector(var
, set_b
);
5451 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5453 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
5454 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5455 expected_f_v
[0] = -1.0f
; expected_f_v
[1] = 0.0f
; expected_f_v
[2] = -1.0f
; expected_f_v
[3] = 0.0f
;
5456 for (i
= 0; i
< components
; ++i
)
5457 ok(ret_f
[i
] == expected_f_v
[i
], "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5459 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
5460 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5461 expected_i_v
[0] = -1; expected_i_v
[1] = 0; expected_i_v
[2] = -1; expected_i_v
[3] = 0;
5462 for (i
= 0; i
< components
; ++i
)
5463 ok(ret_i
[i
] == expected_i_v
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5465 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
5466 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5467 for (i
= 0; i
< components
; ++i
)
5469 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : expected_i_v
[i
];
5470 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5473 set_b
[0] = 5; set_b
[1] = 10; set_b
[2] = 15; set_b
[3] = 20;
5474 hr
= var
->lpVtbl
->SetBoolVector(var
, set_b
);
5475 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5477 hr
= var
->lpVtbl
->GetFloatVector(var
, ret_f
);
5478 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5479 for (i
= 0; i
< components
; ++i
)
5480 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5482 hr
= var
->lpVtbl
->GetIntVector(var
, ret_i
);
5483 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5484 for (i
= 0; i
< components
; ++i
)
5485 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5487 hr
= var
->lpVtbl
->GetBoolVector(var
, ret_b
);
5488 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5489 for (i
= 0; i
< components
; ++i
)
5491 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
5492 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5496 static void test_vector_array_methods(ID3D10EffectVectorVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5497 const char *name
, unsigned int components
, unsigned int elements
)
5499 float set_f
[9], ret_f
[9], expected_f
, expected_f_a
[9];
5500 int set_i
[9], ret_i
[9], expected_i
, expected_i_a
[9];
5501 BOOL set_b
[9], ret_b
[9], expected_b
;
5505 set_f
[0] = 1.0f
; set_f
[1] = 2.0f
; set_f
[2] = 3.0f
; set_f
[3] = 4.0f
;
5506 set_f
[4] = 5.0f
; set_f
[5] = 6.0f
; set_f
[6] = 7.0f
; set_f
[7] = 8.0f
;
5508 hr
= var
->lpVtbl
->SetFloatVectorArray(var
, set_f
, 0, elements
);
5509 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5511 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
5512 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5513 for (i
= 0; i
< components
* elements
; ++i
)
5515 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: set_f
[i
];
5516 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5519 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
5520 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5521 for (i
= 0; i
< components
* elements
; ++i
)
5523 expected_i
= type
== D3D10_SVT_BOOL
? -1 : (int)set_f
[i
];
5524 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5527 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
5528 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5529 for (i
= 0; i
< components
* elements
; ++i
)
5530 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5532 set_i
[0] = 10; set_i
[1] = 11; set_i
[2] = 12; set_i
[3] = 13;
5533 set_i
[4] = 14; set_i
[5] = 15; set_i
[6] = 16; set_i
[7] = 17;
5535 hr
= var
->lpVtbl
->SetIntVectorArray(var
, set_i
, 0, elements
);
5536 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5538 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
5539 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5540 for (i
= 0; i
< components
* elements
; ++i
)
5542 expected_f
= type
== D3D10_SVT_BOOL
? -1.0f
: (float)set_i
[i
];
5543 ok(ret_f
[i
] == expected_f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5546 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
5547 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5548 for (i
= 0; i
< components
* elements
; ++i
)
5550 expected_i
= type
== D3D10_SVT_BOOL
? -1 : set_i
[i
];
5551 ok(ret_i
[i
] == expected_i
, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5554 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
5555 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5556 for (i
= 0; i
< components
* elements
; ++i
)
5557 ok(ret_b
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5559 set_b
[0] = 1; set_b
[1] = 0; set_b
[2] = 1; set_b
[3] = 1;
5560 set_b
[4] = 1; set_b
[5] = 0; set_b
[6] = 0; set_b
[7] = 1;
5562 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
5563 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5565 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
5566 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5567 expected_f_a
[0] = -1.0f
; expected_f_a
[1] = 0.0f
; expected_f_a
[2] = -1.0f
; expected_f_a
[3] = -1.0f
;
5568 expected_f_a
[4] = -1.0f
; expected_f_a
[5] = 0.0f
; expected_f_a
[6] = 0.0f
; expected_f_a
[7] = -1.0f
;
5569 expected_f_a
[8] = -1.0f
;
5570 for (i
= 0; i
< components
* elements
; ++i
)
5571 ok(ret_f
[i
] == expected_f_a
[i
], "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5573 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
5574 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5575 expected_i_a
[0] = -1; expected_i_a
[1] = 0; expected_i_a
[2] = -1; expected_i_a
[3] = -1;
5576 expected_i_a
[4] = -1; expected_i_a
[5] = 0; expected_i_a
[6] = 0; expected_i_a
[7] = -1;
5577 expected_i_a
[8] = -1;
5578 for (i
= 0; i
< components
* elements
; ++i
)
5579 ok(ret_i
[i
] == expected_i_a
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5581 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
5582 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5583 for (i
= 0; i
< components
* elements
; ++i
)
5585 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : expected_i_a
[i
];
5586 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5589 set_b
[0] = 5; set_b
[1] = 10; set_b
[2] = 15; set_b
[3] = 20;
5590 set_b
[4] = 25; set_b
[5] = 30; set_b
[6] = 35; set_b
[7] = 40;
5592 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
5593 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5595 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, elements
);
5596 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5597 for (i
= 0; i
< components
* elements
; ++i
)
5598 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5600 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, elements
);
5601 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5602 for (i
= 0; i
< components
* elements
; ++i
)
5603 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5605 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, elements
);
5606 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5607 for (i
= 0; i
< components
* elements
; ++i
)
5609 expected_b
= type
== D3D10_SVT_BOOL
? set_b
[i
] : -1;
5610 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5613 /* According to MSDN, the offset argument goes unused for VectorArray
5614 * methods, same as the ScalarArray methods. This test shows that's not
5616 set_b
[0] = 0; set_b
[1] = 0; set_b
[2] = 0; set_b
[3] = 0;
5617 set_b
[4] = 0; set_b
[5] = 0; set_b
[6] = 0; set_b
[7] = 0;
5619 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 0, elements
);
5620 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5622 set_b
[0] = 1; set_b
[1] = 1; set_b
[2] = 1; set_b
[3] = 1;
5623 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, 1, 1);
5624 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5626 /* If the previous offset of 1 worked, then the first vector value of the
5627 * array should still be false. */
5628 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 0, 1);
5629 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5630 for (i
= 0; i
< components
; ++i
)
5631 ok(ret_f
[i
] == 0, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5633 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 0, 1);
5634 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5635 for (i
= 0; i
< components
; ++i
)
5636 ok(ret_i
[i
] == 0, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5638 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 0, 1);
5639 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5640 for (i
= 0; i
< components
; ++i
)
5641 ok(!ret_b
[i
], "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5643 /* Test the GetFloatVectorArray offset argument. If it works, we should
5644 * get a vector with all values set to true. */
5645 hr
= var
->lpVtbl
->GetFloatVectorArray(var
, ret_f
, 1, 1);
5646 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5647 for (i
= 0; i
< components
; ++i
)
5648 ok(ret_f
[i
] == -1.0f
, "Variable %s, got unexpected value %.8e.\n", name
, ret_f
[i
]);
5650 hr
= var
->lpVtbl
->GetIntVectorArray(var
, ret_i
, 1, 1);
5651 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5652 for (i
= 0; i
< components
; ++i
)
5653 ok(ret_i
[i
] == -1, "Variable %s, got unexpected value %#x.\n", name
, ret_i
[i
]);
5655 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, 1, 1);
5656 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5657 for (i
= 0; i
< components
; ++i
)
5659 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
5660 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5665 /* Windows array setting function has no bounds checking on offset values
5666 * either, so this ends up writing into adjacent variables. */
5667 hr
= var
->lpVtbl
->SetBoolVectorArray(var
, set_b
, elements
+ 1, 1);
5668 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5670 hr
= var
->lpVtbl
->GetBoolVectorArray(var
, ret_b
, elements
+ 1, 1);
5671 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5672 for (i
= 0; i
< components
; ++i
)
5674 expected_b
= type
== D3D10_SVT_BOOL
? 1 : -1;
5675 ok(ret_b
[i
] == expected_b
, "Variable %s, got unexpected value %#x.\n", name
, ret_b
[i
]);
5680 static void test_effect_vector_variable(void)
5685 D3D_SHADER_VARIABLE_TYPE type
;
5686 unsigned int components
;
5687 unsigned int elements
;
5691 {"v_f0", D3D10_SVT_FLOAT
, 4, 1},
5692 {"v_i0", D3D10_SVT_INT
, 3, 1},
5693 {"v_b0", D3D10_SVT_BOOL
, 2, 1},
5694 {"v_f_a", D3D10_SVT_FLOAT
, 4, 2},
5695 {"v_i_a", D3D10_SVT_INT
, 3, 3},
5696 {"v_b_a", D3D10_SVT_BOOL
, 2, 4},
5698 ID3D10EffectVectorVariable
*v_var
;
5699 D3D10_EFFECT_TYPE_DESC type_desc
;
5700 D3D10_EFFECT_DESC effect_desc
;
5701 ID3D10EffectVariable
*var
;
5702 ID3D10EffectType
*type
;
5703 ID3D10Device
*device
;
5704 ID3D10Effect
*effect
;
5709 if (!(device
= create_device()))
5711 skip("Failed to create device.\n");
5715 hr
= create_effect(fx_test_vector_variable
, 0, device
, NULL
, &effect
);
5716 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5718 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
5719 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
5720 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
5721 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
5722 effect_desc
.ConstantBuffers
);
5723 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
5724 effect_desc
.SharedConstantBuffers
);
5725 ok(effect_desc
.GlobalVariables
== 6, "Unexpected global variables count %u.\n",
5726 effect_desc
.GlobalVariables
);
5727 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
5728 effect_desc
.SharedGlobalVariables
);
5729 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
5731 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
5733 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
5734 type
= var
->lpVtbl
->GetType(var
);
5735 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
5736 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", tests
[i
].name
, hr
);
5737 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
5738 tests
[i
].name
, type_desc
.Type
);
5739 v_var
= var
->lpVtbl
->AsVector(var
);
5740 test_vector_methods(v_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].components
);
5741 if (tests
[i
].elements
> 1)
5742 test_vector_array_methods(v_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].components
, tests
[i
].elements
);
5745 effect
->lpVtbl
->Release(effect
);
5747 refcount
= ID3D10Device_Release(device
);
5748 ok(!refcount
, "Device has %lu references left.\n", refcount
);
5752 * test_effect_matrix_variable
5760 row_major int2x3 m_i0
;
5767 static DWORD fx_test_matrix_variable
[] =
5769 0x43425844, 0xc95a5c42, 0xa138d3cb, 0x8a4ef493,
5770 0x3515b7ee, 0x00000001, 0x000001e2, 0x00000001,
5771 0x00000024, 0x30315846, 0x000001b6, 0xfeff1001,
5772 0x00000001, 0x00000005, 0x00000000, 0x00000000,
5773 0x00000000, 0x00000000, 0x00000000, 0x000000c6,
5774 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5775 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5776 0x00000000, 0x00000000, 0x00000000, 0x66006263,
5777 0x74616f6c, 0x00347834, 0x00000007, 0x00000001,
5778 0x00000000, 0x00000040, 0x00000040, 0x00000040,
5779 0x0000640b, 0x30665f6d, 0x00000700, 0x00000100,
5780 0x00000200, 0x00008000, 0x00004000, 0x00008000,
5781 0x00640b00, 0x665f6d00, 0x6900615f, 0x7832746e,
5782 0x00530033, 0x00010000, 0x00000000, 0x001c0000,
5783 0x00200000, 0x00180000, 0x1a130000, 0x5f6d0000,
5784 0x62003069, 0x336c6f6f, 0x7b003278, 0x01000000,
5785 0x00000000, 0x1c000000, 0x20000000, 0x18000000,
5786 0x23000000, 0x6d000053, 0x0030625f, 0x0000007b,
5787 0x00000001, 0x00000002, 0x0000003c, 0x00000020,
5788 0x00000030, 0x00005323, 0x5f625f6d, 0x00040061,
5789 0x01400000, 0x00000000, 0x00050000, 0xffff0000,
5790 0x0000ffff, 0x002c0000, 0x00100000, 0x00000000,
5791 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5792 0x004d0000, 0x00310000, 0x00000000, 0x00400000,
5793 0x00000000, 0x00000000, 0x00000000, 0x00760000,
5794 0x005a0000, 0x00000000, 0x00c00000, 0x00000000,
5795 0x00000000, 0x00000000, 0x009f0000, 0x00830000,
5796 0x00000000, 0x00e00000, 0x00000000, 0x00000000,
5797 0x00000000, 0x00c00000, 0x00a40000, 0x00000000,
5798 0x01000000, 0x00000000, 0x00000000, 0x00000000,
5807 static void set_test_matrix(struct d3d10_matrix
*m
, D3D10_SHADER_VARIABLE_TYPE type
,
5808 unsigned int row_count
, unsigned int col_count
, unsigned int elements
)
5810 unsigned int row
, col
, elem
;
5815 memset(m
, 0, elements
* sizeof(*m
));
5818 case D3D10_SVT_FLOAT
:
5820 for (elem
= 0; elem
< elements
; ++elem
)
5822 for (row
= 0; row
< row_count
; ++row
)
5824 for (col
= 0; col
< col_count
; ++col
)
5826 m
[elem
].m
[row
][col
] = tmp_f
;
5835 for (elem
= 0; elem
< elements
; ++elem
)
5837 for (row
= 0; row
< row_count
; ++row
)
5839 for (col
= 0; col
< col_count
; ++col
)
5841 m
[elem
].m
[row
][col
] = *(float *)&tmp_i
;
5848 case D3D10_SVT_BOOL
:
5850 for (elem
= 0; elem
< elements
; ++elem
)
5853 for (row
= 0; row
< row_count
; ++row
)
5855 for (col
= 0; col
< col_count
; ++col
)
5857 m
[elem
].m
[row
][col
] = *(float *)&tmp_b
;
5869 static void transpose_matrix(struct d3d10_matrix
*src
, struct d3d10_matrix
*dst
,
5870 unsigned int row_count
, unsigned int col_count
)
5872 unsigned int row
, col
;
5874 for (row
= 0; row
< col_count
; ++row
)
5876 for (col
= 0; col
< row_count
; ++col
)
5877 dst
->m
[row
][col
] = src
->m
[col
][row
];
5881 static void compare_matrix(const char *name
, unsigned int line
, struct d3d10_matrix
*a
,
5882 struct d3d10_matrix
*b
, unsigned int row_count
, unsigned int col_count
, BOOL transpose
)
5884 unsigned int row
, col
;
5887 for (row
= 0; row
< row_count
; ++row
)
5889 for (col
= 0; col
< col_count
; ++col
)
5891 tmp
= !transpose
? b
->m
[row
][col
] : b
->m
[col
][row
];
5892 ok_(__FILE__
, line
)(a
->m
[row
][col
] == tmp
,
5893 "Variable %s (%u, %u), got unexpected value 0x%08x.\n", name
, row
, col
,
5894 *(unsigned int *)&tmp
);
5899 static void test_matrix_methods(ID3D10EffectMatrixVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5900 const char *name
, unsigned int row_count
, unsigned int col_count
)
5902 struct d3d10_matrix m_set
, m_ret
, m_expected
;
5905 set_test_matrix(&m_set
, type
, row_count
, col_count
, 1);
5907 hr
= var
->lpVtbl
->SetMatrix(var
, &m_set
.m
[0][0]);
5908 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5910 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5911 hr
= var
->lpVtbl
->GetMatrix(var
, &m_ret
.m
[0][0]);
5912 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5913 compare_matrix(name
, __LINE__
, &m_set
, &m_ret
, row_count
, col_count
, FALSE
);
5915 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5916 hr
= var
->lpVtbl
->GetMatrixTranspose(var
, &m_ret
.m
[0][0]);
5917 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5918 compare_matrix(name
, __LINE__
, &m_set
, &m_ret
, row_count
, col_count
, TRUE
);
5920 hr
= var
->lpVtbl
->SetMatrixTranspose(var
, &m_set
.m
[0][0]);
5921 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5923 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5924 hr
= var
->lpVtbl
->GetMatrix(var
, &m_ret
.m
[0][0]);
5925 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5926 compare_matrix(name
, __LINE__
, &m_ret
, &m_set
, row_count
, col_count
, TRUE
);
5928 memset(&m_ret
.m
[0][0], 0, sizeof(m_ret
));
5929 memset(&m_expected
.m
[0][0], 0, sizeof(m_expected
));
5930 hr
= var
->lpVtbl
->GetMatrixTranspose(var
, &m_ret
.m
[0][0]);
5931 transpose_matrix(&m_set
, &m_expected
, row_count
, col_count
);
5932 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5933 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
, row_count
, col_count
, TRUE
);
5936 static void test_matrix_array_methods(ID3D10EffectMatrixVariable
*var
, D3D10_SHADER_VARIABLE_TYPE type
,
5937 const char *name
, unsigned int row_count
, unsigned int col_count
, unsigned int elements
)
5939 struct d3d10_matrix m_set
[2], m_ret
[2], m_expected
;
5943 set_test_matrix(&m_set
[0], type
, row_count
, col_count
, elements
);
5945 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], 0, elements
);
5946 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5948 memset(m_ret
, 0, sizeof(m_ret
));
5949 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5950 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5951 for (i
= 0; i
< elements
; ++i
)
5952 compare_matrix(name
, __LINE__
, &m_set
[i
], &m_ret
[i
], row_count
, col_count
, FALSE
);
5954 memset(m_ret
, 0, sizeof(m_ret
));
5955 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5956 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5957 for (i
= 0; i
< elements
; ++i
)
5958 compare_matrix(name
, __LINE__
, &m_set
[i
], &m_ret
[i
], row_count
, col_count
, TRUE
);
5960 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], 0, elements
);
5961 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5963 memset(m_ret
, 0, sizeof(m_ret
));
5964 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5965 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5966 for (i
= 0; i
< elements
; ++i
)
5967 compare_matrix(name
, __LINE__
, &m_ret
[i
], &m_set
[i
], row_count
, col_count
, TRUE
);
5969 memset(m_ret
, 0, sizeof(m_ret
));
5970 memset(&m_expected
, 0, sizeof(m_expected
));
5971 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5972 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5973 for (i
= 0; i
< elements
; ++i
)
5975 memset(&m_expected
, 0, sizeof(m_expected
));
5976 transpose_matrix(&m_set
[i
], &m_expected
, row_count
, col_count
);
5977 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[i
], row_count
, col_count
, TRUE
);
5981 memset(m_ret
, 0, sizeof(m_ret
));
5982 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5984 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], 1, 1);
5985 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5987 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], 1, 1);
5988 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5989 compare_matrix(name
, __LINE__
, &m_ret
[0], &m_set
[0], row_count
, col_count
, FALSE
);
5991 memset(m_ret
, 0, sizeof(m_ret
));
5992 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_ret
[0].m
[0][0], 0, elements
);
5994 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], 1, 1);
5995 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
5997 memset(&m_expected
, 0, sizeof(m_expected
));
5998 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], 1, 1);
5999 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
6000 transpose_matrix(&m_set
[0], &m_expected
, row_count
, col_count
);
6001 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
6005 /* Like vector array functions, matrix array functions will allow for
6006 * writing out of bounds into adjacent memory. */
6007 hr
= var
->lpVtbl
->SetMatrixArray(var
, &m_set
[0].m
[0][0], elements
+ 1, 1);
6008 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
6010 memset(m_ret
, 0, sizeof(m_ret
));
6011 hr
= var
->lpVtbl
->GetMatrixArray(var
, &m_ret
[0].m
[0][0], elements
+ 1, 1);
6012 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
6013 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
6015 hr
= var
->lpVtbl
->SetMatrixTransposeArray(var
, &m_set
[0].m
[0][0], elements
+ 1, 1);
6016 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
6018 memset(&m_expected
, 0, sizeof(m_expected
));
6019 hr
= var
->lpVtbl
->GetMatrixTransposeArray(var
, &m_ret
[0].m
[0][0], elements
+ 1, 1);
6020 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", name
, hr
);
6021 transpose_matrix(&m_set
[0], &m_expected
, row_count
, col_count
);
6022 compare_matrix(name
, __LINE__
, &m_expected
, &m_ret
[0], row_count
, col_count
, TRUE
);
6026 static void test_effect_matrix_variable(void)
6031 D3D_SHADER_VARIABLE_TYPE type
;
6033 unsigned int columns
;
6034 unsigned int elements
;
6038 {"m_f0", D3D10_SVT_FLOAT
, 4, 4, 1},
6039 {"m_i0", D3D10_SVT_INT
, 2, 3, 1},
6040 {"m_b0", D3D10_SVT_BOOL
, 3, 2, 1},
6041 {"m_f_a", D3D10_SVT_FLOAT
, 4, 4, 2},
6042 {"m_b_a", D3D10_SVT_BOOL
, 3, 2, 2},
6044 ID3D10EffectMatrixVariable
*m_var
;
6045 D3D10_EFFECT_TYPE_DESC type_desc
;
6046 D3D10_EFFECT_DESC effect_desc
;
6047 ID3D10EffectVariable
*var
;
6048 ID3D10EffectType
*type
;
6049 ID3D10Device
*device
;
6050 ID3D10Effect
*effect
;
6055 if (!(device
= create_device()))
6057 skip("Failed to create device, skipping tests.\n");
6061 hr
= create_effect(fx_test_matrix_variable
, 0, device
, NULL
, &effect
);
6062 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6064 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
6065 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6066 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
6067 ok(effect_desc
.ConstantBuffers
== 1, "Unexpected constant buffers count %u.\n",
6068 effect_desc
.ConstantBuffers
);
6069 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
6070 effect_desc
.SharedConstantBuffers
);
6071 ok(effect_desc
.GlobalVariables
== 5, "Unexpected global variables count %u.\n",
6072 effect_desc
.GlobalVariables
);
6073 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
6074 effect_desc
.SharedGlobalVariables
);
6075 ok(effect_desc
.Techniques
== 0, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
6077 for (i
= 0; i
< ARRAY_SIZE(tests
); ++i
)
6079 var
= effect
->lpVtbl
->GetVariableByName(effect
, tests
[i
].name
);
6080 type
= var
->lpVtbl
->GetType(var
);
6081 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
6082 ok(hr
== S_OK
, "Variable %s, got unexpected hr %#lx.\n", tests
[i
].name
, hr
);
6083 ok(type_desc
.Type
== tests
[i
].type
, "Variable %s, got unexpected type %#x.\n",
6084 tests
[i
].name
, type_desc
.Type
);
6085 m_var
= var
->lpVtbl
->AsMatrix(var
);
6086 test_matrix_methods(m_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].rows
, tests
[i
].columns
);
6087 if (tests
[i
].elements
> 1)
6088 test_matrix_array_methods(m_var
, tests
[i
].type
, tests
[i
].name
, tests
[i
].rows
, tests
[i
].columns
,
6092 effect
->lpVtbl
->Release(effect
);
6094 refcount
= ID3D10Device_Release(device
);
6095 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6099 * test_effect_resource_variable
6105 float4
VS( float4 Pos
: POSITION
) : SV_POSITION
{ return float4(1.0f
, 1.0f
, 1.0f
, 1.0f
); }
6107 float4
PS( float4 Pos
: SV_POSITION
) : SV_Target
6111 tmp
= t0
.Load(int3(0, 0, 0));
6112 tmp
= t_a
[0].Load(int4(0, 0, 0, 0));
6113 tmp
= t_a
[1].Load(int4(0, 0, 0, 0));
6114 return float4(1.0f
, 1.0f
, 0.0f
, 1.0f
) + tmp
;
6117 technique10 rsrc_test
6121 SetVertexShader(CompileShader(vs_4_0
, VS()));
6122 SetPixelShader(CompileShader(ps_4_0
, PS()));
6126 static DWORD fx_test_resource_variable
[] =
6128 0x43425844, 0x767a8421, 0xdcbfffe6, 0x83df123d, 0x189ce72a, 0x00000001, 0x0000065a, 0x00000001,
6129 0x00000024, 0x30315846, 0x0000062e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000,
6130 0x00000000, 0x00000000, 0x00000001, 0x00000582, 0x00000000, 0x00000003, 0x00000000, 0x00000000,
6131 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x74786554,
6132 0x32657275, 0x00040044, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000,
6133 0x30740000, 0x00000400, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000c00,
6134 0x615f7400, 0x72737200, 0x65745f63, 0x70007473, 0x01b40030, 0x58440000, 0x338d4342, 0xc5a69f46,
6135 0x56883ae5, 0xa98fccc2, 0x00018ead, 0x01b40000, 0x00050000, 0x00340000, 0x008c0000, 0x00c00000,
6136 0x00f40000, 0x01380000, 0x44520000, 0x00504645, 0x00000000, 0x00000000, 0x00000000, 0x001c0000,
6137 0x04000000, 0x0100fffe, 0x001c0000, 0x694d0000, 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48,
6138 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x322e3920, 0x35392e39, 0x31332e32, 0xab003131,
6139 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000,
6140 0x00000000, 0x000f0000, 0x4f500000, 0x49544953, 0xab004e4f, 0x534fabab, 0x002c4e47, 0x00010000,
6141 0x00080000, 0x00200000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
6142 0x534f505f, 0x4f495449, 0x4853004e, 0x003c5244, 0x00400000, 0x000f0001, 0x00670000, 0x20f20400,
6143 0x00000010, 0x00010000, 0x00360000, 0x20f20800, 0x00000010, 0x40020000, 0x00000000, 0x00003f80,
6144 0x00003f80, 0x00003f80, 0x003e3f80, 0x54530100, 0x00745441, 0x00020000, 0x00000000, 0x00000000,
6145 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
6146 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6147 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6148 0x00000000, 0x00000000, 0x005a0000, 0x00000000, 0x035c0000, 0x58440000, 0xe3754342, 0x3e477f40,
6149 0xed6f143f, 0xf16d26ce, 0x00010c3a, 0x035c0000, 0x00050000, 0x00340000, 0x00d00000, 0x01040000,
6150 0x01380000, 0x02e00000, 0x44520000, 0x00944645, 0x00000000, 0x00000000, 0x00020000, 0x001c0000,
6151 0x04000000, 0x0100ffff, 0x00630000, 0x005c0000, 0x00020000, 0x00050000, 0x00040000, 0xffff0000,
6152 0x0000ffff, 0x00010000, 0x000c0000, 0x005f0000, 0x00020000, 0x00050000, 0x00040000, 0xffff0000,
6153 0x0001ffff, 0x00020000, 0x000c0000, 0x30740000, 0x615f7400, 0x63694d00, 0x6f736f72, 0x28207466,
6154 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c, 0x39322e39, 0x3235392e,
6155 0x3131332e, 0x53490031, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00010000,
6156 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, 0x002c4e47,
6157 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000,
6158 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x01a05244, 0x00400000, 0x00680000, 0x18580000,
6159 0x70000400, 0x00000010, 0x55550000, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x18580000,
6160 0x70000400, 0x00020010, 0x55550000, 0x00650000, 0x20f20300, 0x00000010, 0x00680000, 0x00020200,
6161 0x002d0000, 0x00f20a00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6162 0x7e460000, 0x00000010, 0x001c0000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x00560000,
6163 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x002d0000, 0x00f20a00, 0x00010010, 0x40020000,
6164 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x00000000, 0x00f20700,
6165 0x00000010, 0x0e460000, 0x00000010, 0x0e460000, 0x00010010, 0x001c0000, 0x00f20500, 0x00000010,
6166 0x0e460000, 0x00000010, 0x00560000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x002d0000,
6167 0x00f20a00, 0x00010010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7e460000,
6168 0x00020010, 0x00000000, 0x00f20700, 0x00000010, 0x0e460000, 0x00000010, 0x0e460000, 0x00010010,
6169 0x001c0000, 0x00f20500, 0x00000010, 0x0e460000, 0x00000010, 0x00560000, 0x00f20500, 0x00000010,
6170 0x0e460000, 0x00000010, 0x00000000, 0x20f20a00, 0x00000010, 0x0e460000, 0x00000010, 0x40020000,
6171 0x00000000, 0x00003f80, 0x00003f80, 0x00000000, 0x003e3f80, 0x54530100, 0x00745441, 0x000d0000,
6172 0x00020000, 0x00000000, 0x00010000, 0x00030000, 0x00000000, 0x00000000, 0x00010000, 0x00000000,
6173 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6174 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00060000, 0x00000000, 0x00000000, 0x00000000,
6175 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x021a0000, 0x00000000, 0x002a0000, 0x000e0000,
6176 0x00000000, 0xffff0000, 0x0000ffff, 0x00490000, 0x002d0000, 0x00000000, 0xffff0000, 0x0000ffff,
6177 0x004d0000, 0x00010000, 0x00000000, 0x00570000, 0x00020000, 0x00000000, 0x00060000, 0x00000000,
6178 0x00070000, 0x02120000, 0x00070000, 0x00000000, 0x00070000, 0x057a0000, 0x00000000,
6184 SamplerState s
[2] : register(s1
);
6186 float4
PS( float4 pos
: SV_POSITION
) : SV_Target
6188 return t_a
[1].Sample(s
[1], float2(0, 0));
6191 PixelShader ps
[1] = { CompileShader(ps_4_0
, PS()) };
6193 technique10 rsrc_test
6197 SetPixelShader(ps
[0]);
6201 static DWORD fx_test_resource_variable2
[] =
6203 0x43425844, 0xecd43fcd, 0x0654927c, 0x71931f03, 0xf166cc09, 0x00000001, 0x0000039d, 0x00000001,
6204 0x00000024, 0x30315846, 0x00000371, 0xfeff1001, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
6205 0x00000000, 0x00000000, 0x00000001, 0x000002b5, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6206 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x74786554,
6207 0x32657275, 0x00040044, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000,
6208 0x5f740000, 0x61530061, 0x656c706d, 0x61745372, 0x2e006574, 0x02000000, 0x02000000, 0x00000000,
6209 0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x78695000, 0x68536c65, 0x72656461, 0x00005900,
6210 0x00000200, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000500, 0x00737000, 0x00000218,
6211 0x43425844, 0x9e83b242, 0xfc183c88, 0x2920b8b8, 0x877a749f, 0x00000001, 0x00000218, 0x00000005,
6212 0x00000034, 0x000000c8, 0x000000fc, 0x00000130, 0x0000019c, 0x46454452, 0x0000008c, 0x00000000,
6213 0x00000000, 0x00000002, 0x0000001c, 0xffff0400, 0x00000100, 0x00000062, 0x0000005c, 0x00000003,
6214 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000001, 0x0000005e, 0x00000002,
6215 0x00000005, 0x00000004, 0xffffffff, 0x00000000, 0x00000002, 0x0000000c, 0x5f740073, 0x694d0061,
6216 0x736f7263, 0x2074666f, 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69,
6217 0x2e303120, 0xabab0031, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000,
6218 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f,
6219 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
6220 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000064, 0x00000040, 0x00000019,
6221 0x0300005a, 0x00106000, 0x00000002, 0x04001858, 0x00107000, 0x00000001, 0x00005555, 0x03000065,
6222 0x001020f2, 0x00000000, 0x0c000045, 0x001020f2, 0x00000000, 0x00004002, 0x00000000, 0x00000000,
6223 0x00000000, 0x00000000, 0x00107e46, 0x00000001, 0x00106000, 0x00000002, 0x0100003e, 0x54415453,
6224 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
6225 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
6226 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6227 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x63727372, 0x7365745f,
6228 0x30700074, 0x00008100, 0x00000000, 0x00002a00, 0x00000e00, 0x00000000, 0xffffff00, 0x000000ff,
6229 0x00005700, 0x00003b00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00000000, 0x00008100,
6230 0x00006500, 0x00000000, 0xffffff00, 0x000084ff, 0x00000000, 0x0002a000, 0x00000100, 0x00000000,
6231 0x0002aa00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000300, 0x0002ad00, 0x00000000,
6234 #define get_effect_shader_resource_variable(a) get_effect_shader_resource_variable_(__LINE__, a)
6235 static ID3D10EffectShaderResourceVariable
*get_effect_shader_resource_variable_(unsigned int line
,
6236 ID3D10EffectVariable
*var
)
6238 D3D10_EFFECT_TYPE_DESC type_desc
;
6239 ID3D10EffectType
*type
;
6242 type
= var
->lpVtbl
->GetType(var
);
6243 ok_(__FILE__
, line
)(!!type
, "Got unexpected type %p.\n", type
);
6244 hr
= type
->lpVtbl
->GetDesc(type
, &type_desc
);
6245 ok_(__FILE__
, line
)(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6246 ok_(__FILE__
, line
)(type_desc
.Type
== D3D10_SVT_TEXTURE2D
, "Type is %x, expected %x.\n",
6247 type_desc
.Type
, D3D10_SVT_TEXTURE2D
);
6248 return var
->lpVtbl
->AsShaderResource(var
);
6251 static void test_effect_resource_variable(void)
6253 ID3D10SamplerState
*samplers
[D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
];
6254 ID3D10ShaderResourceView
*srv0
, *srv_a
[2], *srv_tmp
[2];
6255 ID3D10EffectShaderResourceVariable
*t0
, *t_a
, *t_a_0
;
6256 ID3D10EffectTechnique
*technique
;
6257 ID3D10Texture2D
*tex0
, *tex_a
[2];
6258 ID3D10EffectSamplerVariable
*s
;
6259 ID3D10SamplerState
*sampler
[2];
6260 D3D10_EFFECT_DESC effect_desc
;
6261 D3D10_PASS_DESC pass_desc
;
6262 ID3D10EffectVariable
*var
;
6263 ID3D10EffectPass
*pass
;
6264 ID3D10Device
*device
;
6265 ID3D10Effect
*effect
;
6270 if (!(device
= create_device()))
6272 skip("Failed to create device.\n");
6276 hr
= create_effect(fx_test_resource_variable
, 0, device
, NULL
, &effect
);
6277 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6279 hr
= effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
6280 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6281 ok(!effect_desc
.IsChildEffect
, "Unexpected IsChildEffect.\n");
6282 ok(effect_desc
.ConstantBuffers
== 0, "Unexpected constant buffers count %u.\n",
6283 effect_desc
.ConstantBuffers
);
6284 ok(effect_desc
.SharedConstantBuffers
== 0, "Unexpected shared constant buffers count %u.\n",
6285 effect_desc
.SharedConstantBuffers
);
6286 ok(effect_desc
.GlobalVariables
== 2, "Unexpected global variables count %u.\n",
6287 effect_desc
.GlobalVariables
);
6288 ok(effect_desc
.SharedGlobalVariables
== 0, "Unexpected shared global variables count %u.\n",
6289 effect_desc
.SharedGlobalVariables
);
6290 ok(effect_desc
.Techniques
== 1, "Unexpected techniques count %u.\n", effect_desc
.Techniques
);
6292 create_effect_texture_resource(device
, &srv0
, &tex0
);
6294 /* SetResource() on null resource variable. */
6295 var
= effect
->lpVtbl
->GetVariableByName(effect
, "dummy name");
6296 t0
= var
->lpVtbl
->AsShaderResource(var
);
6297 hr
= t0
->lpVtbl
->SetResource(t0
, srv0
);
6298 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
6300 var
= effect
->lpVtbl
->GetVariableByName(effect
, "t0");
6301 t0
= get_effect_shader_resource_variable(var
);
6302 hr
= t0
->lpVtbl
->SetResource(t0
, srv0
);
6303 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6305 var
= effect
->lpVtbl
->GetVariableByName(effect
, "t_a");
6306 t_a
= get_effect_shader_resource_variable(var
);
6307 for (i
= 0; i
< 2; ++i
)
6308 create_effect_texture_resource(device
, &srv_a
[i
], &tex_a
[i
]);
6309 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 0, 2);
6310 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6312 /* Apply the pass to bind the resource to the shader. */
6313 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "rsrc_test");
6314 ok(technique
->lpVtbl
->IsValid(technique
), "Expected valid technique.\n");
6315 pass
= technique
->lpVtbl
->GetPassByName(technique
, "p0");
6316 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
6317 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
6318 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6319 ok(!!pass_desc
.pIAInputSignature
, "Unexpected input signature.\n");
6320 ok(pass_desc
.IAInputSignatureSize
== 88, "Got unexpected input signature size %Iu.\n",
6321 pass_desc
.IAInputSignatureSize
);
6323 hr
= pass
->lpVtbl
->Apply(pass
, 0);
6324 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6326 ID3D10Device_PSGetShaderResources(device
, 0, 1, &srv_tmp
[0]);
6327 ok(srv_tmp
[0] == srv0
, "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
6328 ID3D10ShaderResourceView_Release(srv_tmp
[0]);
6330 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
6331 for (i
= 0; i
< 2; ++i
)
6333 ok(srv_tmp
[i
] == srv_a
[i
], "Got unexpected shader resource view %p.\n", srv_tmp
[i
]);
6334 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
6337 /* Test individual array element variable SetResource. */
6338 var
= t_a
->lpVtbl
->GetElement(t_a
, 1);
6339 t_a_0
= get_effect_shader_resource_variable(var
);
6340 hr
= t_a_0
->lpVtbl
->SetResource(t_a_0
, srv0
);
6341 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6343 hr
= pass
->lpVtbl
->Apply(pass
, 0);
6344 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6346 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
6347 ok(srv_tmp
[0] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
6348 ok(srv_tmp
[1] == srv0
, "Got unexpected shader resource view %p.\n", srv_tmp
[1]);
6349 for (i
= 0; i
< 2; ++i
)
6350 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
6353 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 1, 1);
6354 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6356 hr
= pass
->lpVtbl
->Apply(pass
, 0);
6357 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6359 ID3D10Device_PSGetShaderResources(device
, 1, 2, srv_tmp
);
6360 ok(srv_tmp
[0] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[0]);
6361 ok(srv_tmp
[1] == srv_a
[0], "Got unexpected shader resource view %p.\n", srv_tmp
[1]);
6362 for (i
= 0; i
< 2; ++i
)
6363 ID3D10ShaderResourceView_Release(srv_tmp
[i
]);
6367 /* This crashes on Windows. */
6368 hr
= t_a
->lpVtbl
->SetResourceArray(t_a
, srv_a
, 2, 2);
6369 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6372 ID3D10ShaderResourceView_Release(srv0
);
6373 ID3D10Texture2D_Release(tex0
);
6374 for (i
= 0; i
< 2; ++i
)
6376 ID3D10ShaderResourceView_Release(srv_a
[i
]);
6377 ID3D10Texture2D_Release(tex_a
[i
]);
6380 effect
->lpVtbl
->Release(effect
);
6382 hr
= create_effect(fx_test_resource_variable2
, 0, device
, NULL
, &effect
);
6383 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6385 technique
= effect
->lpVtbl
->GetTechniqueByName(effect
, "rsrc_test");
6386 ok(technique
->lpVtbl
->IsValid(technique
), "Expected valid technique.\n");
6387 pass
= technique
->lpVtbl
->GetPassByName(technique
, "p0");
6388 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
6390 var
= effect
->lpVtbl
->GetVariableByName(effect
, "s");
6391 ok(var
->lpVtbl
->IsValid(var
), "Expected valid variable.\n");
6393 s
= var
->lpVtbl
->AsSampler(var
);
6394 ok(s
->lpVtbl
->IsValid(s
), "Expected valid sample variable.\n");
6396 hr
= s
->lpVtbl
->GetSampler(s
, 0, &sampler
[0]);
6397 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6398 hr
= s
->lpVtbl
->GetSampler(s
, 1, &sampler
[1]);
6399 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6401 hr
= pass
->lpVtbl
->Apply(pass
, 0);
6402 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6404 ID3D10Device_PSGetSamplers(device
, 0, ARRAY_SIZE(samplers
), samplers
);
6405 for (i
= 0; i
< ARRAY_SIZE(samplers
); ++i
)
6407 if (i
== 1 || i
== 2)
6409 ok(samplers
[i
] == sampler
[i
- 1], "Unexpected sampler at %u.\n", i
);
6412 ok(!samplers
[i
], "Unexpected sampler at %u.\n", i
);
6414 ID3D10SamplerState_Release(samplers
[i
]);
6416 for (i
= 0; i
< ARRAY_SIZE(sampler
); ++i
)
6417 ID3D10SamplerState_Release(sampler
[i
]);
6419 effect
->lpVtbl
->Release(effect
);
6421 refcount
= ID3D10Device_Release(device
);
6422 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6426 cbuffer cb
<string s
= "cb_a"; >
6428 float f1
: COLOR0
<string s
= "f1_a"; >;
6431 BlendState blendstate
<string s
= "bs_a"; >;
6432 Texture2D tex
<string s
= "tex_a"; >;
6433 PixelShader ps
<string s
= "ps_a"; >;
6434 VertexShader vs
<string s
= "vs_a"; >;
6435 GeometryShader gs
<string s
= "gs_a"; >;
6436 DepthStencilState ds
<string s
= "ds_a"; >;
6437 RasterizerState rs
<string s
= "rs_a"; >;
6438 SamplerState s
<string s
= "s_a"; >;
6439 RenderTargetView rtv
<string s
= "rtv_a"; >;
6440 DepthStencilView dsv
<string s
= "dsv_a"; >;
6442 technique10 tech
<string s
= "tech_a"; >
6444 pass P0
<string s
= "P0_a"; >
6449 static DWORD fx_test_annotations
[] =
6451 0x43425844, 0x2b3e08d4, 0xe3eda7bb, 0x36982de8, 0x0dcab1aa, 0x00000001, 0x000004c6, 0x00000001,
6452 0x00000024, 0x30315846, 0x0000049a, 0xfeff1001, 0x00000001, 0x00000001, 0x0000000a, 0x00000000,
6453 0x00000000, 0x00000000, 0x00000001, 0x00000276, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
6454 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x00000000, 0x53006263,
6455 0x6e697274, 0x00070067, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000,
6456 0x00730000, 0x615f6263, 0x6f6c6600, 0x31007461, 0x01000000, 0x00000000, 0x04000000, 0x10000000,
6457 0x04000000, 0x09000000, 0x66000009, 0x4f430031, 0x30524f4c, 0x5f316600, 0x6c420061, 0x53646e65,
6458 0x65746174, 0x00006200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
6459 0x656c6200, 0x7473646e, 0x00657461, 0x615f7362, 0x78655400, 0x65727574, 0x99004432, 0x02000000,
6460 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0c000000, 0x74000000, 0x74007865, 0x615f7865,
6461 0x78695000, 0x68536c65, 0x72656461, 0x0000c900, 0x00000200, 0x00000000, 0x00000000, 0x00000000,
6462 0x00000000, 0x00000500, 0x00737000, 0x615f7370, 0x72655600, 0x53786574, 0x65646168, 0x00f90072,
6463 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00060000, 0x73760000, 0x5f737600,
6464 0x65470061, 0x74656d6f, 0x68537972, 0x72656461, 0x00012a00, 0x00000200, 0x00000000, 0x00000000,
6465 0x00000000, 0x00000000, 0x00000700, 0x00736700, 0x615f7367, 0x70654400, 0x74536874, 0x69636e65,
6466 0x6174536c, 0x5d006574, 0x02000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000,
6467 0x64000000, 0x73640073, 0x5200615f, 0x65747361, 0x657a6972, 0x61745372, 0x93006574, 0x02000001,
6468 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x04000000, 0x72000000, 0x73720073, 0x5300615f,
6469 0x6c706d61, 0x74537265, 0x00657461, 0x000001c7, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
6470 0x00000000, 0x00000015, 0x00615f73, 0x646e6552, 0x61547265, 0x74656772, 0x77656956, 0x0001f400,
6471 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001300, 0x76747200, 0x76747200,
6472 0x4400615f, 0x68747065, 0x6e657453, 0x566c6963, 0x00776569, 0x0000022b, 0x00000002, 0x00000000,
6473 0x00000000, 0x00000000, 0x00000000, 0x00000014, 0x00767364, 0x5f767364, 0x65740061, 0x74006863,
6474 0x5f686365, 0x30500061, 0x5f305000, 0x00040061, 0x00100000, 0x00000000, 0x00010000, 0xffff0000,
6475 0x0001ffff, 0x002a0000, 0x000e0000, 0x002c0000, 0x00530000, 0x00370000, 0x00560000, 0x00000000,
6476 0x00000000, 0x00000000, 0x00010000, 0x002a0000, 0x000e0000, 0x005d0000, 0x00890000, 0x006d0000,
6477 0x00000000, 0xffff0000, 0x0000ffff, 0x00010000, 0x002a0000, 0x000e0000, 0x00940000, 0x00bf0000,
6478 0x00a30000, 0x00000000, 0xffff0000, 0x0001ffff, 0x002a0000, 0x000e0000, 0x00c30000, 0x00f10000,
6479 0x00d50000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00010000, 0x002a0000, 0x000e0000, 0x00f40000,
6480 0x01220000, 0x01060000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00010000, 0x002a0000, 0x000e0000,
6481 0x01250000, 0x01550000, 0x01390000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00010000, 0x002a0000,
6482 0x000e0000, 0x01580000, 0x018b0000, 0x016f0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00010000,
6483 0x002a0000, 0x000e0000, 0x018e0000, 0x01bf0000, 0x01a30000, 0x00000000, 0xffff0000, 0x0000ffff,
6484 0x00010000, 0x002a0000, 0x000e0000, 0x01c20000, 0x002a0000, 0x01d40000, 0x00000000, 0xffff0000,
6485 0x0000ffff, 0x00010000, 0x002a0000, 0x000e0000, 0x01f00000, 0x02210000, 0x02050000, 0x00000000,
6486 0xffff0000, 0x0001ffff, 0x002a0000, 0x000e0000, 0x02250000, 0x02580000, 0x023c0000, 0x00000000,
6487 0xffff0000, 0x0001ffff, 0x002a0000, 0x000e0000, 0x025c0000, 0x02620000, 0x00010000, 0x00010000,
6488 0x002a0000, 0x000e0000, 0x02670000, 0x026e0000, 0x00000000, 0x00010000, 0x002a0000, 0x000e0000,
6489 0x02710000, 0x00000000,
6492 static void test_effect_annotations(void)
6494 D3D10_EFFECT_VARIABLE_DESC var_desc
;
6495 ID3D10EffectConstantBuffer
*cb
;
6496 D3D10_EFFECT_DESC effect_desc
;
6497 ID3D10EffectTechnique
*tech
;
6498 ID3D10EffectVariable
*v
, *a
;
6499 ID3D10EffectPass
*pass
;
6500 ID3D10Effect
*effect
;
6501 ID3D10Device
*device
;
6505 if (!(device
= create_device()))
6507 skip("Failed to create device, skipping tests.\n");
6511 hr
= create_effect(fx_test_annotations
, 0, device
, NULL
, &effect
);
6512 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6514 cb
= effect
->lpVtbl
->GetConstantBufferByName(effect
, "cb");
6515 a
= cb
->lpVtbl
->GetAnnotationByName(cb
, "s");
6516 ok(a
->lpVtbl
->IsValid(a
), "Expected valid variable.\n");
6517 a
= cb
->lpVtbl
->GetAnnotationByName(cb
, "S");
6518 ok(!a
->lpVtbl
->IsValid(a
), "Unexpected valid variable.\n");
6520 effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
6521 for (i
= 0; i
< effect_desc
.GlobalVariables
; ++i
)
6523 v
= effect
->lpVtbl
->GetVariableByIndex(effect
, i
);
6524 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
6525 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6526 ok(var_desc
.Annotations
== 1, "Unexpected annotations count %u.\n", var_desc
.Annotations
);
6527 v
= v
->lpVtbl
->GetAnnotationByName(v
, "s");
6528 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6529 a
= cb
->lpVtbl
->GetAnnotationByName(cb
, "S");
6530 ok(!a
->lpVtbl
->IsValid(a
), "Unexpected valid variable.\n");
6533 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
6534 ok(tech
->lpVtbl
->IsValid(tech
), "Expected valid technique.\n");
6535 a
= tech
->lpVtbl
->GetAnnotationByName(tech
, "s");
6536 ok(a
->lpVtbl
->IsValid(a
), "Expected valid variable.\n");
6537 a
= tech
->lpVtbl
->GetAnnotationByName(tech
, "S");
6538 ok(!a
->lpVtbl
->IsValid(a
), "Unexpected valid variable.\n");
6540 pass
= tech
->lpVtbl
->GetPassByIndex(tech
, 0);
6541 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid technique.\n");
6542 a
= pass
->lpVtbl
->GetAnnotationByName(pass
, "s");
6543 ok(a
->lpVtbl
->IsValid(a
), "Expected valid variable.\n");
6544 a
= pass
->lpVtbl
->GetAnnotationByName(pass
, "S");
6545 ok(!a
->lpVtbl
->IsValid(a
), "Unexpected valid variable.\n");
6547 effect
->lpVtbl
->Release(effect
);
6549 refcount
= ID3D10Device_Release(device
);
6550 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6553 static void test_effect_optimize(void)
6555 D3D10_EFFECT_SHADER_DESC shaderdesc
;
6556 D3D10_EFFECT_VARIABLE_DESC var_desc
;
6557 ID3D10EffectConstantBuffer
*cb
;
6558 ID3D10EffectShaderVariable
*gs
;
6559 D3D10_TECHNIQUE_DESC tech_desc
;
6560 D3D10_EFFECT_DESC effect_desc
;
6561 ID3D10EffectTechnique
*tech
;
6562 D3D10_PASS_DESC pass_desc
;
6563 ID3D10EffectVariable
*v
;
6564 ID3D10EffectPass
*pass
;
6565 ID3D10Effect
*effect
;
6566 ID3D10Device
*device
;
6571 if (!(device
= create_device()))
6573 skip("Failed to create device, skipping tests.\n");
6577 hr
= create_effect(fx_local_shader
, 0, device
, NULL
, &effect
);
6578 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6580 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
6581 hr
= tech
->lpVtbl
->GetDesc(tech
, &tech_desc
);
6582 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6583 ok(!strcmp(tech_desc
.Name
, "Render"), "Unexpected technique name %s.\n", tech_desc
.Name
);
6585 pass
= tech
->lpVtbl
->GetPassByIndex(tech
, 0);
6586 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
6587 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6588 ok(!strcmp(pass_desc
.Name
, "P0"), "Unexpected pass name %s.\n", pass_desc
.Name
);
6590 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_so");
6592 gs
= v
->lpVtbl
->AsShader(v
);
6593 hr
= gs
->lpVtbl
->GetShaderDesc(gs
, 0, &shaderdesc
);
6594 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6595 ok(!!shaderdesc
.pInputSignature
, "Expected input signature.\n");
6596 ok(!shaderdesc
.IsInline
, "Unexpected inline flag.\n");
6597 ok(!!shaderdesc
.pBytecode
, "Expected bytecode.\n");
6598 ok(!!shaderdesc
.BytecodeLength
, "Unexpected bytecode length.\n");
6599 ok(!strcmp(shaderdesc
.SODecl
, "SV_POSITION.x; $Skip.x; SV_POSITION.gb"),
6600 "Unexpected stream output declaration %s.\n", shaderdesc
.SODecl
);
6601 ok(!!shaderdesc
.NumInputSignatureEntries
, "Unexpected input signature count.\n");
6602 ok(!!shaderdesc
.NumOutputSignatureEntries
, "Unexpected output signature count.\n");
6604 ret
= effect
->lpVtbl
->IsOptimized(effect
);
6605 ok(!ret
, "Unexpected return value.\n");
6607 hr
= effect
->lpVtbl
->Optimize(effect
);
6608 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6610 ret
= effect
->lpVtbl
->IsOptimized(effect
);
6611 ok(ret
, "Unexpected return value.\n");
6613 hr
= gs
->lpVtbl
->GetShaderDesc(gs
, 0, &shaderdesc
);
6614 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6615 ok(!!shaderdesc
.pInputSignature
, "Expected input signature.\n");
6616 ok(!shaderdesc
.IsInline
, "Unexpected inline flag.\n");
6617 ok(!shaderdesc
.pBytecode
, "Unexpected bytecode.\n");
6618 ok(!shaderdesc
.BytecodeLength
, "Unexpected bytecode length.\n");
6619 ok(!shaderdesc
.SODecl
, "Unexpected stream output declaration %p.\n", shaderdesc
.SODecl
);
6620 ok(!shaderdesc
.NumInputSignatureEntries
, "Unexpected input signature count.\n");
6621 ok(!shaderdesc
.NumOutputSignatureEntries
, "Unexpected output signature count.\n");
6623 hr
= tech
->lpVtbl
->GetDesc(tech
, &tech_desc
);
6624 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6625 ok(!tech_desc
.Name
, "Unexpected technique name %p.\n", tech_desc
.Name
);
6627 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
6628 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6629 ok(!pass_desc
.Name
, "Unexpected pass name %p.\n", pass_desc
.Name
);
6631 pass
= tech
->lpVtbl
->GetPassByName(tech
, "P0");
6632 ok(!pass
->lpVtbl
->IsValid(pass
), "Unexpected valid pass.\n");
6634 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
6635 ok(tech
->lpVtbl
->IsValid(tech
), "Unexpected valid technique.\n");
6637 tech
= effect
->lpVtbl
->GetTechniqueByName(effect
, "Render");
6638 ok(!tech
->lpVtbl
->IsValid(tech
), "Unexpected valid technique.\n");
6640 /* Already optimized */
6641 hr
= effect
->lpVtbl
->Optimize(effect
);
6642 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6644 effect
->lpVtbl
->Release(effect
);
6646 /* Annotations are stripped. */
6647 hr
= create_effect(fx_test_annotations
, 0, device
, NULL
, &effect
);
6648 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6650 cb
= effect
->lpVtbl
->GetConstantBufferByName(effect
, "cb");
6651 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
6652 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6653 ok(var_desc
.Annotations
== 1, "Unexpected annotations count %u.\n", var_desc
.Annotations
);
6654 v
= cb
->lpVtbl
->GetAnnotationByName(cb
, "s");
6655 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6657 effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
6659 for (i
= 0; i
< effect_desc
.GlobalVariables
; ++i
)
6661 v
= effect
->lpVtbl
->GetVariableByIndex(effect
, i
);
6662 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
6663 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6664 ok(var_desc
.Annotations
== 1, "Unexpected annotations count %u.\n", var_desc
.Annotations
);
6665 v
= v
->lpVtbl
->GetAnnotationByName(v
, "s");
6666 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6669 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
6670 hr
= tech
->lpVtbl
->GetDesc(tech
, &tech_desc
);
6671 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6672 ok(tech_desc
.Annotations
== 1, "Unexpected annotations count %u.\n", tech_desc
.Annotations
);
6673 v
= tech
->lpVtbl
->GetAnnotationByName(tech
, "s");
6674 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6676 pass
= tech
->lpVtbl
->GetPassByIndex(tech
, 0);
6677 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid technique.\n");
6678 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
6679 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6680 ok(pass_desc
.Annotations
== 1, "Unexpected annotations count %u.\n", pass_desc
.Annotations
);
6681 v
= pass
->lpVtbl
->GetAnnotationByName(pass
, "s");
6682 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6684 hr
= effect
->lpVtbl
->Optimize(effect
);
6685 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6687 cb
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
6688 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
6689 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6691 ok(!var_desc
.Annotations
, "Unexpected annotations count %u.\n", var_desc
.Annotations
);
6692 v
= cb
->lpVtbl
->GetAnnotationByName(cb
, "s");
6693 ok(!v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6696 effect
->lpVtbl
->GetDesc(effect
, &effect_desc
);
6698 for (i
= 0; i
< effect_desc
.GlobalVariables
; ++i
)
6700 v
= effect
->lpVtbl
->GetVariableByIndex(effect
, i
);
6701 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
6702 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6704 ok(!var_desc
.Annotations
, "Unexpected annotations count %u.\n", var_desc
.Annotations
);
6705 v
= v
->lpVtbl
->GetAnnotationByName(v
, "s");
6706 ok(!v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6710 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
6711 hr
= tech
->lpVtbl
->GetDesc(tech
, &tech_desc
);
6712 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6714 ok(!tech_desc
.Annotations
, "Unexpected annotations count %u.\n", tech_desc
.Annotations
);
6715 v
= tech
->lpVtbl
->GetAnnotationByName(tech
, "s");
6716 ok(!v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6719 pass
= tech
->lpVtbl
->GetPassByIndex(tech
, 0);
6720 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid technique.\n");
6721 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
6722 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6724 ok(!pass_desc
.Annotations
, "Unexpected annotations count %u.\n", pass_desc
.Annotations
);
6725 v
= pass
->lpVtbl
->GetAnnotationByName(pass
, "s");
6726 ok(!v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
6729 effect
->lpVtbl
->Release(effect
);
6731 refcount
= ID3D10Device_Release(device
);
6732 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6735 static void test_effect_shader_description(void)
6737 D3D10_EFFECT_SHADER_DESC shaderdesc
;
6738 ID3D10EffectShaderVariable
*s
;
6739 ID3D10EffectVariable
*v
;
6740 ID3D10Effect
*effect
;
6741 ID3D10Device
*device
;
6745 if (!(device
= create_device()))
6747 skip("Failed to create device, skipping tests.\n");
6751 hr
= create_effect(fx_local_shader
, 0, device
, NULL
, &effect
);
6752 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6754 v
= effect
->lpVtbl
->GetVariableByName(effect
, "v0");
6756 /* GetShaderDesc() is indexing through all shaders in the effect.*/
6757 s
= v
->lpVtbl
->AsShader(v
);
6758 hr
= s
->lpVtbl
->GetShaderDesc(s
, 0, &shaderdesc
);
6759 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6760 ok(!shaderdesc
.BytecodeLength
, "Unexpected bytecode length %u.\n", shaderdesc
.BytecodeLength
);
6761 hr
= s
->lpVtbl
->GetShaderDesc(s
, 1, &shaderdesc
);
6762 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6763 ok(!shaderdesc
.BytecodeLength
, "Unexpected bytecode length %u.\n", shaderdesc
.BytecodeLength
);
6764 hr
= s
->lpVtbl
->GetShaderDesc(s
, 2, &shaderdesc
);
6765 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6766 ok(!shaderdesc
.BytecodeLength
, "Unexpected bytecode length %u.\n", shaderdesc
.BytecodeLength
);
6767 hr
= s
->lpVtbl
->GetShaderDesc(s
, 3, &shaderdesc
);
6768 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6769 ok(shaderdesc
.BytecodeLength
== 424, "Unexpected bytecode length %u.\n",
6770 shaderdesc
.BytecodeLength
);
6771 hr
= s
->lpVtbl
->GetShaderDesc(s
, 4, &shaderdesc
);
6772 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6773 ok(shaderdesc
.BytecodeLength
== 424, "Unexpected bytecode length %u.\n",
6774 shaderdesc
.BytecodeLength
);
6775 hr
= s
->lpVtbl
->GetShaderDesc(s
, 5, &shaderdesc
);
6776 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6777 ok(shaderdesc
.BytecodeLength
== 420, "Unexpected bytecode length %u.\n",
6778 shaderdesc
.BytecodeLength
);
6779 hr
= s
->lpVtbl
->GetShaderDesc(s
, 6, &shaderdesc
);
6780 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6781 ok(shaderdesc
.BytecodeLength
== 516, "Unexpected bytecode length %u.\n",
6782 shaderdesc
.BytecodeLength
);
6783 ok(!shaderdesc
.SODecl
, "Unexpected SO declaration %p.\n", shaderdesc
.SODecl
);
6784 hr
= s
->lpVtbl
->GetShaderDesc(s
, 7, &shaderdesc
);
6785 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6786 ok(shaderdesc
.BytecodeLength
== 516, "Unexpected bytecode length %u.\n",
6787 shaderdesc
.BytecodeLength
);
6788 ok(!strcmp(shaderdesc
.SODecl
, "SV_POSITION.x; $Skip.x; SV_POSITION.gb"),
6789 "Unexpected SO declaration %s.\n", wine_dbgstr_a(shaderdesc
.SODecl
));
6791 effect
->lpVtbl
->Release(effect
);
6793 refcount
= ID3D10Device_Release(device
);
6794 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6797 static void test_effect_shader_object(void)
6799 ID3D10EffectShaderVariable
*s
;
6800 ID3D10GeometryShader
*gs
;
6801 ID3D10EffectVariable
*v
;
6802 ID3D10VertexShader
*vs
;
6803 ID3D10PixelShader
*ps
;
6804 ID3D10Effect
* effect
;
6805 ID3D10Device
*device
;
6809 if (!(device
= create_device()))
6811 skip("Failed to create device, skipping tests.\n");
6815 hr
= create_effect(fx_local_shader
, 0, device
, NULL
, &effect
);
6816 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6818 v
= effect
->lpVtbl
->GetVariableByName(effect
, "v0");
6820 s
= v
->lpVtbl
->AsShader(v
);
6822 vs
= (void *)0xdeadbeef;
6823 hr
= s
->lpVtbl
->GetVertexShader(s
, 0, &vs
);
6824 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6825 ok(!vs
, "Unexpected shader object.\n");
6827 vs
= (void *)0xdeadbeef;
6828 hr
= s
->lpVtbl
->GetVertexShader(s
, 1, &vs
);
6829 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6830 ok(!vs
, "Unexpected shader object.\n");
6832 vs
= (void *)0xdeadbeef;
6833 hr
= s
->lpVtbl
->GetVertexShader(s
, 2, &vs
);
6834 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6835 ok(!vs
, "Unexpected shader object.\n");
6838 hr
= s
->lpVtbl
->GetVertexShader(s
, 3, &vs
);
6839 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6840 ok(!!vs
, "Unexpected shader object.\n");
6841 ID3D10VertexShader_Release(vs
);
6844 hr
= s
->lpVtbl
->GetVertexShader(s
, 4, &vs
);
6845 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6846 ok(!!vs
, "Unexpected shader object.\n");
6847 ID3D10VertexShader_Release(vs
);
6849 ps
= (void *)0xdeadbeef;
6850 hr
= s
->lpVtbl
->GetPixelShader(s
, 0, &ps
);
6851 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6852 ok(!ps
, "Unexpected shader object.\n");
6854 ps
= (void *)0xdeadbeef;
6855 hr
= s
->lpVtbl
->GetPixelShader(s
, 1, &ps
);
6856 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6857 ok(!ps
, "Unexpected shader object.\n");
6859 ps
= (void *)0xdeadbeef;
6860 hr
= s
->lpVtbl
->GetPixelShader(s
, 2, &ps
);
6861 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6862 ok(!ps
, "Unexpected shader object.\n");
6864 ps
= (void *)0xdeadbeef;
6865 hr
= s
->lpVtbl
->GetPixelShader(s
, 3, &ps
);
6866 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6867 ok(!ps
, "Unexpected shader object.\n");
6869 ps
= (void *)0xdeadbeef;
6870 hr
= s
->lpVtbl
->GetPixelShader(s
, 4, &ps
);
6871 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6872 ok(!ps
, "Unexpected shader object.\n");
6875 hr
= s
->lpVtbl
->GetPixelShader(s
, 5, &ps
);
6876 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6877 ok(!!ps
, "Unexpected shader object.\n");
6878 ID3D10PixelShader_Release(ps
);
6880 gs
= (void *)0xdeadbeef;
6881 hr
= s
->lpVtbl
->GetGeometryShader(s
, 0, &gs
);
6882 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6883 ok(!gs
, "Unexpected shader object.\n");
6885 gs
= (void *)0xdeadbeef;
6886 hr
= s
->lpVtbl
->GetGeometryShader(s
, 1, &gs
);
6887 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6888 ok(!gs
, "Unexpected shader object.\n");
6890 gs
= (void *)0xdeadbeef;
6891 hr
= s
->lpVtbl
->GetGeometryShader(s
, 2, &gs
);
6892 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6893 ok(!gs
, "Unexpected shader object.\n");
6895 gs
= (void *)0xdeadbeef;
6896 hr
= s
->lpVtbl
->GetGeometryShader(s
, 3, &gs
);
6897 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6898 ok(!gs
, "Unexpected shader object.\n");
6900 gs
= (void *)0xdeadbeef;
6901 hr
= s
->lpVtbl
->GetGeometryShader(s
, 4, &gs
);
6902 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6903 ok(!gs
, "Unexpected shader object.\n");
6905 gs
= (void *)0xdeadbeef;
6906 hr
= s
->lpVtbl
->GetGeometryShader(s
, 5, &gs
);
6907 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
6908 ok(!gs
, "Unexpected shader object.\n");
6911 hr
= s
->lpVtbl
->GetGeometryShader(s
, 6, &gs
);
6912 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6913 ok(!!gs
, "Unexpected shader object.\n");
6914 ID3D10GeometryShader_Release(gs
);
6917 hr
= s
->lpVtbl
->GetGeometryShader(s
, 7, &gs
);
6918 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
6919 ok(!!gs
, "Unexpected shader object.\n");
6920 ID3D10GeometryShader_Release(gs
);
6922 effect
->lpVtbl
->Release(effect
);
6924 refcount
= ID3D10Device_Release(device
);
6925 ok(!refcount
, "Device has %lu references left.\n", refcount
);
6929 cbuffer s_cb
<String s
= "value"; >
6935 BlendState s_blendstate
;
6936 Texture2D s_texture
;
6939 float4
VS( float4 pos
: POSITION
) : SV_POSITION
6949 SetVertexShader(NULL
);
6950 SetGeometryShader(NULL
);
6955 SetVertexShader(CompileShader(vs_4_0
, VS()));
6959 static DWORD fx_test_pool
[] =
6961 0x43425844, 0x5a29c5ce, 0xa6970df1, 0x3b2ae8f2, 0x7b225509, 0x00000001, 0x000004dc, 0x00000001,
6962 0x00000024, 0x30315846, 0x000004b0, 0xfeff1001, 0x00000001, 0x00000002, 0x00000003, 0x00000000,
6963 0x00000000, 0x00000000, 0x00000001, 0x00000360, 0x00000000, 0x00000001, 0x00000000, 0x00000001,
6964 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x62635f73,
6965 0x72745300, 0x00676e69, 0x00000009, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6966 0x00000001, 0x61760073, 0x0065756c, 0x616f6c66, 0x00340074, 0x00010000, 0x00000000, 0x00040000,
6967 0x00100000, 0x00040000, 0x09090000, 0x31660000, 0x4c4f4300, 0x0030524f, 0x43003266, 0x524f4c4f,
6968 0x6c420031, 0x53646e65, 0x65746174, 0x00006a00, 0x00000200, 0x00000000, 0x00000000, 0x00000000,
6969 0x00000000, 0x00000200, 0x625f7300, 0x646e656c, 0x74617473, 0x65540065, 0x72757478, 0x00443265,
6970 0x0000009e, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x65745f73,
6971 0x72757478, 0x69500065, 0x536c6578, 0x65646168, 0x00ce0072, 0x00020000, 0x00000000, 0x00000000,
6972 0x00000000, 0x00000000, 0x00050000, 0x73700000, 0x63657400, 0x30500068, 0x00000100, 0x00000200,
6973 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00315000, 0x00000238, 0x43425844, 0x37b3f12d,
6974 0x2579b942, 0x27ed5925, 0x4a80132c, 0x00000001, 0x00000238, 0x00000005, 0x00000034, 0x00000108,
6975 0x0000013c, 0x00000170, 0x000001bc, 0x46454452, 0x000000cc, 0x00000001, 0x00000044, 0x00000001,
6976 0x0000001c, 0xfffe0400, 0x00000100, 0x000000a3, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
6977 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x62635f73, 0xababab00, 0x0000003c, 0x00000002,
6978 0x0000005c, 0x00000010, 0x00000000, 0x00000000, 0x0000008c, 0x00000000, 0x00000004, 0x00000002,
6979 0x00000090, 0x00000000, 0x000000a0, 0x00000004, 0x00000004, 0x00000000, 0x00000090, 0x00000000,
6980 0xab003166, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x4d003266, 0x6f726369, 0x74666f73,
6981 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
6982 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
6983 0x00000000, 0x0000000f, 0x49534f50, 0x4e4f4954, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001,
6984 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653,
6985 0x5449534f, 0x004e4f49, 0x52444853, 0x00000044, 0x00010040, 0x00000011, 0x04000059, 0x00208e46,
6986 0x00000000, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x06000036, 0x001020f2,
6987 0x00000000, 0x00208006, 0x00000000, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002,
6988 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
6989 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6990 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6991 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000011c, 0x00000000, 0x00000004, 0x00000010,
6992 0x00000000, 0x00000002, 0xffffffff, 0x00000001, 0x0000002c, 0x00000010, 0x0000002e, 0x00000056,
6993 0x0000003a, 0x00000059, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000060, 0x0000003a,
6994 0x00000063, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000091, 0x00000075, 0x00000000,
6995 0xffffffff, 0x00000000, 0x00000000, 0x000000c4, 0x000000a8, 0x00000000, 0xffffffff, 0x00000000,
6996 0x000000f6, 0x000000da, 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x000000f9, 0x00000002,
6997 0x00000000, 0x000000fe, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000002, 0x000000f6,
6998 0x00000006, 0x00000000, 0x00000001, 0x00000101, 0x00000008, 0x00000000, 0x00000001, 0x0000010d,
6999 0x00000119, 0x00000001, 0x00000000, 0x00000006, 0x00000000, 0x00000007, 0x00000358,
7002 /* Compiled as a child with /Gch (D3DCOMPILE_EFFECT_CHILD_EFFECT) */
7020 shared BlendState s_blendstate
;
7021 shared Texture2D s_texture
;
7022 shared PixelShader ps
;
7024 float4
VS( float4 pos
: POSITION
) : SV_POSITION
7029 float4
PS( float4 pos
: SV_POSITION
) : SV_Target
7031 return s_texture
.Load(int3(0,0,0));
7034 PixelShader vs
= CompileShader(ps_4_0
, PS());
7036 technique10 tech_child
7041 SetVertexShader(CompileShader(vs_4_0
, VS()));
7042 SetGeometryShader(NULL
);
7046 static DWORD fx_test_pool_child
[] =
7048 0x43425844, 0xfbf00688, 0x8af86d85, 0x759a5832, 0x320fdd75, 0x00000001, 0x000006e0, 0x00000001,
7049 0x00000024, 0x30315846, 0x000006b4, 0xfeff1001, 0x00000002, 0x00000002, 0x00000001, 0x00000001,
7050 0x00000002, 0x00000003, 0x00000001, 0x0000052c, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7051 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x62635f6c,
7052 0x6f6c6600, 0x09007461, 0x01000000, 0x00000000, 0x04000000, 0x10000000, 0x04000000, 0x09000000,
7053 0x66000009, 0x4f430030, 0x30524f4c, 0x635f6c00, 0x66003262, 0x69500033, 0x536c6578, 0x65646168,
7054 0x003e0072, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00050000, 0x73760000,
7055 0x0001e800, 0x42584400, 0x8d083943, 0x1caa8131, 0x88ca8b86, 0xbdb25507, 0x000001d8, 0x0001e800,
7056 0x00000500, 0x00003400, 0x0000ac00, 0x0000e000, 0x00011400, 0x00016c00, 0x45445200, 0x00007046,
7057 0x00000000, 0x00000000, 0x00000100, 0x00001c00, 0xff040000, 0x000100ff, 0x00004600, 0x00003c00,
7058 0x00000200, 0x00000500, 0x00000400, 0xffffff00, 0x000000ff, 0x00000100, 0x00000c00, 0x745f7300,
7059 0x75747865, 0x4d006572, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7060 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x475349ab, 0x00002c4e, 0x00000100, 0x00000800,
7061 0x00002000, 0x00000000, 0x00000100, 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x49534f50,
7062 0x4e4f4954, 0x47534f00, 0x00002c4e, 0x00000100, 0x00000800, 0x00002000, 0x00000000, 0x00000000,
7063 0x00000300, 0x00000000, 0x00000f00, 0x5f565300, 0x67726154, 0xab007465, 0x444853ab, 0x00005052,
7064 0x00004000, 0x00001400, 0x00185800, 0x10700004, 0x00000000, 0x00555500, 0x00006500, 0x1020f203,
7065 0x00000000, 0x00002d00, 0x1020f20a, 0x00000000, 0x00400200, 0x00000000, 0x00000000, 0x00000000,
7066 0x00000000, 0x107e4600, 0x00000000, 0x00003e00, 0x41545301, 0x00007454, 0x00000200, 0x00000000,
7067 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
7068 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
7069 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7070 0x00000000, 0x00000000, 0x00000000, 0x635f7300, 0x31660062, 0x00326600, 0x4f4c4f43, 0x42003152,
7071 0x646e656c, 0x74617453, 0x02670065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7072 0x00020000, 0x5f730000, 0x6e656c62, 0x61747364, 0x54006574, 0x75747865, 0x44326572, 0x00029b00,
7073 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000c00, 0x745f7300, 0x75747865,
7074 0x70006572, 0x65740073, 0x635f6863, 0x646c6968, 0x00305000, 0x00000238, 0x43425844, 0x37b3f12d,
7075 0x2579b942, 0x27ed5925, 0x4a80132c, 0x00000001, 0x00000238, 0x00000005, 0x00000034, 0x00000108,
7076 0x0000013c, 0x00000170, 0x000001bc, 0x46454452, 0x000000cc, 0x00000001, 0x00000044, 0x00000001,
7077 0x0000001c, 0xfffe0400, 0x00000100, 0x000000a3, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
7078 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x62635f73, 0xababab00, 0x0000003c, 0x00000002,
7079 0x0000005c, 0x00000010, 0x00000000, 0x00000000, 0x0000008c, 0x00000000, 0x00000004, 0x00000002,
7080 0x00000090, 0x00000000, 0x000000a0, 0x00000004, 0x00000004, 0x00000000, 0x00000090, 0x00000000,
7081 0xab003166, 0x00030000, 0x00010001, 0x00000000, 0x00000000, 0x4d003266, 0x6f726369, 0x74666f73,
7082 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
7083 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
7084 0x00000000, 0x0000000f, 0x49534f50, 0x4e4f4954, 0xababab00, 0x4e47534f, 0x0000002c, 0x00000001,
7085 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653,
7086 0x5449534f, 0x004e4f49, 0x52444853, 0x00000044, 0x00010040, 0x00000011, 0x04000059, 0x00208e46,
7087 0x00000000, 0x00000001, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x06000036, 0x001020f2,
7088 0x00000000, 0x00208006, 0x00000000, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002,
7089 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
7090 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7091 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7092 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000002dc, 0x00000000, 0x00000001, 0x00000002,
7093 0x00000000, 0x00000004, 0x00000010, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x0000002b,
7094 0x0000000f, 0x0000002e, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000035, 0x00000010,
7095 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x0000003b, 0x0000000f, 0x00000000, 0x00000000,
7096 0x00000000, 0x00000000, 0x00000000, 0x00000066, 0x0000004a, 0x00000000, 0xffffffff, 0x00000069,
7097 0x00000000, 0x00000255, 0x00000010, 0x00000000, 0x00000002, 0xffffffff, 0x0000025a, 0x0000000f,
7098 0x0000002e, 0x00000000, 0x00000000, 0x00000000, 0x0000025d, 0x0000000f, 0x00000260, 0x00000004,
7099 0x00000000, 0x00000000, 0x0000028e, 0x00000272, 0x00000000, 0xffffffff, 0x000002c1, 0x000002a5,
7100 0x00000000, 0xffffffff, 0x000002cb, 0x0000004a, 0x00000000, 0xffffffff, 0x000002ce, 0x00000001,
7101 0x00000000, 0x000002d9, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000002, 0x000002cb,
7102 0x00000006, 0x00000000, 0x00000007, 0x00000518, 0x00000008, 0x00000000, 0x00000001, 0x00000520,
7105 static void test_effect_pool(void)
7107 ID3D10Effect
*effect
, *effect2
, *child_effect
;
7108 ID3D10Device
*device
, *device2
, *device3
;
7109 D3D10_EFFECT_VARIABLE_DESC var_desc
;
7110 D3D10_PASS_SHADER_DESC shader_desc
;
7111 ID3D10EffectPool
*pool
, *pool2
;
7112 ID3D10EffectConstantBuffer
*cb
;
7113 ID3D10EffectShaderVariable
*sv
;
7114 ID3D10EffectVariable
*v
, *a
;
7115 ID3D10EffectTechnique
*t
;
7116 ID3D10EffectPass
*pass
;
7117 D3D10_EFFECT_DESC desc
;
7118 ID3D10Buffer
*buffer
;
7124 if (!(device
= create_device()))
7126 skip("Failed to create device, skipping tests.\n");
7130 device2
= create_device();
7131 ok(!!device2
, "Failed to create d3d device.\n");
7133 hr
= D3D10CreateEffectPoolFromMemory(NULL
, 0, 0, device
, &pool
);
7134 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
7136 hr
= create_effect_pool(fx_test_pool
, NULL
, &pool
);
7137 ok(hr
== D3DERR_INVALIDCALL
, "Got unexpected hr %#lx.\n", hr
);
7139 hr
= create_effect_pool(fx_test_pool
, device
, &pool
);
7140 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7142 refcount
= get_refcount(pool
);
7143 ok(refcount
== 1, "Got unexpected refcount %lu.\n", refcount
);
7144 effect
= pool
->lpVtbl
->AsEffect(pool
);
7145 ok(!!effect
, "Expected effect pointer.\n");
7147 effect
->lpVtbl
->AddRef(effect
);
7148 refcount
= get_refcount(pool
);
7149 ok(refcount
== 2, "Got unexpected refcount %lu.\n", refcount
);
7150 effect
->lpVtbl
->Release(effect
);
7152 hr
= pool
->lpVtbl
->QueryInterface(pool
, &IID_IUnknown
, (void **)&unk
);
7154 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7155 if (SUCCEEDED(hr
)) IUnknown_Release(unk
);
7157 hr
= pool
->lpVtbl
->QueryInterface(pool
, &IID_ID3D10Effect
, (void **)&unk
);
7158 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7160 hr
= pool
->lpVtbl
->QueryInterface(pool
, &IID_ID3D10EffectPool
, (void **)&unk
);
7161 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7162 ok(unk
== (IUnknown
*)pool
, "Unexpected pointer.\n");
7163 IUnknown_Release(unk
);
7165 hr
= effect
->lpVtbl
->QueryInterface(effect
, &IID_IUnknown
, (void **)&unk
);
7167 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7168 if (SUCCEEDED(hr
)) IUnknown_Release(unk
);
7170 hr
= effect
->lpVtbl
->QueryInterface(effect
, &IID_ID3D10Effect
, (void **)&unk
);
7171 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7173 hr
= effect
->lpVtbl
->QueryInterface(effect
, &IID_ID3D10EffectPool
, (void **)&pool2
);
7174 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7175 ok(pool2
== pool
, "Unexpected pool pointer.\n");
7176 pool2
->lpVtbl
->Release(pool2
);
7178 ret
= effect
->lpVtbl
->IsPool(effect
);
7179 ok(ret
, "Expected pool.\n");
7181 hr
= effect
->lpVtbl
->GetDesc(effect
, &desc
);
7182 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7183 ok(!desc
.IsChildEffect
, "Unexpected child flag.\n");
7184 ok(desc
.ConstantBuffers
== 1, "Unexpected buffer count %u.\n", desc
.ConstantBuffers
);
7185 ok(!desc
.SharedConstantBuffers
, "Unexpected shared buffer count %u.\n",
7186 desc
.SharedConstantBuffers
);
7187 ok(desc
.GlobalVariables
== 5, "Unexpected variables count %u.\n", desc
.GlobalVariables
);
7188 ok(!desc
.SharedGlobalVariables
, "Unexpected shared variables count %u.\n",
7189 desc
.SharedGlobalVariables
);
7191 cb
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
7192 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
7193 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7194 ok(!strcmp(var_desc
.Name
, "s_cb"), "Unexpected name %s.\n", var_desc
.Name
);
7195 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7196 a
= cb
->lpVtbl
->GetAnnotationByIndex(cb
, 0);
7197 ok(a
->lpVtbl
->IsValid(a
), "Expected valid annotation.\n");
7198 hr
= a
->lpVtbl
->GetDesc(a
, &var_desc
);
7199 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7200 ok(!strcmp(var_desc
.Name
, "s"), "Unexpected name %s.\n", var_desc
.Name
);
7201 ok(var_desc
.Flags
== (D3D10_EFFECT_VARIABLE_POOLED
| D3D10_EFFECT_VARIABLE_ANNOTATION
),
7202 "Unexpected flags %#x.\n", var_desc
.Flags
);
7204 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
7205 pass
= t
->lpVtbl
->GetPassByName(t
, "P1");
7206 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
7207 hr
= pass
->lpVtbl
->GetVertexShaderDesc(pass
, &shader_desc
);
7208 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7209 hr
= shader_desc
.pShaderVariable
->lpVtbl
->GetDesc(shader_desc
.pShaderVariable
, &var_desc
);
7210 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7211 ok(!strcmp(var_desc
.Name
, "$Anonymous"), "Unexpected name %s.\n", var_desc
.Name
);
7212 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7214 v
= effect
->lpVtbl
->GetVariableByName(effect
, "s_blendstate");
7215 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7216 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7217 ok(!strcmp(var_desc
.Name
, "s_blendstate"), "Unexpected name %s.\n", var_desc
.Name
);
7218 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7220 v
= effect
->lpVtbl
->GetVariableByName(effect
, "s_texture");
7221 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7222 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7223 ok(!strcmp(var_desc
.Name
, "s_texture"), "Unexpected name %s.\n", var_desc
.Name
);
7224 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7226 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ps");
7227 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7228 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7229 ok(!strcmp(var_desc
.Name
, "ps"), "Unexpected name %s.\n", var_desc
.Name
);
7230 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7232 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
7233 pass
= t
->lpVtbl
->GetPassByIndex(t
, 0);
7234 hr
= pass
->lpVtbl
->GetVertexShaderDesc(pass
, &shader_desc
);
7235 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7236 sv
= shader_desc
.pShaderVariable
;
7237 hr
= sv
->lpVtbl
->GetDesc(sv
, &var_desc
);
7238 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7239 ok(!strcmp(var_desc
.Name
, "$Anonymous"), "Unexpected name %s.\n", var_desc
.Name
);
7240 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7242 /* Create standalone effect from the same blob used for pool, */
7243 hr
= create_effect(fx_test_pool
, D3D10_EFFECT_COMPILE_CHILD_EFFECT
, device
, NULL
, &child_effect
);
7244 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
7246 hr
= create_effect(fx_test_pool
, 0, device
, NULL
, &effect2
);
7247 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7249 hr
= effect2
->lpVtbl
->QueryInterface(effect2
, &IID_IUnknown
, (void **)&unk
);
7251 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7252 if (SUCCEEDED(hr
)) IUnknown_Release(unk
);
7254 hr
= effect2
->lpVtbl
->QueryInterface(effect2
, &IID_ID3D10Effect
, (void **)&unk
);
7256 ok(hr
== E_NOINTERFACE
, "Got unexpected hr %#lx.\n", hr
);
7257 if (SUCCEEDED(hr
)) IUnknown_Release(unk
);
7259 /* For regular effects querying for ID3D10EffectPool is broken */
7260 hr
= effect2
->lpVtbl
->QueryInterface(effect2
, &IID_ID3D10EffectPool
, (void **)&unk
);
7261 todo_wine
ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7262 todo_wine
ok(unk
== (IUnknown
*)effect2
, "Got unexpected pointer %p.\n", unk
);
7263 if (SUCCEEDED(hr
)) IUnknown_Release(unk
);
7265 ret
= effect2
->lpVtbl
->IsPool(effect2
);
7266 ok(!ret
, "Unexpected pool.\n");
7268 hr
= effect2
->lpVtbl
->GetDesc(effect2
, &desc
);
7269 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7270 ok(!desc
.IsChildEffect
, "Unexpected child flag.\n");
7271 ok(desc
.ConstantBuffers
== 1, "Unexpected buffer count %u.\n", desc
.ConstantBuffers
);
7272 ok(!desc
.SharedConstantBuffers
, "Unexpected shared buffer count %u.\n",
7273 desc
.SharedConstantBuffers
);
7274 ok(desc
.GlobalVariables
== 5, "Unexpected variables count %u.\n", desc
.GlobalVariables
);
7275 ok(!desc
.SharedGlobalVariables
, "Unexpected shared variables count %u.\n",
7276 desc
.SharedGlobalVariables
);
7278 cb
= effect2
->lpVtbl
->GetConstantBufferByIndex(effect2
, 0);
7279 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
7280 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7281 ok(!strcmp(var_desc
.Name
, "s_cb"), "Unexpected name %s.\n", var_desc
.Name
);
7282 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7284 effect2
->lpVtbl
->Release(effect2
);
7286 /* Pool and child that use different devices. */
7287 hr
= create_effect_pool(fx_test_pool
, device2
, &pool2
);
7288 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7290 hr
= create_effect(fx_test_pool_child
, D3D10_EFFECT_COMPILE_CHILD_EFFECT
, device
, pool2
, &child_effect
);
7291 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7293 hr
= child_effect
->lpVtbl
->GetDevice(child_effect
, &device3
);
7294 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7295 ok(device3
== device
, "Unexpected device.\n");
7296 ID3D10Device_Release(device3
);
7298 cb
= child_effect
->lpVtbl
->GetConstantBufferByName(child_effect
, "s_cb");
7299 ok(cb
->lpVtbl
->IsValid(cb
), "Expected valid constant buffer.\n");
7301 hr
= cb
->lpVtbl
->GetConstantBuffer(cb
, &buffer
);
7302 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7303 ID3D10Buffer_GetDevice(buffer
, &device3
);
7304 ok(device3
== device2
, "Unexpected device.\n");
7305 ID3D10Device_Release(device3
);
7306 ID3D10Buffer_Release(buffer
);
7308 child_effect
->lpVtbl
->Release(child_effect
);
7309 pool2
->lpVtbl
->Release(pool2
);
7311 /* When pool is specified, corresponding flag has to be set. */
7312 hr
= create_effect(fx_test_pool_child
, 0, device
, pool
, &child_effect
);
7313 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
7315 hr
= create_effect(fx_test_pool_child
, D3D10_EFFECT_COMPILE_CHILD_EFFECT
, device
, NULL
, &child_effect
);
7316 ok(hr
== E_INVALIDARG
, "Got unexpected hr %#lx.\n", hr
);
7318 refcount
= get_refcount(pool
);
7319 ok(refcount
== 1, "Got unexpected refcount %lu.\n", refcount
);
7321 hr
= create_effect(fx_test_pool_child
, D3D10_EFFECT_COMPILE_CHILD_EFFECT
, device
, pool
, &child_effect
);
7322 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7324 refcount
= get_refcount(pool
);
7325 ok(refcount
== 2, "Got unexpected refcount %lu.\n", refcount
);
7327 hr
= child_effect
->lpVtbl
->GetDesc(child_effect
, &desc
);
7328 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7329 ok(desc
.IsChildEffect
, "Unexpected child flag.\n");
7330 ok(desc
.ConstantBuffers
== 2, "Unexpected buffer count %u.\n", desc
.ConstantBuffers
);
7331 ok(desc
.SharedConstantBuffers
== 1, "Unexpected shared buffer count %u.\n",
7332 desc
.SharedConstantBuffers
);
7333 ok(desc
.GlobalVariables
== 3, "Unexpected variables count %u.\n", desc
.GlobalVariables
);
7334 ok(desc
.SharedGlobalVariables
== 5, "Unexpected shared variables count %u.\n",
7335 desc
.SharedGlobalVariables
);
7337 /* Local buffers are enumerated first, then shared ones. */
7338 cb
= child_effect
->lpVtbl
->GetConstantBufferByIndex(child_effect
, 0);
7339 ret
= cb
->lpVtbl
->IsValid(cb
);
7340 ok(ret
, "Unexpected invalid variable.\n");
7342 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
7343 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7344 ok(!strcmp(var_desc
.Name
, "l_cb"), "Unexpected name %s.\n", var_desc
.Name
);
7345 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7347 cb
= child_effect
->lpVtbl
->GetConstantBufferByIndex(child_effect
, 1);
7348 ret
= cb
->lpVtbl
->IsValid(cb
);
7349 ok(ret
, "Unexpected invalid variable.\n");
7351 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
7352 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7353 ok(!strcmp(var_desc
.Name
, "l_cb2"), "Unexpected name %s.\n", var_desc
.Name
);
7354 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7356 cb
= child_effect
->lpVtbl
->GetConstantBufferByIndex(child_effect
, 2);
7357 ret
= cb
->lpVtbl
->IsValid(cb
);
7358 ok(ret
, "Unexpected invalid variable.\n");
7360 hr
= cb
->lpVtbl
->GetDesc(cb
, &var_desc
);
7361 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7362 ok(!strcmp(var_desc
.Name
, "s_cb"), "Unexpected name %s.\n", var_desc
.Name
);
7363 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7365 /* Pool techniques are not accessible */
7366 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
7367 ok(t
->lpVtbl
->IsValid(t
), "Unexpected invalid technique.\n");
7369 t
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 1);
7370 ok(!t
->lpVtbl
->IsValid(t
), "Unexpected valid technique.\n");
7372 /* Local variables first */
7373 v
= child_effect
->lpVtbl
->GetVariableByIndex(child_effect
, 0);
7374 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7375 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7376 ok(!strcmp(var_desc
.Name
, "f0"), "Unexpected name %s.\n", var_desc
.Name
);
7377 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7379 v
= child_effect
->lpVtbl
->GetVariableByIndex(child_effect
, 1);
7380 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7381 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7382 ok(!strcmp(var_desc
.Name
, "f3"), "Unexpected name %s.\n", var_desc
.Name
);
7383 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7385 v
= child_effect
->lpVtbl
->GetVariableByIndex(child_effect
, 2);
7386 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7387 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7388 ok(!strcmp(var_desc
.Name
, "vs"), "Unexpected name %s.\n", var_desc
.Name
);
7389 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7391 v
= child_effect
->lpVtbl
->GetVariableByIndex(child_effect
, 3);
7392 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7393 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7394 ok(!strcmp(var_desc
.Name
, "f1"), "Unexpected name %s.\n", var_desc
.Name
);
7395 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7397 v
= child_effect
->lpVtbl
->GetVariableByIndex(child_effect
, 4);
7398 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7399 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7400 ok(!strcmp(var_desc
.Name
, "f2"), "Unexpected name %s.\n", var_desc
.Name
);
7401 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7403 v
= child_effect
->lpVtbl
->GetVariableByName(child_effect
, "s_texture");
7404 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7405 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7406 ok(!strcmp(var_desc
.Name
, "s_texture"), "Unexpected name %s.\n", var_desc
.Name
);
7407 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7409 v
= child_effect
->lpVtbl
->GetVariableBySemantic(child_effect
, "COLOR0");
7410 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7411 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7412 ok(!strcmp(var_desc
.Name
, "f0"), "Unexpected name %s.\n", var_desc
.Name
);
7413 ok(!var_desc
.Flags
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7415 v
= child_effect
->lpVtbl
->GetVariableBySemantic(child_effect
, "COLOR1");
7416 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7417 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7418 ok(!strcmp(var_desc
.Name
, "f2"), "Unexpected name %s.\n", var_desc
.Name
);
7419 ok(var_desc
.Flags
== D3D10_EFFECT_VARIABLE_POOLED
, "Unexpected flags %#x.\n", var_desc
.Flags
);
7421 child_effect
->lpVtbl
->Release(child_effect
);
7423 pool
->lpVtbl
->Release(pool
);
7425 refcount
= ID3D10Device_Release(device
);
7426 ok(!refcount
, "Device has %lu references left.\n", refcount
);
7428 refcount
= ID3D10Device_Release(device2
);
7429 ok(!refcount
, "Device has %lu references left.\n", refcount
);
7433 float4 f4
= {1,2,3,4};
7446 test s1
= { true, -0.2f
, false };
7448 matrix
<uint
, 2, 3> m1
= { 1, 2, 3, 4, 5, 6 };
7449 row_major matrix
<uint
, 2, 3> m2
= { 1, 2, 3, 4, 5, 6 };
7450 row_major matrix
<bool, 2, 3> m3
= { true, false, true, false, true, false };
7451 float2x2 m4
= { 1.0f
, 2.0f
, 3.0f
, 4.0f
};
7453 static DWORD fx_test_default_variable_value
[] =
7455 0x43425844, 0x3673286d, 0xd7bb3432, 0xb571508a, 0x5d70cc01, 0x00000001, 0x00000448, 0x00000001,
7456 0x00000024, 0x30315846, 0x0000041c, 0xfeff1001, 0x00000001, 0x0000000b, 0x00000000, 0x00000000,
7457 0x00000000, 0x00000000, 0x00000000, 0x00000284, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7458 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
7459 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010,
7460 0x00000010, 0x0000210a, 0x00003466, 0x003f8000, 0x00400000, 0x00404000, 0x66408000, 0x74616f6c,
7461 0x00430032, 0x00010000, 0x00000000, 0x00080000, 0x00100000, 0x00080000, 0x110a0000, 0x32660000,
7462 0x80000000, 0x0000003f, 0x6f6c6640, 0x00317461, 0x00000071, 0x00000001, 0x00000000, 0x00000004,
7463 0x00000010, 0x00000004, 0x0000090a, 0x00003166, 0x693f8000, 0x9b00746e, 0x01000000, 0x00000000,
7464 0x04000000, 0x10000000, 0x04000000, 0x11000000, 0x69000009, 0x00000a00, 0x00009b00, 0x00000100,
7465 0x00000200, 0x00001400, 0x00001000, 0x00000800, 0x00091100, 0x00326900, 0x00000009, 0x0000000c,
7466 0x616f6c66, 0x00e80074, 0x00010000, 0x00000000, 0x00040000, 0x00100000, 0x00040000, 0x09090000,
7467 0x00660000, 0x3e4ccccd, 0x74736574, 0x00316200, 0x6c6f6f62, 0x00011800, 0x00000100, 0x00000000,
7468 0x00000400, 0x00001000, 0x00000400, 0x00092100, 0x00326200, 0x00000110, 0x00000003, 0x00000000,
7469 0x0000000c, 0x00000010, 0x0000000c, 0x00000003, 0x00000115, 0x00000000, 0x00000000, 0x0000011d,
7470 0x00000066, 0x00000000, 0x00000004, 0x000000ee, 0x00000139, 0x00000000, 0x00000008, 0x0000011d,
7471 0x01003173, 0xcd000000, 0x00be4ccc, 0x75000000, 0x32746e69, 0x97003378, 0x01000001, 0x00000000,
7472 0x28000000, 0x30000000, 0x18000000, 0x1b000000, 0x6d00005a, 0x00010031, 0x00020000, 0x00030000,
7473 0x00040000, 0x00050000, 0x00060000, 0x01970000, 0x00010000, 0x00000000, 0x001c0000, 0x00200000,
7474 0x00180000, 0x1a1b0000, 0x326d0000, 0x00000100, 0x00000200, 0x00000300, 0x00000400, 0x00000500,
7475 0x00000600, 0x6f6f6200, 0x3378326c, 0x00020d00, 0x00000100, 0x00000000, 0x00001c00, 0x00002000,
7476 0x00001800, 0x001a2300, 0x00336d00, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001,
7477 0x00000000, 0x616f6c66, 0x32783274, 0x00024c00, 0x00000100, 0x00000000, 0x00001800, 0x00002000,
7478 0x00001000, 0x00520b00, 0x00346d00, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x00000004,
7479 0x000000e0, 0x00000000, 0x0000000b, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000,
7480 0x00000000, 0x00000033, 0x00000000, 0x00000000, 0x00000066, 0x0000004a, 0x00000000, 0x00000010,
7481 0x00000069, 0x00000000, 0x00000000, 0x00000094, 0x00000078, 0x00000000, 0x00000018, 0x00000097,
7482 0x00000000, 0x00000000, 0x000000bb, 0x0000009f, 0x00000000, 0x0000001c, 0x000000bd, 0x00000000,
7483 0x00000000, 0x000000dd, 0x000000c1, 0x00000000, 0x00000020, 0x000000e0, 0x00000000, 0x00000000,
7484 0x0000010a, 0x000000ee, 0x00000000, 0x00000034, 0x0000010c, 0x00000000, 0x00000000, 0x00000188,
7485 0x0000013c, 0x00000000, 0x00000040, 0x0000018b, 0x00000000, 0x00000000, 0x000001bb, 0x0000019f,
7486 0x00000000, 0x00000050, 0x000001be, 0x00000000, 0x00000000, 0x000001f2, 0x000001d6, 0x00000000,
7487 0x00000080, 0x000001f5, 0x00000000, 0x00000000, 0x00000231, 0x00000215, 0x00000000, 0x000000a0,
7488 0x00000234, 0x00000000, 0x00000000, 0x00000271, 0x00000255, 0x00000000, 0x000000c0, 0x00000274,
7489 0x00000000, 0x00000000,
7492 static void test_effect_default_variable_value(void)
7494 D3D10_EFFECT_VARIABLE_DESC var_desc
;
7495 ID3D10EffectVectorVariable
*vector
;
7496 ID3D10EffectScalarVariable
*scalar
;
7497 ID3D10EffectMatrixVariable
*matrix
;
7498 struct d3d10_matrix m_set
, m_ret
;
7499 ID3D10EffectVariable
*v
, *v2
, *m
;
7500 float float_v
[4], float_s
;
7501 ID3D10Effect
*effect
;
7502 ID3D10Device
*device
;
7503 int int_v
[2], int_s
;
7508 if (!(device
= create_device()))
7510 skip("Failed to create device, skipping tests.\n");
7514 hr
= create_effect(fx_test_default_variable_value
, 0, device
, NULL
, &effect
);
7515 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7517 memset(float_v
, 0, sizeof(float_v
));
7518 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f4");
7519 vector
= v
->lpVtbl
->AsVector(v
);
7520 hr
= vector
->lpVtbl
->GetFloatVector(vector
, float_v
);
7521 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7522 ok(float_v
[0] == 1.0f
&& float_v
[1] == 2.0f
&& float_v
[2] == 3.0f
&& float_v
[3] == 4.0f
,
7523 "Unexpected vector {%.8e,%.8e,%.8e,%.8e}\n", float_v
[0], float_v
[1], float_v
[2], float_v
[3]);
7525 memset(float_v
, 0, sizeof(float_v
));
7526 float_v
[2] = float_v
[3] = 5.0f
;
7527 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f2");
7528 vector
= v
->lpVtbl
->AsVector(v
);
7529 hr
= vector
->lpVtbl
->GetFloatVector(vector
, float_v
);
7530 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7531 ok(float_v
[0] == 1.0f
&& float_v
[1] == 2.0f
&& float_v
[2] == 5.0f
&& float_v
[3] == 5.0f
,
7532 "Unexpected vector {%.8e,%.8e,%.8e,%.8e}\n", float_v
[0], float_v
[1], float_v
[2], float_v
[3]);
7534 memset(float_v
, 0, sizeof(float_v
));
7535 float_v
[1] = float_v
[2] = float_v
[3] = 5.0f
;
7536 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f1");
7537 vector
= v
->lpVtbl
->AsVector(v
);
7538 hr
= vector
->lpVtbl
->GetFloatVector(vector
, float_v
);
7539 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7540 ok(float_v
[0] == 1.0f
&& float_v
[1] == 5.0f
&& float_v
[2] == 5.0f
&& float_v
[3] == 5.0f
,
7541 "Unexpected vector {%.8e,%.8e,%.8e,%.8e}\n", float_v
[0], float_v
[1], float_v
[2], float_v
[3]);
7544 v
= effect
->lpVtbl
->GetVariableByName(effect
, "i");
7545 scalar
= v
->lpVtbl
->AsScalar(v
);
7546 hr
= scalar
->lpVtbl
->GetInt(scalar
, &int_s
);
7547 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7548 ok(int_s
== 10, "Unexpected value %d.\n", int_s
);
7550 memset(int_v
, 0, sizeof(int_v
));
7551 v
= effect
->lpVtbl
->GetVariableByName(effect
, "i2");
7552 scalar
= v
->lpVtbl
->AsScalar(v
);
7553 hr
= scalar
->lpVtbl
->GetIntArray(scalar
, int_v
, 0, 2);
7554 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7555 ok(int_v
[0] == 9 && int_v
[1] == 12, "Unexpected vector {%d,%d}\n", int_v
[0], int_v
[1]);
7556 hr
= v
->lpVtbl
->GetDesc(v
, &var_desc
);
7557 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7558 ok(var_desc
.BufferOffset
== 32, "Unexpected offset %u.\n", var_desc
.BufferOffset
);
7559 v2
= v
->lpVtbl
->GetElement(v
, 0);
7560 hr
= v2
->lpVtbl
->GetDesc(v2
, &var_desc
);
7561 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7562 ok(var_desc
.BufferOffset
== 32, "Unexpected offset %u.\n", var_desc
.BufferOffset
);
7563 v2
= v
->lpVtbl
->GetElement(v
, 1);
7564 hr
= v2
->lpVtbl
->GetDesc(v2
, &var_desc
);
7565 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7566 ok(var_desc
.BufferOffset
== 48, "Unexpected offset %u.\n", var_desc
.BufferOffset
);
7569 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f");
7570 scalar
= v
->lpVtbl
->AsScalar(v
);
7571 hr
= scalar
->lpVtbl
->GetFloat(scalar
, &float_s
);
7572 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7573 ok(float_s
== 0.2f
, "Unexpected value %.8e.\n", float_s
);
7576 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m1");
7577 matrix
= v
->lpVtbl
->AsMatrix(v
);
7578 ok(matrix
->lpVtbl
->IsValid(matrix
), "Expected valid matrix.\n");
7579 memset(&m_ret
, 0, sizeof(m_ret
));
7580 hr
= matrix
->lpVtbl
->GetMatrix(matrix
, &m_ret
.m
[0][0]);
7581 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7583 set_test_matrix(&m_set
, D3D10_SVT_INT
, 2, 3, 1);
7584 compare_matrix("m1", __LINE__
, &m_set
, &m_ret
, 2, 3, FALSE
);
7586 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m2");
7587 matrix
= v
->lpVtbl
->AsMatrix(v
);
7588 ok(matrix
->lpVtbl
->IsValid(matrix
), "Expected valid matrix.\n");
7589 memset(&m_ret
, 0, sizeof(m_ret
));
7590 hr
= matrix
->lpVtbl
->GetMatrix(matrix
, &m_ret
.m
[0][0]);
7591 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7593 set_test_matrix(&m_set
, D3D10_SVT_INT
, 2, 3, 1);
7594 compare_matrix("m2", __LINE__
, &m_set
, &m_ret
, 2, 3, FALSE
);
7596 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m3");
7597 matrix
= v
->lpVtbl
->AsMatrix(v
);
7598 ok(matrix
->lpVtbl
->IsValid(matrix
), "Expected valid matrix.\n");
7599 memset(&m_ret
, 0, sizeof(m_ret
));
7600 hr
= matrix
->lpVtbl
->GetMatrix(matrix
, &m_ret
.m
[0][0]);
7601 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7603 memset(&m_set
, 0, sizeof(m_set
));
7604 *(unsigned int *)&m_set
.m
[0][0] = 1;
7605 *(unsigned int *)&m_set
.m
[0][1] = 0;
7606 *(unsigned int *)&m_set
.m
[0][2] = 1;
7607 *(unsigned int *)&m_set
.m
[1][0] = 0;
7608 *(unsigned int *)&m_set
.m
[1][1] = 1;
7609 *(unsigned int *)&m_set
.m
[1][2] = 0;
7610 compare_matrix("m3", __LINE__
, &m_set
, &m_ret
, 2, 3, FALSE
);
7612 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m4");
7613 matrix
= v
->lpVtbl
->AsMatrix(v
);
7614 ok(matrix
->lpVtbl
->IsValid(matrix
), "Expected valid matrix.\n");
7615 memset(&m_ret
, 0, sizeof(m_ret
));
7616 hr
= matrix
->lpVtbl
->GetMatrix(matrix
, &m_ret
.m
[0][0]);
7617 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7619 set_test_matrix(&m_set
, D3D10_SVT_FLOAT
, 2, 2, 1);
7620 compare_matrix("m4", __LINE__
, &m_set
, &m_ret
, 2, 2, FALSE
);
7623 v
= effect
->lpVtbl
->GetVariableByName(effect
, "s1");
7624 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
7626 m
= v
->lpVtbl
->GetMemberByName(v
, "b1");
7627 ok(m
->lpVtbl
->IsValid(m
), "Expected valid variable.\n");
7628 scalar
= m
->lpVtbl
->AsScalar(m
);
7629 hr
= scalar
->lpVtbl
->GetBool(scalar
, &ret
);
7630 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7631 ok(ret
== 1, "Unexpected value.\n");
7633 m
= v
->lpVtbl
->GetMemberByName(v
, "f2");
7634 ok(m
->lpVtbl
->IsValid(m
), "Expected valid variable.\n");
7635 scalar
= m
->lpVtbl
->AsScalar(m
);
7636 hr
= scalar
->lpVtbl
->GetFloat(scalar
, &float_s
);
7637 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7638 ok(float_s
== -0.2f
, "Unexpected value %f.\n", float_s
);
7640 m
= v
->lpVtbl
->GetMemberByName(v
, "b2");
7641 ok(m
->lpVtbl
->IsValid(m
), "Expected valid variable.\n");
7642 scalar
= m
->lpVtbl
->AsScalar(m
);
7643 hr
= scalar
->lpVtbl
->GetBool(scalar
, &ret
);
7644 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7645 ok(!ret
, "Unexpected value.\n");
7647 effect
->lpVtbl
->Release(effect
);
7649 refcount
= ID3D10Device_Release(device
);
7650 ok(!refcount
, "Device has %lu references left.\n", refcount
);
7653 static void test_effect_raw_value(void)
7655 ID3D10EffectConstantBuffer
*cb
;
7656 ID3D10EffectVariable
*v
;
7657 ID3D10Effect
*effect
;
7658 ID3D10Device
*device
;
7665 if (!(device
= create_device()))
7667 skip("Failed to create device, skipping tests.\n");
7671 hr
= create_effect(fx_test_default_variable_value
, 0, device
, NULL
, &effect
);
7672 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7674 /* Read 1 float at a time, from float4 vector. */
7675 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f4");
7676 for (i
= 0; i
< 4; ++i
)
7678 hr
= v
->lpVtbl
->GetRawValue(v
, &f
, sizeof(f
) * i
, sizeof(f
));
7679 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7680 ok(f
== i
+ 1.0f
, "Unexpected value %f.\n", f
);
7682 /* Offset outside of variable storage, returns adjacent memory contents. */
7683 hr
= v
->lpVtbl
->GetRawValue(v
, &f
, 16, sizeof(f
));
7684 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7685 ok(f
== 1.0f
, "Unexpected value %f.\n", f
);
7686 hr
= v
->lpVtbl
->GetRawValue(v
, &f
, 20, sizeof(f
));
7687 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7688 ok(f
== 2.0f
, "Unexpected value %f.\n", f
);
7691 v
= effect
->lpVtbl
->GetVariableByName(effect
, "i2");
7692 ok(v
->lpVtbl
->IsValid(v
), "Expected valid variable.\n");
7693 hr
= v
->lpVtbl
->GetRawValue(v
, i_v
, 0, 8 * sizeof(float));
7694 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7695 ok(i_v
[0] == 9, "Unexpected value %d.\n", i_v
[0]);
7696 ok(i_v
[1] == 0, "Unexpected value %d.\n", i_v
[1]);
7697 ok(i_v
[2] == 0, "Unexpected value %d.\n", i_v
[2]);
7698 ok(i_v
[3] == 0, "Unexpected value %d.\n", i_v
[3]);
7699 ok(i_v
[4] == 12, "Unexpected value %d.\n", i_v
[4]);
7701 hr
= v
->lpVtbl
->GetRawValue(v
, &f
, 20, sizeof(f
));
7702 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7703 ok(f
== 0.2f
, "Unexpected value %f.\n", f
);
7706 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m1");
7707 hr
= v
->lpVtbl
->GetRawValue(v
, i_v
, 0, sizeof(i_v
));
7708 ok(i_v
[0] == 1, "Unexpected value %d.\n", i_v
[0]);
7709 ok(i_v
[1] == 4, "Unexpected value %d.\n", i_v
[1]);
7710 ok(i_v
[2] == 0, "Unexpected value %d.\n", i_v
[2]);
7711 ok(i_v
[3] == 0, "Unexpected value %d.\n", i_v
[3]);
7712 ok(i_v
[4] == 2, "Unexpected value %d.\n", i_v
[4]);
7713 ok(i_v
[5] == 5, "Unexpected value %d.\n", i_v
[5]);
7714 ok(i_v
[6] == 0, "Unexpected value %d.\n", i_v
[6]);
7715 ok(i_v
[7] == 0, "Unexpected value %d.\n", i_v
[7]);
7716 ok(i_v
[8] == 3, "Unexpected value %d.\n", i_v
[8]);
7717 ok(i_v
[9] == 6, "Unexpected value %d.\n", i_v
[9]);
7719 v
= effect
->lpVtbl
->GetVariableByName(effect
, "m2");
7720 hr
= v
->lpVtbl
->GetRawValue(v
, i_v
, 0, 7 * sizeof(i_v
[0]));
7721 ok(i_v
[0] == 1, "Unexpected value %d.\n", i_v
[0]);
7722 ok(i_v
[1] == 2, "Unexpected value %d.\n", i_v
[1]);
7723 ok(i_v
[2] == 3, "Unexpected value %d.\n", i_v
[2]);
7724 ok(i_v
[3] == 0, "Unexpected value %d.\n", i_v
[3]);
7725 ok(i_v
[4] == 4, "Unexpected value %d.\n", i_v
[4]);
7726 ok(i_v
[5] == 5, "Unexpected value %d.\n", i_v
[5]);
7727 ok(i_v
[6] == 6, "Unexpected value %d.\n", i_v
[6]);
7729 /* Read from constant buffer directly. */
7730 cb
= effect
->lpVtbl
->GetConstantBufferByIndex(effect
, 0);
7732 for (i
= 0; i
< 4; ++i
)
7734 hr
= cb
->lpVtbl
->GetRawValue(cb
, &f
, sizeof(f
) * i
, sizeof(f
));
7735 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7736 ok(f
== i
+ 1.0f
, "Unexpected value %f.\n", f
);
7738 hr
= cb
->lpVtbl
->GetRawValue(cb
, &f
, 16, sizeof(f
));
7739 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7740 ok(f
== 1.0f
, "Unexpected value %f.\n", f
);
7741 hr
= cb
->lpVtbl
->GetRawValue(cb
, &f
, 20, sizeof(f
));
7742 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7743 ok(f
== 2.0f
, "Unexpected value %f.\n", f
);
7745 /* Invalid variable */
7746 v
= effect
->lpVtbl
->GetVariableByName(effect
, "invalid");
7747 hr
= v
->lpVtbl
->GetRawValue(v
, &f
, 0, sizeof(f
));
7748 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
7750 effect
->lpVtbl
->Release(effect
);
7752 refcount
= ID3D10Device_Release(device
);
7753 ok(!refcount
, "Device has %lu references left.\n", refcount
);
7759 float4 fv1
= {0.5f
, 0.6f
, 0.7f
, 0.8f
};
7760 float4 fv1_a
[2] = { { 1.0f
, 1.1f
, 1.2f
, 1.3f
}, {0.1f
, 0.2f
, 0.3f
, 0.4f
} };
7762 int i2_a
[2] = { 0x1, 0x2 };
7769 SetBlendState(NULL
, fv1
, i2
);
7770 SetDepthStencilState(NULL
, i1
);
7774 SetBlendState(NULL
, fv1_a
[1], i2_a
[1]);
7775 SetDepthStencilState(NULL
, i1_a
[1]);
7779 SetBlendState(NULL
, f1
, 0);
7783 static DWORD fx_test_effect_dynamic_numeric_field
[] =
7785 0x43425844, 0xec585518, 0x7c866383, 0xf6e767fd, 0x019e1f41, 0x00000001, 0x00000562, 0x00000001,
7786 0x00000024, 0x30315846, 0x00000536, 0xfeff1001, 0x00000001, 0x00000007, 0x00000000, 0x00000000,
7787 0x00000000, 0x00000000, 0x00000001, 0x0000030e, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7788 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
7789 0x736c6162, 0x6e697500, 0x000d0074, 0x00010000, 0x00000000, 0x00040000, 0x00100000, 0x00040000,
7790 0x09190000, 0x31690000, 0x00000d00, 0x00000100, 0x00000200, 0x00001400, 0x00001000, 0x00000800,
7791 0x00091900, 0x5f316900, 0x6c660061, 0x3474616f, 0x00005200, 0x00000100, 0x00000000, 0x00001000,
7792 0x00001000, 0x00001000, 0x00210a00, 0x31766600, 0x00000000, 0x19999a3f, 0x3333333f, 0x4ccccd3f,
7793 0x0000523f, 0x00000100, 0x00000200, 0x00002000, 0x00001000, 0x00002000, 0x00210a00, 0x31766600,
7794 0x0000615f, 0xcd3f8000, 0x9a3f8ccc, 0x663f9999, 0xcd3fa666, 0xcd3dcccc, 0x9a3e4ccc, 0xcd3e9999,
7795 0x693ecccc, 0xcb00746e, 0x01000000, 0x00000000, 0x04000000, 0x10000000, 0x04000000, 0x11000000,
7796 0x69000009, 0x01230032, 0x00cb0000, 0x00010000, 0x00020000, 0x00140000, 0x00100000, 0x00080000,
7797 0x09110000, 0x32690000, 0x0100615f, 0x02000000, 0x66000000, 0x74616f6c, 0x00011b00, 0x00000100,
7798 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900, 0x00316600, 0x3e99999a, 0x68636574,
7799 0x00305000, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0xa5003150,
7800 0x04000000, 0x0e000000, 0x04000001, 0x01000000, 0x02000000, 0x00000000, 0x4d000000, 0x04000000,
7801 0x01000000, 0x02000000, 0x00000000, 0x50000000, 0x01580032, 0x58440000, 0x4df04342, 0xad7a0608,
7802 0xb4963c34, 0xe74c5ab9, 0x000151a3, 0x01580000, 0x00030000, 0x002c0000, 0x00b40000, 0x00c00000,
7803 0x54430000, 0x00804241, 0x001c0000, 0x00570000, 0x04000000, 0x00014658, 0x001c0000, 0x01000000,
7804 0x00540000, 0x00300000, 0x00020000, 0x00010000, 0x00340000, 0x00440000, 0x31660000, 0x0000ab00,
7805 0x00010003, 0x00010001, 0x00000000, 0x999a0000, 0x00003e99, 0x00000000, 0x00000000, 0x78740000,
7806 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f,
7807 0x2072656c, 0x312e3031, 0x4c43ab00, 0x00043449, 0x00000000, 0x58460000, 0x0090434c, 0x00040000,
7808 0x00010000, 0x00011000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00040000, 0x00000000,
7809 0x00010000, 0x00011000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00040000, 0x00010000,
7810 0x00010000, 0x00011000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00040000, 0x00020000,
7811 0x00010000, 0x00011000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00040000, 0x00030000,
7812 0xf0f00000, 0x0f0ff0f0, 0xffff0f0f, 0x00010000, 0x00020000, 0x00000000, 0x00010000, 0x00020000,
7813 0x00000000, 0x00040000, 0x00900000, 0x00000000, 0x00070000, 0xffff0000, 0x0000ffff, 0x002e0000,
7814 0x00120000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x004d0000, 0x00310000,
7815 0x00000000, 0x00100000, 0x00000000, 0x00000000, 0x00000000, 0x00750000, 0x00590000, 0x00000000,
7816 0x00300000, 0x00790000, 0x00000000, 0x00000000, 0x00a50000, 0x00890000, 0x00000000, 0x00400000,
7817 0x00ab0000, 0x00000000, 0x00000000, 0x00eb0000, 0x00cf0000, 0x00000000, 0x00600000, 0x00ee0000,
7818 0x00000000, 0x00000000, 0x010e0000, 0x00f20000, 0x00000000, 0x00700000, 0x01130000, 0x00000000,
7819 0x00000000, 0x013d0000, 0x01210000, 0x00000000, 0x00840000, 0x01400000, 0x00000000, 0x00000000,
7820 0x01440000, 0x00030000, 0x00000000, 0x01490000, 0x00050000, 0x00000000, 0x000a0000, 0x00000000,
7821 0x00020000, 0x00750000, 0x000b0000, 0x00000000, 0x00020000, 0x00eb0000, 0x00020000, 0x00000000,
7822 0x00010000, 0x014c0000, 0x00090000, 0x00000000, 0x00020000, 0x002e0000, 0x00010000, 0x00000000,
7823 0x00010000, 0x01580000, 0x01640000, 0x00050000, 0x00000000, 0x000a0000, 0x00000000, 0x00030000,
7824 0x01670000, 0x000b0000, 0x00000000, 0x00030000, 0x016f0000, 0x00020000, 0x00000000, 0x00010000,
7825 0x01770000, 0x00090000, 0x00000000, 0x00030000, 0x01830000, 0x00010000, 0x00000000, 0x00010000,
7826 0x018b0000, 0x01970000, 0x00030000, 0x00000000, 0x000a0000, 0x00000000, 0x00060000, 0x019a0000,
7827 0x000b0000, 0x00000000, 0x00010000, 0x02f60000, 0x00020000, 0x00000000, 0x00010000, 0x03020000,
7831 static void test_effect_dynamic_numeric_field(void)
7833 ID3D10EffectScalarVariable
*scalar
;
7834 ID3D10DepthStencilState
*ds_state
;
7835 ID3D10BlendState
*blend_state
;
7836 UINT stencil_ref
, sample_mask
;
7837 ID3D10EffectTechnique
*tech
;
7838 D3D10_PASS_DESC pass_desc
;
7839 ID3D10EffectVariable
*v
;
7840 ID3D10EffectPass
*pass
;
7841 float blend_factor
[4];
7842 ID3D10Effect
*effect
;
7843 ID3D10Device
*device
;
7848 if (!(device
= create_device()))
7850 skip("Failed to create device, skipping tests.\n");
7854 hr
= create_effect(fx_test_effect_dynamic_numeric_field
, 0, device
, NULL
, &effect
);
7855 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7857 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
7858 ok(tech
->lpVtbl
->IsValid(tech
), "Expected valid technique.\n");
7861 pass
= tech
->lpVtbl
->GetPassByName(tech
, "P0");
7863 ID3D10Device_OMSetDepthStencilState(device
, NULL
, 0x1);
7864 memset(blend_factor
, 0, sizeof(blend_factor
));
7865 ID3D10Device_OMSetBlendState(device
, NULL
, blend_factor
, 0);
7866 hr
= pass
->lpVtbl
->Apply(pass
, 0);
7867 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7868 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
7869 ok(!stencil_ref
, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7870 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
7871 ok(blend_factor
[0] == 0.5f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
7872 ok(blend_factor
[1] == 0.6f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
7873 ok(blend_factor
[2] == 0.7f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
7874 ok(blend_factor
[3] == 0.8f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
7875 ok(sample_mask
== 0x123, "Unexpected sample mask %#x.\n", sample_mask
);
7877 v
= effect
->lpVtbl
->GetVariableByName(effect
, "i1");
7878 scalar
= v
->lpVtbl
->AsScalar(v
);
7879 hr
= scalar
->lpVtbl
->SetInt(scalar
, 2);
7880 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7882 hr
= pass
->lpVtbl
->Apply(pass
, 0);
7883 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7884 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
7885 ok(stencil_ref
== 0x2, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7887 hr
= scalar
->lpVtbl
->SetInt(scalar
, 3);
7888 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7889 hr
= pass
->lpVtbl
->GetDesc(pass
, &pass_desc
);
7890 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7891 ok(pass_desc
.StencilRef
== 0x3, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7892 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
7893 ok(stencil_ref
== 0x2, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7895 pass
= tech
->lpVtbl
->GetPassByName(tech
, "P1");
7897 v
= effect
->lpVtbl
->GetVariableByName(effect
, "i1_a");
7898 v
= v
->lpVtbl
->GetElement(v
, 1);
7899 scalar
= v
->lpVtbl
->AsScalar(v
);
7900 hr
= scalar
->lpVtbl
->SetInt(scalar
, 4);
7901 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7903 ID3D10Device_OMSetDepthStencilState(device
, NULL
, 0x1);
7904 memset(blend_factor
, 0, sizeof(blend_factor
));
7905 ID3D10Device_OMSetBlendState(device
, NULL
, blend_factor
, 0);
7906 hr
= pass
->lpVtbl
->Apply(pass
, 0);
7907 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7908 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
7909 ok(stencil_ref
== 0x4, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7910 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
7911 ok(blend_factor
[0] == 0.1f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
7912 ok(blend_factor
[1] == 0.2f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
7913 ok(blend_factor
[2] == 0.3f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
7914 ok(blend_factor
[3] == 0.4f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
7915 ok(sample_mask
== 0x2, "Unexpected sample mask %#x.\n", sample_mask
);
7917 pass
= tech
->lpVtbl
->GetPassByName(tech
, "P2");
7919 v
= effect
->lpVtbl
->GetVariableByName(effect
, "f1");
7920 scalar
= v
->lpVtbl
->AsScalar(v
);
7921 hr
= scalar
->lpVtbl
->SetFloat(scalar
, 0.123f
);
7922 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7924 memset(blend_factor
, 0, sizeof(blend_factor
));
7925 ID3D10Device_OMSetBlendState(device
, NULL
, blend_factor
, 0);
7926 hr
= pass
->lpVtbl
->Apply(pass
, 0);
7927 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
7928 ID3D10Device_OMGetDepthStencilState(device
, &ds_state
, &stencil_ref
);
7929 ok(stencil_ref
== 0x4, "Unexpected stencil ref value %#x.\n", stencil_ref
);
7930 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
7931 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
7932 ok(blend_factor
[idx
] == 0.123f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
7933 ok(!sample_mask
, "Unexpected sample mask %#x.\n", sample_mask
);
7935 effect
->lpVtbl
->Release(effect
);
7937 refcount
= ID3D10Device_Release(device
);
7938 ok(!refcount
, "Device has %lu references left.\n", refcount
);
7944 PixelShader ps_array
[2];
7945 VertexShader vs_array
[2];
7946 GeometryShader gs_array
[2];
7947 BlendState bs_array
[2]
7949 { BlendEnable
[0] = true; SrcBlend
= inv_src_color
; },
7950 { BlendEnable
[0] = true; SrcBlend
= src_color
; }
7956 SetBlendState( bs_array
[g_var
.w
], float4(0.0f
, 0.0f
, 0.0f
, 0.0f
), 0xffff );
7957 SetPixelShader( ps_array
[g_var
.z
] );
7958 SetVertexShader( vs_array
[g_var
.x
+ 0.1f
] );
7959 SetGeometryShader( gs_array
[g_var2
.y
] );
7963 static DWORD fx_test_index_expression
[] =
7965 0x43425844, 0x85cafff9, 0xf7f791b5, 0xfc973931, 0x1de9cde1, 0x00000001, 0x00000778, 0x00000001,
7966 0x00000024, 0x30315846, 0x0000074c, 0xfeff1001, 0x00000001, 0x00000002, 0x00000004, 0x00000000,
7967 0x00000000, 0x00000000, 0x00000001, 0x00000588, 0x00000000, 0x00000000, 0x00000000, 0x00000002,
7968 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006, 0x00000000, 0x00000000, 0x6f6c4724,
7969 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010,
7970 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x78695000, 0x68536c65, 0x72656461,
7971 0x00003d00, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000500, 0x5f737000,
7972 0x61727261, 0x65560079, 0x78657472, 0x64616853, 0x6e007265, 0x02000000, 0x02000000, 0x00000000,
7973 0x00000000, 0x00000000, 0x06000000, 0x76000000, 0x72615f73, 0x00796172, 0x6d6f6547, 0x79727465,
7974 0x64616853, 0xa0007265, 0x02000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x07000000,
7975 0x67000000, 0x72615f73, 0x00796172, 0x6e656c42, 0x61745364, 0xd4006574, 0x02000000, 0x02000000,
7976 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x62000000, 0x72615f73, 0x00796172, 0x00000001,
7977 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000004, 0x00000001, 0x00000004, 0x00000001,
7978 0x00000001, 0x00000002, 0x00000003, 0x68636574, 0x00307000, 0x00000004, 0x00000001, 0x00000000,
7979 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000003,
7980 0x0000ffff, 0x000000ec, 0x43425844, 0xc647666b, 0x92d327e5, 0x82d21ef6, 0xc31dc0cf, 0x00000001,
7981 0x000000ec, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c,
7982 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002,
7983 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001,
7984 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7985 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846,
7986 0x00000030, 0x00000001, 0x13300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000,
7987 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x000000fb, 0x0000016c, 0x000000ec,
7988 0x43425844, 0xe6990a97, 0x7ed17834, 0x9f40de47, 0x01f476a7, 0x00000001, 0x000000ec, 0x00000003,
7989 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400,
7990 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
7991 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
7992 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
7993 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000030, 0x00000001,
7994 0x13300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000000,
7995 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000065, 0x00000264, 0x00000128, 0x43425844, 0x7a78de2e,
7996 0xcd31414e, 0xb6f69158, 0x92416c97, 0x00000001, 0x00000128, 0x00000003, 0x0000002c, 0x000000a8,
7997 0x000000c4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c,
7998 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67,
7999 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8000 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8001 0x34494c43, 0x00000014, 0x00000004, 0x3dcccccd, 0x00000000, 0x00000000, 0x00000000, 0x434c5846,
8002 0x0000005c, 0x00000002, 0x20400001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8003 0x00000001, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13300001, 0x00000001, 0x00000000,
8004 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
8005 0x00000097, 0x0000035c, 0x000000ec, 0x43425844, 0x90e93368, 0x6c8d5166, 0x276e99ab, 0x25ccef44,
8006 0x00000001, 0x000000ec, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074,
8007 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030,
8008 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003272, 0x00030001, 0x00040001,
8009 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
8010 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000,
8011 0x434c5846, 0x00000030, 0x00000001, 0x13300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
8012 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x000000cb, 0x00000490,
8013 0x00000004, 0x00000020, 0x00000000, 0x00000002, 0xffffffff, 0x00000000, 0x00000030, 0x00000014,
8014 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000,
8015 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000065, 0x00000049, 0x00000000, 0xffffffff,
8016 0x00000000, 0x00000000, 0x00000000, 0x00000097, 0x0000007b, 0x00000000, 0xffffffff, 0x00000000,
8017 0x00000000, 0x00000000, 0x000000cb, 0x000000af, 0x00000000, 0xffffffff, 0x00000000, 0x00000000,
8018 0x00000000, 0x000000fb, 0x000000df, 0x00000000, 0xffffffff, 0x00000002, 0x00000025, 0x00000000,
8019 0x00000001, 0x00000104, 0x00000026, 0x00000000, 0x00000001, 0x00000110, 0x00000002, 0x00000025,
8020 0x00000000, 0x00000001, 0x0000011c, 0x00000026, 0x00000000, 0x00000001, 0x00000128, 0x00000000,
8021 0x00000134, 0x00000001, 0x00000000, 0x00000139, 0x00000006, 0x00000000, 0x0000000a, 0x00000000,
8022 0x00000001, 0x0000013c, 0x0000000b, 0x00000000, 0x00000001, 0x00000160, 0x00000002, 0x00000000,
8023 0x00000005, 0x0000025c, 0x00000007, 0x00000000, 0x00000005, 0x00000354, 0x00000006, 0x00000000,
8024 0x00000005, 0x00000488, 0x00000008, 0x00000000, 0x00000005, 0x00000580,
8027 static void test_effect_index_expression(void)
8029 D3D10_PASS_SHADER_DESC shader_desc
;
8030 ID3D10EffectVectorVariable
*vector
;
8031 ID3D10EffectTechnique
*tech
;
8032 D3D10_BLEND_DESC bs_desc
;
8033 ID3D10EffectVariable
*v
;
8034 ID3D10EffectPass
*pass
;
8035 ID3D10BlendState
*bs
;
8036 ID3D10Effect
*effect
;
8037 ID3D10Device
*device
;
8042 if (!(device
= create_device()))
8044 skip("Failed to create device, skipping tests.\n");
8048 hr
= create_effect(fx_test_index_expression
, 0, device
, NULL
, &effect
);
8049 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8052 tech
= effect
->lpVtbl
->GetTechniqueByIndex(effect
, 0);
8053 pass
= tech
->lpVtbl
->GetPassByIndex(tech
, 0);
8054 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8055 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8056 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index.\n");
8058 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var");
8059 vector
= v
->lpVtbl
->AsVector(v
);
8061 set_vec4(val
, 0.0f
, 0.0f
, 1.0f
, 0.0f
);
8062 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8063 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8065 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8066 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8067 ok(shader_desc
.ShaderIndex
== 1, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8069 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8070 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8071 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8072 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8073 ok(bs_desc
.SrcBlend
== D3D10_BLEND_INV_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8074 ID3D10BlendState_Release(bs
);
8076 set_vec4(val
, 0.0f
, 0.0f
, 1.0f
, 1.0f
);
8077 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8078 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8080 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8081 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8082 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8083 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8084 ok(bs_desc
.SrcBlend
== D3D10_BLEND_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8085 ID3D10BlendState_Release(bs
);
8087 /* Out of bounds index */
8088 set_vec4(val
, 0.0f
, 0.0f
, 2.0f
, 2.0f
);
8089 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8090 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8092 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8093 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8094 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8096 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8097 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8098 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8099 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8100 ok(bs_desc
.SrcBlend
== D3D10_BLEND_INV_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8101 ID3D10BlendState_Release(bs
);
8103 set_vec4(val
, 0.0f
, 0.0f
, 3.0f
, 3.0f
);
8104 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8105 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8107 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8108 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8109 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8111 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8112 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8113 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8114 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8115 ok(bs_desc
.SrcBlend
== D3D10_BLEND_INV_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8116 ID3D10BlendState_Release(bs
);
8118 set_vec4(val
, 0.0f
, 0.0f
, -1.0f
, -1.0f
);
8119 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8120 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8122 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8123 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8124 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8126 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8127 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8128 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8129 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8130 ok(bs_desc
.SrcBlend
== D3D10_BLEND_INV_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8131 ID3D10BlendState_Release(bs
);
8133 set_vec4(val
, 0.0f
, 0.0f
, -11.0f
, 0.0f
);
8134 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8135 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8137 hr
= pass
->lpVtbl
->GetPixelShaderDesc(pass
, &shader_desc
);
8138 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8139 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8141 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8142 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8143 ID3D10Device_OMGetBlendState(device
, &bs
, NULL
, NULL
);
8144 ID3D10BlendState_GetDesc(bs
, &bs_desc
);
8145 ok(bs_desc
.SrcBlend
== D3D10_BLEND_INV_SRC_COLOR
, "Unexpected blend state parameter %u.\n", bs_desc
.SrcBlend
);
8146 ID3D10BlendState_Release(bs
);
8148 hr
= pass
->lpVtbl
->GetVertexShaderDesc(pass
, &shader_desc
);
8149 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8150 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8152 set_vec4(val
, 0.9f
, 0.0f
, 1.0f
, 0.0f
);
8153 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8154 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8156 hr
= pass
->lpVtbl
->GetVertexShaderDesc(pass
, &shader_desc
);
8157 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8158 ok(shader_desc
.ShaderIndex
== 1, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8160 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var2");
8161 vector
= v
->lpVtbl
->AsVector(v
);
8163 hr
= pass
->lpVtbl
->GetGeometryShaderDesc(pass
, &shader_desc
);
8164 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8165 ok(!shader_desc
.ShaderIndex
, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8167 set_vec4(val
, 0.0f
, 1.0f
, 0.0f
, 0.0f
);
8168 hr
= vector
->lpVtbl
->SetFloatVector(vector
, val
);
8169 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8171 hr
= pass
->lpVtbl
->GetGeometryShaderDesc(pass
, &shader_desc
);
8172 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8173 ok(shader_desc
.ShaderIndex
== 1, "Unexpected shader index %#x.\n", shader_desc
.ShaderIndex
);
8175 effect
->lpVtbl
->Release(effect
);
8177 refcount
= ID3D10Device_Release(device
);
8178 ok(!refcount
, "Device has %lu references left.\n", refcount
);
8187 DepthStencilState ds_state
8189 StencilEnable
= g_var
.x
;
8196 SetBlendState( NULL
, -g_var
+ sin(g_var
.x
) + cos(g_var
.y
) + 0.1f
+ g_var2
* 2.1f
, 0 );
8200 SetBlendState( NULL
, g_var
.x
+ g_var2
+ g_var
.y
, 0 );
8204 SetBlendState( NULL
, min(g_var
.x
, g_var2
.x
) + max(g_var
.y
, g_var2
.y
) + min(g_var
, g_var2
) + max(g_var
, g_var2
), 0 );
8208 SetBlendState( NULL
, min(g_var
.x
, g_var2
), 0 );
8212 SetBlendState( NULL
, max(g_var
.x
, g_var2
), 0 );
8216 SetBlendState( NULL
, g_var
.x
/ g_var
, 0 );
8220 SetBlendState( NULL
, 1.0f
/ g_var
, 0 );
8224 SetBlendState( NULL
, frac(g_var
), 0 );
8228 SetBlendState( NULL
, 0.1 * -max(g_var3
.x
, g_var3
.y
), 0 );
8232 SetBlendState( NULL
, g_var4
.x
/ g_var4
.y
, 0 );
8236 SetBlendState( NULL
, g_var
.x
? g_var
.y
: g_var
.z
, 0 );
8240 SetBlendState( NULL
, min(g_var4
.x
, g_var4
.y
), 0 );
8244 SetBlendState( NULL
, max(g_var4
.x
, g_var4
.y
), 0 );
8248 SetBlendState( NULL
, min(g_var3
.x
, g_var3
.y
), 0 );
8252 SetBlendState( NULL
, g_var4
.x
+ g_var4
.y
, 0 );
8256 SetBlendState( NULL
, asin(g_var
.x
), 0 );
8260 SetBlendState( NULL
, acos(g_var
.x
), 0 );
8264 SetBlendState( NULL
, atan(g_var
.x
), 0 );
8268 SetBlendState( NULL
, atan2(g_var
.x
, g_var
.y
), 0 );
8272 SetBlendState( NULL
, g_var3
.x
/ g_var3
.y
, 0 );
8276 SetBlendState( NULL
, g_var3
.x
< g_var3
.y
? (g_var3
.x
>= g_var3
.z
? 0 : 1 ) :
8277 (g_var3
.x
!= g_var3
.z
? g_var3
.z
== g_var3
.w
: 2), 0 );
8281 SetBlendState( NULL
, g_var4
.x
>= g_var4
.y
? 0 : (g_var4
.y
< g_var4
.z
? 1 : 2), 0 );
8285 SetBlendState( NULL
, ceil(g_var
), 0 );
8289 SetBlendState( NULL
, floor(g_var
), 0 );
8293 SetBlendState( NULL
, dot(g_var
, g_var2
), 0 );
8297 SetBlendState( NULL
, dot(g_var
.xyz
, g_var2
.xyz
), 0 );
8301 SetBlendState( NULL
, dot(g_var
.zyxw
, g_var2
.yzwx
), 0 );
8305 SetBlendState( NULL
, dot(g_var
.zyx
, g_var2
.yzw
), 0 );
8309 SetBlendState( NULL
, g_var3
.x
* g_var3
.y
, 0 );
8313 SetBlendState( NULL
, sqrt(g_var
), 0 );
8317 SetBlendState( NULL
, rsqrt(g_var
), 0 );
8321 SetBlendState( NULL
, log(g_var
), 0 );
8325 SetBlendState( NULL
, exp(g_var
), 0 );
8329 SetBlendState( NULL
, ~g_var3
, 0 );
8333 SetBlendState( NULL
, g_var4
| g_var3
, 0 );
8337 SetBlendState( NULL
, float4(g_var3
.x
>> g_var3
.y
, g_var3
.z
<< g_var3
.w
, g_var4
.x
>> g_var4
.y
, 0), 0 );
8341 SetBlendState( NULL
, float4(log2(g_var
.x
), log10(g_var
.y
), exp2(g_var
.z
), 0.0), 0 );
8345 static DWORD fx_test_value_expression
[] =
8347 0x43425844, 0xf55b96f2, 0x76722813, 0x530fae3e, 0x4cd9c847, 0x00000001, 0x00004964, 0x00000001,
8348 0x00000024, 0x30315846, 0x00004938, 0xfeff1001, 0x00000001, 0x00000004, 0x00000001, 0x00000000,
8349 0x00000000, 0x00000000, 0x00000001, 0x00003f84, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
8350 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724,
8351 0x736c6162, 0x6f6c6600, 0x00347461, 0x0000000d, 0x00000001, 0x00000000, 0x00000010, 0x00000010,
8352 0x00000010, 0x0000210a, 0x61765f67, 0x5f670072, 0x32726176, 0x746e6900, 0x003d0034, 0x00010000,
8353 0x00000000, 0x00100000, 0x00100000, 0x00100000, 0x21120000, 0x5f670000, 0x33726176, 0x6e697500,
8354 0x65003474, 0x01000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x1a000000, 0x67000021,
8355 0x7261765f, 0x65440034, 0x53687470, 0x636e6574, 0x74536c69, 0x00657461, 0x0000008e, 0x00000002,
8356 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x735f7364, 0x65746174, 0x0000ec00,
8357 0x42584400, 0x12544043, 0xf05fca79, 0x55a99c90, 0xe16165fe, 0x00000145, 0x0000ec00, 0x00000300,
8358 0x00002c00, 0x0000a800, 0x0000b400, 0x41544300, 0x00007442, 0x00001c00, 0x00004b00, 0x58040000,
8359 0x00000146, 0x00001c00, 0x00010000, 0x00004800, 0x00003000, 0x00000200, 0x00000100, 0x00003800,
8360 0x00000000, 0x765f6700, 0xab007261, 0x030001ab, 0x04000100, 0x00000100, 0x00000000, 0x00787400,
8361 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d,
8362 0x31207265, 0x00312e30, 0x494c43ab, 0x00000434, 0x00000000, 0x4c584600, 0x00003043, 0x00000100,
8363 0x70000100, 0x00000113, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000400, 0x00000000,
8364 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f, 0x63657400, 0x30700068, 0x00024400, 0x42584400, 0xff104243,
8365 0xa078c06f, 0xb9d7d003, 0x421eb8c7, 0x0000014c, 0x00024400, 0x00000300, 0x00002c00, 0x0000d400,
8366 0x0000f000, 0x41544300, 0x0000a042, 0x00001c00, 0x00007700, 0x58040000, 0x00000246, 0x00001c00,
8367 0x00010000, 0x00007400, 0x00004400, 0x00000200, 0x00000100, 0x00004c00, 0x00000000, 0x00005c00,
8368 0x01000200, 0x00000100, 0x00006400, 0x00000000, 0x765f6700, 0xab007261, 0x030001ab, 0x04000100,
8369 0x00000100, 0x00000000, 0x765f6700, 0x00327261, 0x030001ab, 0x04000100, 0x00000100, 0x00000000,
8370 0x00787400, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072,
8371 0x6c69706d, 0x31207265, 0x00312e30, 0x494c43ab, 0x00001434, 0x00000400, 0xcccccd00, 0x0666663d,
8372 0x00000040, 0x00000000, 0x4c584600, 0x00014c43, 0x00000800, 0x10000400, 0x00000110, 0x00000000,
8373 0x00000200, 0x00000000, 0x00000000, 0x00000700, 0x00000000, 0x80000100, 0x00000110, 0x00000000,
8374 0x00000200, 0x00000000, 0x00000000, 0x00000700, 0x00000400, 0x40000400, 0x000002a0, 0x00000000,
8375 0x00000700, 0x00000400, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000700, 0x00000800,
8376 0x90000100, 0x00000110, 0x00000000, 0x00000200, 0x00000100, 0x00000000, 0x00000700, 0x00000000,
8377 0x40000400, 0x000002a0, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000700, 0x00000800,
8378 0x00000000, 0x00000700, 0x00000400, 0x40000400, 0x000002a0, 0x00000000, 0x00000100, 0x00000000,
8379 0x00000000, 0x00000700, 0x00000400, 0x00000000, 0x00000700, 0x00000000, 0x50000400, 0x000002a0,
8380 0x00000000, 0x00000100, 0x00000100, 0x00000000, 0x00000200, 0x00000400, 0x00000000, 0x00000700,
8381 0x00000400, 0x40000400, 0x00000220, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000700,
8382 0x00000400, 0x00000000, 0x00000400, 0x00000000, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f, 0x00000100,
8383 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00317000, 0x00000150, 0x43425844,
8384 0xc6a29e4c, 0x6292ed35, 0xd90bb8cb, 0x50dcd25f, 0x00000001, 0x00000150, 0x00000003, 0x0000002c,
8385 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0, 0x0000001c, 0x00000077, 0x46580400, 0x00000002,
8386 0x0000001c, 0x00000100, 0x00000074, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x00000000,
8387 0x0000005c, 0x00010002, 0x00000001, 0x00000064, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001,
8388 0x00040001, 0x00000001, 0x00000000, 0x61765f67, 0xab003272, 0x00030001, 0x00040001, 0x00000001,
8389 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
8390 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846,
8391 0x00000068, 0x00000002, 0xa0400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8392 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0400004, 0x00000002, 0x00000000,
8393 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
8394 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
8395 0x00000000, 0x2c003270, 0x44000002, 0x9e434258, 0xfae994e0, 0xb641b826, 0x0bac8f3a, 0x019d4eb7,
8396 0x2c000000, 0x03000002, 0x2c000000, 0xd4000000, 0xe0000000, 0x43000000, 0xa0424154, 0x1c000000,
8397 0x77000000, 0x00000000, 0x02465804, 0x1c000000, 0x00000000, 0x74000001, 0x44000000, 0x02000000,
8398 0x01000000, 0x4c000000, 0x00000000, 0x5c000000, 0x02000000, 0x01000100, 0x64000000, 0x00000000,
8399 0x67000000, 0x7261765f, 0x01abab00, 0x01000300, 0x01000400, 0x00000000, 0x67000000, 0x7261765f,
8400 0x01ab0032, 0x01000300, 0x01000400, 0x00000000, 0x74000000, 0x694d0078, 0x736f7263, 0x2074666f,
8401 0x20295228, 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120, 0x43ab0031,
8402 0x0434494c, 0x00000000, 0x46000000, 0x44434c58, 0x07000001, 0x01000000, 0x02200000, 0x00000000,
8403 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x04000000, 0x00000000, 0x07000000, 0x00000000,
8404 0x01000000, 0x02201000, 0x00000000, 0x02000000, 0x01000000, 0x00000000, 0x02000000, 0x05000000,
8405 0x00000000, 0x07000000, 0x01000000, 0x01000000, 0x02204000, 0x00000000, 0x07000000, 0x01000000,
8406 0x00000000, 0x07000000, 0x00000000, 0x00000000, 0x07000000, 0x04000000, 0x04000000, 0x02200000,
8407 0x00000000, 0x02000000, 0x00000000, 0x00000000, 0x02000000, 0x04000000, 0x00000000, 0x07000000,
8408 0x00000000, 0x04000000, 0x02a04000, 0x00000000, 0x07000000, 0x04000000, 0x00000000, 0x07000000,
8409 0x00000000, 0x00000000, 0x07000000, 0x08000000, 0x04000000, 0x02201000, 0x00000000, 0x02000000,
8410 0x00000000, 0x00000000, 0x02000000, 0x04000000, 0x00000000, 0x07000000, 0x00000000, 0x04000000,
8411 0x02204000, 0x00000000, 0x07000000, 0x00000000, 0x00000000, 0x07000000, 0x08000000, 0x00000000,
8412 0x04000000, 0x00000000, 0xf0000000, 0x0ff0f0f0, 0xff0f0f0f, 0x010000ff, 0x02000000, 0x00000000,
8413 0x01000000, 0x02000000, 0x00000000, 0x70000000, 0x01240033, 0x58440000, 0xf4c54342, 0x070658ce,
8414 0xcabd2023, 0x24d22fca, 0x00010f0c, 0x01240000, 0x00030000, 0x002c0000, 0x00d40000, 0x00e00000,
8415 0x54430000, 0x00a04241, 0x001c0000, 0x00770000, 0x04000000, 0x00024658, 0x001c0000, 0x01000000,
8416 0x00740000, 0x00440000, 0x00020000, 0x00010000, 0x004c0000, 0x00000000, 0x005c0000, 0x00020000,
8417 0x00010001, 0x00640000, 0x00000000, 0x5f670000, 0x00726176, 0x0001abab, 0x00010003, 0x00010004,
8418 0x00000000, 0x5f670000, 0x32726176, 0x0001ab00, 0x00010003, 0x00010004, 0x00000000, 0x78740000,
8419 0x63694d00, 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f,
8420 0x2072656c, 0x312e3031, 0x4c43ab00, 0x00043449, 0x00000000, 0x58460000, 0x003c434c, 0x00010000,
8421 0x00040000, 0x0002a000, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00020000, 0x00040000,
8422 0x00000000, 0x00040000, 0x00000000, 0xf0f00000, 0x0f0ff0f0, 0xffff0f0f, 0x00010000, 0x00020000,
8423 0x00000000, 0x00010000, 0x00020000, 0x00000000, 0x34700000, 0x00012400, 0x42584400, 0xc902bb43,
8424 0xafcba635, 0xa383ff89, 0xed53a9f6, 0x000001f8, 0x00012400, 0x00000300, 0x00002c00, 0x0000d400,
8425 0x0000e000, 0x41544300, 0x0000a042, 0x00001c00, 0x00007700, 0x58040000, 0x00000246, 0x00001c00,
8426 0x00010000, 0x00007400, 0x00004400, 0x00000200, 0x00000100, 0x00004c00, 0x00000000, 0x00005c00,
8427 0x01000200, 0x00000100, 0x00006400, 0x00000000, 0x765f6700, 0xab007261, 0x030001ab, 0x04000100,
8428 0x00000100, 0x00000000, 0x765f6700, 0x00327261, 0x030001ab, 0x04000100, 0x00000100, 0x00000000,
8429 0x00787400, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072,
8430 0x6c69706d, 0x31207265, 0x00312e30, 0x494c43ab, 0x00000434, 0x00000000, 0x4c584600, 0x00003c43,
8431 0x00000100, 0x10000400, 0x000002a0, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000200,
8432 0x00000400, 0x00000000, 0x00000400, 0x00000000, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f, 0x00000100,
8433 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00357000, 0x000000f8, 0x43425844,
8434 0xf74bf893, 0x3d094d0b, 0xf013f99e, 0x99d86fff, 0x00000001, 0x000000f8, 0x00000003, 0x0000002c,
8435 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001,
8436 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000,
8437 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
8438 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
8439 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x0000003c, 0x00000001, 0xa0800004,
8440 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8441 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000,
8442 0x00000001, 0x00000002, 0x00000000, 0x4c003670, 0x44000001, 0x0f434258, 0xd38746b5, 0x34bf74fe,
8443 0x9d061641, 0x01dbbd02, 0x4c000000, 0x03000001, 0x2c000000, 0xa8000000, 0xb4000000, 0x43000000,
8444 0x74424154, 0x1c000000, 0x4b000000, 0x00000000, 0x01465804, 0x1c000000, 0x00000000, 0x48000001,
8445 0x30000000, 0x02000000, 0x01000000, 0x38000000, 0x00000000, 0x67000000, 0x7261765f, 0x01abab00,
8446 0x01000300, 0x01000400, 0x00000000, 0x74000000, 0x694d0078, 0x736f7263, 0x2074666f, 0x20295228,
8447 0x4c534c48, 0x61685320, 0x20726564, 0x706d6f43, 0x72656c69, 0x2e303120, 0x43ab0031, 0x0434494c,
8448 0x00000000, 0x46000000, 0x90434c58, 0x04000000, 0x01000000, 0x01103000, 0x00000000, 0x02000000,
8449 0x00000000, 0x00000000, 0x04000000, 0x00000000, 0x01000000, 0x01103000, 0x00000000, 0x02000000,
8450 0x01000000, 0x00000000, 0x04000000, 0x01000000, 0x01000000, 0x01103000, 0x00000000, 0x02000000,
8451 0x02000000, 0x00000000, 0x04000000, 0x02000000, 0x01000000, 0x01103000, 0x00000000, 0x02000000,
8452 0x03000000, 0x00000000, 0x04000000, 0x03000000, 0xf0000000, 0x0ff0f0f0, 0xff0f0f0f, 0x010000ff,
8453 0x02000000, 0x00000000, 0x01000000, 0x02000000, 0x00000000, 0x70000000, 0x00ec0037, 0x58440000,
8454 0xaa424342, 0x4a779667, 0x419ccee2, 0x743a2086, 0x0001e1df, 0x00ec0000, 0x00030000, 0x002c0000,
8455 0x00a80000, 0x00b40000, 0x54430000, 0x00744241, 0x001c0000, 0x004b0000, 0x04000000, 0x00014658,
8456 0x001c0000, 0x01000000, 0x00480000, 0x00300000, 0x00020000, 0x00010000, 0x00380000, 0x00000000,
8457 0x5f670000, 0x00726176, 0x0001abab, 0x00010003, 0x00010004, 0x00000000, 0x78740000, 0x63694d00,
8458 0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c,
8459 0x312e3031, 0x4c43ab00, 0x00043449, 0x00000000, 0x58460000, 0x0030434c, 0x00010000, 0x00040000,
8460 0x00011040, 0x00000000, 0x00020000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0xf0f00000,
8461 0x0f0ff0f0, 0xffff0f0f, 0x00010000, 0x00020000, 0x00000000, 0x00010000, 0x00020000, 0x00000000,
8462 0x38700000, 0x0001f800, 0x42584400, 0x6df99043, 0xe623cb12, 0xb7d81780, 0x4894a558, 0x000001ba,
8463 0x0001f800, 0x00000300, 0x00002c00, 0x0000a800, 0x0000c400, 0x41544300, 0x00007442, 0x00001c00,
8464 0x00004b00, 0x58040000, 0x00000146, 0x00001c00, 0x00010000, 0x00004800, 0x00003000, 0x00000200,
8465 0x00000100, 0x00003800, 0x00000000, 0x765f6700, 0x00337261, 0x020001ab, 0x04000100, 0x00000100,
8466 0x00000000, 0x00787400, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168,
8467 0x6f432072, 0x6c69706d, 0x31207265, 0x00312e30, 0x494c43ab, 0x00001434, 0x00000400, 0xcccccd00,
8468 0x0000003d, 0x00000000, 0x00000000, 0x4c584600, 0x00012c43, 0x00000700, 0xe0000100, 0x00000221,
8469 0x00000000, 0x00000200, 0x00000100, 0x00000000, 0x00000200, 0x00000000, 0x00000000, 0x00000700,
8470 0x00000000, 0x00000100, 0x00000112, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000700,
8471 0x00000400, 0x00000100, 0x00000113, 0x00000000, 0x00000700, 0x00000400, 0x00000000, 0x00000700,
8472 0x00000000, 0x50000100, 0x00000220, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000100,
8473 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0x50000100, 0x00000220, 0x00000000, 0x00000700,
8474 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000400, 0x00000100, 0x50000100,
8475 0x00000220, 0x00000000, 0x00000700, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
8476 0x00000400, 0x00000200, 0x50000100, 0x00000220, 0x00000000, 0x00000700, 0x00000000, 0x00000000,
8477 0x00000100, 0x00000000, 0x00000000, 0x00000400, 0x00000300, 0xf0f0f000, 0x0f0f0ff0, 0x00ffff0f,
8478 0x00000100, 0x00000200, 0x00000000, 0x00000100, 0x00000200, 0x00000000, 0x00397000, 0x00000178,
8479 0x43425844, 0x453449ff, 0x2e103a44, 0x8883c1ca, 0x78e0dcb1, 0x00000001, 0x00000178, 0x00000003,
8480 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400,
8481 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
8482 0x00000000, 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
8483 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
8484 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005,
8485 0x21a00001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
8486 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8487 0x00000000, 0x00000004, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8488 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8489 0x00000000, 0x00000004, 0x00000002, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8490 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002,
8491 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00303170, 0x000001cc, 0x43425844, 0x18677c9b,
8492 0xf5e472af, 0x9ba288a2, 0xcca43bb2, 0x00000001, 0x000001cc, 0x00000003, 0x0000002c, 0x000000a8,
8493 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c,
8494 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67,
8495 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8496 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8497 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000110, 0x00000005, 0x13700001, 0x00000001,
8498 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003,
8499 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
8500 0x00000002, 0x00000000, 0x00000004, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007,
8501 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
8502 0x00000004, 0x00000001, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8503 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002,
8504 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
8505 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
8506 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00313170,
8507 0x00000178, 0x43425844, 0xb2dec0d7, 0x6d936ace, 0x1e31a035, 0x7de038f5, 0x00000001, 0x00000178,
8508 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b,
8509 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001,
8510 0x00000038, 0x00000000, 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
8511 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
8512 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc,
8513 0x00000005, 0x21f00001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
8514 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007,
8515 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007,
8516 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007,
8517 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 0x00000001, 0x00000000, 0x00000007,
8518 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001,
8519 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00323170, 0x00000178, 0x43425844,
8520 0x0334f480, 0xa1c4caca, 0x9e1735e8, 0x1d8a5fb0, 0x00000001, 0x00000178, 0x00000003, 0x0000002c,
8521 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001,
8522 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000,
8523 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
8524 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
8525 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005, 0x22000001,
8526 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8527 0x00000007, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8528 0x00000004, 0x00000000, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8529 0x00000004, 0x00000001, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8530 0x00000004, 0x00000002, 0x13100001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8531 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000,
8532 0x00000001, 0x00000002, 0x00000000, 0x00333170, 0x00000178, 0x43425844, 0x98cbead4, 0xa96cee69,
8533 0xfa67fbf6, 0x10832177, 0x00000001, 0x00000178, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4,
8534 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100,
8535 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003372,
8536 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
8537 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43,
8538 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005, 0x21d00001, 0x00000002, 0x00000000,
8539 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000,
8540 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
8541 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
8542 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002,
8543 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
8544 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
8545 0x00000000, 0x00343170, 0x00000178, 0x43425844, 0xd7c8865b, 0xe0b95177, 0xcad7d001, 0x106ac5ac,
8546 0x00000001, 0x00000178, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074,
8547 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030,
8548 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003472, 0x00020001, 0x00040001,
8549 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
8550 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000,
8551 0x434c5846, 0x000000bc, 0x00000005, 0x21600001, 0x00000002, 0x00000000, 0x00000002, 0x00000001,
8552 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001,
8553 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x13100001, 0x00000001,
8554 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x13100001, 0x00000001,
8555 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x13100001, 0x00000001,
8556 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
8557 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00353170,
8558 0x0000014c, 0x43425844, 0x858202fa, 0x6eea0ef1, 0x035697d7, 0x8937d809, 0x00000001, 0x0000014c,
8559 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b,
8560 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001,
8561 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
8562 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
8563 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000090,
8564 0x00000004, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
8565 0x00000000, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
8566 0x00000001, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
8567 0x00000002, 0x10a00001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
8568 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001,
8569 0x00000002, 0x00000000, 0x00363170, 0x0000014c, 0x43425844, 0x27003e76, 0x45cf2121, 0x9b3336ae,
8570 0xca07856b, 0x00000001, 0x0000014c, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443,
8571 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048,
8572 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001,
8573 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
8574 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004,
8575 0x00000000, 0x434c5846, 0x00000090, 0x00000004, 0x10b00001, 0x00000001, 0x00000000, 0x00000002,
8576 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10b00001, 0x00000001, 0x00000000, 0x00000002,
8577 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10b00001, 0x00000001, 0x00000000, 0x00000002,
8578 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10b00001, 0x00000001, 0x00000000, 0x00000002,
8579 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001,
8580 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00373170, 0x0000014c, 0x43425844,
8581 0x7a9aaef0, 0xcc3049d9, 0x1c45c020, 0xa01af792, 0x00000001, 0x0000014c, 0x00000003, 0x0000002c,
8582 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001,
8583 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000,
8584 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
8585 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
8586 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000090, 0x00000004, 0x10c00001,
8587 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10c00001,
8588 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10c00001,
8589 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10c00001,
8590 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
8591 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
8592 0x00383170, 0x0000017c, 0x43425844, 0xb9755ca9, 0x574af4c2, 0x92daa707, 0xdab0053b, 0x00000001,
8593 0x0000017c, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c,
8594 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002,
8595 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001,
8596 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
8597 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846,
8598 0x000000c0, 0x00000004, 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8599 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000000, 0x20600001, 0x00000002, 0x00000000,
8600 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001,
8601 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
8602 0x00000000, 0x00000004, 0x00000002, 0x20600001, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
8603 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
8604 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00393170,
8605 0x000002d0, 0x43425844, 0xca0a64ed, 0x1e48bebb, 0x50b61480, 0x81af66f1, 0x00000001, 0x000002d0,
8606 0x00000003, 0x0000002c, 0x000000a8, 0x000000c4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b,
8607 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001,
8608 0x00000038, 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
8609 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
8610 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000014, 0x00000004, 0x80000000, 0x00000000,
8611 0x00000000, 0x00000000, 0x434c5846, 0x00000204, 0x0000000d, 0x12000001, 0x00000001, 0x00000000,
8612 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x21e00001, 0x00000002, 0x00000000,
8613 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
8614 0x12000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8615 0x21e00001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
8616 0x00000000, 0x00000007, 0x00000005, 0x21a00001, 0x00000002, 0x00000000, 0x00000007, 0x00000004,
8617 0x00000000, 0x00000007, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0x12000001, 0x00000001,
8618 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x23300001, 0x00000002,
8619 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007,
8620 0x00000001, 0x23000001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000001,
8621 0x00000000, 0x00000000, 0x00000007, 0x00000005, 0x30100001, 0x00000003, 0x00000000, 0x00000007,
8622 0x00000005, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8623 0x00000007, 0x00000008, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000,
8624 0x00000004, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000,
8625 0x00000004, 0x00000001, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000,
8626 0x00000004, 0x00000002, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000,
8627 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000,
8628 0x00000001, 0x00000002, 0x00000000, 0x00303270, 0x000002e0, 0x43425844, 0x561ee53c, 0x9807d928,
8629 0x8a3e8c4e, 0x78f7bcb7, 0x00000001, 0x000002e0, 0x00000003, 0x0000002c, 0x000000a8, 0x000000c4,
8630 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100,
8631 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003372,
8632 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
8633 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43,
8634 0x00000014, 0x00000004, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x434c5846, 0x00000214,
8635 0x0000000c, 0x21200001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000002,
8636 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x23000001, 0x00000002, 0x00000000, 0x00000007,
8637 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000007, 0x00000004, 0x21300001,
8638 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8639 0x00000007, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
8640 0x00000007, 0x00000004, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000007, 0x00000008,
8641 0x21100001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000002,
8642 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000,
8643 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000007,
8644 0x00000004, 0x21000001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
8645 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007,
8646 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, 0x00000000,
8647 0x00000007, 0x0000000c, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x0000000c, 0x00000000,
8648 0x00000004, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x0000000c, 0x00000000,
8649 0x00000004, 0x00000001, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x0000000c, 0x00000000,
8650 0x00000004, 0x00000002, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x0000000c, 0x00000000,
8651 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000,
8652 0x00000001, 0x00000002, 0x00000000, 0x00313270, 0x0000024c, 0x43425844, 0x2c53dbe2, 0x46a9f629,
8653 0xb72e1a1a, 0xf1302ff3, 0x00000001, 0x0000024c, 0x00000003, 0x0000002c, 0x000000a8, 0x000000c4,
8654 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100,
8655 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xab003472,
8656 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
8657 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43,
8658 0x00000014, 0x00000004, 0x3f800000, 0x40000000, 0x00000000, 0x00000000, 0x434c5846, 0x00000180,
8659 0x00000007, 0x21500001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
8660 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007,
8661 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000,
8662 0x00000007, 0x00000004, 0x21400001, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8663 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x30100001, 0x00000003, 0x00000000,
8664 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000007, 0x00000004,
8665 0x00000000, 0x00000004, 0x00000000, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000,
8666 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004,
8667 0x00000001, 0x30100001, 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001,
8668 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000002, 0x30100001,
8669 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000000,
8670 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
8671 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00323270, 0x000000ec,
8672 0x43425844, 0xc95f99d5, 0x429f3bc7, 0xe63b88c0, 0x6af83630, 0x00000001, 0x000000ec, 0x00000003,
8673 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400,
8674 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
8675 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
8676 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
8677 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000030, 0x00000001,
8678 0x13a00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
8679 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
8680 0x00000000, 0x00333270, 0x000000ec, 0x43425844, 0x522b9c04, 0xb45214ce, 0x80b49b27, 0x3c625e1f,
8681 0x00000001, 0x000000ec, 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074,
8682 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030,
8683 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001,
8684 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
8685 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000,
8686 0x434c5846, 0x00000030, 0x00000001, 0x13900004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
8687 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002,
8688 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00343270, 0x000001a4, 0x43425844, 0x2d57898e,
8689 0xcbaa523b, 0xa6a27e6f, 0xb91c2543, 0x00000001, 0x000001a4, 0x00000003, 0x0000002c, 0x000000d4,
8690 0x000000e0, 0x42415443, 0x000000a0, 0x0000001c, 0x00000077, 0x46580400, 0x00000002, 0x0000001c,
8691 0x00000100, 0x00000074, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x00000000, 0x0000005c,
8692 0x00010002, 0x00000001, 0x00000064, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001,
8693 0x00000001, 0x00000000, 0x61765f67, 0xab003272, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
8694 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
8695 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc,
8696 0x00000005, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
8697 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000007,
8698 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000007,
8699 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000007,
8700 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000007,
8701 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001,
8702 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00353270, 0x000001a4, 0x43425844,
8703 0x290c4bc4, 0x2befa5b6, 0x3846720d, 0x91ce4617, 0x00000001, 0x000001a4, 0x00000003, 0x0000002c,
8704 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0, 0x0000001c, 0x00000077, 0x46580400, 0x00000002,
8705 0x0000001c, 0x00000100, 0x00000074, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x00000000,
8706 0x0000005c, 0x00010002, 0x00000001, 0x00000064, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001,
8707 0x00040001, 0x00000001, 0x00000000, 0x61765f67, 0xab003272, 0x00030001, 0x00040001, 0x00000001,
8708 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
8709 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846,
8710 0x000000bc, 0x00000005, 0x50000003, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
8711 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
8712 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
8713 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
8714 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001, 0x00000000,
8715 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
8716 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00363270, 0x000001ec,
8717 0x43425844, 0xd1c3fbc0, 0xc234ebce, 0x0829e8d7, 0x81c3fc5c, 0x00000001, 0x000001ec, 0x00000003,
8718 0x0000002c, 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0, 0x0000001c, 0x00000077, 0x46580400,
8719 0x00000002, 0x0000001c, 0x00000100, 0x00000074, 0x00000044, 0x00000002, 0x00000001, 0x0000004c,
8720 0x00000000, 0x0000005c, 0x00010002, 0x00000001, 0x00000064, 0x00000000, 0x61765f67, 0xabab0072,
8721 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x61765f67, 0xab003272, 0x00030001, 0x00040001,
8722 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
8723 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000,
8724 0x434c5846, 0x00000104, 0x00000005, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000003,
8725 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
8726 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000,
8727 0x00000002, 0x00000006, 0x00000000, 0x00000002, 0x00000007, 0x00000000, 0x00000007, 0x00000000,
8728 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
8729 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
8730 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002,
8731 0x10000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
8732 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
8733 0x00000000, 0x00373270, 0x000001d4, 0x43425844, 0x8d6a0e48, 0x9e27e0a9, 0x0f3eba37, 0x93932040,
8734 0x00000001, 0x000001d4, 0x00000003, 0x0000002c, 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0,
8735 0x0000001c, 0x00000077, 0x46580400, 0x00000002, 0x0000001c, 0x00000100, 0x00000074, 0x00000044,
8736 0x00000002, 0x00000001, 0x0000004c, 0x00000000, 0x0000005c, 0x00010002, 0x00000001, 0x00000064,
8737 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x61765f67,
8738 0xab003272, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8739 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8740 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000ec, 0x00000005, 0x70e00001, 0x00000006,
8741 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
8742 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
8743 0x00000002, 0x00000007, 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
8744 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000001, 0x00000001, 0x00000000,
8745 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
8746 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001, 0x00000000,
8747 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
8748 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00383270, 0x00000178,
8749 0x43425844, 0x40465071, 0x33ca1cb9, 0x8d1d7192, 0xedd86abd, 0x00000001, 0x00000178, 0x00000003,
8750 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400,
8751 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
8752 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
8753 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
8754 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005,
8755 0x21900001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
8756 0x00000000, 0x00000007, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8757 0x00000000, 0x00000004, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8758 0x00000000, 0x00000004, 0x00000001, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8759 0x00000000, 0x00000004, 0x00000002, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
8760 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002,
8761 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00393270, 0x000000ec, 0x43425844, 0xc5784377,
8762 0x16c9ce18, 0x67a07021, 0xb9eaebe9, 0x00000001, 0x000000ec, 0x00000003, 0x0000002c, 0x000000a8,
8763 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c,
8764 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67,
8765 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8766 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8767 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000030, 0x00000001, 0x11200004, 0x00000001,
8768 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
8769 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00303370,
8770 0x0000014c, 0x43425844, 0x36d77f1e, 0xfb12f04e, 0x9c616c93, 0x0ab9004d, 0x00000001, 0x0000014c,
8771 0x00000003, 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b,
8772 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001,
8773 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
8774 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
8775 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000090,
8776 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
8777 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
8778 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
8779 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
8780 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001,
8781 0x00000002, 0x00000000, 0x00313370, 0x00000188, 0x43425844, 0xdadb15b4, 0x2d2e9c74, 0x5c105708,
8782 0x9218f7c5, 0x00000001, 0x00000188, 0x00000003, 0x0000002c, 0x000000a8, 0x000000c4, 0x42415443,
8783 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c, 0x00000100, 0x00000048,
8784 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67, 0xabab0072, 0x00030001,
8785 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
8786 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x34494c43, 0x00000014,
8787 0x00000004, 0x3f317218, 0x00000000, 0x00000000, 0x00000000, 0x434c5846, 0x000000bc, 0x00000005,
8788 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000,
8789 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001,
8790 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002,
8791 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003,
8792 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000007, 0x00000000,
8793 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002,
8794 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00323370, 0x00000188, 0x43425844, 0xcc3b2c7b,
8795 0x0ab3141b, 0xea88d5b8, 0x99b314cc, 0x00000001, 0x00000188, 0x00000003, 0x0000002c, 0x000000a8,
8796 0x000000c4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001, 0x0000001c,
8797 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000, 0x61765f67,
8798 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8799 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8800 0x34494c43, 0x00000014, 0x00000004, 0x3fb8aa3b, 0x00000000, 0x00000000, 0x00000000, 0x434c5846,
8801 0x000000bc, 0x00000005, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
8802 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10500001, 0x00000001, 0x00000000,
8803 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10500001, 0x00000001, 0x00000000,
8804 0x00000007, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10500001, 0x00000001, 0x00000000,
8805 0x00000007, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10500001, 0x00000001, 0x00000000,
8806 0x00000007, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
8807 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00333370, 0x0000010c,
8808 0x43425844, 0x13228b05, 0x212f3cde, 0x9538c252, 0xedacc5f2, 0x00000001, 0x0000010c, 0x00000003,
8809 0x0000002c, 0x000000a8, 0x000000b4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400,
8810 0x00000001, 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
8811 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
8812 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
8813 0x30312072, 0xab00312e, 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x00000050, 0x00000002,
8814 0x12100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000,
8815 0x13000004, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
8816 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002,
8817 0x00000000, 0x00343370, 0x00000144, 0x43425844, 0x74c24633, 0x7c8b5796, 0x94f5cf48, 0x026f6022,
8818 0x00000001, 0x00000144, 0x00000003, 0x0000002c, 0x000000d4, 0x000000e0, 0x42415443, 0x000000a0,
8819 0x0000001c, 0x00000077, 0x46580400, 0x00000002, 0x0000001c, 0x00000100, 0x00000074, 0x00000044,
8820 0x00000002, 0x00000001, 0x0000004c, 0x00000000, 0x0000005c, 0x00010002, 0x00000001, 0x00000064,
8821 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x61765f67,
8822 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
8823 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e,
8824 0x34494c43, 0x00000004, 0x00000000, 0x434c5846, 0x0000005c, 0x00000002, 0x23100004, 0x00000002,
8825 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
8826 0x00000000, 0x13100004, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
8827 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001,
8828 0x00000002, 0x00000000, 0x00353370, 0x0000020c, 0x43425844, 0xbc818fd3, 0x08f516ed, 0x45b19da0,
8829 0x6741e36e, 0x00000001, 0x0000020c, 0x00000003, 0x0000002c, 0x000000d4, 0x000000f0, 0x42415443,
8830 0x000000a0, 0x0000001c, 0x00000077, 0x46580400, 0x00000002, 0x0000001c, 0x00000100, 0x00000074,
8831 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x00000000, 0x0000005c, 0x00010002, 0x00000001,
8832 0x00000064, 0x00000000, 0x61765f67, 0xab003372, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
8833 0x61765f67, 0xab003472, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
8834 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
8835 0xab00312e, 0x34494c43, 0x00000014, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
8836 0x434c5846, 0x00000114, 0x00000007, 0x23600001, 0x00000002, 0x00000000, 0x00000002, 0x00000004,
8837 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0x13100001, 0x00000001,
8838 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x23500001, 0x00000002,
8839 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007,
8840 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
8841 0x00000000, 0x23400001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002,
8842 0x00000003, 0x00000000, 0x00000007, 0x00000000, 0x13000001, 0x00000001, 0x00000000, 0x00000007,
8843 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000001,
8844 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000001,
8845 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00363370, 0x00000188, 0x43425844,
8846 0x0fa50e48, 0x77568ea3, 0x5a5f1569, 0x9a0b8508, 0x00000001, 0x00000188, 0x00000003, 0x0000002c,
8847 0x000000a8, 0x000000c4, 0x42415443, 0x00000074, 0x0000001c, 0x0000004b, 0x46580400, 0x00000001,
8848 0x0000001c, 0x00000100, 0x00000048, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000000,
8849 0x61765f67, 0xabab0072, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
8850 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x30312072,
8851 0xab00312e, 0x34494c43, 0x00000014, 0x00000004, 0x3e9a209b, 0x00000000, 0x00000000, 0x00000000,
8852 0x434c5846, 0x000000bc, 0x00000005, 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
8853 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
8854 0x00000000, 0x00000007, 0x00000000, 0x20500001, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
8855 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x10500001, 0x00000001,
8856 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001,
8857 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
8858 0x0000ffff, 0x00000001, 0x00000002, 0x00000000, 0x00000001, 0x00000002, 0x00000000, 0x00000004,
8859 0x00000040, 0x00000000, 0x00000004, 0xffffffff, 0x00000000, 0x00000030, 0x00000014, 0x00000000,
8860 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000036, 0x00000014, 0x00000000, 0x00000010,
8861 0x00000000, 0x00000000, 0x00000000, 0x0000005e, 0x00000042, 0x00000000, 0x00000020, 0x00000000,
8862 0x00000000, 0x00000000, 0x00000087, 0x0000006b, 0x00000000, 0x00000030, 0x00000000, 0x00000000,
8863 0x00000000, 0x000000bc, 0x000000a0, 0x00000000, 0xffffffff, 0x00000001, 0x00000019, 0x00000000,
8864 0x00000006, 0x000000c5, 0x00000000, 0x000001b5, 0x00000025, 0x00000000, 0x000001ba, 0x00000003,
8865 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000001bd, 0x0000000b, 0x00000000, 0x00000001,
8866 0x00000405, 0x00000002, 0x00000000, 0x00000001, 0x00000411, 0x0000041d, 0x00000003, 0x00000000,
8867 0x0000000a, 0x00000000, 0x00000006, 0x00000420, 0x0000000b, 0x00000000, 0x00000001, 0x00000574,
8868 0x00000002, 0x00000000, 0x00000001, 0x00000580, 0x0000058c, 0x00000003, 0x00000000, 0x0000000a,
8869 0x00000000, 0x00000006, 0x0000058f, 0x0000000b, 0x00000000, 0x00000001, 0x000007bf, 0x00000002,
8870 0x00000000, 0x00000001, 0x000007cb, 0x000007d7, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
8871 0x00000006, 0x000007da, 0x0000000b, 0x00000000, 0x00000001, 0x00000902, 0x00000002, 0x00000000,
8872 0x00000001, 0x0000090e, 0x0000091a, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
8873 0x0000091d, 0x0000000b, 0x00000000, 0x00000001, 0x00000a45, 0x00000002, 0x00000000, 0x00000001,
8874 0x00000a51, 0x00000a5d, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000a60,
8875 0x0000000b, 0x00000000, 0x00000001, 0x00000b5c, 0x00000002, 0x00000000, 0x00000001, 0x00000b68,
8876 0x00000b74, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000b77, 0x0000000b,
8877 0x00000000, 0x00000001, 0x00000cc7, 0x00000002, 0x00000000, 0x00000001, 0x00000cd3, 0x00000cdf,
8878 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ce2, 0x0000000b, 0x00000000,
8879 0x00000001, 0x00000dd2, 0x00000002, 0x00000000, 0x00000001, 0x00000dde, 0x00000dea, 0x00000003,
8880 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00000ded, 0x0000000b, 0x00000000, 0x00000001,
8881 0x00000fe9, 0x00000002, 0x00000000, 0x00000001, 0x00000ff5, 0x00001001, 0x00000003, 0x00000000,
8882 0x0000000a, 0x00000000, 0x00000006, 0x00001004, 0x0000000b, 0x00000000, 0x00000001, 0x00001180,
8883 0x00000002, 0x00000000, 0x00000001, 0x0000118c, 0x00001198, 0x00000003, 0x00000000, 0x0000000a,
8884 0x00000000, 0x00000006, 0x0000119c, 0x0000000b, 0x00000000, 0x00000001, 0x0000136c, 0x00000002,
8885 0x00000000, 0x00000001, 0x00001378, 0x00001384, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
8886 0x00000006, 0x00001388, 0x0000000b, 0x00000000, 0x00000001, 0x00001504, 0x00000002, 0x00000000,
8887 0x00000001, 0x00001510, 0x0000151c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
8888 0x00001520, 0x0000000b, 0x00000000, 0x00000001, 0x0000169c, 0x00000002, 0x00000000, 0x00000001,
8889 0x000016a8, 0x000016b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000016b8,
8890 0x0000000b, 0x00000000, 0x00000001, 0x00001834, 0x00000002, 0x00000000, 0x00000001, 0x00001840,
8891 0x0000184c, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001850, 0x0000000b,
8892 0x00000000, 0x00000001, 0x000019cc, 0x00000002, 0x00000000, 0x00000001, 0x000019d8, 0x000019e4,
8893 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000019e8, 0x0000000b, 0x00000000,
8894 0x00000001, 0x00001b38, 0x00000002, 0x00000000, 0x00000001, 0x00001b44, 0x00001b50, 0x00000003,
8895 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00001b54, 0x0000000b, 0x00000000, 0x00000001,
8896 0x00001ca4, 0x00000002, 0x00000000, 0x00000001, 0x00001cb0, 0x00001cbc, 0x00000003, 0x00000000,
8897 0x0000000a, 0x00000000, 0x00000006, 0x00001cc0, 0x0000000b, 0x00000000, 0x00000001, 0x00001e10,
8898 0x00000002, 0x00000000, 0x00000001, 0x00001e1c, 0x00001e28, 0x00000003, 0x00000000, 0x0000000a,
8899 0x00000000, 0x00000006, 0x00001e2c, 0x0000000b, 0x00000000, 0x00000001, 0x00001fac, 0x00000002,
8900 0x00000000, 0x00000001, 0x00001fb8, 0x00001fc4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
8901 0x00000006, 0x00001fc8, 0x0000000b, 0x00000000, 0x00000001, 0x0000229c, 0x00000002, 0x00000000,
8902 0x00000001, 0x000022a8, 0x000022b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
8903 0x000022b8, 0x0000000b, 0x00000000, 0x00000001, 0x0000259c, 0x00000002, 0x00000000, 0x00000001,
8904 0x000025a8, 0x000025b4, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000025b8,
8905 0x0000000b, 0x00000000, 0x00000001, 0x00002808, 0x00000002, 0x00000000, 0x00000001, 0x00002814,
8906 0x00002820, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002824, 0x0000000b,
8907 0x00000000, 0x00000001, 0x00002914, 0x00000002, 0x00000000, 0x00000001, 0x00002920, 0x0000292c,
8908 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002930, 0x0000000b, 0x00000000,
8909 0x00000001, 0x00002a20, 0x00000002, 0x00000000, 0x00000001, 0x00002a2c, 0x00002a38, 0x00000003,
8910 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00002a3c, 0x0000000b, 0x00000000, 0x00000001,
8911 0x00002be4, 0x00000002, 0x00000000, 0x00000001, 0x00002bf0, 0x00002bfc, 0x00000003, 0x00000000,
8912 0x0000000a, 0x00000000, 0x00000006, 0x00002c00, 0x0000000b, 0x00000000, 0x00000001, 0x00002da8,
8913 0x00000002, 0x00000000, 0x00000001, 0x00002db4, 0x00002dc0, 0x00000003, 0x00000000, 0x0000000a,
8914 0x00000000, 0x00000006, 0x00002dc4, 0x0000000b, 0x00000000, 0x00000001, 0x00002fb4, 0x00000002,
8915 0x00000000, 0x00000001, 0x00002fc0, 0x00002fcc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
8916 0x00000006, 0x00002fd0, 0x0000000b, 0x00000000, 0x00000001, 0x000031a8, 0x00000002, 0x00000000,
8917 0x00000001, 0x000031b4, 0x000031c0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
8918 0x000031c4, 0x0000000b, 0x00000000, 0x00000001, 0x00003340, 0x00000002, 0x00000000, 0x00000001,
8919 0x0000334c, 0x00003358, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000335c,
8920 0x0000000b, 0x00000000, 0x00000001, 0x0000344c, 0x00000002, 0x00000000, 0x00000001, 0x00003458,
8921 0x00003464, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x00003468, 0x0000000b,
8922 0x00000000, 0x00000001, 0x000035b8, 0x00000002, 0x00000000, 0x00000001, 0x000035c4, 0x000035d0,
8923 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x000035d4, 0x0000000b, 0x00000000,
8924 0x00000001, 0x00003760, 0x00000002, 0x00000000, 0x00000001, 0x0000376c, 0x00003778, 0x00000003,
8925 0x00000000, 0x0000000a, 0x00000000, 0x00000006, 0x0000377c, 0x0000000b, 0x00000000, 0x00000001,
8926 0x00003908, 0x00000002, 0x00000000, 0x00000001, 0x00003914, 0x00003920, 0x00000003, 0x00000000,
8927 0x0000000a, 0x00000000, 0x00000006, 0x00003924, 0x0000000b, 0x00000000, 0x00000001, 0x00003a34,
8928 0x00000002, 0x00000000, 0x00000001, 0x00003a40, 0x00003a4c, 0x00000003, 0x00000000, 0x0000000a,
8929 0x00000000, 0x00000006, 0x00003a50, 0x0000000b, 0x00000000, 0x00000001, 0x00003b98, 0x00000002,
8930 0x00000000, 0x00000001, 0x00003ba4, 0x00003bb0, 0x00000003, 0x00000000, 0x0000000a, 0x00000000,
8931 0x00000006, 0x00003bb4, 0x0000000b, 0x00000000, 0x00000001, 0x00003dc4, 0x00000002, 0x00000000,
8932 0x00000001, 0x00003dd0, 0x00003ddc, 0x00000003, 0x00000000, 0x0000000a, 0x00000000, 0x00000006,
8933 0x00003de0, 0x0000000b, 0x00000000, 0x00000001, 0x00003f6c, 0x00000002, 0x00000000, 0x00000001,
8937 static float get_frc(float v
)
8939 return v
- floor(v
);
8942 static void test_effect_value_expression(void)
8944 ID3D10EffectVectorVariable
*g_var
, *g_var2
, *g_var3
, *g_var4
;
8945 ID3D10EffectDepthStencilVariable
*ds
;
8946 D3D10_DEPTH_STENCIL_DESC ds_desc
;
8947 ID3D10BlendState
*blend_state
;
8948 float f
[4], blend_factor
[4];
8949 ID3D10EffectTechnique
*t
;
8950 ID3D10EffectVariable
*v
;
8951 ID3D10EffectPass
*pass
;
8952 ID3D10Effect
*effect
;
8953 ID3D10Device
*device
;
8960 if (!(device
= create_device()))
8962 skip("Failed to create device, skipping tests.\n");
8966 hr
= create_effect(fx_test_value_expression
, 0, device
, NULL
, &effect
);
8967 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8969 t
= effect
->lpVtbl
->GetTechniqueByName(effect
, "tech");
8970 ok(t
->lpVtbl
->IsValid(t
), "Expected valid technique.\n");
8972 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var");
8973 g_var
= v
->lpVtbl
->AsVector(v
);
8974 ok(g_var
->lpVtbl
->IsValid(g_var
), "Expected valid vector variable.\n");
8975 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var2");
8976 g_var2
= v
->lpVtbl
->AsVector(v
);
8977 ok(g_var2
->lpVtbl
->IsValid(g_var2
), "Expected valid vector variable.\n");
8978 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var3");
8979 g_var3
= v
->lpVtbl
->AsVector(v
);
8980 ok(g_var3
->lpVtbl
->IsValid(g_var3
), "Expected valid vector variable.\n");
8981 v
= effect
->lpVtbl
->GetVariableByName(effect
, "g_var4");
8982 g_var4
= v
->lpVtbl
->AsVector(v
);
8983 ok(g_var4
->lpVtbl
->IsValid(g_var4
), "Expected valid vector variable.\n");
8986 pass
= t
->lpVtbl
->GetPassByName(t
, "p3");
8987 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
8989 hr
= pass
->lpVtbl
->Apply(pass
, 0);
8990 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
8992 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
8993 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
8994 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
8995 ok(blend_factor
[idx
] == 0.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
8996 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
8998 set_vec4(f
, 1.0f
, 2.0f
, 3.0f
, 4.0f
);
8999 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9000 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9001 set_vec4(f
, 2.0f
, 1.1f
, 0.1f
, -3.0f
);
9002 hr
= g_var2
->lpVtbl
->SetFloatVector(g_var2
, f
);
9003 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9005 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9006 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9008 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9009 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9010 ok(blend_factor
[0] == 1.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9011 ok(blend_factor
[1] == 1.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9012 ok(blend_factor
[2] == 0.1f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9013 ok(blend_factor
[3] == -3.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9014 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9016 pass
= t
->lpVtbl
->GetPassByName(t
, "p4");
9017 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9019 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9020 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9022 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9023 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9024 ok(blend_factor
[0] == 2.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9025 ok(blend_factor
[1] == 1.1f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9026 ok(blend_factor
[2] == 1.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9027 ok(blend_factor
[3] == 1.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9028 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9031 pass
= t
->lpVtbl
->GetPassByName(t
, "p5");
9032 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9034 set_vec4(f
, 1.0f
, 2.0f
, 3.0f
, 4.0f
);
9035 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9036 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9038 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9039 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9041 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9042 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9043 ok(blend_factor
[0] == 1.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9044 ok(blend_factor
[1] == 1.0f
/ 2.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9045 ok(blend_factor
[2] == 1.0f
/ 3.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9046 ok(blend_factor
[3] == 1.0f
/ 4.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9047 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9050 pass
= t
->lpVtbl
->GetPassByName(t
, "p6");
9051 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9053 set_vec4(f
, 2.0f
, 3.0f
, 4.0f
, 5.0f
);
9054 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9055 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9057 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9058 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9060 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9061 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9062 ok(blend_factor
[0] == 1.0f
/ 2.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9063 ok(blend_factor
[1] == 1.0f
/ 3.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9064 ok(blend_factor
[2] == 1.0f
/ 4.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9065 ok(blend_factor
[3] == 1.0f
/ 5.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9066 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9069 pass
= t
->lpVtbl
->GetPassByName(t
, "p7");
9070 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9072 set_vec4(f
, 0.0f
, 3.1f
, -4.2f
, 0.1f
);
9073 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9074 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9076 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9077 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9079 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9080 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9081 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9082 ok(blend_factor
[idx
] == get_frc(f
[idx
]), "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9083 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9085 /* Mutable state objects. */
9086 v
= effect
->lpVtbl
->GetVariableByName(effect
, "ds_state");
9087 ds
= v
->lpVtbl
->AsDepthStencil(v
);
9089 set_vec4(f
, 1.0f
, 2.0f
, 3.0f
, 4.0f
);
9090 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9091 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9092 ds
->lpVtbl
->GetBackingStore(ds
, 0, &ds_desc
);
9093 ok(ds_desc
.StencilEnable
== 0xffffffff, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
9095 set_vec4(f
, 0.0f
, 2.0f
, 3.0f
, 4.0f
);
9096 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9097 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9098 ds
->lpVtbl
->GetBackingStore(ds
, 0, &ds_desc
);
9099 ok(!ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
9101 set_vec4(f
, -0.1f
, 2.0f
, 3.0f
, 4.0f
);
9102 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9103 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9104 ds
->lpVtbl
->GetBackingStore(ds
, 0, &ds_desc
);
9105 ok(ds_desc
.StencilEnable
== 0xffffffff, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
9107 set_vec4(f
, 0.0f
, 2.0f
, 3.0f
, 4.0f
);
9108 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9109 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9110 ds
->lpVtbl
->GetBackingStore(ds
, 0, &ds_desc
);
9111 ok(!ds_desc
.StencilEnable
, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
9113 set_vec4(f
, NAN
, 2.0f
, 3.0f
, 4.0f
);
9114 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9115 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9116 ds
->lpVtbl
->GetBackingStore(ds
, 0, &ds_desc
);
9117 ok(ds_desc
.StencilEnable
== 0xffffffff, "Got unexpected StencilEnable %#x.\n", ds_desc
.StencilEnable
);
9120 pass
= t
->lpVtbl
->GetPassByName(t
, "p8");
9121 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9123 set_vec4(f
, -4.0f
, -3.0f
, 3.0f
, 4.0f
);
9124 hr
= g_var3
->lpVtbl
->SetFloatVector(g_var3
, f
);
9125 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9127 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9128 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9130 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9131 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9132 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9133 ok(blend_factor
[idx
] == 0.3f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9134 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9137 pass
= t
->lpVtbl
->GetPassByName(t
, "p9");
9138 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9140 set_vec4(f
, 2.0f
, 0.0f
, 3.0f
, 4.0f
);
9141 hr
= g_var3
->lpVtbl
->SetFloatVector(g_var3
, f
);
9142 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9144 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9145 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9147 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9148 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9149 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9150 ok(blend_factor
[idx
] == (float)UINT_MAX
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9151 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9154 pass
= t
->lpVtbl
->GetPassByName(t
, "p10");
9155 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9157 set_vec4(f
, 0.0f
, 1.1f
, 2.2f
, 4.0f
);
9158 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9159 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9161 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9162 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9164 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9165 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9166 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9167 ok(blend_factor
[idx
] == 2.2f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9168 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9170 set_vec4(f
, 0.1f
, 0.1f
, 0.2f
, 4.0f
);
9171 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9172 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9174 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9175 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9177 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9178 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9179 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9180 ok(blend_factor
[idx
] == 0.1f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9181 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9184 pass
= t
->lpVtbl
->GetPassByName(t
, "p11");
9185 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9187 set_int4(i
, 3, 2, 0, 0);
9188 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9189 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9191 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9192 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9194 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9195 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9196 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9197 ok(blend_factor
[idx
] == 2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9198 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9200 pass
= t
->lpVtbl
->GetPassByName(t
, "p12");
9201 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9203 set_int4(i
, 2, 5, 0, 0);
9204 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9205 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9207 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9208 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9210 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9211 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9212 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9213 ok(blend_factor
[idx
] == 5.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9214 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9217 pass
= t
->lpVtbl
->GetPassByName(t
, "p13");
9218 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9220 set_int4(i
, 3, 5, 0, 0);
9221 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9222 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9224 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9225 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9227 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9228 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9229 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9230 ok(blend_factor
[idx
] == 3.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9231 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9234 pass
= t
->lpVtbl
->GetPassByName(t
, "p14");
9235 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9237 set_int4(i
, 3, 5, 0, 0);
9238 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9239 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9241 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9242 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9244 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9245 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9246 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9247 ok(blend_factor
[idx
] == 8.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9248 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9251 pass
= t
->lpVtbl
->GetPassByName(t
, "p15");
9252 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9254 set_vec4(f
, 0.1234567f
, 0.0f
, 0.0f
, 0.0f
);
9255 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9256 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9258 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9259 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9261 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9262 ok(blend_factor
[0] == asinf(f
[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9265 pass
= t
->lpVtbl
->GetPassByName(t
, "p16");
9266 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9268 set_vec4(f
, 0.1234567f
, 0.0f
, 0.0f
, 0.0f
);
9269 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9270 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9272 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9273 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9275 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9276 ok(blend_factor
[0] == acosf(f
[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9279 pass
= t
->lpVtbl
->GetPassByName(t
, "p17");
9280 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9282 set_vec4(f
, 0.1234567f
, 0.0f
, 0.0f
, 0.0f
);
9283 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9284 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9286 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9287 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9289 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9290 ok(blend_factor
[0] == atanf(f
[0]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9293 pass
= t
->lpVtbl
->GetPassByName(t
, "p18");
9294 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9296 set_vec4(f
, 0.1234567f
, 0.7654321f
, 0.0f
, 0.0f
);
9297 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9298 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9300 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9301 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9303 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9304 ok(blend_factor
[0] == atan2f(f
[0], f
[1]), "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9306 /* Integer division */
9307 pass
= t
->lpVtbl
->GetPassByName(t
, "p19");
9308 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9310 set_int4(i
, 10, 5, 0, 0);
9311 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9312 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9314 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9315 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9317 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9318 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9319 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9320 ok(blend_factor
[idx
] == 2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9321 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9323 /* Signed integer comparison. */
9324 pass
= t
->lpVtbl
->GetPassByName(t
, "p20");
9325 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9327 set_int4(i
, 1, 5, 6, 5);
9328 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9329 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9331 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9332 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9334 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9335 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9336 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9337 ok(blend_factor
[idx
] == 1.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9338 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9340 set_int4(i
, 2, 1, 2, 5);
9341 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9342 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9344 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9345 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9347 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9348 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9349 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9350 ok(blend_factor
[idx
] == 2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9351 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9353 /* Unsigned integer comparison. */
9354 pass
= t
->lpVtbl
->GetPassByName(t
, "p21");
9355 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9357 set_int4(i
, 6, 5, 7, 1);
9358 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9359 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9361 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9362 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9364 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9365 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9366 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9367 ok(blend_factor
[idx
] == 0.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9368 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9370 set_int4(i
, 2, 5, 7, 1);
9371 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9372 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9374 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9375 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9377 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9378 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9379 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9380 ok(blend_factor
[idx
] == 1.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9381 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9384 pass
= t
->lpVtbl
->GetPassByName(t
, "p22");
9385 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9387 set_vec4(f
, 1.1f
, -2.3f
, 3.5f
, -4.5f
);
9388 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9389 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9391 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9392 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9394 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9395 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9396 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9397 ok(blend_factor
[idx
] == 2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9398 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9400 set_vec4(f
, -2.3f
, 1.1f
, 3.5f
, -4.5f
);
9401 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9402 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9404 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9405 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9407 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9408 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9409 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9410 ok(blend_factor
[idx
] == -2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9411 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9413 set_vec4(f
, 3.5f
, -2.3f
, 1.1f
, -4.5f
);
9414 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9415 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9417 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9418 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9420 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9421 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9422 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9423 ok(blend_factor
[idx
] == 4.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9424 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9426 set_vec4(f
, -4.5f
, -2.3f
, 3.5f
, 1.1f
);
9427 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9428 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9430 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9431 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9433 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9434 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9435 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9436 ok(blend_factor
[idx
] == -4.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9437 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9440 pass
= t
->lpVtbl
->GetPassByName(t
, "p23");
9441 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9443 set_vec4(f
, 1.1f
, -2.3f
, 3.5f
, -4.5f
);
9444 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9445 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9447 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9448 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9450 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9451 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9452 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9453 ok(blend_factor
[idx
] == 1.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9454 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9456 set_vec4(f
, -2.3f
, 1.1f
, 3.5f
, -4.5f
);
9457 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9458 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9460 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9461 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9463 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9464 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9465 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9466 ok(blend_factor
[idx
] == -3.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9467 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9469 set_vec4(f
, 3.5f
, -2.3f
, 1.1f
, -4.5f
);
9470 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9471 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9473 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9474 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9476 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9477 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9478 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9479 ok(blend_factor
[idx
] == 3.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9480 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9482 set_vec4(f
, -4.5f
, -2.3f
, 3.5f
, 1.1f
);
9483 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9484 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9486 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9487 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9489 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9490 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9491 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9492 ok(blend_factor
[idx
] == -5.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9493 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9495 /* dot(), 4-component vectors */
9496 pass
= t
->lpVtbl
->GetPassByName(t
, "p24");
9497 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9499 set_vec4(f
, 1.0f
, -2.0f
, 3.0f
, -4.0f
);
9500 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9501 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9502 set_vec4(f
, 5.0f
, 6.0f
, -7.0f
, 8.0f
);
9503 hr
= g_var2
->lpVtbl
->SetFloatVector(g_var2
, f
);
9504 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9506 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9507 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9509 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9510 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9511 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9512 ok(blend_factor
[idx
] == -60.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9513 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9515 /* dot(), 3-component vectors */
9516 pass
= t
->lpVtbl
->GetPassByName(t
, "p25");
9517 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9519 set_vec4(f
, 1.0f
, -2.0f
, 3.0f
, -4.0f
);
9520 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9521 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9522 set_vec4(f
, 5.0f
, 6.0f
, -7.0f
, 8.0f
);
9523 hr
= g_var2
->lpVtbl
->SetFloatVector(g_var2
, f
);
9524 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9526 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9527 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9529 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9530 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9531 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9532 ok(blend_factor
[idx
] == -28.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9533 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9535 /* dot(), 4-component vectors with swizzles */
9536 pass
= t
->lpVtbl
->GetPassByName(t
, "p26");
9537 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9539 set_vec4(f
, 1.0f
, -2.0f
, 3.0f
, -4.0f
);
9540 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9541 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9542 set_vec4(f
, 5.0f
, 6.0f
, -7.0f
, 8.0f
);
9543 hr
= g_var2
->lpVtbl
->SetFloatVector(g_var2
, f
);
9544 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9546 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9547 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9549 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9550 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9551 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9552 ok(blend_factor
[idx
] == 20.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9553 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9555 /* dot(), 3-component vectors with swizzles */
9556 pass
= t
->lpVtbl
->GetPassByName(t
, "p27");
9557 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9559 set_vec4(f
, 1.0f
, -2.0f
, 3.0f
, -4.0f
);
9560 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9561 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9562 set_vec4(f
, 5.0f
, 6.0f
, -7.0f
, 8.0f
);
9563 hr
= g_var2
->lpVtbl
->SetFloatVector(g_var2
, f
);
9564 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9566 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9567 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9569 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9570 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9571 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9572 ok(blend_factor
[idx
] == 40.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9573 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9575 /* Signed integer multiplication */
9576 pass
= t
->lpVtbl
->GetPassByName(t
, "p28");
9577 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9579 set_int4(i
, 3, -2, 5, -4);
9580 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9581 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9583 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9584 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9586 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9587 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9588 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9589 ok(blend_factor
[idx
] == -6.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9590 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9593 pass
= t
->lpVtbl
->GetPassByName(t
, "p29");
9594 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9596 set_vec4(f
, 4.0f
, 0.0f
, 1.0f
, 64.0f
);
9597 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9598 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9600 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9601 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9603 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9604 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9605 ok(blend_factor
[0] == 2.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9606 ok(blend_factor
[1] == 0.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9607 ok(blend_factor
[2] == 1.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9608 ok(blend_factor
[3] == 8.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9609 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9612 pass
= t
->lpVtbl
->GetPassByName(t
, "p30");
9613 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9615 set_vec4(f
, 4.0f
, 9.0f
, 1.0f
, 64.0f
);
9616 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9617 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9619 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9620 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9622 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9623 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9624 ok(blend_factor
[0] == 0.5f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9625 ok(blend_factor
[1] == 1.0f
/ 3.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9626 ok(blend_factor
[2] == 1.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9627 ok(blend_factor
[3] == 0.125f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9628 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9631 pass
= t
->lpVtbl
->GetPassByName(t
, "p31");
9632 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9634 set_vec4(f
, 4.0f
, 9.0f
, 0.0f
, -2.0f
);
9635 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9636 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9638 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9639 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9641 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9642 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9643 ok(blend_factor
[0] == logf(fabsf(f
[0])), "Got unexpected blend_factor %.8e.\n", blend_factor
[0]);
9644 ok(blend_factor
[1] == logf(fabsf(f
[1])), "Got unexpected blend_factor %.8e.\n", blend_factor
[1]);
9645 ok(blend_factor
[2] == 0.0f
, "Got unexpected blend_factor %.8e.\n", blend_factor
[2]);
9646 ok(blend_factor
[3] == logf(fabsf(f
[3])), "Got unexpected blend_factor %.8e.\n", blend_factor
[3]);
9647 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9650 pass
= t
->lpVtbl
->GetPassByName(t
, "p32");
9651 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9653 set_vec4(f
, 4.0f
, 1.0f
, 0.0f
, -2.0f
);
9654 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9655 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9657 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9658 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9660 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9661 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9662 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9663 ok(blend_factor
[idx
] == expf(f
[idx
]), "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9664 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9666 /* binary complement */
9667 pass
= t
->lpVtbl
->GetPassByName(t
, "p33");
9668 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9670 set_int4(i
, 0, 1, 2, 3);
9671 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9672 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9674 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9675 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9677 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9678 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9679 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9680 ok(blend_factor
[idx
] == -1.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9681 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9683 set_int4(i
, 1, 0, 2, 3);
9684 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9685 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9687 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9688 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9690 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9691 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9692 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9693 ok(blend_factor
[idx
] == -2.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9694 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9697 pass
= t
->lpVtbl
->GetPassByName(t
, "p34");
9698 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9700 set_int4(i
, 1, 2, 3, 4);
9701 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9702 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9704 set_int4(i
, 0x10, 0x20, 0x30, 0x40);
9705 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9706 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9708 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9709 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9711 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9712 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9713 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9714 ok(blend_factor
[idx
] == 17.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9715 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9717 set_int4(i
, 0x20, 0x10, 0x30, 0x40);
9718 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9719 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9721 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9722 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9724 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9725 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9726 for (idx
= 0; idx
< ARRAY_SIZE(blend_factor
); ++idx
)
9727 ok(blend_factor
[idx
] == 33.0f
, "Got unexpected blend_factor[%u] %.8e.\n", idx
, blend_factor
[idx
]);
9728 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9731 pass
= t
->lpVtbl
->GetPassByName(t
, "p35");
9732 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9734 set_int4(i
, 10, 1, 20, 2);
9735 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9736 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9738 set_int4(i
, 10, 2, 0, 0);
9739 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9740 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9742 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9743 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9745 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9746 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9747 ok(blend_factor
[0] == 5.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9748 ok(blend_factor
[1] == 80.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9749 ok(blend_factor
[2] == 2.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9750 ok(blend_factor
[3] == 0.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9751 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9753 set_int4(i
, 40, 35, 20, 37);
9754 hr
= g_var3
->lpVtbl
->SetIntVector(g_var3
, i
);
9755 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9757 set_int4(i
, 10, 66, 0, 0);
9758 hr
= g_var4
->lpVtbl
->SetIntVector(g_var4
, i
);
9759 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9761 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9762 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9764 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9765 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9766 ok(blend_factor
[0] == 5.0f
, "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9767 ok(blend_factor
[1] == 640.0f
, "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9768 ok(blend_factor
[2] == 2.0f
, "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9769 ok(blend_factor
[3] == 0.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9770 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9772 /* log2(), log10(), exp2() */
9773 pass
= t
->lpVtbl
->GetPassByName(t
, "p36");
9774 ok(pass
->lpVtbl
->IsValid(pass
), "Expected valid pass.\n");
9776 set_vec4(f
, 4.0f
, 9.0f
, 3.0f
, 0.0f
);
9777 hr
= g_var
->lpVtbl
->SetFloatVector(g_var
, f
);
9778 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9780 hr
= pass
->lpVtbl
->Apply(pass
, 0);
9781 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9783 ID3D10Device_OMGetBlendState(device
, &blend_state
, blend_factor
, &sample_mask
);
9784 ok(!blend_state
, "Unexpected blend state %p.\n", blend_state
);
9785 ok(blend_factor
[0] == logf(f
[0]) / logf(2.0f
), "Got unexpected blend_factor[0] %.8e.\n", blend_factor
[0]);
9786 ok(blend_factor
[1] == log10f(f
[1]), "Got unexpected blend_factor[1] %.8e.\n", blend_factor
[1]);
9787 ok(blend_factor
[2] == exp2f(f
[2]), "Got unexpected blend_factor[2] %.8e.\n", blend_factor
[2]);
9788 ok(blend_factor
[3] == 0.0f
, "Got unexpected blend_factor[3] %.8e.\n", blend_factor
[3]);
9789 ok(!sample_mask
, "Got unexpected sample_mask %#x.\n", sample_mask
);
9791 effect
->lpVtbl
->Release(effect
);
9793 refcount
= ID3D10Device_Release(device
);
9794 ok(!refcount
, "Device has %lu references left.\n", refcount
);
9803 static DWORD fx_test_fx_4_1
[] =
9805 0x43425844, 0x228fcf4d, 0x9396b2f5, 0xd817b31f, 0xab6dd460, 0x00000001, 0x000000a0, 0x00000001,
9806 0x00000024, 0x30315846, 0x00000074, 0xfeff1011, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
9807 0x00000000, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
9808 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x68636574,
9809 0x61700030, 0x00307373, 0x00000004, 0x00000001, 0x00000000, 0x0000000a, 0x00000000, 0x00000000,
9812 static void test_effect_fx_4_1(void)
9814 ID3D10Effect
*effect
;
9815 ID3D10Device
*device
;
9819 if (!(device
= create_device()))
9821 skip("Failed to create device, skipping tests.\n");
9825 hr
= create_effect(fx_test_fx_4_1
, 0, device
, NULL
, &effect
);
9826 ok(hr
== S_OK
, "Got unexpected hr %#lx.\n", hr
);
9828 effect
->lpVtbl
->Release(effect
);
9830 refcount
= ID3D10Device_Release(device
);
9831 ok(!refcount
, "Device has %lu references left.\n", refcount
);
9835 BlendState blend_state
9840 static DWORD fx_4_1_test_blend_state
[] =
9842 0x43425844, 0xe4566da7, 0x2242fb47, 0xa5924d09, 0x8280296f, 0x00000001, 0x000001a7, 0x00000001,
9843 0x00000024, 0x30315846, 0x0000017b, 0xfeff1011, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
9844 0x00000000, 0x00000000, 0x00000000, 0x00000097, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
9845 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6e656c42,
9846 0x61745364, 0x04006574, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000,
9847 0x62000000, 0x646e656c, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000, 0x02000000,
9848 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000,
9849 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000, 0x01000000, 0x02000000, 0x02000000,
9850 0x01000000, 0x02000000, 0x02000000, 0x2b000000, 0x0f000000, 0x00000000, 0xff000000, 0x08ffffff,
9851 0x26000000, 0x00000000, 0x01000000, 0x37000000, 0x26000000, 0x01000000, 0x01000000, 0x43000000,
9852 0x26000000, 0x02000000, 0x01000000, 0x4f000000, 0x26000000, 0x03000000, 0x01000000, 0x5b000000,
9853 0x26000000, 0x04000000, 0x01000000, 0x67000000, 0x26000000, 0x05000000, 0x01000000, 0x73000000,
9854 0x26000000, 0x06000000, 0x01000000, 0x7f000000, 0x26000000, 0x07000000, 0x01000000, 0x8b000000,
9855 0x00000000, 0x00000000,
9858 static void test_effect_fx_4_1_blend_state(void)
9860 ID3D10Effect
*effect
= NULL
;
9861 ID3D10Device
*device
;
9865 if (!(device
= create_device()))
9867 skip("Failed to create device, skipping tests.\n");
9871 hr
= create_effect(fx_4_1_test_blend_state
, 0, device
, NULL
, &effect
);
9872 ok(hr
== E_FAIL
, "Got unexpected hr %#lx.\n", hr
);
9874 refcount
= ID3D10Device_Release(device
);
9875 ok(!refcount
, "Device has %lu references left.\n", refcount
);
9878 static void test_effect_compiler(void)
9880 static char empty_effect
[] = "technique10 {};";
9881 D3D10_EFFECT_DESC desc
;
9882 ID3D10Device
*device
;
9883 ID3D10Effect
*effect
;
9887 if (!(device
= create_device()))
9889 skip("Failed to create device, skipping tests.\n");
9893 hr
= D3D10CompileEffectFromMemory(empty_effect
, sizeof(empty_effect
), NULL
, NULL
, NULL
, 0, 0,
9895 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9897 hr
= create_effect(ID3D10Blob_GetBufferPointer(blob
), 0, device
, NULL
, &effect
);
9898 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9899 hr
= ID3D10Effect_GetDesc(effect
, &desc
);
9900 ok(hr
== S_OK
, "Unexpected hr %#lx.\n", hr
);
9901 ok(desc
.Techniques
== 1, "Unexpected technique count %u.\n", desc
.Techniques
);
9902 ID3D10Effect_Release(effect
);
9904 ID3D10Device_Release(device
);
9905 ID3D10Blob_Release(blob
);
9910 test_effect_constant_buffer_type();
9911 test_effect_variable_type();
9912 test_effect_variable_member();
9913 test_effect_variable_element();
9914 test_effect_variable_type_class();
9915 test_effect_constant_buffer_stride();
9916 test_effect_local_shader();
9917 test_effect_get_variable_by();
9918 test_effect_state_groups();
9919 test_effect_state_group_defaults();
9920 test_effect_scalar_variable();
9921 test_effect_vector_variable();
9922 test_effect_matrix_variable();
9923 test_effect_resource_variable();
9924 test_effect_annotations();
9925 test_effect_optimize();
9926 test_effect_shader_description();
9927 test_effect_shader_object();
9929 test_effect_default_variable_value();
9930 test_effect_raw_value();
9931 test_effect_dynamic_numeric_field();
9932 test_effect_index_expression();
9933 test_effect_value_expression();
9934 test_effect_fx_4_1();
9935 test_effect_fx_4_1_blend_state();
9936 test_effect_compiler();