d3dx9/tests: Use the available ARRAY_SIZE() macro.
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blob1900f3eac1bc0098a3135882cb3705a5ddc5e253
1 /*
2 * Copyright 2010 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
20 #include "initguid.h"
21 #include <limits.h>
22 #include "wine/test.h"
23 #include "d3dx9.h"
25 #ifndef INFINITY
26 static inline float __port_infinity(void)
28 static const unsigned __inf_bytes = 0x7f800000;
29 return *(const float *)&__inf_bytes;
31 #define INFINITY __port_infinity()
32 #endif /* INFINITY */
34 #ifndef NAN
35 static float get_nan(void)
37 DWORD nan = 0x7fc00000;
39 return *(float *)&nan;
41 #define NAN get_nan()
42 #endif
44 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr))
46 /* helper functions */
47 static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps)
49 INT x = *(INT *)&f;
50 INT y = *(INT *)&g;
52 if (x < 0)
53 x = INT_MIN - x;
54 if (y < 0)
55 y = INT_MIN - y;
57 if (abs(x - y) > ulps)
58 return FALSE;
60 return TRUE;
63 static inline INT get_int(D3DXPARAMETER_TYPE type, const void *data)
65 INT i;
67 switch (type)
69 case D3DXPT_FLOAT:
70 i = *(FLOAT *)data;
71 break;
73 case D3DXPT_INT:
74 i = *(INT *)data;
75 break;
77 case D3DXPT_BOOL:
78 i = *(BOOL *)data;
79 break;
81 default:
82 i = 0;
83 ok(0, "Unhandled type %x.\n", type);
84 break;
87 return i;
90 static inline float get_float(D3DXPARAMETER_TYPE type, const void *data)
92 float f;
94 switch (type)
96 case D3DXPT_FLOAT:
97 f = *(FLOAT *)data;
98 break;
100 case D3DXPT_INT:
101 f = *(INT *)data;
102 break;
104 case D3DXPT_BOOL:
105 f = *(BOOL *)data;
106 break;
108 default:
109 f = 0.0f;
110 ok(0, "Unhandled type %x.\n", type);
111 break;
114 return f;
117 static inline BOOL get_bool(const void *data)
119 return !!*(BOOL *)data;
122 static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
124 switch (outtype)
126 case D3DXPT_FLOAT:
127 *(FLOAT *)outdata = get_float(intype, indata);
128 break;
130 case D3DXPT_BOOL:
131 *(BOOL *)outdata = get_bool(indata);
132 break;
134 case D3DXPT_INT:
135 *(INT *)outdata = get_int(intype, indata);
136 break;
138 case D3DXPT_PIXELSHADER:
139 case D3DXPT_VERTEXSHADER:
140 case D3DXPT_TEXTURE2D:
141 case D3DXPT_STRING:
142 *(INT *)outdata = 0x12345678;
143 break;
145 default:
146 ok(0, "Unhandled type %x.\n", outtype);
147 *(INT *)outdata = 0;
148 break;
152 static const char effect_desc[] =
153 "Technique\n"
154 "{\n"
155 "}\n";
157 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
159 HRESULT hr;
160 ID3DXEffect *effect;
161 ID3DXBaseEffect *base;
162 ULONG count;
163 IDirect3DDevice9 *device2;
164 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
165 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
167 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
168 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
170 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
171 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
173 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
174 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
176 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
177 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
179 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
180 todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
181 if (FAILED(hr))
183 skip("Failed to compile effect, skipping test.\n");
184 return;
187 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
188 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
190 hr = effect->lpVtbl->GetStateManager(effect, NULL);
191 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
193 hr = effect->lpVtbl->GetStateManager(effect, &manager);
194 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
195 ok(!manager, "GetStateManager failed, got %p\n", manager);
197 /* this works, but it is not recommended! */
198 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
199 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
201 hr = effect->lpVtbl->GetStateManager(effect, &manager);
202 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
203 ok(manager != NULL, "GetStateManager failed\n");
205 IDirect3DDevice9_AddRef(device);
206 count = IDirect3DDevice9_Release(device);
207 ok(count == 4, "Release failed, got %u, expected 4\n", count);
209 count = IUnknown_Release(manager);
210 ok(count == 3, "Release failed, got %u, expected 3\n", count);
212 hr = effect->lpVtbl->SetStateManager(effect, NULL);
213 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
215 hr = effect->lpVtbl->GetPool(effect, &pool);
216 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
217 ok(!pool, "GetPool failed, got %p\n", pool);
219 hr = effect->lpVtbl->GetPool(effect, NULL);
220 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
222 hr = effect->lpVtbl->GetDevice(effect, &device2);
223 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
225 hr = effect->lpVtbl->GetDevice(effect, NULL);
226 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
228 count = IDirect3DDevice9_Release(device2);
229 ok(count == 2, "Release failed, got %u, expected 2\n", count);
231 count = effect->lpVtbl->Release(effect);
232 ok(count == 0, "Release failed %u\n", count);
234 hr = D3DXCreateEffectPool(NULL);
235 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
237 hr = D3DXCreateEffectPool(&pool);
238 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
240 count = pool->lpVtbl->Release(pool);
241 ok(count == 0, "Release failed %u\n", count);
243 hr = D3DXCreateEffectPool(&pool);
244 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
246 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
247 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
249 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
250 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
251 ok(pool == pool2, "Release failed, got %p, expected %p\n", pool2, pool);
253 count = pool2->lpVtbl->Release(pool2);
254 ok(count == 1, "Release failed, got %u, expected 1\n", count);
256 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
257 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
259 count = IDirect3DDevice9_Release(device2);
260 ok(count == 1, "Release failed, got %u, expected 1\n", count);
262 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
263 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
265 hr = effect->lpVtbl->GetPool(effect, &pool);
266 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
267 ok(pool == pool2, "GetPool failed, got %p, expected %p\n", pool2, pool);
269 count = pool2->lpVtbl->Release(pool2);
270 ok(count == 2, "Release failed, got %u, expected 2\n", count);
272 count = effect->lpVtbl->Release(effect);
273 ok(count == 0, "Release failed %u\n", count);
275 count = pool->lpVtbl->Release(pool);
276 ok(count == 0, "Release failed %u\n", count);
279 static void test_create_effect_compiler(void)
281 HRESULT hr;
282 ID3DXEffectCompiler *compiler, *compiler2;
283 ID3DXBaseEffect *base;
284 IUnknown *unknown;
285 ULONG count;
287 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
288 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
290 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
291 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
293 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
294 todo_wine ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
295 if (FAILED(hr))
297 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
298 return;
301 count = compiler->lpVtbl->Release(compiler);
302 ok(count == 0, "Release failed %u\n", count);
304 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
305 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
307 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
308 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
310 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
311 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
313 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
314 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
316 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
317 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
319 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
320 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
322 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
323 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
325 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
326 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
328 count = unknown->lpVtbl->Release(unknown);
329 ok(count == 2, "Release failed, got %u, expected %u\n", count, 2);
331 count = compiler2->lpVtbl->Release(compiler2);
332 ok(count == 1, "Release failed, got %u, expected %u\n", count, 1);
334 count = compiler->lpVtbl->Release(compiler);
335 ok(count == 0, "Release failed %u\n", count);
339 * Parameter value test
341 struct test_effect_parameter_value_result
343 const char *full_name;
344 D3DXPARAMETER_DESC desc;
345 UINT value_offset; /* start position for the value in the blob */
349 * fxc.exe /Tfx_2_0
351 #if 0
352 float f = 0.1;
353 float1 f1 = {1.1};
354 float2 f2 = {2.1, 2.2};
355 float3 f3 = {3.1, 3.2, 3.3};
356 float4 f4 = {4.1, 4.2, 4.3, 4.4};
357 float1x1 f11 = {11.1};
358 float1x2 f12 = {12.1, 12.2};
359 float1x3 f13 = {13.1, 13.2, 13.3};
360 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
361 float2x1 f21 = {{21.11, 21.21}};
362 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
363 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
364 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
365 float3x1 f31 = {{31.11, 31.21, 31.31}};
366 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
367 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
368 {33.13, 33.23, 33.33}};
369 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
370 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
371 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
372 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
373 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
374 {43.13, 43.23, 43.33, 43.43}};
375 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
376 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
377 float f_2[2] = {0.101, 0.102};
378 float1 f1_2[2] = {{1.101}, {1.102}};
379 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
380 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
381 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
382 float1x1 f11_2[2] = {{11.101}, {11.102}};
383 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
384 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
385 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
386 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
387 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
388 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
389 {23.1202, 23.2202}, {23.1302, 23.2302}}};
390 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
391 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
392 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
393 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
394 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
395 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
396 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
397 {33.1302, 33.2302, 33.3302}}};
398 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
399 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
400 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
401 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
402 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
403 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
404 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
405 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
406 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
407 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
408 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
409 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
410 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
411 technique t { pass p { } }
412 #endif
413 static const DWORD test_effect_parameter_value_blob_float[] =
415 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
416 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
417 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
418 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
419 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
420 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
421 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
422 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
423 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
424 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
425 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
426 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
427 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
428 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
429 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
430 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
431 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
432 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
433 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
434 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
435 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
436 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
437 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
438 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
439 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
440 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
441 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
442 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
443 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
444 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
445 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
446 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
447 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
448 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
449 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
450 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
451 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
452 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
453 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
454 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
455 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
456 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
457 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
458 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
459 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
460 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
461 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
462 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
463 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
464 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
465 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
466 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
467 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
468 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
469 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
470 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
471 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
472 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
473 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
474 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
475 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
476 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
477 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
478 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
479 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
480 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
481 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
482 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
483 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
484 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
485 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
486 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
487 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
488 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
489 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
490 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
491 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
492 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
493 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
494 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
495 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
496 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
497 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
498 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
499 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
500 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
501 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
502 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
503 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
504 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
505 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
506 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
507 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
508 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
509 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
510 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
511 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
512 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
513 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
514 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
515 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
516 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
517 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
518 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
519 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
520 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
521 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
522 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
523 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
524 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
525 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
526 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
527 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
528 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
529 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
532 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
534 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
535 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
536 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
537 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
538 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
539 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
540 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
541 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
542 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
543 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
544 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
545 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
546 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
547 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
548 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
549 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
550 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
551 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
552 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
553 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
554 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
555 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
556 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
557 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
558 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
559 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
560 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
561 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
562 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
563 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
564 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
565 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
566 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
567 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
568 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
569 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
570 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
571 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
572 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
573 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
574 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
575 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
579 * fxc.exe /Tfx_2_0
581 #if 0
582 int i = 1;
583 int1 i1 = {11};
584 int2 i2 = {21, 22};
585 int3 i3 = {31, 32, 33};
586 int4 i4 = {41, 42, 43, 44};
587 int1x1 i11 = {111};
588 int1x2 i12 = {121, 122};
589 int1x3 i13 = {131, 132, 133};
590 int1x4 i14 = {141, 142, 143, 144};
591 int2x1 i21 = {{2111, 2121}};
592 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
593 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
594 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
595 int3x1 i31 = {{3111, 3121, 3131}};
596 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
597 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
598 {3313, 3323, 3333}};
599 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
600 {3413, 3423, 3433}, {3414, 3424, 3434}};
601 int4x1 i41 = {{4111, 4121, 4131, 4141}};
602 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
603 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
604 {4313, 4323, 4333, 4343}};
605 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
606 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
607 int i_2[2] = {0101, 0102};
608 int1 i1_2[2] = {{1101}, {1102}};
609 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
610 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
611 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
612 int1x1 i11_2[2] = {{11101}, {11102}};
613 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
614 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
615 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
616 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
617 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
618 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
619 {231202, 232202}, {231302, 232302}}};
620 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
621 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
622 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
623 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
624 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
625 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
626 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
627 {331302, 332302, 333302}}};
628 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
629 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
630 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
631 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
632 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
633 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
634 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
635 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
636 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
637 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
638 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
639 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
640 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
641 technique t { pass p { } }
642 #endif
643 static const DWORD test_effect_parameter_value_blob_int[] =
645 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
646 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
647 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
648 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
649 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
650 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
651 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
652 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
653 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
654 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
655 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
656 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
657 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
658 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
659 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
660 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
661 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
662 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
663 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
664 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
665 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
666 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
667 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
668 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
669 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
670 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
671 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
672 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
673 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
674 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
675 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
676 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
677 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
678 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
679 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
680 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
681 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
682 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
683 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
684 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
685 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
686 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
687 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
688 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
689 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
690 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
691 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
692 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
693 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
694 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
695 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
696 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
697 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
698 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
699 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
700 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
701 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
702 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
703 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
704 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
705 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
706 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
707 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
708 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
709 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
710 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
711 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
712 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
713 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
714 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
715 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
716 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
717 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
718 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
719 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
720 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
721 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
722 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
723 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
724 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
725 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
726 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
727 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
728 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
729 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
730 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
731 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
732 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
733 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
734 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
735 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
736 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
737 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
738 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
739 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
740 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
741 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
742 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
743 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
744 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
745 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
746 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
747 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
748 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
749 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
750 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
751 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
752 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
753 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
754 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
755 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
756 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
757 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
758 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
759 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
762 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
764 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
765 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
766 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
767 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
768 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
769 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
770 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
771 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
772 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
773 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
774 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
775 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
776 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
777 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
778 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
779 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
780 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
781 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
782 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
783 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
784 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
785 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
786 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
787 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
788 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
789 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
790 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
791 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
792 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
793 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
794 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
795 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
796 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
797 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
798 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
799 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
800 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
801 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
802 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
803 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
804 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
805 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
809 * fxc.exe /Tfx_2_0
811 #if 0
812 string s = "test";
813 string s_2[2] = {"test1", "test2"};
814 texture2D tex;
815 Vertexshader v;
816 Vertexshader v_2[2];
817 Pixelshader p;
818 Pixelshader p_2[2];
819 technique t { pass p { } }
820 #endif
821 static const DWORD test_effect_parameter_value_blob_object[] =
823 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
824 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
825 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
826 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
827 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
828 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
829 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
830 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
831 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
832 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
833 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
834 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
835 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
836 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
837 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
838 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
839 0x00000001, 0x00000005, 0x74736574, 0x00000000,
842 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
844 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
845 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
846 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
847 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
848 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
849 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
850 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
854 * fxc.exe /Tfx_2_0
856 #if 0
857 float3 f3 = {-3.1, 153.2, 283.3};
858 float3 f3min = {-31.1, -31.2, -31.3};
859 float3 f3max = {320.1, 320.2, 320.3};
860 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
861 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
862 float4 f4max = {420.1, 42.20, 420.3, 420.4};
863 technique t { pass p { } }
864 #endif
865 static const DWORD test_effect_parameter_value_blob_special[] =
867 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
868 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
869 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
870 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
871 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
872 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
873 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
874 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
875 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
876 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
877 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
878 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
879 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
880 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
881 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
882 0x00000000, 0x00000000,
885 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
887 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
888 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
889 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
890 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
891 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
892 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
895 #define ADD_PARAMETER_VALUE(x) {\
896 test_effect_parameter_value_blob_ ## x,\
897 sizeof(test_effect_parameter_value_blob_ ## x),\
898 test_effect_parameter_value_result_ ## x,\
899 sizeof(test_effect_parameter_value_result_ ## x)/sizeof(*test_effect_parameter_value_result_ ## x),\
902 static const struct
904 const DWORD *blob;
905 UINT blob_size;
906 const struct test_effect_parameter_value_result *res;
907 UINT res_count;
909 test_effect_parameter_value_data[] =
911 ADD_PARAMETER_VALUE(float),
912 ADD_PARAMETER_VALUE(int),
913 ADD_PARAMETER_VALUE(object),
914 ADD_PARAMETER_VALUE(special),
917 #undef ADD_PARAMETER_VALUE
919 /* Multiple of 16 to cover complete matrices */
920 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
921 /* Constants for special INT/FLOAT conversation */
922 #define INT_FLOAT_MULTI 255.0f
923 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
925 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
926 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
928 const D3DXPARAMETER_DESC *res_desc = &res->desc;
929 const char *res_full_name = res->full_name;
930 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
931 HRESULT hr;
932 UINT l;
934 memset(value, 0xab, sizeof(value));
935 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
936 if (res_desc->Class == D3DXPC_SCALAR
937 || res_desc->Class == D3DXPC_VECTOR
938 || res_desc->Class == D3DXPC_MATRIX_ROWS)
940 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
942 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
944 ok(value[l] == res_value[l], "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
945 i, res_full_name, l, value[l], res_value[l]);
948 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
950 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
951 i, res_full_name, l, value[l], 0xabababab);
954 else if (res_desc->Class == D3DXPC_OBJECT)
956 switch (res_desc->Type)
958 case D3DXPT_PIXELSHADER:
959 case D3DXPT_VERTEXSHADER:
960 case D3DXPT_TEXTURE2D:
961 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
963 for (l = 0; l < (res_desc->Elements ? res_desc->Elements : 1); ++l)
965 IUnknown *unk = *((IUnknown **)value + l);
966 if (unk) IUnknown_Release(unk);
968 break;
970 case D3DXPT_STRING:
971 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
972 break;
974 default:
975 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
976 break;
979 else
981 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
982 i, res_full_name, hr, D3DERR_INVALIDCALL);
984 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
986 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
987 i, res_full_name, l, value[l], 0xabababab);
992 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
993 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
995 const D3DXPARAMETER_DESC *res_desc = &res->desc;
996 const char *res_full_name = res->full_name;
997 BOOL bvalue = 0xabababab;
998 HRESULT hr;
1000 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
1001 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1003 ok(hr == D3D_OK, "%u - %s: GetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1004 ok(bvalue == get_bool(res_value), "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1005 i, res_full_name, bvalue, get_bool(res_value));
1007 else
1009 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1010 i, res_full_name, hr, D3DERR_INVALIDCALL);
1011 ok(bvalue == 0xabababab, "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1012 i, res_full_name, bvalue, 0xabababab);
1016 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
1017 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1019 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1020 const char *res_full_name = res->full_name;
1021 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1022 HRESULT hr;
1023 UINT l, err = 0;
1025 memset(bavalue, 0xab, sizeof(bavalue));
1026 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1027 if (res_desc->Class == D3DXPC_SCALAR
1028 || res_desc->Class == D3DXPC_VECTOR
1029 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1031 ok(hr == D3D_OK, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1033 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1035 if (bavalue[l] != get_bool(&res_value[l])) ++err;
1038 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1040 if (bavalue[l] != 0xabababab) ++err;
1043 else
1045 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1046 i, res_full_name, hr, D3DERR_INVALIDCALL);
1048 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (bavalue[l] != 0xabababab) ++err;
1050 ok(!err, "%u - %s: GetBoolArray failed with %u errors\n", i, res_full_name, err);
1053 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1054 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1056 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1057 const char *res_full_name = res->full_name;
1058 INT ivalue = 0xabababab;
1059 HRESULT hr;
1061 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1062 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1064 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1065 ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1066 i, res_full_name, ivalue, get_int(res_desc->Type, res_value));
1068 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1069 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1070 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1072 INT tmp;
1074 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1076 tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1077 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1078 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1079 if (res_desc->Columns * res_desc->Rows > 3)
1081 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1084 ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n",
1085 i, res_full_name, ivalue, tmp);
1087 else
1089 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1090 i, res_full_name, hr, D3DERR_INVALIDCALL);
1091 ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1092 i, res_full_name, ivalue, 0xabababab);
1096 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1097 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1099 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1100 const char *res_full_name = res->full_name;
1101 INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1102 HRESULT hr;
1103 UINT l, err = 0;
1105 memset(iavalue, 0xab, sizeof(iavalue));
1106 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1107 if (res_desc->Class == D3DXPC_SCALAR
1108 || res_desc->Class == D3DXPC_VECTOR
1109 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1111 ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1113 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1115 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1118 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1120 if (iavalue[l] != 0xabababab) ++err;
1123 else
1125 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1126 i, res_full_name, hr, D3DERR_INVALIDCALL);
1128 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1130 ok(!err, "%u - %s: GetIntArray failed with %u errors\n", i, res_full_name, err);
1133 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1134 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1136 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1137 const char *res_full_name = res->full_name;
1138 HRESULT hr;
1139 DWORD cmp = 0xabababab;
1140 FLOAT fvalue = *(FLOAT *)&cmp;
1142 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1143 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1145 ok(hr == D3D_OK, "%u - %s: GetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1146 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1147 i, res_full_name, fvalue, get_float(res_desc->Type, res_value));
1149 else
1151 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1152 i, res_full_name, hr, D3DERR_INVALIDCALL);
1153 ok(fvalue == *(FLOAT *)&cmp, "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1154 i, res_full_name, fvalue, *(FLOAT *)&cmp);
1158 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1159 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1161 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1162 const char *res_full_name = res->full_name;
1163 FLOAT favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1164 HRESULT hr;
1165 UINT l, err = 0;
1166 DWORD cmp = 0xabababab;
1168 memset(favalue, 0xab, sizeof(favalue));
1169 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1170 if (res_desc->Class == D3DXPC_SCALAR
1171 || res_desc->Class == D3DXPC_VECTOR
1172 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1174 ok(hr == D3D_OK, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1176 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1178 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1181 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1183 if (favalue[l] != *(FLOAT *)&cmp) ++err;
1186 else
1188 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1189 i, res_full_name, hr, D3DERR_INVALIDCALL);
1191 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1193 ok(!err, "%u - %s: GetFloatArray failed with %u errors\n", i, res_full_name, err);
1196 static void test_effect_parameter_value_GetVector(const struct test_effect_parameter_value_result *res,
1197 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1199 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1200 const char *res_full_name = res->full_name;
1201 HRESULT hr;
1202 DWORD cmp = 0xabababab;
1203 FLOAT fvalue[4];
1204 UINT l, err = 0;
1206 memset(fvalue, 0xab, sizeof(fvalue));
1207 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1208 if (!res_desc->Elements &&
1209 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1210 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1212 DWORD tmp;
1214 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1216 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1217 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1218 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1219 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1221 if (*res_value != tmp) ++err;
1223 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1225 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1227 for (l = 0; l < res_desc->Columns; ++l)
1229 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1232 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l] != 0.0f) ++err;
1234 else
1236 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1237 i, res_full_name, hr, D3DERR_INVALIDCALL);
1239 for (l = 0; l < 4; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1241 ok(!err, "%u - %s: GetVector failed with %u errors\n", i, res_full_name, err);
1244 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1245 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1247 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1248 const char *res_full_name = res->full_name;
1249 HRESULT hr;
1250 DWORD cmp = 0xabababab;
1251 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1252 UINT l, k, element, err = 0;
1254 for (element = 0; element <= res_desc->Elements + 1; ++element)
1256 memset(fvalue, 0xab, sizeof(fvalue));
1257 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1258 if (!element)
1260 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1262 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1264 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1266 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1268 for (k = 0; k < element; ++k)
1270 for (l = 0; l < res_desc->Columns; ++l)
1272 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1273 &res_value[l + k * res_desc->Columns]), 512))
1274 ++err;
1277 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l + k * 4] != 0.0f) ++err;
1280 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1282 else
1284 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n",
1285 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1287 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1289 ok(!err, "%u - %s[%u]: GetVectorArray failed with %u errors\n", i, res_full_name, element, err);
1293 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1294 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1296 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1297 const char *res_full_name = res->full_name;
1298 HRESULT hr;
1299 union
1301 DWORD d;
1302 float f;
1303 } cmp;
1304 float fvalue[16];
1305 UINT l, k, err = 0;
1307 cmp.d = 0xabababab;
1308 memset(fvalue, 0xab, sizeof(fvalue));
1309 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1310 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1312 ok(hr == D3D_OK, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1314 for (k = 0; k < 4; ++k)
1316 for (l = 0; l < 4; ++l)
1318 if (k < res_desc->Columns && l < res_desc->Rows)
1320 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1321 &res_value[l * res_desc->Columns + k]), 512))
1322 ++err;
1324 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1328 else
1330 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n",
1331 i, res_full_name, hr, D3DERR_INVALIDCALL);
1333 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1334 if (fvalue[l] != cmp.f)
1335 ++err;
1337 ok(!err, "%u - %s: GetMatrix failed with %u errors.\n", i, res_full_name, err);
1340 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1341 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1343 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1344 const char *res_full_name = res->full_name;
1345 HRESULT hr;
1346 DWORD cmp = 0xabababab;
1347 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1348 UINT l, k, m, element, err = 0;
1350 for (element = 0; element <= res_desc->Elements + 1; ++element)
1352 memset(fvalue, 0xab, sizeof(fvalue));
1353 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1354 if (!element)
1356 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1358 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1360 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1362 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1364 for (m = 0; m < element; ++m)
1366 for (k = 0; k < 4; ++k)
1368 for (l = 0; l < 4; ++l)
1370 if (k < res_desc->Columns && l < res_desc->Rows)
1372 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1373 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1374 ++err;
1376 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1381 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1383 else
1385 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n",
1386 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1388 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1390 ok(!err, "%u - %s[%u]: GetMatrixArray failed with %u errors\n", i, res_full_name, element, err);
1394 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1395 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1397 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1398 const char *res_full_name = res->full_name;
1399 HRESULT hr;
1400 DWORD cmp = 0xabababab;
1401 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1402 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1403 UINT l, k, m, element, err = 0;
1405 for (element = 0; element <= res_desc->Elements + 1; ++element)
1407 memset(fvalue, 0xab, sizeof(fvalue));
1408 for (l = 0; l < element; ++l)
1410 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1412 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
1413 if (!element)
1415 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1416 i, res_full_name, element, hr, D3D_OK);
1418 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1420 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1422 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1423 i, res_full_name, element, hr, D3D_OK);
1425 for (m = 0; m < element; ++m)
1427 for (k = 0; k < 4; ++k)
1429 for (l = 0; l < 4; ++l)
1431 if (k < res_desc->Columns && l < res_desc->Rows)
1433 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1434 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1435 ++err;
1437 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1442 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1444 else
1446 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1448 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1449 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1451 ok(!err, "%u - %s[%u]: GetMatrixPointerArray failed with %u errors\n", i, res_full_name, element, err);
1455 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1456 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1458 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1459 const char *res_full_name = res->full_name;
1460 HRESULT hr;
1461 union
1463 DWORD d;
1464 float f;
1465 } cmp;
1466 float fvalue[16];
1467 UINT l, k, err = 0;
1469 cmp.d = 0xabababab;
1470 memset(fvalue, 0xab, sizeof(fvalue));
1471 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1472 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1474 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1476 for (k = 0; k < 4; ++k)
1478 for (l = 0; l < 4; ++l)
1480 if (k < res_desc->Columns && l < res_desc->Rows)
1482 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1483 &res_value[l * res_desc->Columns + k]), 512))
1484 ++err;
1486 else if (fvalue[l + k * 4] != 0.0f) ++err;
1490 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1492 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1494 for (k = 0; k < 4; ++k)
1496 for (l = 0; l < 4; ++l)
1498 if (k < res_desc->Columns && l < res_desc->Rows)
1500 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1501 &res_value[l * res_desc->Columns + k]), 512))
1502 ++err;
1504 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1508 else
1510 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n",
1511 i, res_full_name, hr, D3DERR_INVALIDCALL);
1513 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1514 if (fvalue[l] != cmp.f)
1515 ++err;
1517 ok(!err, "%u - %s: GetMatrixTranspose failed with %u errors.\n", i, res_full_name, err);
1520 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1521 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1523 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1524 const char *res_full_name = res->full_name;
1525 HRESULT hr;
1526 DWORD cmp = 0xabababab;
1527 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1528 UINT l, k, m, element, err = 0;
1530 for (element = 0; element <= res_desc->Elements + 1; ++element)
1532 memset(fvalue, 0xab, sizeof(fvalue));
1533 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1534 if (!element)
1536 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1537 i, res_full_name, element, hr, D3D_OK);
1539 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1541 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1543 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1544 i, res_full_name, element, hr, D3D_OK);
1546 for (m = 0; m < element; ++m)
1548 for (k = 0; k < 4; ++k)
1550 for (l = 0; l < 4; ++l)
1552 if (k < res_desc->Columns && l < res_desc->Rows)
1554 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1555 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1556 ++err;
1558 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1563 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1565 else
1567 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1568 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1570 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1572 ok(!err, "%u - %s[%u]: GetMatrixTransposeArray failed with %u errors\n", i, res_full_name, element, err);
1576 static void test_effect_parameter_value_GetMatrixTransposePointerArray(const struct test_effect_parameter_value_result *res,
1577 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1579 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1580 const char *res_full_name = res->full_name;
1581 HRESULT hr;
1582 DWORD cmp = 0xabababab;
1583 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1584 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1585 UINT l, k, m, element, err = 0;
1587 for (element = 0; element <= res_desc->Elements + 1; ++element)
1589 memset(fvalue, 0xab, sizeof(fvalue));
1590 for (l = 0; l < element; ++l)
1592 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1594 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
1595 if (!element)
1597 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1598 i, res_full_name, element, hr, D3D_OK);
1600 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1602 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1604 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1605 i, res_full_name, element, hr, D3D_OK);
1607 for (m = 0; m < element; ++m)
1609 for (k = 0; k < 4; ++k)
1611 for (l = 0; l < 4; ++l)
1613 if (k < res_desc->Columns && l < res_desc->Rows)
1615 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1616 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1617 ++err;
1619 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1624 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1626 else
1628 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1629 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1631 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1633 ok(!err, "%u - %s[%u]: GetMatrixTransposePointerArray failed with %u errors\n", i, res_full_name, element, err);
1637 static void test_effect_parameter_value_GetTestGroup(const struct test_effect_parameter_value_result *res,
1638 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1640 test_effect_parameter_value_GetValue(res, effect, res_value, parameter, i);
1641 test_effect_parameter_value_GetBool(res, effect, res_value, parameter, i);
1642 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter, i);
1643 test_effect_parameter_value_GetInt(res, effect, res_value, parameter, i);
1644 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter, i);
1645 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter, i);
1646 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter, i);
1647 test_effect_parameter_value_GetVector(res, effect, res_value, parameter, i);
1648 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter, i);
1649 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter, i);
1650 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter, i);
1651 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter, i);
1652 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter, i);
1653 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter, i);
1654 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter, i);
1657 static void test_effect_parameter_value_ResetValue(const struct test_effect_parameter_value_result *res,
1658 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1660 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1661 const char *res_full_name = res->full_name;
1662 HRESULT hr;
1664 if (res_desc->Class == D3DXPC_SCALAR
1665 || res_desc->Class == D3DXPC_VECTOR
1666 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1668 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1669 ok(hr == D3D_OK, "%u - %s: SetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1671 else
1673 /* nothing to do */
1674 switch (res_desc->Type)
1676 case D3DXPT_PIXELSHADER:
1677 case D3DXPT_VERTEXSHADER:
1678 case D3DXPT_TEXTURE2D:
1679 case D3DXPT_STRING:
1680 break;
1682 default:
1683 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1684 break;
1689 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1691 unsigned int effect_count = ARRAY_SIZE(test_effect_parameter_value_data), i;
1693 for (i = 0; i < effect_count; ++i)
1695 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1696 UINT res_count = test_effect_parameter_value_data[i].res_count;
1697 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1698 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1699 HRESULT hr;
1700 ID3DXEffect *effect;
1701 D3DXEFFECT_DESC edesc;
1702 ULONG count;
1703 UINT k;
1705 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1706 ok(hr == D3D_OK, "%u: D3DXCreateEffect failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1708 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1709 ok(hr == D3D_OK, "%u: GetDesc failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1710 ok(edesc.Parameters == res_count, "%u: Parameters failed, got %u, expected %u\n",
1711 i, edesc.Parameters, res_count);
1713 for (k = 0; k < res_count; ++k)
1715 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1716 const char *res_full_name = res[k].full_name;
1717 UINT res_value_offset = res[k].value_offset;
1718 D3DXHANDLE parameter;
1719 D3DXPARAMETER_DESC pdesc;
1720 BOOL bvalue = TRUE;
1721 INT ivalue = 42;
1722 FLOAT fvalue = 2.71828f;
1723 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1724 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1725 UINT l, n, m, element;
1726 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/sizeof(D3DXMATRIX)];
1728 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1729 ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
1731 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1732 ok(hr == D3D_OK, "%u - %s: GetParameterDesc failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1734 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1735 "%u - %s: GetParameterDesc Name failed, got \"%s\", expected \"%s\"\n",
1736 i, res_full_name, pdesc.Name, res_desc->Name);
1737 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1738 "%u - %s: GetParameterDesc Semantic failed, got \"%s\", expected \"%s\"\n",
1739 i, res_full_name, pdesc.Semantic, res_desc->Semantic);
1740 ok(res_desc->Class == pdesc.Class, "%u - %s: GetParameterDesc Class failed, got %#x, expected %#x\n",
1741 i, res_full_name, pdesc.Class, res_desc->Class);
1742 ok(res_desc->Type == pdesc.Type, "%u - %s: GetParameterDesc Type failed, got %#x, expected %#x\n",
1743 i, res_full_name, pdesc.Type, res_desc->Type);
1744 ok(res_desc->Rows == pdesc.Rows, "%u - %s: GetParameterDesc Rows failed, got %u, expected %u\n",
1745 i, res_full_name, pdesc.Rows, res_desc->Rows);
1746 ok(res_desc->Columns == pdesc.Columns, "%u - %s: GetParameterDesc Columns failed, got %u, expected %u\n",
1747 i, res_full_name, pdesc.Columns, res_desc->Columns);
1748 ok(res_desc->Elements == pdesc.Elements, "%u - %s: GetParameterDesc Elements failed, got %u, expected %u\n",
1749 i, res_full_name, pdesc.Elements, res_desc->Elements);
1750 ok(res_desc->Annotations == pdesc.Annotations, "%u - %s: GetParameterDesc Annotations failed, got %u, expected %u\n",
1751 i, res_full_name, pdesc.Annotations, res_desc->Annotations);
1752 ok(res_desc->StructMembers == pdesc.StructMembers, "%u - %s: GetParameterDesc StructMembers failed, got %u, expected %u\n",
1753 i, res_full_name, pdesc.StructMembers, res_desc->StructMembers);
1754 ok(res_desc->Flags == pdesc.Flags, "%u - %s: GetParameterDesc Flags failed, got %u, expected %u\n",
1755 i, res_full_name, pdesc.Flags, res_desc->Flags);
1756 ok(res_desc->Bytes == pdesc.Bytes, "%u - %s: GetParameterDesc Bytes, got %u, expected %u\n",
1757 i, res_full_name, pdesc.Bytes, res_desc->Bytes);
1759 /* check size */
1760 ok(EFFECT_PARAMETER_VALUE_ARRAY_SIZE >= res_desc->Bytes / 4 +
1761 (res_desc->Elements ? res_desc->Bytes / 4 / res_desc->Elements : 0),
1762 "%u - %s: Warning: Array size too small\n", i, res_full_name);
1764 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1765 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1766 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1769 * check invalid calls
1770 * These will crash:
1771 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1772 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1773 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1774 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1775 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1776 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1777 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1778 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1779 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1780 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1781 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1782 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1783 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1784 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1786 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1787 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1788 i, res_full_name, hr, D3DERR_INVALIDCALL);
1790 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1791 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1792 i, res_full_name, hr, D3DERR_INVALIDCALL);
1794 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1795 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1796 i, res_full_name, hr, D3DERR_INVALIDCALL);
1798 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1799 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1800 i, res_full_name, hr, D3DERR_INVALIDCALL);
1802 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1803 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1804 i, res_full_name, hr, D3DERR_INVALIDCALL);
1806 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1807 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1808 i, res_full_name, hr, D3DERR_INVALIDCALL);
1810 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1811 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
1812 i, res_full_name, hr, D3DERR_INVALIDCALL);
1814 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1815 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1816 i, res_full_name, hr, D3DERR_INVALIDCALL);
1818 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1819 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1820 i, res_full_name, hr, D3DERR_INVALIDCALL);
1822 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1823 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
1824 i, res_full_name, hr, D3DERR_INVALIDCALL);
1826 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1827 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1828 i, res_full_name, hr, D3DERR_INVALIDCALL);
1830 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1831 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1832 i, res_full_name, hr, D3DERR_INVALIDCALL);
1834 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1835 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
1836 i, res_full_name, hr, D3DERR_INVALIDCALL);
1838 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1839 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1840 i, res_full_name, hr, D3DERR_INVALIDCALL);
1842 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1843 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1844 i, res_full_name, hr, D3DERR_INVALIDCALL);
1846 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1847 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
1848 i, res_full_name, hr, D3DERR_INVALIDCALL);
1850 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1851 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1852 i, res_full_name, hr, D3DERR_INVALIDCALL);
1854 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1855 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1856 i, res_full_name, hr, D3DERR_INVALIDCALL);
1858 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1859 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
1860 i, res_full_name, hr, D3DERR_INVALIDCALL);
1862 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1863 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1864 i, res_full_name, hr, D3DERR_INVALIDCALL);
1866 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1867 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1868 i, res_full_name, hr, D3DERR_INVALIDCALL);
1870 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1871 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
1872 i, res_full_name, hr, D3DERR_INVALIDCALL);
1874 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1875 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1876 i, res_full_name, hr, D3DERR_INVALIDCALL);
1878 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1879 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1880 i, res_full_name, hr, D3DERR_INVALIDCALL);
1882 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1883 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
1884 i, res_full_name, hr, D3DERR_INVALIDCALL);
1886 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1887 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1888 i, res_full_name, hr, D3DERR_INVALIDCALL);
1890 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1891 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
1892 i, res_full_name, hr, D3DERR_INVALIDCALL);
1894 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1895 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1896 i, res_full_name, hr, D3DERR_INVALIDCALL);
1898 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1899 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1900 i, res_full_name, hr, D3DERR_INVALIDCALL);
1902 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1903 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1904 i, res_full_name, hr, D3DERR_INVALIDCALL);
1906 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
1907 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1908 i, res_full_name, hr, D3DERR_INVALIDCALL);
1910 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
1911 ok(hr == D3D_OK, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1912 i, res_full_name, hr, D3D_OK);
1914 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1915 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1916 i, res_full_name, hr, D3DERR_INVALIDCALL);
1918 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1919 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1920 i, res_full_name, hr, D3DERR_INVALIDCALL);
1922 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1923 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
1924 i, res_full_name, hr, D3DERR_INVALIDCALL);
1926 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1927 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1928 i, res_full_name, hr, D3DERR_INVALIDCALL);
1930 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
1931 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1932 i, res_full_name, hr, D3DERR_INVALIDCALL);
1934 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1935 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
1936 i, res_full_name, hr, D3DERR_INVALIDCALL);
1938 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1939 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1940 i, res_full_name, hr, D3DERR_INVALIDCALL);
1942 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1943 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1944 i, res_full_name, hr, D3DERR_INVALIDCALL);
1946 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1947 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1948 i, res_full_name, hr, D3DERR_INVALIDCALL);
1950 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
1951 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1952 i, res_full_name, hr, D3DERR_INVALIDCALL);
1954 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
1955 ok(hr == D3D_OK, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1956 i, res_full_name, hr, D3D_OK);
1958 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1959 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1960 i, res_full_name, hr, D3DERR_INVALIDCALL);
1962 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1963 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1964 i, res_full_name, hr, D3DERR_INVALIDCALL);
1966 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
1967 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1968 i, res_full_name, hr, D3DERR_INVALIDCALL);
1970 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1971 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1972 i, res_full_name, hr, D3DERR_INVALIDCALL);
1974 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
1975 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1976 i, res_full_name, hr, D3DERR_INVALIDCALL);
1978 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1979 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1980 i, res_full_name, hr, D3DERR_INVALIDCALL);
1982 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1984 /* SetBool */
1985 bvalue = 5;
1986 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1987 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
1988 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1990 bvalue = TRUE;
1991 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
1992 ok(hr == D3D_OK, "%u - %s: SetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1994 else
1996 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1997 i, res_full_name, hr, D3DERR_INVALIDCALL);
1999 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2000 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2002 /* SetBoolArray */
2003 *input_value = 1;
2004 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
2006 *(input_value + l) = *(input_value + l - 1) + 1;
2008 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2009 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
2010 if (res_desc->Class == D3DXPC_SCALAR
2011 || res_desc->Class == D3DXPC_VECTOR
2012 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2014 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2016 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
2018 ok(hr == D3D_OK, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2020 else
2022 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
2023 i, res_full_name, hr, D3DERR_INVALIDCALL);
2025 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2026 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2028 /* SetInt */
2029 ivalue = 0x1fbf02ff;
2030 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2031 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2032 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2034 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2035 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2037 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2038 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2039 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2041 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2042 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2043 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2044 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2045 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2046 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2047 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2048 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2050 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2051 i, res_full_name, hr, D3D_OK);
2053 else
2055 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2056 i, res_full_name, hr, D3DERR_INVALIDCALL);
2058 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2059 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2061 /* SetIntArray */
2062 *input_value = 123456;
2063 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2065 *(input_value + l) = *(input_value + l - 1) + 23;
2067 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2068 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2069 if (res_desc->Class == D3DXPC_SCALAR
2070 || res_desc->Class == D3DXPC_VECTOR
2071 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2073 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2075 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2077 ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2079 else
2081 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
2082 i, res_full_name, hr, D3DERR_INVALIDCALL);
2084 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2085 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2087 /* SetFloat */
2088 fvalue = 1.33;
2089 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2090 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2091 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2093 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2094 ok(hr == D3D_OK, "%u - %s: SetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2096 else
2098 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
2099 i, res_full_name, hr, D3DERR_INVALIDCALL);
2101 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2102 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2104 /* SetFloatArray */
2105 fvalue = 1.33;
2106 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2108 *(input_value + l) = *(DWORD *)&fvalue;
2109 fvalue += 1.12;
2111 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2112 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2113 if (res_desc->Class == D3DXPC_SCALAR
2114 || res_desc->Class == D3DXPC_VECTOR
2115 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2117 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2119 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2121 ok(hr == D3D_OK, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2123 else
2125 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
2126 i, res_full_name, hr, D3DERR_INVALIDCALL);
2128 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2129 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2131 /* SetVector */
2132 fvalue = -1.33;
2133 for (l = 0; l < 4; ++l)
2135 *(input_value + l) = *(DWORD *)&fvalue;
2136 fvalue += 1.12;
2138 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2139 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2140 if (!res_desc->Elements &&
2141 (res_desc->Class == D3DXPC_SCALAR
2142 || res_desc->Class == D3DXPC_VECTOR))
2144 /* only values between 0 and INT_FLOAT_MULTI are valid */
2145 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2147 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2148 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2149 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2150 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2152 else
2154 for (l = 0; l < 4; ++l)
2156 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2159 ok(hr == D3D_OK, "%u - %s: SetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2161 else
2163 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
2164 i, res_full_name, hr, D3DERR_INVALIDCALL);
2166 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2167 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2169 /* SetVectorArray */
2170 for (element = 0; element < res_desc->Elements + 1; ++element)
2172 fvalue = 1.33;
2173 for (l = 0; l < element * 4; ++l)
2175 *(input_value + l) = *(DWORD *)&fvalue;
2176 fvalue += 1.12;
2178 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2179 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
2180 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
2182 for (m = 0; m < element; ++m)
2184 for (l = 0; l < res_desc->Columns; ++l)
2186 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2189 ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2191 else
2193 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
2194 i, res_full_name, hr, D3DERR_INVALIDCALL);
2196 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2197 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2200 /* SetMatrix */
2201 fvalue = 1.33;
2202 for (l = 0; l < 16; ++l)
2204 *(input_value + l) = *(DWORD *)&fvalue;
2205 fvalue += 1.12;
2207 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2208 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2209 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2211 for (l = 0; l < 4; ++l)
2213 for (m = 0; m < 4; ++m)
2215 if (m < res_desc->Rows && l < res_desc->Columns)
2216 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2217 input_value + l + m * 4, D3DXPT_FLOAT);
2221 ok(hr == D3D_OK, "%u - %s: SetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2223 else
2225 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
2226 i, res_full_name, hr, D3DERR_INVALIDCALL);
2228 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2229 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2231 /* SetMatrixArray */
2232 for (element = 0; element < res_desc->Elements + 1; ++element)
2234 fvalue = 1.33;
2235 for (l = 0; l < element * 16; ++l)
2237 *(input_value + l) = *(DWORD *)&fvalue;
2238 fvalue += 1.12;
2240 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2241 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2242 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2244 for (n = 0; n < element; ++n)
2246 for (l = 0; l < 4; ++l)
2248 for (m = 0; m < 4; ++m)
2250 if (m < res_desc->Rows && l < res_desc->Columns)
2251 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2252 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2257 ok(hr == D3D_OK, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2259 else
2261 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
2262 i, res_full_name, hr, D3DERR_INVALIDCALL);
2264 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2265 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2268 /* SetMatrixPointerArray */
2269 for (element = 0; element < res_desc->Elements + 1; ++element)
2271 fvalue = 1.33;
2272 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2274 *(input_value + l) = *(DWORD *)&fvalue;
2275 fvalue += 1.12;
2277 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2278 for (l = 0; l < element; ++l)
2280 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2282 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
2283 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2285 for (n = 0; n < element; ++n)
2287 for (l = 0; l < 4; ++l)
2289 for (m = 0; m < 4; ++m)
2291 if (m < res_desc->Rows && l < res_desc->Columns)
2292 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2293 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2298 ok(hr == D3D_OK, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2299 i, res_full_name, hr, D3D_OK);
2301 else
2303 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2304 i, res_full_name, hr, D3DERR_INVALIDCALL);
2306 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2307 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2310 /* SetMatrixTranspose */
2311 fvalue = 1.33;
2312 for (l = 0; l < 16; ++l)
2314 *(input_value + l) = *(DWORD *)&fvalue;
2315 fvalue += 1.12;
2317 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2318 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2319 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2321 for (l = 0; l < 4; ++l)
2323 for (m = 0; m < 4; ++m)
2325 if (m < res_desc->Rows && l < res_desc->Columns)
2326 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2327 input_value + l * 4 + m, D3DXPT_FLOAT);
2331 ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2333 else
2335 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2336 i, res_full_name, hr, D3DERR_INVALIDCALL);
2338 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2339 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2341 /* SetMatrixTransposeArray */
2342 for (element = 0; element < res_desc->Elements + 1; ++element)
2344 fvalue = 1.33;
2345 for (l = 0; l < element * 16; ++l)
2347 *(input_value + l) = *(DWORD *)&fvalue;
2348 fvalue += 1.12;
2350 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2351 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2352 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2354 for (n = 0; n < element; ++n)
2356 for (l = 0; l < 4; ++l)
2358 for (m = 0; m < 4; ++m)
2360 if (m < res_desc->Rows && l < res_desc->Columns)
2361 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2362 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2367 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2369 else
2371 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2372 i, res_full_name, hr, D3DERR_INVALIDCALL);
2374 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2375 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2378 /* SetMatrixTransposePointerArray */
2379 for (element = 0; element < res_desc->Elements + 1; ++element)
2381 fvalue = 1.33;
2382 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2384 *(input_value + l) = *(DWORD *)&fvalue;
2385 fvalue += 1.12;
2387 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2388 for (l = 0; l < element; ++l)
2390 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2392 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
2393 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2395 for (n = 0; n < element; ++n)
2397 for (l = 0; l < 4; ++l)
2399 for (m = 0; m < 4; ++m)
2401 if (m < res_desc->Rows && l < res_desc->Columns)
2402 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2403 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2408 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2409 i, res_full_name, hr, D3D_OK);
2411 else
2413 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2414 i, res_full_name, hr, D3DERR_INVALIDCALL);
2416 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2417 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2421 count = effect->lpVtbl->Release(effect);
2422 ok(!count, "Release failed %u\n", count);
2426 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2428 static const char expected_string[] = "test_string_1";
2429 static const char expected_string2[] = "test_longer_string_2";
2430 static const char *expected_string_array[] = {expected_string, expected_string2};
2431 const char *string_array[ARRAY_SIZE(expected_string_array)];
2432 const char *string, *string2;
2433 IDirect3DTexture9 *texture_set;
2434 IDirect3DTexture9 *texture;
2435 D3DXHANDLE parameter;
2436 ID3DXEffect *effect;
2437 unsigned int i;
2438 ULONG count;
2439 HRESULT hr;
2441 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2442 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2443 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2445 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2446 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2448 texture = NULL;
2449 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2450 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2451 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2452 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2453 texture_set = NULL;
2454 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2455 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2456 ok(texture == texture_set, "Texture does not match.\n");
2458 count = IDirect3DTexture9_Release(texture_set);
2459 ok(count == 2, "Got reference count %u, expected 2.\n", count);
2460 texture_set = NULL;
2461 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2462 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2463 count = IDirect3DTexture9_Release(texture);
2464 ok(!count, "Got reference count %u, expected 0.\n", count);
2466 hr = effect->lpVtbl->SetString(effect, "s", expected_string);
2467 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2468 string = NULL;
2469 hr = effect->lpVtbl->GetString(effect, "s", &string);
2470 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2471 hr = effect->lpVtbl->GetString(effect, "s", &string2);
2472 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2474 ok(string != expected_string, "String pointers are the same.\n");
2475 ok(string == string2, "String pointers differ.\n");
2476 ok(!strcmp(string, expected_string), "Unexpected string '%s'.\n", string);
2478 string = expected_string2;
2479 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) - 1);
2480 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
2481 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string));
2482 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2483 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) * 2);
2484 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2485 string = NULL;
2486 hr = effect->lpVtbl->GetValue(effect, "s", &string, sizeof(string));
2487 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2489 ok(string != expected_string2, "String pointers are the same.\n");
2490 ok(!strcmp(string, expected_string2), "Unexpected string '%s'.\n", string);
2492 hr = effect->lpVtbl->SetValue(effect, "s_2", expected_string_array,
2493 sizeof(expected_string_array));
2494 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2495 hr = effect->lpVtbl->GetValue(effect, "s_2", string_array,
2496 sizeof(string_array));
2497 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2498 for (i = 0; i < ARRAY_SIZE(expected_string_array); ++i)
2500 ok(!strcmp(string_array[i], expected_string_array[i]), "Unexpected string '%s', i %u.\n",
2501 string_array[i], i);
2503 effect->lpVtbl->Release(effect);
2507 * fxc.exe /Tfx_2_0
2509 #if 0
2510 float a = 2.1;
2511 float b[1];
2512 float c <float d = 3;>;
2513 struct {float e;} f;
2514 float g <float h[1] = {3};>;
2515 struct s {float j;};
2516 float i <s k[1] = {4};>;
2517 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2518 #endif
2519 static const DWORD test_effect_variable_names_blob[] =
2521 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2522 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2523 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2524 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2525 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2526 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2527 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2528 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2529 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2530 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2531 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2532 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2533 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2534 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2535 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2536 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2537 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2538 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2539 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2540 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2541 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2542 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2543 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2544 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2545 0x000001f4, 0x00000000, 0x00000000,
2548 static void test_effect_variable_names(IDirect3DDevice9 *device)
2550 ID3DXEffect *effect;
2551 ULONG count;
2552 HRESULT hr;
2553 D3DXHANDLE parameter, p;
2555 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2556 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2557 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2560 * check invalid calls
2561 * This will crash:
2562 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2564 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2565 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2567 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2568 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2570 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2571 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2573 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2574 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2576 /* float a; */
2577 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2578 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2580 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2581 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2583 /* members */
2584 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2585 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2587 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2588 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2590 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2591 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2593 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2594 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2596 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2597 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2599 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2600 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2602 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2603 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2605 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2606 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2608 /* elements */
2609 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2610 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2612 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2613 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2615 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2616 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2618 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2619 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2621 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2622 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2624 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2625 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2627 /* annotations */
2628 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2629 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2631 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2632 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2634 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2635 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2637 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2638 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2640 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2641 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2643 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2644 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2646 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2647 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2649 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2650 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2652 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2653 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2655 /* float b[1]; */
2656 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2657 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2659 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2660 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2662 /* elements */
2663 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2664 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2666 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2667 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2669 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2670 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2672 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2673 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2675 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2676 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2678 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2679 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2681 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2682 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2684 /* float c <float d = 3;>; */
2685 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2686 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2688 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2689 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2691 /* annotations */
2692 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2693 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2695 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2696 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2698 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2699 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2701 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2702 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2704 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2705 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2707 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2708 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2710 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2711 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2713 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2714 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2716 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2717 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2719 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2720 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2722 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2723 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2725 /* struct {float e;} f; */
2726 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2727 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2729 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2730 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2732 /* members */
2733 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2734 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2736 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2737 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2739 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2740 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2742 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2743 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2745 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2746 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2748 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2749 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2751 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2752 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2754 /* float g <float h[1] = {3};>; */
2755 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2756 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2758 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2759 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2761 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2762 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2764 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2765 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2767 /* struct s {float j;}; float i <s k[1] = {4};>; */
2768 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2769 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2771 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2772 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2774 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2775 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2777 /* technique t <s l[1] = {5};> */
2778 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2779 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2781 /* pass p <s m[1] = {6};> */
2782 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2783 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2785 count = effect->lpVtbl->Release(effect);
2786 ok(!count, "Release failed %u\n", count);
2789 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2791 ID3DXEffect *effect;
2792 ID3DXBuffer *compilation_errors;
2793 HRESULT hr;
2795 /* Test binary effect */
2796 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2797 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2798 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
2799 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2801 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2802 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2803 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2804 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2805 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2806 effect->lpVtbl->Release(effect);
2810 * fxc.exe /Tfx_2_0
2812 #if 0
2813 vertexshader vs_arr1[2] =
2817 vs_1_1
2818 def c0, 1, 1, 1, 1
2819 mov oPos, c0
2823 vs_2_0
2824 def c0, 2, 2, 2, 2
2825 mov oPos, c0
2829 sampler sampler1 =
2830 sampler_state
2832 MipFilter = LINEAR;
2835 float4x4 camera : VIEW = {4.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,6.0};
2836 technique tech0
2838 pass p0
2840 vertexshader = vs_arr1[1];
2841 VertexShaderConstant1[3] = {2,2,2,2};
2842 BlendOp = 2;
2843 AlphaOp[3] = 4;
2844 ZEnable = true;
2845 WorldTransform[1]={2.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,4.0};
2846 ViewTransform=(camera);
2847 LightEnable[2] = TRUE;
2848 LightType[2] = POINT;
2849 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2850 Sampler[1] = sampler1;
2853 #endif
2854 static const DWORD test_effect_states_effect_blob[] =
2856 0xfeff0901, 0x000002e8, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2857 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2858 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2859 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2860 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2861 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2862 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2863 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2864 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40000000, 0x40000000,
2865 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2866 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2867 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2868 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2869 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2870 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2871 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2872 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2873 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2874 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2875 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2876 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2877 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2878 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2879 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2880 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2881 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x000002dc, 0x00000000, 0x00000001, 0x000002d4,
2882 0x00000000, 0x0000000b, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000003,
2883 0x00000120, 0x00000110, 0x0000004b, 0x00000000, 0x00000140, 0x0000013c, 0x0000006b, 0x00000003,
2884 0x00000160, 0x0000015c, 0x00000000, 0x00000000, 0x00000180, 0x0000017c, 0x0000007d, 0x00000001,
2885 0x000001dc, 0x0000019c, 0x0000007c, 0x00000000, 0x00000238, 0x000001f8, 0x00000091, 0x00000002,
2886 0x00000258, 0x00000254, 0x00000084, 0x00000002, 0x00000278, 0x00000274, 0x00000088, 0x00000002,
2887 0x000002a0, 0x00000294, 0x000000b2, 0x00000001, 0x000002c0, 0x000002bc, 0x00000002, 0x00000003,
2888 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
2889 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200,
2890 0x05000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x02000001, 0xc00f0000,
2891 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000000a, 0x00000001, 0x00000009,
2892 0x706d6173, 0x3172656c, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000006, 0x00000000,
2893 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443, 0x0000001c, 0x0000008b, 0x46580200, 0x00000001,
2894 0x0000001c, 0x20000100, 0x00000088, 0x00000030, 0x00000002, 0x00000004, 0x00000038, 0x00000048,
2895 0x656d6163, 0xab006172, 0x00030003, 0x00040004, 0x00000001, 0x00000000, 0x40800000, 0x00000000,
2896 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2897 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369,
2898 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2899 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
2900 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
2901 0x00000000, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
2902 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000004,
2903 0x00000008, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000004,
2904 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
2905 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272, 0x00005d31,
2907 #define TEST_EFFECT_STATES_VSHADER_POS 271
2909 static void test_effect_states(IDirect3DDevice9 *device)
2911 D3DMATRIX test_mat =
2913 -1.0f, 0.0f, 0.0f, 0.0f,
2914 0.0f, 0.0f, 0.0f, 0.0f,
2915 0.0f, 0.0f, 0.0f, 0.0f,
2916 0.0f, 0.0f, 0.0f, 0.0f
2917 }}};
2918 D3DMATRIX test_mat_camera =
2920 4.0f, 0.0f, 0.0f, 0.0f,
2921 0.0f, 0.0f, 0.0f, 0.0f,
2922 0.0f, 0.0f, 0.0f, 0.0f,
2923 0.0f, 0.0f, 0.0f, 6.0f
2924 }}};
2925 D3DMATRIX test_mat_world1 =
2927 2.0f, 0.0f, 0.0f, 0.0f,
2928 0.0f, 0.0f, 0.0f, 0.0f,
2929 0.0f, 0.0f, 0.0f, 0.0f,
2930 0.0f, 0.0f, 0.0f, 4.0f
2931 }}};
2932 D3DMATRIX mat;
2933 HRESULT hr;
2934 ID3DXEffect *effect;
2935 UINT npasses;
2936 DWORD value;
2937 IDirect3DVertexShader9 *vshader;
2938 void *byte_code;
2939 UINT byte_code_size;
2940 BOOL bval;
2941 D3DLIGHT9 light;
2942 float float_data[4];
2944 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
2945 NULL, NULL, 0, NULL, &effect, NULL);
2946 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2948 /* State affected in passes saved/restored even if no pass
2949 was performed. States not present in passes are not saved &
2950 restored */
2951 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
2952 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2953 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
2954 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2956 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2957 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2958 ok(npasses == 1, "Expected 1 pass, got %u\n", npasses);
2960 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
2961 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2962 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
2963 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2965 hr = effect->lpVtbl->End(effect);
2966 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2968 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2969 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2970 ok(value == 1, "Got result %u, expected %u.\n", value, 1);
2971 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
2972 ok(value == 2, "Got result %u, expected %u.\n", value, 2);
2974 /* Test states application in BeginPass. No states are restored
2975 on EndPass. */
2976 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
2977 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2978 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
2979 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2981 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
2982 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2983 if (hr == D3D_OK)
2984 ok(!bval, "Got result %u, expected 0.\n", bval);
2986 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
2987 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2988 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2990 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2991 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2992 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
2994 hr = effect->lpVtbl->BeginPass(effect, 0);
2995 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2997 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2998 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2999 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
3001 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
3002 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3003 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
3005 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3006 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3007 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3009 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3010 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3011 ok(vshader != NULL, "Got NULL vshader.\n");
3012 if (vshader)
3014 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
3015 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3016 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
3017 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
3018 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3019 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
3020 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
3021 "Incorrect shader selected.\n");
3022 HeapFree(GetProcessHeap(), 0, byte_code);
3023 IDirect3DVertexShader9_Release(vshader);
3026 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3027 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3028 if (hr == D3D_OK)
3029 ok(bval, "Got result %u, expected TRUE.\n", bval);
3030 hr = IDirect3DDevice9_GetLight(device, 2, &light);
3031 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3032 if (hr == D3D_OK)
3033 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
3034 "Got unexpected light position (%f, %f, %f).\n", light.Position.x, light.Position.y, light.Position.z);
3035 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, float_data, 1);
3036 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3037 ok(float_data[0] == 2.0f && float_data[1] == 2.0f && float_data[2] == 2.0f && float_data[3] == 2.0f,
3038 "Got unexpected vertex shader floats: (%f %f %f %f).\n",
3039 float_data[0], float_data[1], float_data[2], float_data[3]);
3041 hr = effect->lpVtbl->EndPass(effect);
3042 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3043 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3044 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3045 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3047 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
3048 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3049 ok(value, "Got result %u, expected TRUE.\n", value);
3051 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
3052 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3053 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %u.\n", value);
3055 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
3056 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3057 ok(value == 4, "Unexpected texture stage 3 AlphaOp %u.\n", value);
3059 hr = effect->lpVtbl->End(effect);
3060 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3062 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3063 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3064 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
3066 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3067 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3068 if (hr == D3D_OK)
3069 ok(!bval, "Got result %u, expected 0.\n", bval);
3071 /* State is not restored if effect is released without End call */
3072 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3073 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3075 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3076 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3078 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3079 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3081 effect->lpVtbl->Release(effect);
3083 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3084 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3085 ok(value == 3, "Got result %u, expected %u.\n", value, 1);
3089 * fxc.exe /Tfx_2_0
3091 #if 0
3092 float4 g_Pos1;
3093 float4 g_Pos2;
3094 float4 g_Selector[3] = {{0, 0, 0, 0}, {10, 10, 10, 10}, {5001, 5002, 5003, 5004}};
3096 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3097 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3098 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3100 float4 vect_sampler = {1, 2, 3, 4};
3102 float3 vec3 = {1001, 1002, 1003};
3104 int4 g_iVect = {4, 3, 2, 1};
3106 vertexshader vs_arr[3] =
3110 vs_1_0
3111 def c0, 1, 1, 1, 1
3112 mov oPos, c0
3116 vs_1_1
3117 def c0, 2, 2, 2, 2
3118 mov oPos, c0
3122 vs_2_0
3123 def c0, 3, 3, 3, 3
3124 mov oPos, c0
3128 float4x4 m4x4 = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}, {41, 42, 43, 44}};
3130 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3131 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3132 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3133 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3134 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3135 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3136 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3137 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3138 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3139 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3141 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3142 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3144 struct test_struct
3146 float3 v1;
3147 float fv;
3148 float4 v2;
3151 struct struct_array
3153 test_struct ts[2];
3156 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3157 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3158 struct_array ts3 = {{{1, 2, 3}, 4, {5, 6, 7, 8}}, {{9, 10, 11}, 12, {13, 14, 15, 16}}};
3160 float arr1[1] = {91};
3161 shared float arr2[2] = {92, 93};
3163 Texture2D tex1;
3164 Texture2D tex2;
3165 sampler sampler1 =
3166 sampler_state
3168 Texture = tex1;
3169 MinFilter = g_iVect.y;
3170 MagFilter = vect_sampler.x + vect_sampler.y;
3173 sampler samplers_array[2] =
3175 sampler_state
3177 MinFilter = 1;
3178 MagFilter = vect_sampler.x;
3180 sampler_state
3182 MinFilter = 2;
3183 MagFilter = vect_sampler.y;
3187 struct VS_OUTPUT
3189 float4 Position : POSITION;
3190 float2 TextureUV : TEXCOORD0;
3191 float4 Diffuse : COLOR0;
3193 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3194 float3 vNormal : NORMAL,
3195 float2 vTexCoord0 : TEXCOORD0,
3196 uniform int nNumLights,
3197 uniform bool bTexture)
3199 VS_OUTPUT Output;
3201 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3202 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3203 else
3204 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3205 Output.TextureUV = float2(0, 0);
3206 Output.Diffuse = 0;
3207 Output.Diffuse.xyz = mul(vPos, m4x3column);
3208 Output.Diffuse += mul(vPos, m3x4column);
3209 Output.Diffuse += mul(vPos, m3x4row);
3210 Output.Diffuse.xyz += mul(vPos, m4x3row);
3211 Output.Diffuse += mul(vPos, ts1[0].fv);
3212 Output.Diffuse += mul(vPos, ts1[0].v2);
3213 Output.Diffuse += mul(vPos, ts2[1].fv);
3214 Output.Diffuse += mul(vPos, ts2[1].v2);
3215 Output.Diffuse += mul(vPos, arr1[0]);
3216 Output.Diffuse += mul(vPos, arr2[1]);
3217 Output.Diffuse += mul(vPos, ts3.ts[1].fv);
3218 Output.Diffuse += mul(vPos, ts3.ts[1].v2);
3219 Output.Diffuse += tex2Dlod(sampler1, g_Pos1);
3220 Output.Diffuse += tex2Dlod(samplers_array[1], g_Pos1);
3221 return Output;
3224 VS_OUTPUT RenderSceneVS2(float4 vPos : POSITION)
3226 VS_OUTPUT Output;
3228 Output.Position = g_Pos1;
3229 Output.TextureUV = float2(0, 0);
3230 Output.Diffuse = 0;
3231 return Output;
3234 struct PS_OUTPUT
3236 float4 RGBColor : COLOR0; /* Pixel color */
3238 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3240 PS_OUTPUT Output;
3241 int i;
3243 Output.RGBColor = In.Diffuse;
3244 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3245 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3246 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3247 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3248 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3249 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3250 for (i = 0; i < g_iVect.x; ++i)
3251 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3252 if (mb[1][1])
3254 Output.RGBColor += sin(Output.RGBColor);
3255 Output.RGBColor += cos(Output.RGBColor);
3256 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3257 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3258 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3259 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3261 if (mb2x3column[0][0])
3263 Output.RGBColor += sin(Output.RGBColor);
3264 Output.RGBColor += cos(Output.RGBColor);
3265 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3266 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3267 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3268 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3270 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3271 Output.RGBColor += tex2D(samplers_array[0], In.TextureUV);
3272 return Output;
3275 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3276 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3278 technique tech0
3280 pass p0
3282 VertexShader = vs_arr2[g_iVect.w - 1];
3283 PixelShader = ps_arr[g_iVect.w - 1];
3285 LightEnable[0] = TRUE;
3286 LightEnable[1] = TRUE;
3287 LightEnable[2] = TRUE;
3288 LightEnable[3] = TRUE;
3289 LightEnable[4] = TRUE;
3290 LightEnable[5] = TRUE;
3291 LightEnable[6] = TRUE;
3292 LightEnable[7] = TRUE;
3293 LightType[0] = POINT;
3294 LightType[1] = POINT;
3295 LightType[2] = POINT;
3296 LightType[3] = POINT;
3297 LightType[4] = POINT;
3298 LightType[5] = POINT;
3299 LightType[6] = POINT;
3300 LightType[7] = POINT;
3301 LightDiffuse[0] = 1 / opvect1;
3302 LightDiffuse[1] = rsqrt(opvect1);
3303 LightDiffuse[2] = opvect1 * opvect2;
3304 LightDiffuse[3] = opvect1 + opvect2;
3305 LightDiffuse[4] = float4(opvect1 < opvect2);
3306 LightDiffuse[5] = float4(opvect1 >= opvect2);
3307 LightDiffuse[6] = -opvect1;
3308 LightDiffuse[7] = rcp(opvect1);
3310 LightAmbient[0] = frac(opvect1);
3311 LightAmbient[1] = min(opvect1, opvect2);
3312 LightAmbient[2] = max(opvect1, opvect2);
3313 LightAmbient[3] = sin(opvect1);
3314 LightAmbient[4] = cos(opvect1);
3315 LightAmbient[5] = 1e-2 / opvect1;
3316 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3317 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3319 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3320 dot(opvect1.zzzx, opvect2.xxyy), 0);
3321 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3322 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3323 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3324 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3325 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3327 FogEnable = TRUE;
3328 FogDensity = ts2[0].fv;
3329 FogStart = ts2[1].fv;
3330 PointScale_A = ts3.ts[0].fv;
3331 PointScale_B = ts3.ts[1].fv;
3333 pass p1
3335 VertexShader = vs_arr[g_iVect.z];
3338 #endif
3339 static const DWORD test_effect_preshader_effect_blob[] =
3341 0xfeff0901, 0x00001160, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3342 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3343 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3344 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3345 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3346 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3347 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3348 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3349 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3350 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3351 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3352 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3353 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3354 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3355 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3356 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3357 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3358 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3359 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3360 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3361 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3362 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3363 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3364 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3365 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3366 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3367 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3368 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3369 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3370 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3371 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3372 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3373 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3374 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3375 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3376 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3377 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3378 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3379 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3380 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3381 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3382 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3383 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3384 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3385 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3386 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3387 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3388 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3389 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3390 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3391 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3392 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3393 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3394 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3395 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3396 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3397 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3398 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3399 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3400 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3401 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3402 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3403 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3404 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3405 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3406 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3407 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3408 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3409 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3410 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3411 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3412 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3413 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3414 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3415 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3416 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3417 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3418 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3419 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3420 0x00000000, 0x0000000a, 0x00000004, 0x00000ab8, 0x00000000, 0x00000002, 0x00000001, 0x00000002,
3421 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3422 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3423 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3424 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000aa,
3425 0x00000100, 0x000009f4, 0x000009f0, 0x000000a9, 0x00000100, 0x00000a14, 0x00000a10, 0x00000002,
3426 0x000000aa, 0x00000100, 0x00000a34, 0x00000a30, 0x000000a9, 0x00000100, 0x00000a54, 0x00000a50,
3427 0x0000000f, 0x706d6173, 0x7372656c, 0x7272615f, 0x00007961, 0x00000010, 0x00000004, 0x00000ae8,
3428 0x00000000, 0x00000002, 0x00000007, 0x00000008, 0x00000008, 0x615f7376, 0x00327272, 0x0000000f,
3429 0x00000004, 0x00000b0c, 0x00000000, 0x00000001, 0x00000009, 0x00000007, 0x615f7370, 0x00007272,
3430 0x0000000a, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x0000000b, 0x0000000f,
3431 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3432 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3433 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3434 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3435 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3436 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3437 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3438 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3439 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3440 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3441 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3442 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3443 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3444 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3445 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3446 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3447 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3448 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3449 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3450 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3451 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3452 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3453 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3454 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3455 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3456 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3457 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3458 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3459 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3460 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3461 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3462 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3463 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3464 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3465 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3466 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3467 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3468 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3469 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3470 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3471 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3472 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3473 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3474 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3475 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3476 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3477 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3478 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x0000000c,
3479 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006,
3480 0x68636574, 0x00000030, 0x00000022, 0x00000001, 0x0000000e, 0x0000000d, 0x00000004, 0x00000020,
3481 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000, 0x00000000, 0x00000074, 0x00000090,
3482 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
3483 0x00000000, 0x00000000, 0x00000140, 0x0000015c, 0x00000000, 0x00000000, 0x00000178, 0x00000194,
3484 0x00000000, 0x00000000, 0x000001b8, 0x000001d4, 0x00000000, 0x00000000, 0x000001ec, 0x00000208,
3485 0x00000000, 0x00000000, 0x00000224, 0x00000238, 0x00000000, 0x00000000, 0x00000250, 0x0000026c,
3486 0x00000000, 0x00000000, 0x000002b8, 0x000002d4, 0x00000000, 0x00000000, 0x00000310, 0x0000032c,
3487 0x00000000, 0x00000000, 0x00000368, 0x00000384, 0x00000000, 0x00000000, 0x000003c4, 0x000003e0,
3488 0x00000000, 0x00000000, 0x00000420, 0x0000043c, 0x00000000, 0x00000000, 0x00000458, 0x00000474,
3489 0x00000000, 0x00000000, 0x00000494, 0x000004b0, 0x00000000, 0x00000000, 0x000004d4, 0x000004f0,
3490 0x00000000, 0x00000000, 0x00000518, 0x00000534, 0x00000000, 0x00000000, 0x00000558, 0x00000574,
3491 0x00000000, 0x00000000, 0x0000059c, 0x000005b8, 0x00000000, 0x00000000, 0x000005e0, 0x000005fc,
3492 0x00000000, 0x00000000, 0x00000624, 0x00000690, 0x00000000, 0x00000000, 0x000006d0, 0x0000073c,
3493 0x00000001, 0x00000000, 0x0000079c, 0x00000820, 0x00000000, 0x00000000, 0x00000888, 0x000008a4,
3494 0x00000000, 0x00000000, 0x000008b4, 0x000008d0, 0x00000001, 0x00000000, 0x000008e4, 0x000008f8,
3495 0x00000000, 0x00000000, 0x00000908, 0x0000091c, 0x00000000, 0x00000000, 0x0000092c, 0x00000998,
3496 0x00000000, 0x00000000, 0x000009dc, 0x00000a70, 0x00000000, 0x00000000, 0x00000acc, 0x00000ae0,
3497 0x00000001, 0x00000000, 0x00000af4, 0x00000b08, 0x00000000, 0x00000000, 0x00001154, 0x00000000,
3498 0x00000002, 0x0000112c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000b1c, 0x00000b18,
3499 0x00000093, 0x00000000, 0x00000b34, 0x00000b30, 0x00000091, 0x00000000, 0x00000b4c, 0x00000b48,
3500 0x00000091, 0x00000001, 0x00000b6c, 0x00000b68, 0x00000091, 0x00000002, 0x00000b8c, 0x00000b88,
3501 0x00000091, 0x00000003, 0x00000bac, 0x00000ba8, 0x00000091, 0x00000004, 0x00000bcc, 0x00000bc8,
3502 0x00000091, 0x00000005, 0x00000bec, 0x00000be8, 0x00000091, 0x00000006, 0x00000c0c, 0x00000c08,
3503 0x00000091, 0x00000007, 0x00000c2c, 0x00000c28, 0x00000084, 0x00000000, 0x00000c4c, 0x00000c48,
3504 0x00000084, 0x00000001, 0x00000c6c, 0x00000c68, 0x00000084, 0x00000002, 0x00000c8c, 0x00000c88,
3505 0x00000084, 0x00000003, 0x00000cac, 0x00000ca8, 0x00000084, 0x00000004, 0x00000ccc, 0x00000cc8,
3506 0x00000084, 0x00000005, 0x00000cec, 0x00000ce8, 0x00000084, 0x00000006, 0x00000d0c, 0x00000d08,
3507 0x00000084, 0x00000007, 0x00000d2c, 0x00000d28, 0x00000085, 0x00000000, 0x00000d58, 0x00000d48,
3508 0x00000085, 0x00000001, 0x00000d84, 0x00000d74, 0x00000085, 0x00000002, 0x00000db0, 0x00000da0,
3509 0x00000085, 0x00000003, 0x00000ddc, 0x00000dcc, 0x00000085, 0x00000004, 0x00000e08, 0x00000df8,
3510 0x00000085, 0x00000005, 0x00000e34, 0x00000e24, 0x00000085, 0x00000006, 0x00000e60, 0x00000e50,
3511 0x00000085, 0x00000007, 0x00000e8c, 0x00000e7c, 0x00000087, 0x00000000, 0x00000eb8, 0x00000ea8,
3512 0x00000087, 0x00000001, 0x00000ee4, 0x00000ed4, 0x00000087, 0x00000002, 0x00000f10, 0x00000f00,
3513 0x00000087, 0x00000003, 0x00000f3c, 0x00000f2c, 0x00000087, 0x00000004, 0x00000f68, 0x00000f58,
3514 0x00000087, 0x00000005, 0x00000f94, 0x00000f84, 0x00000087, 0x00000006, 0x00000fc0, 0x00000fb0,
3515 0x00000087, 0x00000007, 0x00000fec, 0x00000fdc, 0x00000086, 0x00000000, 0x00001018, 0x00001008,
3516 0x00000086, 0x00000001, 0x00001044, 0x00001034, 0x00000086, 0x00000002, 0x00001070, 0x00001060,
3517 0x0000000e, 0x00000000, 0x00001090, 0x0000108c, 0x00000014, 0x00000000, 0x000010b0, 0x000010ac,
3518 0x00000012, 0x00000000, 0x000010d0, 0x000010cc, 0x00000041, 0x00000000, 0x000010f0, 0x000010ec,
3519 0x00000042, 0x00000000, 0x00001110, 0x0000110c, 0x0000114c, 0x00000000, 0x00000001, 0x00000092,
3520 0x00000000, 0x00001138, 0x00001134, 0x00000008, 0x0000001f, 0x00000009, 0x00000ad0, 0xffff0300,
3521 0x00d9fffe, 0x42415443, 0x0000001c, 0x0000032f, 0xffff0300, 0x0000000b, 0x0000001c, 0x00000000,
3522 0x00000328, 0x000000f8, 0x00000001, 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x00080002,
3523 0x00000002, 0x0000012c, 0x0000013c, 0x0000015c, 0x00060002, 0x00000002, 0x00000164, 0x00000174,
3524 0x00000194, 0x00000002, 0x00000003, 0x000001a0, 0x000001b0, 0x000001e0, 0x000a0002, 0x00000002,
3525 0x000001e8, 0x000001f8, 0x00000218, 0x000c0002, 0x00000002, 0x00000224, 0x00000234, 0x00000254,
3526 0x00030002, 0x00000003, 0x0000025c, 0x0000026c, 0x0000029c, 0x00050000, 0x00000001, 0x000002a8,
3527 0x000002b8, 0x000002d0, 0x00000000, 0x00000005, 0x000002dc, 0x000002b8, 0x000002ec, 0x00000003,
3528 0x00000001, 0x000002f8, 0x00000000, 0x00000308, 0x00010003, 0x00000001, 0x00000318, 0x00000000,
3529 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x00000004, 0x00000003,
3530 0x00000002, 0x00000001, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001,
3531 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3532 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3533 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d,
3534 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3535 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000,
3536 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000,
3537 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3538 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000,
3539 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d,
3540 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3541 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000,
3542 0x00000000, 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00010003, 0x00030002, 0x00000001, 0x00000000,
3543 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x7832626d, 0x776f7233,
3544 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, 0x706d6173, 0x3172656c, 0xababab00,
3545 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c, 0x7272615f, 0xab007961,
3546 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x335f7370, 0x4d00305f, 0x6f726369, 0x74666f73,
3547 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3548 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, 0x3f800000, 0xbe22f983,
3549 0x05000051, 0xa00f000f, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x05000051, 0xa00f0010,
3550 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x0200001f, 0x80000005, 0x90030000, 0x0200001f,
3551 0x8000000a, 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801,
3552 0x03000005, 0x80030000, 0xa0e40007, 0x90550001, 0x04000004, 0x80030000, 0x90000001, 0xa0e40006,
3553 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40001, 0x02000001, 0x80010001, 0xa0000010,
3554 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3555 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000,
3556 0xa0440004, 0x90550001, 0x04000004, 0x800c0000, 0x90000001, 0xa0440003, 0x80e40000, 0x04000004,
3557 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000,
3558 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d,
3559 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, 0x90550001,
3560 0x04000004, 0x800e0001, 0x90000001, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001,
3561 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000,
3562 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002,
3563 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, 0x02000001,
3564 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000, 0x03000002, 0x80070003, 0x80e40002, 0x80e40003,
3565 0x00000027, 0x01000028, 0xe0e40804, 0x02000001, 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000,
3566 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000,
3567 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004,
3568 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002,
3569 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002,
3570 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003,
3571 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e,
3572 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, 0xa000000f,
3573 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002,
3574 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010, 0x04000004,
3575 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004,
3576 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003,
3577 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a,
3578 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002,
3579 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x800e0001, 0x80550000,
3580 0xa090000b, 0x04000004, 0x800e0001, 0x80000000, 0xa090000a, 0x80e40001, 0x03000002, 0x80070003,
3581 0x80e40000, 0x80f90001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000,
3582 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000,
3583 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000, 0x04000004,
3584 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000,
3585 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001, 0x0000002b, 0x01000028, 0xe0e40805, 0x04000004,
3586 0x800f0000, 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004,
3587 0x800f0000, 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000,
3588 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3589 0x80e40002, 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004,
3590 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002,
3591 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000,
3592 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3593 0xa000000f, 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004,
3594 0x80e40002, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010,
3595 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002,
3596 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002,
3597 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001,
3598 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003,
3599 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x80070001,
3600 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000, 0xa0e4000a, 0x80e40001, 0x03000002,
3601 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008,
3602 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005,
3603 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000,
3604 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000,
3605 0x80e40000, 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0000,
3606 0x80e40000, 0x80e40003, 0x03000042, 0x800f0001, 0x90e40000, 0xa0e40801, 0x03000002, 0x800f0800,
3607 0x80e40000, 0x80e40001, 0x0000ffff, 0x00000007, 0x00000b6c, 0xfffe0300, 0x013cfffe, 0x42415443,
3608 0x0000001c, 0x000004bb, 0xfffe0300, 0x0000000c, 0x0000001c, 0x00000000, 0x000004b4, 0x0000010c,
3609 0x00200002, 0x00000001, 0x00000114, 0x00000124, 0x00000134, 0x001d0002, 0x00000002, 0x0000013c,
3610 0x0000014c, 0x0000016c, 0x001f0002, 0x00000001, 0x00000174, 0x00000184, 0x00000194, 0x00100002,
3611 0x00000004, 0x000001a0, 0x000001b0, 0x000001f0, 0x00140002, 0x00000003, 0x000001f8, 0x00000208,
3612 0x00000238, 0x00170002, 0x00000003, 0x00000244, 0x00000254, 0x00000284, 0x000c0002, 0x00000004,
3613 0x0000028c, 0x0000029c, 0x000002dc, 0x00020003, 0x00000001, 0x000002e8, 0x00000000, 0x000002f8,
3614 0x00000003, 0x00000002, 0x00000308, 0x00000000, 0x00000318, 0x001a0002, 0x00000003, 0x00000370,
3615 0x00000380, 0x000003b0, 0x00000002, 0x00000006, 0x000003b4, 0x000003c4, 0x00000424, 0x00060002,
3616 0x00000006, 0x00000444, 0x00000454, 0x31727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001,
3617 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, 0x32727261, 0xababab00, 0x00030000,
3618 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, 0x00000000, 0x00000000, 0x42ba0000,
3619 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3620 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63, 0xab006e6d,
3621 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x00000000,
3622 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000, 0x00000000,
3623 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002, 0x00040003,
3624 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3625 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d, 0x756c6f63,
3626 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3627 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000,
3628 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000, 0x41300000,
3629 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, 0x41f80000,
3630 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000, 0x706d6173,
3631 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c,
3632 0x7272615f, 0xab007961, 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x00317374, 0xab003176,
3633 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3634 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0000031c, 0x00000320,
3635 0x00000330, 0x00000334, 0x00000344, 0x00000348, 0x00000005, 0x00080001, 0x00030001, 0x00000358,
3636 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000,
3637 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005, 0x00080001, 0x00030002,
3638 0x00000358, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3639 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000,
3640 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3641 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001, 0x00030002, 0x00000358, 0x00000428,
3642 0x0000042c, 0x00000005, 0x00100001, 0x00010001, 0x0000043c, 0x3f800000, 0x40000000, 0x40400000,
3643 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3644 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000,
3645 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x335f7376, 0x4d00305f, 0x6f726369,
3646 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3647 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250, 0x46580201, 0x0047fffe, 0x42415443,
3648 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c, 0x00000100, 0x000000e4, 0x00000058,
3649 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088,
3650 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173,
3651 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3652 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c,
3653 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3654 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800,
3655 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3656 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250,
3657 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000021,
3658 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018, 0x00000000, 0x00000000,
3659 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3660 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3661 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3662 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3fe00000,
3663 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000, 0x00000000, 0x40100000,
3664 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000, 0x0064fffe, 0x434c5846,
3665 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011, 0x00000000, 0x00000002,
3666 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3667 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000004, 0xa0500004,
3668 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002, 0x0000000c, 0x00000000,
3669 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3670 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004, 0x00000001, 0x00000000,
3671 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000,
3672 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x0000000c,
3673 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000002, 0x00000005,
3674 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3675 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004, 0x20400004, 0x00000002,
3676 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004,
3677 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f0022, 0x00000000, 0x00000000,
3678 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0801,
3679 0x0200001f, 0x90000000, 0xa00f0802, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005,
3680 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017,
3681 0x03000009, 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019,
3682 0x03000008, 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011,
3683 0x03000008, 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013,
3684 0x02000001, 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005,
3685 0x800f0001, 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001,
3686 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000,
3687 0x80e40001, 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000,
3688 0xa0e4000c, 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004,
3689 0x80070001, 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001,
3690 0x04000004, 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000,
3691 0xa0e4001c, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000,
3692 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000,
3693 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004,
3694 0x800f0000, 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a,
3695 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000,
3696 0x80000001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40802, 0x03000002, 0x800f0000, 0x80e40000,
3697 0x80e40001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40801, 0x03000002, 0xe00f0002, 0x80e40000,
3698 0x80e40001, 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff,
3699 0x00000008, 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300,
3700 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73,
3701 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3702 0x332e3235, 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c,
3703 0x0000005b, 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3704 0x00000001, 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3705 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3706 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3707 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3708 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe,
3709 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000,
3710 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3711 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000,
3712 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001,
3713 0xe00f0000, 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001,
3714 0x0000ffff, 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101,
3715 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000,
3716 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000,
3717 0x40000000, 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003,
3718 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000,
3719 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
3720 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443,
3721 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
3722 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
3723 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
3724 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3725 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3726 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3727 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029,
3728 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200,
3729 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4,
3730 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3731 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3732 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064,
3733 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001,
3734 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3735 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3736 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3737 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3738 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3739 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3740 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3741 0x00000000, 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe,
3742 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114,
3743 0x00000030, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031,
3744 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3745 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c,
3746 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074,
3747 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000,
3748 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3749 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3750 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369,
3751 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3752 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3753 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3754 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027,
3755 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200,
3756 0x00000001, 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088,
3757 0x00000098, 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3758 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3759 0x00000000, 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005,
3760 0x00080001, 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3761 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3762 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3763 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3764 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3765 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001,
3766 0x00000000, 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3767 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200,
3768 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3769 0x000000f8, 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176,
3770 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3771 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038,
3772 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070,
3773 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3774 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000,
3775 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000,
3776 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3777 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3778 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004,
3779 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3780 0xffffffff, 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c,
3781 0x000001fb, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002,
3782 0x00000001, 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac,
3783 0x000000ec, 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001,
3784 0x000001d8, 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
3785 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004,
3786 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000,
3787 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000,
3788 0x42080000, 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001,
3789 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001,
3790 0x00040001, 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c,
3791 0x00000120, 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005,
3792 0x00100001, 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3793 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000,
3794 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000,
3795 0x41600000, 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001,
3796 0x00000000, 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3797 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3798 0x332e3235, 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000,
3799 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3800 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3801 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3802 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3803 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3804 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3805 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3806 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3807 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3808 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3809 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3810 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3811 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3812 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3813 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3814 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000,
3815 0x3ff00000, 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e,
3816 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e,
3817 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000,
3818 0x00000002, 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000,
3819 0x00000007, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001,
3820 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004,
3821 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3822 0x0000003c, 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3823 0x0000002f, 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004,
3824 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001,
3825 0x00000030, 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3826 0x0000001c, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007,
3827 0x00000009, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007,
3828 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002,
3829 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3830 0x00000000, 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3831 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002,
3832 0x00000000, 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030,
3833 0x00000000, 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041,
3834 0x00000000, 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002,
3835 0x0000002f, 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031,
3836 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003,
3837 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040,
3838 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000,
3839 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3840 0x00000000, 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe,
3841 0x42415443, 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130,
3842 0x0000006c, 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001,
3843 0x000000c0, 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108,
3844 0x00090002, 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3845 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3846 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67,
3847 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000,
3848 0x3f800000, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3849 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3850 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3851 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3852 0x332e3235, 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
3853 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3854 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3855 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3856 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3857 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3858 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3859 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3860 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3861 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3862 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3863 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3864 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3865 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3866 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3867 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008,
3868 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a,
3869 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000,
3870 0x00000002, 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000,
3871 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000,
3872 0x00000002, 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000,
3873 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
3874 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028,
3875 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001,
3876 0xa0400001, 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001,
3877 0x00000002, 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001,
3878 0x00000002, 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002,
3879 0x0000002b, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
3880 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200,
3881 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3882 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3883 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3884 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3885 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3886 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3887 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
3888 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3889 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3890 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0061fffe,
3891 0x434c5846, 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3892 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000,
3893 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001,
3894 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
3895 0x00000000, 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002,
3896 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3897 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
3898 0x00000004, 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3899 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3900 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002,
3901 0x00000005, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
3902 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
3903 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248,
3904 0x46580200, 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c,
3905 0x20000100, 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
3906 0x00010002, 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0,
3907 0x00000070, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3908 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3909 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001,
3910 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3911 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3912 0x0022fffe, 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3913 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3914 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3915 0x00000000, 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000,
3916 0x00000000, 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002,
3917 0x00000000, 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
3918 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002,
3919 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002,
3920 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3921 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3922 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0,
3923 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
3924 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
3925 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3926 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
3927 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
3928 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3929 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c,
3930 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3931 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3932 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3933 0x002afffe, 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3934 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002,
3935 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3936 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
3937 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
3938 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f,
3939 0x00000000, 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3940 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3941 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3942 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3943 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3944 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3945 0x00000000, 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000,
3946 0x00000000, 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001,
3947 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001,
3948 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001,
3949 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001,
3950 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002,
3951 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
3952 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e,
3953 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3954 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3955 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3956 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3957 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3958 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001,
3959 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3960 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200,
3961 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3962 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
3963 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3964 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3965 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3966 0x000cfffe, 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
3967 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3968 0xffffffff, 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
3969 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
3970 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
3971 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3972 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3973 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3974 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3975 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004,
3976 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
3977 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3978 0x0000001b, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
3979 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
3980 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
3981 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3982 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
3983 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3984 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3985 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002,
3986 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3987 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a,
3988 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3989 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3990 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3991 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3992 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3993 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001,
3994 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3995 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200,
3996 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3997 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
3998 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3999 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4000 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4001 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4002 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4003 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002,
4004 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003,
4005 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4006 0xffffffff, 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
4007 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
4008 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4009 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
4010 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
4011 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
4012 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
4013 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000,
4014 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
4015 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
4016 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
4017 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
4018 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
4019 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4020 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4021 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002,
4022 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4023 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124,
4024 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4025 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4026 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4027 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4028 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4029 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4030 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4031 0x000ffffe, 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4032 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4033 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200,
4034 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
4035 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
4036 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4037 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
4038 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
4039 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4040 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4041 0x434c5846, 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4042 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4043 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
4044 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
4045 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4046 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4047 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4048 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
4049 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4050 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4051 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
4052 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4053 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4054 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4055 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4056 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
4057 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4058 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4059 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4060 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4061 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4062 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4063 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012,
4064 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4065 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4066 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4067 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4068 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4069 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001,
4070 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001,
4071 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001,
4072 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001,
4073 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4074 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008,
4075 0x615f7370, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4076 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4077 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
4078 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4079 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4080 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4081 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000,
4082 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002,
4083 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004,
4084 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
4085 0x00000002, 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443,
4086 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
4087 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4088 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4089 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4090 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000,
4091 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000,
4092 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846,
4093 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001,
4094 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4095 0x0000001f, 0x00000001, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443,
4096 0x0000001c, 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030,
4097 0x00000002, 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00,
4098 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000,
4099 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4100 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4101 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4102 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001f,
4103 0x00000000, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c,
4104 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002,
4105 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001,
4106 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874,
4107 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4108 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4109 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4110 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000,
4111 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c, 0x00000063,
4112 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002, 0x00000001,
4113 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001, 0x00040001,
4114 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874, 0x6f726369,
4115 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4116 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4117 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
4118 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4119 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443,
4120 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4121 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4122 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4123 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4124 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
4125 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4126 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000, 0x00000000,
4127 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4129 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2991
4130 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4132 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4133 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4134 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4135 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4137 unsigned int i = 0;
4139 todo_wine_if(todo)
4140 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4142 if (!bytecode)
4143 return;
4145 while (bytecode[i++] != 0x0000ffff)
4148 if (!bytecode_size)
4149 bytecode_size = i * sizeof(*bytecode);
4150 else
4151 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4153 todo_wine_if(todo)
4154 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4155 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4156 "Incorrect shader selected.\n");
4159 #define test_effect_preshader_compare_shader(a, b, c) \
4160 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4161 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4162 int expected_shader_index, BOOL todo)
4164 IDirect3DVertexShader9 *vshader;
4165 void *byte_code;
4166 unsigned int byte_code_size;
4167 HRESULT hr;
4169 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4170 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#x.\n", hr);
4172 todo_wine_if(todo)
4173 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4174 if (!vshader)
4175 return;
4177 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4178 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#x.\n", hr);
4179 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4181 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
4182 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4183 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4185 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4186 byte_code_size, expected_shader_index, todo);
4188 HeapFree(GetProcessHeap(), 0, byte_code);
4189 IDirect3DVertexShader9_Release(vshader);
4192 static const struct
4194 const char *comment;
4195 BOOL todo[4];
4196 unsigned int result[4];
4197 unsigned int ulps;
4199 test_effect_preshader_op_expected[] =
4201 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4202 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4203 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4204 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4205 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4206 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4207 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4208 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4210 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4211 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4212 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4213 #if __x86_64__
4214 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4215 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4216 #else
4217 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4218 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4219 #endif
4220 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4221 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4222 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4224 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4225 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4226 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4229 enum expected_state_update
4231 EXPECTED_STATE_ZERO,
4232 EXPECTED_STATE_UPDATED,
4233 EXPECTED_STATE_ANYTHING
4236 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4237 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4238 const enum expected_state_update *expected_state, const char *updated_param)
4240 static const D3DCOLORVALUE black = {0.0f};
4241 unsigned int i, j;
4242 D3DLIGHT9 light;
4243 const float *v;
4244 HRESULT hr;
4246 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4248 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4249 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4251 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4252 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4254 for (j = 0; j < 4; ++j)
4256 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4257 ok_(__FILE__, line)(compare_float(v[j],
4258 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4259 test_effect_preshader_op_expected[i].ulps),
4260 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4261 test_effect_preshader_op_expected[i].comment, j,
4262 test_effect_preshader_op_expected[i].result[j],
4263 ((const unsigned int *)v)[j], v[j]);
4266 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4268 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4269 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4270 updated_param, i, test_effect_preshader_op_expected[i].comment);
4275 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
4277 static void test_effect_preshader_clear_vconsts(IDirect3DDevice9 *device)
4279 unsigned int i;
4280 HRESULT hr;
4282 for (i = 0; i < 256; ++i)
4284 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
4285 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4289 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4291 {0.0f, 0.0f, 0.0f, 0.0f},
4292 {0.0f, 0.0f, 0.0f, 0.0f},
4293 {0.0f, 0.0f, 0.0f, 0.0f},
4294 {1.0f, 2.0f, 3.0f, 0.0f},
4295 {4.0f, 0.0f, 0.0f, 0.0f},
4296 {5.0f, 6.0f, 7.0f, 8.0f},
4297 {1.0f, 2.0f, 3.0f, 0.0f},
4298 {4.0f, 0.0f, 0.0f, 0.0f},
4299 {5.0f, 6.0f, 7.0f, 8.0f},
4300 {9.0f, 10.0f, 11.0f, 0.0f},
4301 {12.0f, 0.0f, 0.0f, 0.0f},
4302 {13.0f, 14.0f, 15.0f, 16.0f},
4303 {11.0f, 12.0f, 13.0f, 0.0f},
4304 {21.0f, 22.0f, 23.0f, 0.0f},
4305 {31.0f, 32.0f, 33.0f, 0.0f},
4306 {41.0f, 42.0f, 43.0f, 0.0f},
4307 {11.0f, 21.0f, 31.0f, 0.0f},
4308 {12.0f, 22.0f, 32.0f, 0.0f},
4309 {13.0f, 23.0f, 33.0f, 0.0f},
4310 {14.0f, 24.0f, 34.0f, 0.0f},
4311 {11.0f, 12.0f, 13.0f, 14.0f},
4312 {21.0f, 22.0f, 23.0f, 24.0f},
4313 {31.0f, 32.0f, 33.0f, 34.0f},
4314 {11.0f, 21.0f, 31.0f, 41.0f},
4315 {12.0f, 22.0f, 32.0f, 42.0f},
4316 {13.0f, 23.0f, 33.0f, 43.0f},
4317 {9.0f, 10.0f, 11.0f, 0.0f},
4318 {12.0f, 0.0f, 0.0f, 0.0f},
4319 {13.0f, 14.0f, 15.0f, 16.0f},
4320 {92.0f, 0.0f, 0.0f, 0.0f},
4321 {93.0f, 0.0f, 0.0f, 0.0f},
4322 {0.0f, 0.0f, 0.0f, 0.0f},
4323 {91.0f, 0.0f, 0.0f, 0.0f},
4324 {4.0f, 5.0f, 6.0f, 7.0f},
4326 #define TEST_EFFECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4328 #define test_effect_preshader_compare_vconsts(a, b, c) \
4329 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4330 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4331 const unsigned int *const_updated_mask, const char *updated_param)
4333 HRESULT hr;
4334 unsigned int i;
4335 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4337 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4338 ARRAY_SIZE(test_effect_preshader_fvect_v));
4339 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4341 if (!const_updated_mask)
4343 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4344 "Vertex shader float constants do not match.\n");
4346 else
4348 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4350 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4351 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4353 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4354 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), "
4355 "got (%g, %g, %g, %g), parameter %s.\n",
4356 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4357 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4358 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4360 else
4362 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4363 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4368 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4370 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4371 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4372 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4373 "Vertex shader float constants do not match.\n");
4377 static const BOOL test_effect_preshader_bconsts[] =
4379 TRUE, FALSE, TRUE, FALSE, TRUE, TRUE
4382 static void test_effect_preshader_clear_pbool_consts(IDirect3DDevice9 *device)
4384 BOOL bval;
4385 unsigned int i;
4386 HRESULT hr;
4388 for (i = 0; i < 16; ++i)
4390 bval = i < ARRAY_SIZE(test_effect_preshader_bconsts) ? !test_effect_preshader_bconsts[i] : FALSE;
4391 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4392 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4396 #define test_effect_preshader_compare_pbool_consts(a, b, c) \
4397 test_effect_preshader_compare_pbool_consts_(__LINE__, a, b, c)
4398 static void test_effect_preshader_compare_pbool_consts_(unsigned int line, IDirect3DDevice9 *device,
4399 const unsigned int *const_updated_mask, const char *updated_param)
4401 unsigned int i;
4402 BOOL bdata[16];
4403 HRESULT hr;
4405 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, ARRAY_SIZE(bdata));
4406 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4408 if (!const_updated_mask)
4410 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4412 /* The negation on both sides is actually needed, sometimes you
4413 * get 0xffffffff instead of 1 on native. */
4414 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4415 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u.\n",
4416 test_effect_preshader_bconsts[i], bdata[i], i);
4419 else
4421 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4423 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4424 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4426 /* The negation on both sides is actually needed, sometimes
4427 * you get 0xffffffff instead of 1 on native. */
4428 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4429 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u, parameter %s.\n",
4430 test_effect_preshader_bconsts[i], bdata[i], i, updated_param);
4432 else
4434 ok_(__FILE__, line)(bdata[i] == !test_effect_preshader_bconsts[i],
4435 "Pixel shader boolean constants updated unexpectedly, parameter %s.\n", updated_param);
4440 for (; i < 16; ++i)
4442 ok_(__FILE__, line)(!bdata[i], "Got result %#x, boolean register value %u.\n", hr, bdata[i]);
4446 static void test_effect_preshader(IDirect3DDevice9 *device)
4448 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4450 {11.0f, 21.0f, 0.0f, 0.0f},
4451 {12.0f, 22.0f, 0.0f, 0.0f},
4452 {13.0f, 23.0f, 0.0f, 0.0f},
4453 {11.0f, 12.0f, 0.0f, 0.0f},
4454 {21.0f, 22.0f, 0.0f, 0.0f},
4455 {31.0f, 32.0f, 0.0f, 0.0f},
4456 {11.0f, 12.0f, 0.0f, 0.0f},
4457 {21.0f, 22.0f, 0.0f, 0.0f},
4458 {11.0f, 21.0f, 0.0f, 0.0f},
4459 {12.0f, 22.0f, 0.0f, 0.0f},
4460 {11.0f, 12.0f, 13.0f, 0.0f},
4461 {21.0f, 22.0f, 23.0f, 0.0f},
4462 {11.0f, 21.0f, 31.0f, 0.0f},
4463 {12.0f, 22.0f, 32.0f, 0.0f}
4465 static const int test_effect_preshader_iconsts[][4] =
4467 {4, 3, 2, 1}
4469 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4470 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4471 static const int ivect_empty[4] = {-1, -1, -1, -1};
4472 HRESULT hr;
4473 ID3DXEffect *effect;
4474 D3DXHANDLE par;
4475 unsigned int npasses;
4476 DWORD value;
4477 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4478 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4479 IDirect3DVertexShader9 *vshader;
4480 unsigned int i;
4481 D3DCAPS9 caps;
4483 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4484 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
4485 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4486 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4488 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4489 return;
4492 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4493 NULL, NULL, 0, NULL, &effect, NULL);
4494 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4496 test_effect_preshader_clear_vconsts(device);
4498 for (i = 0; i < 224; ++i)
4500 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4501 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4504 test_effect_preshader_clear_pbool_consts(device);
4506 for (i = 0; i < 16; ++i)
4508 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4509 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4512 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4513 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4515 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4516 ok(par != NULL, "GetParameterByName failed.\n");
4518 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4519 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4521 hr = effect->lpVtbl->BeginPass(effect, 0);
4522 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4524 hr = effect->lpVtbl->BeginPass(effect, 0);
4525 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4527 hr = effect->lpVtbl->BeginPass(effect, 1);
4528 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4530 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4532 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4533 ARRAY_SIZE(test_effect_preshader_fvect_p));
4534 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4535 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4536 "Pixel shader float constants do not match.\n");
4537 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4539 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4540 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4541 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4542 "Pixel shader float constants do not match.\n");
4544 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4545 ARRAY_SIZE(test_effect_preshader_iconsts));
4546 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4547 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4548 "Pixel shader integer constants do not match.\n");
4549 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4551 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4552 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4553 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4554 "Pixel shader integer constants do not match.\n");
4557 test_effect_preshader_compare_pbool_consts(device, NULL, NULL);
4559 test_effect_preshader_op_results(device, NULL, NULL);
4561 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4562 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4563 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4564 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4565 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4566 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4568 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4569 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4570 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4571 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4572 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4573 todo_wine
4574 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4576 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4577 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4578 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4579 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4580 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4581 todo_wine
4582 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4584 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4585 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4586 todo_wine
4587 ok(value == 0, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4588 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4589 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4590 todo_wine
4591 ok(value == 0, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4593 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4594 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4595 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4596 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4597 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4598 todo_wine ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4600 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4601 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4602 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4603 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4604 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4605 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4606 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4607 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4608 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4609 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4611 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4613 hr = effect->lpVtbl->EndPass(effect);
4615 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4616 ok(par != NULL, "GetParameterByName failed.\n");
4617 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4618 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4619 hr = effect->lpVtbl->BeginPass(effect, 1);
4620 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4622 test_effect_preshader_compare_shader(device, 1, FALSE);
4624 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4625 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4627 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4628 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4629 hr = effect->lpVtbl->CommitChanges(effect);
4630 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4631 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4632 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4633 ok(!vshader, "Incorrect shader selected.\n");
4635 hr = effect->lpVtbl->EndPass(effect);
4636 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4638 hr = effect->lpVtbl->End(effect);
4639 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4641 effect->lpVtbl->Release(effect);
4643 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4644 NULL, NULL, 0, NULL, &effect, NULL);
4645 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4647 hr = effect->lpVtbl->Begin(effect, &npasses, D3DXFX_DONOTSAVESTATE);
4648 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4650 hr = effect->lpVtbl->BeginPass(effect, 0);
4651 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4653 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4654 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4655 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4656 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4657 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4658 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4660 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4661 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4662 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4663 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4664 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4665 todo_wine
4666 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4668 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4669 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4670 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4671 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4672 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4673 todo_wine
4674 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4676 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4677 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4678 ok(value == 2, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4679 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4680 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4681 todo_wine
4682 ok(value == 2, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4684 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4685 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4686 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4687 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4688 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4689 todo_wine
4690 ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4692 hr = effect->lpVtbl->EndPass(effect);
4693 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4694 hr = effect->lpVtbl->End(effect);
4695 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4696 effect->lpVtbl->Release(effect);
4700 * fxc.exe /Tfx_2_0
4702 #if 0
4703 float4 opvect1;
4704 float4 opvect2;
4705 float4 opvect3;
4707 technique tech0
4709 pass p0
4711 LightEnable[0] = TRUE;
4712 LightEnable[1] = TRUE;
4713 LightEnable[2] = TRUE;
4714 LightEnable[3] = TRUE;
4715 LightEnable[4] = TRUE;
4716 LightEnable[5] = TRUE;
4717 LightEnable[6] = TRUE;
4718 LightEnable[7] = TRUE;
4719 LightType[0] = POINT;
4720 LightType[1] = POINT;
4721 LightType[2] = POINT;
4722 LightType[3] = POINT;
4723 LightType[4] = POINT;
4724 LightType[5] = POINT;
4725 LightType[6] = POINT;
4726 LightType[7] = POINT;
4728 LightDiffuse[0] = exp(opvect1);
4729 LightDiffuse[1] = log(opvect1);
4730 LightDiffuse[2] = asin(opvect1);
4731 LightDiffuse[3] = acos(opvect1);
4732 LightDiffuse[4] = atan(opvect1);
4733 LightDiffuse[5] = atan2(opvect1, opvect2);
4734 LightDiffuse[6] = opvect1 * opvect2;
4736 /* Placeholder for 'div' instruction manually edited in binary blob. */
4737 LightDiffuse[7] = opvect1 * opvect2;
4739 /* Placeholder for 'cmp' instruction manually edited in binary blob. */
4740 LightAmbient[0] = opvect1 + opvect2 + opvect3;
4743 #endif
4744 static const DWORD test_effect_preshader_ops_blob[] =
4746 0xfeff0901, 0x0000044c, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
4747 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f,
4748 0x00317463, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4749 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003,
4750 0x00000001, 0x000000a0, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4751 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00337463, 0x00000001, 0x00000002, 0x00000002,
4752 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4753 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4754 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4755 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4756 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4757 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4758 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4759 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4760 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4761 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4762 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4763 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4764 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4765 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4766 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4767 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4768 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4769 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
4770 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
4771 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4772 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
4773 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
4774 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4775 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
4776 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4777 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
4778 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4779 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4780 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000001,
4781 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000,
4782 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000001,
4783 0x00000438, 0x00000000, 0x00000019, 0x00000091, 0x00000000, 0x000000b0, 0x000000ac, 0x00000091,
4784 0x00000001, 0x000000d0, 0x000000cc, 0x00000091, 0x00000002, 0x000000f0, 0x000000ec, 0x00000091,
4785 0x00000003, 0x00000110, 0x0000010c, 0x00000091, 0x00000004, 0x00000130, 0x0000012c, 0x00000091,
4786 0x00000005, 0x00000150, 0x0000014c, 0x00000091, 0x00000006, 0x00000170, 0x0000016c, 0x00000091,
4787 0x00000007, 0x00000190, 0x0000018c, 0x00000084, 0x00000000, 0x000001b0, 0x000001ac, 0x00000084,
4788 0x00000001, 0x000001d0, 0x000001cc, 0x00000084, 0x00000002, 0x000001f0, 0x000001ec, 0x00000084,
4789 0x00000003, 0x00000210, 0x0000020c, 0x00000084, 0x00000004, 0x00000230, 0x0000022c, 0x00000084,
4790 0x00000005, 0x00000250, 0x0000024c, 0x00000084, 0x00000006, 0x00000270, 0x0000026c, 0x00000084,
4791 0x00000007, 0x00000290, 0x0000028c, 0x00000085, 0x00000000, 0x000002bc, 0x000002ac, 0x00000085,
4792 0x00000001, 0x000002e8, 0x000002d8, 0x00000085, 0x00000002, 0x00000314, 0x00000304, 0x00000085,
4793 0x00000003, 0x00000340, 0x00000330, 0x00000085, 0x00000004, 0x0000036c, 0x0000035c, 0x00000085,
4794 0x00000005, 0x00000398, 0x00000388, 0x00000085, 0x00000006, 0x000003c4, 0x000003b4, 0x00000085,
4795 0x00000007, 0x000003f0, 0x000003e0, 0x00000087, 0x00000000, 0x0000041c, 0x0000040c, 0x00000000,
4796 0x00000009, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, 0x00000000, 0x0000016c, 0x46580200,
4797 0x003afffe, 0x42415443, 0x0000001c, 0x000000b3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
4798 0x000000b0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
4799 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00020002, 0x00000001, 0x000000a0, 0x00000070,
4800 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4801 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4802 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
4803 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4804 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4805 /* FXLC for LightAmbient[0] start. */
4806 0x001afffe, 0x434c5846,
4807 0x00000001, /* Instruction count, set to 1. */
4808 0x30000004, /* Operation code (bits 20-30) set to 'cmp' opcode 0x300. */
4809 0x00000003, /* Input arguments count set to 3. */
4810 /* Argument 1. */
4811 0x00000000, /* Relative addressing flag. */
4812 0x00000002, /* Register table ("c", float constants). */
4813 0x00000000, /* Register offset. */
4814 /* Argument 2. */
4815 0x00000000, 0x00000002, 0x00000004,
4816 /* Argument 3. */
4817 0x00000000, 0x00000002, 0x00000008,
4818 /* Output register. */
4819 0x00000000, 0x00000004, 0x00000000,
4820 /* End mark. */
4821 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4822 /* Padding to match placeholder length. */
4823 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4824 /* FXLC for LightAmbient[0] end. */
4825 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000114,
4826 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c,
4827 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4828 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4829 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463,
4830 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4831 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4832 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4833 /* FXLC for LightDiffuse[7] start. */
4834 0x000ffffe, 0x434c5846,
4835 0x00000001, /* Instruction count. */
4836 0x20800004, /* Operation code (bits 20-30) set to 'div' opcode 0x208. */
4837 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4838 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4839 /* FXLC for LightDiffuse[7] end. */
4840 0x00000000, 0x00000000, 0xffffffff,
4841 0x00000016, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087,
4842 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001,
4843 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f,
4844 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4845 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
4846 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4847 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4848 0x434c5846, 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4849 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4850 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe,
4851 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084,
4852 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4853 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4854 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4855 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4856 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4857 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20600004, 0x00000002, 0x00000000,
4858 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4859 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000,
4860 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
4861 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
4862 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4863 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4864 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4865 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10c00004, 0x00000001, 0x00000000,
4866 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4867 0x00000000, 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4868 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4869 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
4870 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
4871 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4872 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4873 0x434c5846, 0x00000001, 0x10b00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4874 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4875 0x00000012, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
4876 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
4877 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4878 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4879 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4880 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10a00004,
4881 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4882 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000011, 0x00000000, 0x0000013c,
4883 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
4884 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
4885 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4886 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4887 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4888 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4889 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4890 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4891 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4892 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4893 0x00000000, 0xffffffff, 0x00000010, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4894 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4895 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4896 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
4897 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4898 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4899 0x00000004, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4900 0x00000000, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4901 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4902 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4903 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4906 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
4908 static D3DLIGHT9 light;
4909 const struct
4911 const char *mnem;
4912 unsigned int expected_result[4];
4913 unsigned int result_index;
4914 float *result;
4915 D3DXVECTOR4 opvect1, opvect2, opvect3;
4916 unsigned int ulps;
4917 BOOL todo[4];
4919 op_tests[] =
4921 {"exp", {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000}, 0, &light.Diffuse.r,
4922 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4923 {"log", {0, 0x40000000, 0x3f9199b7, 0x43000000}, 1, &light.Diffuse.r,
4924 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4925 {"asin", {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000}, 2, &light.Diffuse.r,
4926 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4927 {"acos", {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000}, 3, &light.Diffuse.r,
4928 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4929 {"atan", {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb}, 4, &light.Diffuse.r,
4930 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4931 {"atan2 test #1", {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000}, 5, &light.Diffuse.r,
4932 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
4933 {"atan2 test #2", {0xbfc90fdb, 0, 0xc0490fdb, 0}, 5, &light.Diffuse.r,
4934 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
4935 {"div", {0, 0, 0, 0}, 7, &light.Diffuse.r,
4936 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
4937 {"cmp", {0x40a00000, 0x40000000, 0x40400000, 0x41000000}, 0, &light.Ambient.r,
4938 {-0.3f, 0.0f, 2.2f, NAN}, {1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 6.0f, 7.0f, 8.0f}},
4939 {"0 * INF", {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000}, 6, &light.Diffuse.r,
4940 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
4942 unsigned int i, j, passes_count;
4943 ID3DXEffect *effect;
4944 HRESULT hr;
4946 hr = D3DXCreateEffect(device, test_effect_preshader_ops_blob, sizeof(test_effect_preshader_ops_blob),
4947 NULL, NULL, 0, NULL, &effect, NULL);
4948 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4949 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4950 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4951 hr = effect->lpVtbl->BeginPass(effect, 0);
4952 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4954 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
4956 const float *result = op_tests[i].result;
4957 const float *expected_float = (float *)op_tests[i].expected_result;
4959 hr = effect->lpVtbl->SetVector(effect, "opvect1", &op_tests[i].opvect1);
4960 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4961 hr = effect->lpVtbl->SetVector(effect, "opvect2", &op_tests[i].opvect2);
4962 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4963 hr = effect->lpVtbl->SetVector(effect, "opvect3", &op_tests[i].opvect3);
4964 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4965 hr = effect->lpVtbl->CommitChanges(effect);
4966 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4968 hr = IDirect3DDevice9_GetLight(device, op_tests[i].result_index, &light);
4969 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4970 for (j = 0; j < 4; ++j)
4972 todo_wine_if(op_tests[i].todo[j])
4973 ok(compare_float(result[j], expected_float[j], op_tests[i].ulps),
4974 "Operation %s, component %u, expected %#x (%.8e), got %#x (%.8e).\n", op_tests[i].mnem,
4975 j, op_tests[i].expected_result[j], expected_float[j],
4976 ((unsigned int *)result)[j], result[j]);
4980 hr = effect->lpVtbl->End(effect);
4981 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4982 effect->lpVtbl->Release(effect);
4985 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
4986 D3DXHANDLE tech, D3DXHANDLE param)
4988 D3DXPARAMETER_DESC desc;
4989 D3DXHANDLE param_child;
4990 unsigned int i, child_count;
4991 HRESULT hr;
4993 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
4994 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#x.\n", hr);
4995 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
4996 for (i = 0; i < child_count; ++i)
4998 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
4999 : effect->lpVtbl->GetParameter(effect, param, i);
5000 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
5001 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
5002 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
5003 test_isparameterused_children(line, effect, tech, param_child);
5007 #define test_isparameterused_param_with_children(args...) \
5008 test_isparameterused_param_with_children_(__LINE__, args)
5009 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
5010 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
5012 D3DXHANDLE param;
5014 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
5015 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
5017 if (effect2)
5018 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
5019 else
5020 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
5021 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
5023 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
5024 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
5026 test_isparameterused_children(line, effect, tech, param);
5029 static void test_effect_isparameterused(IDirect3DDevice9 *device)
5031 static const struct
5033 const char *name;
5034 BOOL expected_result;
5036 check_parameters[] =
5038 {"g_Pos1", TRUE},
5039 {"g_Pos2", TRUE},
5040 {"g_Selector", TRUE},
5041 {"opvect1", TRUE},
5042 {"opvect2", TRUE},
5043 {"opvect3", TRUE},
5044 {"arr2", TRUE},
5045 {"vs_arr", TRUE},
5046 {"g_iVect", TRUE},
5047 {"vect_sampler", TRUE},
5048 {"tex1", TRUE},
5049 {"tex2", FALSE},
5050 {"sampler1", TRUE},
5051 {"ts1", TRUE},
5052 {"ts2", TRUE},
5053 {"ts3", TRUE},
5055 ID3DXEffect *effect, *effect2;
5056 HRESULT hr;
5057 D3DXHANDLE tech;
5058 unsigned int i;
5060 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5061 NULL, NULL, 0, NULL, &effect, NULL);
5062 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5064 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
5065 ok(!!tech, "GetTechniqueByName failed.\n");
5067 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5068 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
5069 check_parameters[i].expected_result);
5071 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5072 NULL, NULL, 0, NULL, &effect2, NULL);
5073 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5075 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5076 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
5077 check_parameters[i].expected_result);
5079 effect2->lpVtbl->Release(effect2);
5081 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
5082 NULL, NULL, 0, NULL, &effect2, NULL);
5083 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5085 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
5086 effect2->lpVtbl->Release(effect2);
5088 effect->lpVtbl->Release(effect);
5091 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
5093 ID3DXEffect *effect;
5094 HRESULT hr;
5095 D3DXHANDLE param;
5096 int ivect[4];
5097 unsigned int passes_count;
5098 IDirect3DVertexShader9 *vshader;
5100 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5101 NULL, NULL, 0, NULL, &effect, NULL);
5103 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5104 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5106 ivect[0] = ivect[1] = ivect[3] = 1;
5108 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5109 ok(!!param, "GetParameterByName failed.\n");
5110 ivect[2] = 3;
5111 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5112 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5114 hr = effect->lpVtbl->BeginPass(effect, 0);
5115 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5116 hr = effect->lpVtbl->EndPass(effect);
5117 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5119 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5120 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5122 hr = effect->lpVtbl->BeginPass(effect, 1);
5123 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5125 /* Second try reports success and selects array element used previously.
5126 * Probably array index is not recomputed and previous index value is used. */
5127 hr = effect->lpVtbl->BeginPass(effect, 1);
5128 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5129 test_effect_preshader_compare_shader(device, 2, FALSE);
5131 /* Confirm that array element selected is the previous good one and does not depend
5132 * on computed (out of bound) index value. */
5133 ivect[2] = 1;
5134 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5135 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5136 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5137 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5138 hr = effect->lpVtbl->CommitChanges(effect);
5139 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5140 test_effect_preshader_compare_shader(device, 1, FALSE);
5141 hr = effect->lpVtbl->EndPass(effect);
5142 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5143 ivect[2] = 3;
5144 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5145 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5146 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5147 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5148 hr = effect->lpVtbl->BeginPass(effect, 1);
5149 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5150 hr = effect->lpVtbl->BeginPass(effect, 1);
5151 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5152 test_effect_preshader_compare_shader(device, 1, FALSE);
5154 /* End and begin effect again to ensure it will not trigger array
5155 * index recompute and error return from BeginPass. */
5156 hr = effect->lpVtbl->EndPass(effect);
5157 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5158 hr = effect->lpVtbl->End(effect);
5159 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5160 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5161 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5162 hr = effect->lpVtbl->BeginPass(effect, 1);
5163 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5164 test_effect_preshader_compare_shader(device, 1, FALSE);
5165 hr = effect->lpVtbl->EndPass(effect);
5166 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5169 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5170 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5172 ivect[2] = -2;
5173 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5174 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5176 hr = effect->lpVtbl->BeginPass(effect, 1);
5177 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5179 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5180 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5181 ok(!vshader, "Got non NULL vshader.\n");
5183 hr = effect->lpVtbl->BeginPass(effect, 1);
5184 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5186 test_effect_preshader_compare_shader(device, 1, FALSE);
5188 hr = effect->lpVtbl->EndPass(effect);
5189 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5191 ivect[2] = -1;
5192 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5193 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5195 hr = effect->lpVtbl->BeginPass(effect, 1);
5196 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5198 test_effect_preshader_compare_shader(device, 0, FALSE);
5200 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5201 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5203 ivect[2] = 3;
5204 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5205 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5206 hr = effect->lpVtbl->CommitChanges(effect);
5207 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5209 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5210 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5211 ok(!vshader, "Got non NULL vshader.\n");
5213 ivect[2] = -1;
5214 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5215 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5216 hr = effect->lpVtbl->CommitChanges(effect);
5217 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5219 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5220 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5221 ok(!vshader, "Got non NULL vshader.\n");
5223 ivect[2] = 1;
5224 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5225 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5226 hr = effect->lpVtbl->CommitChanges(effect);
5227 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5229 test_effect_preshader_compare_shader(device, 1, FALSE);
5231 hr = effect->lpVtbl->EndPass(effect);
5232 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5234 hr = effect->lpVtbl->End(effect);
5235 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5237 effect->lpVtbl->Release(effect);
5240 static void test_effect_commitchanges(IDirect3DDevice9 *device)
5242 static const struct
5244 const char *param_name;
5245 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
5247 check_op_parameters[] =
5249 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5250 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5251 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5252 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5253 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5254 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5255 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5256 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5257 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5258 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5259 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5260 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
5261 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5262 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
5263 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
5265 static const struct
5267 const char *param_name;
5268 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5269 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5271 check_vconsts_parameters[] =
5273 {"g_Selector", {0x00000000, 0x00000002}},
5274 {"g_Pos1", {0x80000000, 0x00000002}},
5275 {"g_Pos2", {0x00000000, 0x00000002}},
5276 {"m4x3column", {0x03800000, 0x00000000}},
5277 {"m3x4column", {0x000f0000, 0x00000000}},
5278 {"m4x3row", {0x0000f000, 0x00000000}},
5279 {"m3x4row", {0x00700000, 0x00000000}},
5280 {"ts1", {0x1c000000, 0x00000000}},
5281 {"ts2", {0x0000003f, 0x00000000}},
5282 {"arr1", {0x00000000, 0x00000001}},
5283 {"arr2", {0x60000000, 0x00000000}},
5284 {"ts3", {0x00000fc0, 0x00000000}},
5286 static const struct
5288 const char *param_name;
5289 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_bconsts)
5290 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5292 check_bconsts_parameters[] =
5294 {"mb2x3row", {0x0000001f}},
5295 {"mb2x3column", {0x00000060}},
5297 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5298 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5299 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
5301 ID3DXEffect *effect;
5302 HRESULT hr;
5303 D3DXHANDLE param;
5304 unsigned int i, passes_count, value;
5305 int ivect[4];
5306 D3DXVECTOR4 fvect;
5307 IDirect3DVertexShader9 *vshader;
5308 unsigned char buffer[256];
5311 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5312 NULL, NULL, 0, NULL, &effect, NULL);
5313 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5315 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5316 ok(!!param, "GetParameterByName failed.\n");
5318 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5319 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5321 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5322 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5324 hr = effect->lpVtbl->BeginPass(effect, 0);
5325 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5327 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
5329 unsigned int j;
5331 for (j = 0; j < 8; ++j)
5333 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
5334 ok(hr == D3D_OK, "Got result %#x, i %u, j %u.\n", hr, i, j);
5336 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
5337 ok(!!param, "GetParameterByName failed.\n");
5338 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
5339 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5340 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
5341 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5342 hr = effect->lpVtbl->CommitChanges(effect);
5343 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5345 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
5346 check_op_parameters[i].param_name);
5349 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
5351 test_effect_preshader_clear_vconsts(device);
5352 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
5353 ok(!!param, "GetParameterByName failed.\n");
5354 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5355 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5356 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5357 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5358 hr = effect->lpVtbl->CommitChanges(effect);
5359 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5361 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
5362 check_vconsts_parameters[i].param_name);
5365 for (i = 0; i < ARRAY_SIZE(check_bconsts_parameters); ++i)
5367 test_effect_preshader_clear_pbool_consts(device);
5368 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_bconsts_parameters[i].param_name);
5369 ok(!!param, "GetParameterByName failed.\n");
5370 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5371 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5372 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5373 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5374 hr = effect->lpVtbl->CommitChanges(effect);
5375 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5377 test_effect_preshader_compare_pbool_consts(device, check_bconsts_parameters[i].const_updated_mask,
5378 check_bconsts_parameters[i].param_name);
5381 test_effect_preshader_clear_vconsts(device);
5382 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
5383 ok(!!param, "GetParameterByName failed.\n");
5384 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5385 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
5386 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5387 hr = effect->lpVtbl->CommitChanges(effect);
5388 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5389 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
5390 check_vconsts_parameters[0].param_name);
5392 test_effect_preshader_clear_vconsts(device);
5393 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5394 ok(!!param, "GetParameterByName failed.\n");
5395 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5396 ok(!!param, "GetParameterElement failed.\n");
5397 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
5398 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5399 hr = effect->lpVtbl->CommitChanges(effect);
5400 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5401 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5402 check_vconsts_parameters[10].param_name);
5404 test_effect_preshader_clear_vconsts(device);
5405 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5406 ok(!!param, "GetParameterByName failed.\n");
5407 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5408 ok(!!param, "GetParameterElement failed.\n");
5409 fvect.x = 93.0f;
5410 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
5411 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5412 hr = effect->lpVtbl->CommitChanges(effect);
5413 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5414 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5415 check_vconsts_parameters[10].param_name);
5417 test_effect_preshader_clear_vconsts(device);
5418 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5419 ok(!!param, "GetParameterByName failed.\n");
5420 fvect.x = 92.0f;
5421 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
5422 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5423 hr = effect->lpVtbl->CommitChanges(effect);
5424 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5425 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5426 check_vconsts_parameters[10].param_name);
5428 test_effect_preshader_clear_vconsts(device);
5429 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5430 ok(!!param, "GetParameterByName failed.\n");
5431 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5432 ok(!!param, "GetParameterElement failed.\n");
5433 hr = effect->lpVtbl->SetInt(effect, param, 93);
5434 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5435 hr = effect->lpVtbl->CommitChanges(effect);
5436 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5437 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5438 check_vconsts_parameters[10].param_name);
5440 test_effect_preshader_clear_vconsts(device);
5441 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5442 ok(!!param, "GetParameterByName failed.\n");
5443 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5444 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
5445 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5446 hr = effect->lpVtbl->CommitChanges(effect);
5447 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5448 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5449 check_vconsts_parameters[1].param_name);
5451 test_effect_preshader_clear_vconsts(device);
5452 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
5453 ok(!!param, "GetParameterByName failed.\n");
5454 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5455 ok(!!param, "GetParameterByName failed.\n");
5456 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5457 ok(!!param, "GetParameterByName failed.\n");
5458 fvect.x = 12;
5459 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5460 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5461 hr = effect->lpVtbl->CommitChanges(effect);
5462 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5463 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5464 check_vconsts_parameters[7].param_name);
5466 *(float *)&value = 9999.0f;
5467 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5468 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5469 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5470 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5471 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5472 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5473 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5474 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5475 test_effect_preshader_clear_vconsts(device);
5476 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5477 ok(!!param, "GetParameterByName failed.\n");
5478 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5479 ok(!!param, "GetParameterByName failed.\n");
5480 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5481 ok(!!param, "GetParameterByName failed.\n");
5482 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5483 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5484 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5485 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5486 hr = effect->lpVtbl->CommitChanges(effect);
5487 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5488 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5489 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5490 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
5491 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5492 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5493 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
5494 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5495 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5496 ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5497 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5498 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5499 ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5500 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5501 check_vconsts_parameters[8].param_name);
5503 *(float *)&value = 9999.0f;
5504 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5505 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5506 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5507 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5508 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5509 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5510 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5511 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5512 test_effect_preshader_clear_vconsts(device);
5513 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5514 ok(!!param, "GetParameterByName failed.\n");
5515 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5516 ok(!!param, "GetParameterByName failed.\n");
5517 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5518 ok(!!param, "GetParameterByName failed.\n");
5519 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5520 ok(!!param, "GetParameterByName failed.\n");
5521 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5522 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5523 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5524 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5525 hr = effect->lpVtbl->CommitChanges(effect);
5526 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5527 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5528 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5529 ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
5530 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5531 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5532 ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
5533 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5534 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5535 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5536 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5537 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5538 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5539 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5540 check_vconsts_parameters[11].param_name);
5542 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5543 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5544 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5545 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5546 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5547 todo_wine
5548 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5549 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5550 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5551 ok(value == 3, "Unexpected sampler 2 minfilter %u.\n", value);
5553 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5554 ok(!!param, "GetParameterByName failed.\n");
5555 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5556 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5557 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5559 for (i = 0; i < 3; ++i)
5561 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MINFILTER, 0);
5562 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5563 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MAGFILTER, 0);
5564 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5567 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5568 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5569 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5570 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5572 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5573 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5574 test_effect_preshader_clear_vconsts(device);
5576 hr = effect->lpVtbl->CommitChanges(effect);
5577 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5579 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5580 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5581 ok(!vshader, "Got non NULL vshader.\n");
5582 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5583 "selector g_iVect");
5585 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5586 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5587 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5588 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5589 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5590 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5592 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5593 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5594 ok(value == 1, "Unexpected sampler 2 minfilter %u.\n", value);
5595 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
5596 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5597 ok(value == 0, "Unexpected sampler 2 minfilter %u.\n", value);
5598 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5599 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5600 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5601 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5602 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5603 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5605 ivect[3] = 2;
5606 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5607 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5608 ivect[3] = 1;
5609 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5611 hr = effect->lpVtbl->CommitChanges(effect);
5612 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5613 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5614 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5615 ok(!vshader, "Got non NULL vshader.\n");
5616 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5617 "selector g_iVect");
5618 ivect[3] = 2;
5619 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5620 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5621 hr = effect->lpVtbl->CommitChanges(effect);
5622 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5623 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5624 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5625 ok(!!vshader, "Got NULL vshader.\n");
5626 IDirect3DVertexShader9_Release(vshader);
5627 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5628 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5629 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5630 "Vertex shader float constants do not match.\n");
5631 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5632 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5633 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5634 "selector g_iVect");
5635 ivect[3] = 1;
5636 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5637 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5638 hr = effect->lpVtbl->CommitChanges(effect);
5639 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5640 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5642 hr = effect->lpVtbl->EndPass(effect);
5643 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5645 hr = effect->lpVtbl->End(effect);
5646 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5648 effect->lpVtbl->Release(effect);
5651 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5653 static const struct
5655 D3DXVECTOR4 opvect2;
5656 D3DXVECTOR4 g_ivect;
5657 unsigned int expected[4];
5659 test_out_of_bounds_index[] =
5661 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5662 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5663 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5664 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5665 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5666 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5667 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5668 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5669 {0x447ac000, 0x448ae000, 0, 0}},
5670 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5671 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5672 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5673 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5674 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5675 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5676 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5677 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5678 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5679 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5680 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5681 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5682 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5683 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5684 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5685 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5686 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5687 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5688 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5689 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5690 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5691 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5692 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5693 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5694 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5696 static const struct
5698 unsigned int zw[2];
5700 expected_light_specular[] =
5702 {{0, 0x44fa2000}},
5703 {{0x447a8000, 0x453b9000}},
5704 {{0x40000000, 0x459c4800}},
5705 {{0xbf800000, 0}},
5706 {{0x447a4000, 0}},
5707 {{0x3f800000, 0}},
5708 {{0xbf800000, 0}},
5709 {{0, 0}},
5710 {{0, 0x447a4000}},
5711 {{0x44fa4000, 0x3f800000}},
5712 {{0x453ba000, 0xbf800000}},
5713 {{0x459c5000, 0}},
5714 {{0x44fa2000, 0}},
5715 {{0x453b9000, 0}},
5716 {{0x459c4800, 0}},
5717 {{0, 0}},
5719 static const struct
5721 int index_value;
5722 unsigned int expected[4];
5724 test_index_to_immediate_table[] =
5726 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5727 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5728 {-32, {0x448d4000, 0x40800000, 0, 0}},
5729 {-31, {0x45843000, 0x41400000, 0, 0}},
5730 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5731 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5732 {-28, {0, 0, 0x447ac000, 0x40400000}},
5733 {-27, {0, 0x3f800000, 0, 0}},
5734 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5735 {-25, {0, 0x41300000, 0, 0}},
5736 {-24, {0, 0x41600000, 0, 0}},
5737 {-23, {0, 0, 0, 0}},
5738 {-22, {0, 0, 0, 0}},
5739 {-21, {0, 0x40a00000, 0, 0}},
5740 {-20, {0, 0x41500000, 0, 0}},
5741 {-19, {0, 0x41500000, 0, 0}},
5742 {-18, {0, 0xc1900000, 0, 0}},
5743 {-17, {0, 0, 0, 0}},
5744 {-16, {0, 0x40800000, 0, 0}},
5745 {-15, {0, 0x41400000, 0, 0}},
5746 {-14, {0, 0x41400000, 0, 0}},
5747 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5748 {-12, {0, 0, 0, 0}},
5749 {-11, {0, 0x3f800000, 0, 0}},
5750 {-10, {0, 0x41100000, 0, 0}},
5751 {-9, {0, 0x41300000, 0, 0}},
5752 {-8, {0, 0x41600000, 0, 0}},
5753 {-7, {0, 0, 0, 0}},
5754 {-6, {0, 0, 0, 0}},
5755 {-5, {0, 0x40a00000, 0, 0}},
5756 {-4, {0, 0x41500000, 0, 0}},
5757 {-3, {0, 0x41500000, 0, 0}},
5758 {-2, {0, 0xc0000000, 0, 0}},
5759 {-1, {0, 0, 0, 0}},
5760 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5761 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5762 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5763 {3, {0, 0x447a4000, 0, 0}},
5764 {4, {0, 0, 0x45bbd800, 0x41300000}},
5765 {5, {0, 0x3f800000, 0, 0}},
5766 {6, {0, 0x41100000, 0, 0}},
5767 {7, {0, 0x41300000, 0, 0}},
5768 {8, {0, 0x41600000, 0, 0}},
5769 {9, {0, 0, 0, 0}},
5770 {10, {0, 0, 0, 0}},
5771 {11, {0, 0x40a00000, 0, 0}},
5772 {12, {0, 0x41500000, 0, 0}},
5773 {13, {0, 0x41500000, 0, 0}},
5774 {14, {0, 0x41600000, 0, 0}},
5775 {15, {0, 0, 0, 0}},
5776 {16, {0, 0x40800000, 0, 0}},
5777 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5778 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5779 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5780 {20, {0, 0, 0, 0}},
5781 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5782 {22, {0, 0x41100000, 0, 0}},
5783 {23, {0, 0x41300000, 0, 0}},
5784 {24, {0, 0x41600000, 0, 0}},
5785 {25, {0, 0, 0, 0}},
5786 {26, {0, 0, 0, 0}},
5787 {27, {0, 0x40a00000, 0, 0}},
5788 {28, {0, 0x41500000, 0, 0}},
5789 {29, {0, 0x41500000, 0, 0}},
5790 {30, {0, 0x41f00000, 0, 0}},
5791 {31, {0, 0, 0, 0}},
5792 {1001, {0, 0, 0, 0}},
5793 {1000000, {0, 0x40800000, 0, 0}},
5795 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5796 {1.0f, 1.0f, 1.0f, 1.0f}};
5797 unsigned int j, passes_count;
5798 const unsigned int *expected;
5799 const float *expected_float;
5800 ID3DXEffect *effect;
5801 D3DXVECTOR4 fvect;
5802 D3DLIGHT9 light;
5803 const float *v;
5804 HRESULT hr;
5805 int i;
5807 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5808 NULL, NULL, 0, NULL, &effect, NULL);
5809 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5811 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5812 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5813 hr = effect->lpVtbl->BeginPass(effect, 0);
5814 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5816 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5817 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5818 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5820 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5821 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5822 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5824 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5825 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5826 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5828 v = &light.Specular.r;
5829 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5831 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5832 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5833 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5834 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5836 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5837 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5839 hr = effect->lpVtbl->CommitChanges(effect);
5840 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5842 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5843 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5845 expected = test_out_of_bounds_index[i].expected;
5846 expected_float = (const float *)expected;
5848 for (j = 0; j < 4; ++j)
5850 ok(compare_float(v[j], expected_float[j], 0),
5851 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5852 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5856 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5857 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5858 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5859 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5861 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5862 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5864 fvect = test_out_of_bounds_index[7].g_ivect;
5865 v = &light.Specular.b;
5866 for (i = -100; i < 100; ++i)
5868 fvect.w = i;
5869 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5870 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5871 hr = effect->lpVtbl->CommitChanges(effect);
5872 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5874 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5875 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5877 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5878 expected_float = (const float *)expected;
5880 for (j = 0; j < 2; ++j)
5882 ok(compare_float(v[j], expected_float[j], 0),
5883 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
5884 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5888 v = &light.Specular.r;
5889 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
5891 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
5892 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5893 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5894 hr = effect->lpVtbl->CommitChanges(effect);
5895 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5897 hr = IDirect3DDevice9_GetLight(device, 2, &light);
5898 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5900 expected = test_index_to_immediate_table[i].expected;
5901 expected_float = (const float *)expected;
5903 for (j = 0; j < 4; ++j)
5905 ok(compare_float(v[j], expected_float[j], 0),
5906 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5907 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5911 hr = effect->lpVtbl->EndPass(effect);
5912 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5913 hr = effect->lpVtbl->End(effect);
5914 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5916 effect->lpVtbl->Release(effect);
5919 struct test_state_manager_update
5921 unsigned int state_op;
5922 DWORD param1;
5923 DWORD param2;
5926 struct test_manager
5928 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
5929 LONG ref;
5931 IDirect3DDevice9 *device;
5932 struct test_state_manager_update *update_record;
5933 unsigned int update_record_count;
5934 unsigned int update_record_size;
5937 #define INITIAL_UPDATE_RECORD_SIZE 64
5939 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
5941 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
5944 static void free_test_effect_state_manager(struct test_manager *state_manager)
5946 HeapFree(GetProcessHeap(), 0, state_manager->update_record);
5947 state_manager->update_record = NULL;
5949 IDirect3DDevice9_Release(state_manager->device);
5952 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
5954 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5956 return InterlockedIncrement(&state_manager->ref);
5959 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
5961 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5962 ULONG ref = InterlockedDecrement(&state_manager->ref);
5964 if (!ref)
5966 free_test_effect_state_manager(state_manager);
5967 HeapFree(GetProcessHeap(), 0, state_manager);
5969 return ref;
5972 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
5973 unsigned int state_op, DWORD param1, DWORD param2)
5975 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5977 if (state_manager->update_record_count == state_manager->update_record_size)
5979 if (!state_manager->update_record_size)
5981 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
5982 state_manager->update_record = HeapAlloc(GetProcessHeap(), 0,
5983 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5985 else
5987 state_manager->update_record_size *= 2;
5988 state_manager->update_record = HeapReAlloc(GetProcessHeap(), 0, state_manager->update_record,
5989 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5992 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
5993 state_manager->update_record[state_manager->update_record_count].param1 = param1;
5994 state_manager->update_record[state_manager->update_record_count].param2 = param2;
5995 ++state_manager->update_record_count;
5996 return D3D_OK;
5999 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
6000 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
6002 return test_process_set_state(iface, 0, state, 0);
6005 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
6006 const D3DMATERIAL9 *material)
6008 return test_process_set_state(iface, 1, 0, 0);
6011 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
6012 DWORD index, const D3DLIGHT9 *light)
6014 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6016 IDirect3DDevice9_SetLight(state_manager->device, index, light);
6017 return test_process_set_state(iface, 2, index, 0);
6020 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
6021 DWORD index, BOOL enable)
6023 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6025 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
6026 return test_process_set_state(iface, 3, index, 0);
6029 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
6030 D3DRENDERSTATETYPE state, DWORD value)
6032 return test_process_set_state(iface, 4, state, 0);
6035 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
6036 DWORD stage, struct IDirect3DBaseTexture9 *texture)
6038 return test_process_set_state(iface, 5, stage, 0);
6041 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
6042 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
6044 return test_process_set_state(iface, 6, stage, type);
6047 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
6048 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
6050 return test_process_set_state(iface, 7, sampler, type);
6053 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
6054 FLOAT num_segments)
6056 return test_process_set_state(iface, 8, 0, 0);
6059 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
6060 DWORD format)
6062 return test_process_set_state(iface, 9, 0, 0);
6065 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
6066 struct IDirect3DVertexShader9 *shader)
6068 return test_process_set_state(iface, 10, 0, 0);
6071 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
6072 UINT register_index, const FLOAT *constant_data, UINT register_count)
6074 return test_process_set_state(iface, 11, register_index, register_count);
6077 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
6078 UINT register_index, const INT *constant_data, UINT register_count)
6080 return test_process_set_state(iface, 12, register_index, register_count);
6083 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
6084 UINT register_index, const BOOL *constant_data, UINT register_count)
6086 return test_process_set_state(iface, 13, register_index, register_count);
6089 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
6090 struct IDirect3DPixelShader9 *shader)
6092 return test_process_set_state(iface, 14, 0, 0);
6095 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
6096 UINT register_index, const FLOAT *constant_data, UINT register_count)
6098 return test_process_set_state(iface, 15, register_index, register_count);
6101 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
6102 UINT register_index, const INT *constant_data, UINT register_count)
6104 return test_process_set_state(iface, 16, register_index, register_count);
6107 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
6108 UINT register_index, const BOOL *constant_data, UINT register_count)
6110 return test_process_set_state(iface, 17, register_index, register_count);
6113 static void test_effect_state_manager_init(struct test_manager *state_manager,
6114 IDirect3DDevice9 *device)
6116 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
6118 /*** IUnknown methods ***/
6119 NULL,
6120 test_manager_AddRef,
6121 test_manager_Release,
6122 /*** ID3DXEffectStateManager methods ***/
6123 test_manager_SetTransform,
6124 test_manager_SetMaterial,
6125 test_manager_SetLight,
6126 test_manager_LightEnable,
6127 test_manager_SetRenderState,
6128 test_manager_SetTexture,
6129 test_manager_SetTextureStageState,
6130 test_manager_SetSamplerState,
6131 test_manager_SetNPatchMode,
6132 test_manager_SetFVF,
6133 test_manager_SetVertexShader,
6134 test_manager_SetVertexShaderConstantF,
6135 test_manager_SetVertexShaderConstantI,
6136 test_manager_SetVertexShaderConstantB,
6137 test_manager_SetPixelShader,
6138 test_manager_SetPixelShaderConstantF,
6139 test_manager_SetPixelShaderConstantI,
6140 test_manager_SetPixelShaderConstantB,
6143 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
6144 state_manager->ref = 1;
6146 IDirect3DDevice9_AddRef(device);
6147 state_manager->device = device;
6150 static const char *test_effect_state_manager_state_names[] =
6152 "SetTransform",
6153 "SetMaterial",
6154 "SetLight",
6155 "LightEnable",
6156 "SetRenderState",
6157 "SetTexture",
6158 "SetTextureStageState",
6159 "SetSamplerState",
6160 "SetNPatchMode",
6161 "SetFVF",
6162 "SetVertexShader",
6163 "SetVertexShaderConstantF",
6164 "SetVertexShaderConstantI",
6165 "SetVertexShaderConstantB",
6166 "SetPixelShader",
6167 "SetPixelShaderConstantF",
6168 "SetPixelShaderConstantI",
6169 "SetPixelShaderConstantB",
6172 static int compare_update_record(const void *a, const void *b)
6174 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
6175 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
6177 if (r1->state_op != r2->state_op)
6178 return r1->state_op - r2->state_op;
6179 if (r1->param1 != r2->param1)
6180 return r1->param1 - r2->param1;
6181 return r1->param2 - r2->param2;
6184 static void test_effect_state_manager(IDirect3DDevice9 *device)
6186 static const struct test_state_manager_update expected_updates[] =
6188 {2, 0, 0},
6189 {2, 1, 0},
6190 {2, 2, 0},
6191 {2, 3, 0},
6192 {2, 4, 0},
6193 {2, 5, 0},
6194 {2, 6, 0},
6195 {2, 7, 0},
6196 {3, 0, 0},
6197 {3, 1, 0},
6198 {3, 2, 0},
6199 {3, 3, 0},
6200 {3, 4, 0},
6201 {3, 5, 0},
6202 {3, 6, 0},
6203 {3, 7, 0},
6204 {4, 28, 0},
6205 {4, 36, 0},
6206 {4, 38, 0},
6207 {4, 158, 0},
6208 {4, 159, 0},
6209 {5, 0, 0},
6210 {5, 259, 0},
6211 {7, 0, 5},
6212 {7, 0, 6},
6213 {7, 1, 5},
6214 {7, 1, 6},
6215 {7, 257, 5},
6216 {7, 257, 6},
6217 {7, 258, 5},
6218 {7, 258, 6},
6219 {7, 259, 5},
6220 {7, 259, 6},
6221 {10, 0, 0},
6222 {11, 0, 34},
6223 {14, 0, 0},
6224 {15, 0, 14},
6225 {16, 0, 1},
6226 {17, 0, 6},
6228 static D3DLIGHT9 light_filler =
6229 {D3DLIGHT_DIRECTIONAL, {0.5f, 0.5f, 0.5f, 0.5f}, {0.5f, 0.5f, 0.5f, 0.5f}, {0.5f, 0.5f, 0.5f, 0.5f}};
6230 struct test_manager *state_manager;
6231 unsigned int passes_count, i, n;
6232 ID3DXEffect *effect;
6233 ULONG refcount;
6234 HRESULT hr;
6236 state_manager = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*state_manager));
6237 test_effect_state_manager_init(state_manager, device);
6239 for (i = 0; i < 8; ++i)
6241 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
6242 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6245 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6246 NULL, NULL, 0, NULL, &effect, NULL);
6247 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6249 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
6250 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6252 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6253 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6255 hr = effect->lpVtbl->BeginPass(effect, 0);
6256 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6258 hr = effect->lpVtbl->EndPass(effect);
6259 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6261 hr = effect->lpVtbl->End(effect);
6262 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6264 effect->lpVtbl->Release(effect);
6266 qsort(state_manager->update_record, state_manager->update_record_count,
6267 sizeof(*state_manager->update_record), compare_update_record);
6269 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
6270 "Got %u update records.\n", state_manager->update_record_count);
6271 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
6272 for (i = 0; i < n; ++i)
6274 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
6275 sizeof(expected_updates[i])),
6276 "Update record mismatch, expected %s, %u, %u, got %s, %u, %u.\n",
6277 test_effect_state_manager_state_names[expected_updates[i].state_op],
6278 expected_updates[i].param1, expected_updates[i].param2,
6279 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
6280 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
6283 for (i = 0; i < 8; ++i)
6285 D3DLIGHT9 light;
6287 hr = IDirect3DDevice9_GetLight(device, i, &light);
6288 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6289 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
6292 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
6293 &state_manager->ID3DXEffectStateManager_iface);
6294 ok(!refcount, "State manager was not properly freed, refcount %u.\n", refcount);
6297 static void test_cross_effect_handle(IDirect3DDevice9 *device)
6299 ID3DXEffect *effect1, *effect2;
6300 D3DXHANDLE param1, param2;
6301 static int expected_ivect[4] = {28, 29, 30, 31};
6302 int ivect[4];
6303 HRESULT hr;
6305 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6306 NULL, NULL, 0, NULL, &effect1, NULL);
6307 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6308 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6309 NULL, NULL, 0, NULL, &effect2, NULL);
6310 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6312 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
6314 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
6315 ok(!!param1, "GetParameterByName failed.\n");
6317 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
6318 ok(!!param2, "GetParameterByName failed.\n");
6320 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
6322 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
6323 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6325 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
6326 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6328 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6330 effect2->lpVtbl->Release(effect2);
6331 effect1->lpVtbl->Release(effect1);
6334 #if 0
6335 struct test_struct
6337 float3 v1_2;
6338 float fv_2;
6339 float4 v2_2;
6342 shared float arr2[1];
6343 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
6345 struct VS_OUTPUT
6347 float4 Position : POSITION;
6350 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6352 VS_OUTPUT Output;
6354 Output.Position = arr2[0] * vPos;
6355 return Output;
6358 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
6360 technique tech0
6362 pass p0
6364 FogEnable = TRUE;
6365 FogDensity = arr2[0];
6366 PointScale_A = ts2[0].fv_2;
6367 VertexShader = vs_arr2[0];
6370 pass p1
6372 VertexShader = vs_arr2[1];
6375 #endif
6376 static const DWORD test_effect_shared_parameters_blob[] =
6378 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
6379 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
6380 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
6381 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
6382 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
6383 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6384 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
6385 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
6386 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
6387 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
6388 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6389 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6390 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
6391 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
6392 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
6393 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
6394 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
6395 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
6396 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
6397 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
6398 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
6399 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
6400 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
6401 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
6402 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
6403 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
6404 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
6405 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
6406 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
6407 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
6408 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
6409 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
6410 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
6411 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
6412 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
6413 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
6414 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6415 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
6416 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
6417 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6418 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6419 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6420 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6421 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
6422 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
6423 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
6424 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
6425 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
6426 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
6427 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6428 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6431 #define test_effect_shared_vs_arr_compare_helper(args...) \
6432 test_effect_shared_vs_arr_compare_helper_(__LINE__, args)
6433 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
6434 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
6435 BOOL todo)
6437 struct IDirect3DVertexShader9 *vshader2;
6438 D3DXHANDLE param_child2;
6439 HRESULT hr;
6441 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
6442 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
6443 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6444 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
6445 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6446 todo_wine_if(todo)
6447 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
6448 if (vshader2)
6449 IDirect3DVertexShader9_Release(vshader2);
6452 #define test_effect_shared_parameters_compare_vconst(args...) \
6453 test_effect_shared_parameters_compare_vconst_(__LINE__, args)
6454 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
6455 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6457 D3DXVECTOR4 fvect;
6458 HRESULT hr;
6460 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6461 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6462 todo_wine_if(todo)
6463 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6464 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6467 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6469 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6470 ID3DXEffectPool *pool;
6471 HRESULT hr;
6472 D3DXHANDLE param, param_child, param2, param_child2;
6473 unsigned int i, passes_count;
6474 ULONG refcount;
6475 D3DXVECTOR4 fvect;
6476 float fval[2];
6478 hr = D3DXCreateEffectPool(&pool);
6479 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6481 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6482 NULL, NULL, 0, pool, &effect2, NULL);
6483 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6484 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6485 effect2->lpVtbl->Release(effect2);
6487 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6488 NULL, NULL, 0, pool, &effect2, NULL);
6489 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6490 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6491 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6492 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6494 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6495 NULL, NULL, 0, pool, &effect1, NULL);
6496 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6498 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6499 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6501 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6502 NULL, NULL, 0, pool, &effect3, NULL);
6503 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6504 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6505 NULL, NULL, 0, pool, &effect4, NULL);
6506 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6508 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6509 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6511 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6512 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6513 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6514 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6515 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6516 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6517 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6519 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6520 ok(!!param, "GetParameterByName failed.\n");
6521 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6522 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6524 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6525 ok(!!param, "GetParameterByName failed.\n");
6526 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6527 "Unexpected IsParameterUsed result.\n");
6529 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6530 ok(!!param, "GetParameterByName failed.\n");
6531 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6532 "Unexpected IsParameterUsed result.\n");
6534 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6535 ok(!!param, "GetParameterByName failed.\n");
6536 todo_wine
6537 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6538 "Unexpected IsParameterUsed result.\n");
6540 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6541 "Unexpected IsParameterUsed result.\n");
6542 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6543 "Unexpected IsParameterUsed result.\n");
6544 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6545 "Unexpected IsParameterUsed result.\n");
6547 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6548 "Unexpected IsParameterUsed result.\n");
6550 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6551 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6553 if (0)
6555 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6556 * but initialized with different shaders using different parameters. */
6557 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6558 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6560 hr = effect3->lpVtbl->EndPass(effect3);
6561 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6564 test_effect_preshader_clear_vconsts(device);
6565 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6566 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6567 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6568 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6569 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6571 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6572 todo_wine
6573 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6575 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6576 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6577 todo_wine
6578 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6579 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6581 hr = effect3->lpVtbl->EndPass(effect3);
6582 todo_wine
6583 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6585 hr = effect3->lpVtbl->End(effect3);
6586 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6588 for (i = 0; i < 2; ++i)
6590 struct IDirect3DVertexShader9 *vshader1;
6592 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6593 ok(!!param_child, "GetParameterElement failed.\n");
6594 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6595 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6597 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6598 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6599 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6600 IDirect3DVertexShader9_Release(vshader1);
6603 effect3->lpVtbl->Release(effect3);
6604 effect4->lpVtbl->Release(effect4);
6606 fval[0] = 1.0f;
6607 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6608 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6609 fval[0] = 0.0f;
6610 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6611 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6612 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6614 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6615 ok(!!param, "GetParameterByName failed.\n");
6616 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6617 ok(!!param, "GetParameterByName failed.\n");
6618 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6619 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6620 ok(!!param_child, "GetParameterElement failed.\n");
6621 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6622 ok(!!param_child2, "GetParameterElement failed.\n");
6623 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6625 fval[0] = 33.0f;
6626 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6627 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6628 fval[0] = 0.0f;
6629 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6630 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6631 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6632 fval[0] = 0.0f;
6633 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6634 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6635 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6637 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6638 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6640 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6641 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6643 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6644 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6646 fvect.x = 1.0f;
6647 fvect.y = fvect.z = fvect.w = 0.0f;
6648 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6650 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6651 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6653 fvect.x = 91.0f;
6654 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6655 fvect.x = 33.0f;
6656 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6658 fval[0] = 28.0f;
6659 fval[1] = -1.0f;
6660 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6661 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6663 test_effect_preshader_clear_vconsts(device);
6665 hr = effect1->lpVtbl->CommitChanges(effect1);
6666 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6668 fvect.x = 28.0f;
6669 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6670 fvect.x = -1.0f;
6671 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6673 test_effect_preshader_clear_vconsts(device);
6675 hr = effect1->lpVtbl->CommitChanges(effect1);
6676 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6678 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6679 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6681 hr = effect2->lpVtbl->CommitChanges(effect2);
6682 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6684 fvect.x = 28.0f;
6685 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6686 fvect.x = -1.0f;
6687 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6689 fval[0] = -2.0f;
6690 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6691 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6692 hr = effect1->lpVtbl->CommitChanges(effect1);
6693 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6695 fvect.x = -2.0f;
6696 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6697 fvect.x = -1.0f;
6698 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6700 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6701 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6702 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6704 hr = effect1->lpVtbl->CommitChanges(effect1);
6705 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6706 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6708 hr = effect1->lpVtbl->CommitChanges(effect2);
6709 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6710 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6712 hr = effect1->lpVtbl->End(effect1);
6713 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6715 hr = effect2->lpVtbl->End(effect2);
6716 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6718 if (0)
6720 refcount = pool->lpVtbl->Release(pool);
6721 ok(refcount == 2, "Unexpected refcount %u.\n", refcount);
6723 refcount = pool->lpVtbl->Release(pool);
6724 ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
6726 refcount = pool->lpVtbl->Release(pool);
6727 ok(!refcount, "Unexpected refcount %u.\n", refcount);
6729 /* Native d3dx crashes in GetFloat(). */
6730 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6733 effect1->lpVtbl->Release(effect1);
6734 effect2->lpVtbl->Release(effect2);
6736 refcount = pool->lpVtbl->Release(pool);
6737 ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount);
6740 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6742 ID3DXEffect *effect;
6743 D3DXHANDLE param;
6744 static int expected_ivect[4] = {28, 29, 30, 31};
6745 int ivect[4];
6746 HRESULT hr;
6748 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6749 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6750 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6752 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6753 ok(!!param, "GetParameterByName failed.\n");
6755 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6756 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6758 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6759 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6761 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6763 if (0)
6765 /* Native d3dx crashes in GetValue(). */
6766 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6767 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6770 effect->lpVtbl->Release(effect);
6773 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6775 unsigned int passes_count;
6776 ID3DXEffect *effect;
6777 D3DXPASS_DESC desc;
6778 D3DXVECTOR4 fvect;
6779 D3DXHANDLE pass;
6780 HRESULT hr;
6782 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6783 NULL, NULL, 0, NULL, &effect, NULL);
6784 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6786 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6787 ok(!!pass, "GetPass() failed.\n");
6789 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6790 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6791 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6793 fvect.x = fvect.y = fvect.w = 0.0f;
6794 fvect.z = 0.0f;
6795 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6796 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6798 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6799 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6800 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6802 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6804 fvect.z = 3.0f;
6805 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6806 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6808 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6809 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6810 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6812 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6813 * as it is not the case sometimes for BeginPass() with out of bound access. */
6814 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6815 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6816 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6818 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6819 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6821 hr = effect->lpVtbl->BeginPass(effect, 1);
6822 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6824 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6825 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6827 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6829 fvect.z = 2.0f;
6830 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6831 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6832 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6833 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6835 effect->lpVtbl->Release(effect);
6837 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6838 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6839 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6841 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6842 ok(!!pass, "GetPass() failed.\n");
6844 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6845 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6847 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6848 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6850 effect->lpVtbl->Release(effect);
6853 #if 0
6854 float v1 : register(c2);
6855 float v2 : register(c3);
6856 float v3;
6857 float v4 : register(c4);
6858 float v5;
6859 float v6[2] : register(c5) = {11, 22};
6861 struct VS_OUTPUT
6863 float4 Position : POSITION;
6866 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6868 VS_OUTPUT Output;
6870 Output.Position = v1 * v2 * vPos + v2 + v3 + v4;
6871 Output.Position += v6[0] + v6[1];
6872 return Output;
6875 technique tech0
6877 pass p0
6879 PointScale_A = v4;
6880 VertexShader = compile vs_3_0 RenderSceneVS();
6883 #endif
6884 static const DWORD test_effect_skip_constants_blob[] =
6886 0xfeff0901, 0x00000144, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
6887 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003176, 0x00000003, 0x00000000, 0x0000004c,
6888 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003276, 0x00000003,
6889 0x00000000, 0x00000074, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6890 0x00003376, 0x00000003, 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6891 0x00000000, 0x00000003, 0x00003476, 0x00000003, 0x00000000, 0x000000c4, 0x00000000, 0x00000000,
6892 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003576, 0x00000003, 0x00000000, 0x000000f0,
6893 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41300000, 0x41b00000, 0x00000003, 0x00003676,
6894 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6895 0x00000001, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070,
6896 0x00000006, 0x68636574, 0x00000030, 0x00000006, 0x00000001, 0x00000002, 0x00000002, 0x00000004,
6897 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054,
6898 0x00000070, 0x00000000, 0x00000000, 0x0000007c, 0x00000098, 0x00000000, 0x00000000, 0x000000a4,
6899 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e8, 0x00000000, 0x00000000, 0x00000138,
6900 0x00000000, 0x00000001, 0x00000130, 0x00000000, 0x00000002, 0x00000041, 0x00000000, 0x000000fc,
6901 0x000000f8, 0x00000092, 0x00000000, 0x0000011c, 0x00000118, 0x00000000, 0x00000002, 0x00000000,
6902 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000001bc, 0xfffe0300, 0x0047fffe, 0x42415443,
6903 0x0000001c, 0x000000e7, 0xfffe0300, 0x00000005, 0x0000001c, 0x20000000, 0x000000e0, 0x00000080,
6904 0x00020002, 0x000a0001, 0x00000084, 0x00000094, 0x000000a4, 0x00030002, 0x000e0001, 0x00000084,
6905 0x00000094, 0x000000a7, 0x00000002, 0x00000001, 0x00000084, 0x00000094, 0x000000aa, 0x00040002,
6906 0x00120001, 0x00000084, 0x00000094, 0x000000ad, 0x00050002, 0x00160002, 0x000000b0, 0x000000c0,
6907 0xab003176, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6908 0x00000000, 0x76003276, 0x34760033, 0x00367600, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
6909 0x41300000, 0x00000000, 0x00000000, 0x00000000, 0x41b00000, 0x00000000, 0x00000000, 0x00000000,
6910 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
6911 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000,
6912 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0x80010000, 0xa0000003, 0x03000005,
6913 0x80010000, 0x80000000, 0xa0000002, 0x04000004, 0x800f0000, 0x80000000, 0x90e40000, 0xa0000003,
6914 0x03000002, 0x800f0000, 0x80e40000, 0xa0000000, 0x03000002, 0x800f0000, 0x80e40000, 0xa0000004,
6915 0x02000001, 0x80010001, 0xa0000005, 0x03000002, 0x80010001, 0x80000001, 0xa0000006, 0x03000002,
6916 0xe00f0000, 0x80e40000, 0x80000001, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
6917 0x00000000, 0x000000d8, 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200,
6918 0x00000001, 0x0000001c, 0x20000100, 0x00000054, 0x00000030, 0x00040002, 0x00120001, 0x00000034,
6919 0x00000044, 0xab003476, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
6920 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6921 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6922 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6923 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6926 static void test_effect_skip_constants(IDirect3DDevice9 *device)
6928 HRESULT hr;
6929 ID3DXEffect *effect;
6930 unsigned int passes_count;
6931 D3DXVECTOR4 fvect;
6932 unsigned int i;
6934 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
6935 NULL, NULL, "v3", 0, NULL, &effect, NULL);
6936 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6937 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
6938 NULL, NULL, "v4", 0, NULL, &effect, NULL);
6939 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6940 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
6941 NULL, NULL, "v1;v5;v4", 0, NULL, &effect, NULL);
6942 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6944 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
6945 NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL);
6946 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6948 ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"),
6949 "Unexpected IsParameterUsed result.\n");
6950 ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"),
6951 "Unexpected IsParameterUsed result.\n");
6952 ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"),
6953 "Unexpected IsParameterUsed result.\n");
6954 ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"),
6955 "Unexpected IsParameterUsed result.\n");
6956 ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"),
6957 "Unexpected IsParameterUsed result.\n");
6958 ok(!effect->lpVtbl->IsParameterUsed(effect, "v6", "tech0"),
6959 "Unexpected IsParameterUsed result.\n");
6961 hr = effect->lpVtbl->SetFloat(effect, "v1", 28.0f);
6962 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6963 hr = effect->lpVtbl->SetFloat(effect, "v2", 29.0f);
6964 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6965 hr = effect->lpVtbl->SetFloat(effect, "v3", 30.0f);
6966 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6967 hr = effect->lpVtbl->SetFloat(effect, "v4", 31.0f);
6968 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6969 hr = effect->lpVtbl->SetFloat(effect, "v5", 32.0f);
6970 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6972 test_effect_preshader_clear_vconsts(device);
6974 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6975 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6976 hr = effect->lpVtbl->BeginPass(effect, 0);
6977 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6979 fvect.y = fvect.z = fvect.w = 0.0f;
6980 fvect.x = 30.0f;
6981 test_effect_shared_parameters_compare_vconst(device, 0, &fvect, FALSE);
6982 for (i = 1; i < 4; ++i)
6983 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
6984 fvect.x = 31.0f;
6985 test_effect_shared_parameters_compare_vconst(device, 4, &fvect, FALSE);
6986 for (i = 5; i < 256; ++i)
6987 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
6989 hr = effect->lpVtbl->EndPass(effect);
6990 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6991 hr = effect->lpVtbl->End(effect);
6992 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6994 effect->lpVtbl->Release(effect);
6997 #if 0
6998 vertexshader vs_arr[2] =
7002 vs_3_0
7003 def c0, 1, 1, 1, 1
7004 dcl_position o0
7005 mov o0, c0
7010 vs_3_sw
7011 def c256, 1, 1, 1, 1
7012 dcl_position o0
7013 mov o0, c256
7017 int i;
7019 technique tech0
7021 pass p0
7023 VertexShader = vs_arr[1];
7026 technique tech1
7028 pass p0
7030 VertexShader = vs_arr[i];
7033 #endif
7034 static const DWORD test_effect_unsupported_shader_blob[] =
7036 0xfeff0901, 0x000000ac, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7037 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7038 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000003,
7039 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006,
7040 0x68636574, 0x00000030, 0x00000004, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
7041 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002, 0x00000002, 0x00000006,
7042 0x00000005, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
7043 0x00000000, 0x00000074, 0x00000000, 0x00000001, 0x0000006c, 0x00000000, 0x00000001, 0x00000092,
7044 0x00000000, 0x00000058, 0x00000054, 0x000000a0, 0x00000000, 0x00000001, 0x00000098, 0x00000000,
7045 0x00000001, 0x00000092, 0x00000000, 0x00000084, 0x00000080, 0x00000002, 0x00000002, 0x00000001,
7046 0x00000038, 0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7047 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40000, 0x0000ffff, 0x00000002,
7048 0x00000038, 0xfffe03ff, 0x05000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7049 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40100, 0x0000ffff, 0x00000001,
7050 0x00000000, 0xffffffff, 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272,
7051 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c,
7052 0x00000100, 0x00000054, 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069,
7053 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7054 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
7055 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
7056 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
7057 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
7058 0xffffffff, 0x00000000, 0x00000001, 0x0000000a, 0x615f7376, 0x315b7272, 0x0000005d,
7061 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS 81
7062 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN 14
7064 static void test_effect_unsupported_shader(void)
7066 D3DPRESENT_PARAMETERS present_parameters = {0};
7067 IDirect3DVertexShader9 *vshader;
7068 unsigned int passes_count;
7069 IDirect3DDevice9 *device;
7070 UINT byte_code_size;
7071 ID3DXEffect *effect;
7072 IDirect3D9 *d3d;
7073 void *byte_code;
7074 ULONG refcount;
7075 HWND window;
7076 HRESULT hr;
7078 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7079 640, 480, NULL, NULL, NULL, NULL)))
7081 skip("Couldn't create application window\n");
7082 return;
7084 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7086 skip("Couldn't create IDirect3D9 object\n");
7087 DestroyWindow(window);
7088 return;
7090 present_parameters.Windowed = TRUE;
7091 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7092 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7093 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7094 if (FAILED(hr)) {
7095 skip("Failed to create IDirect3DDevice9 object, hr %#x\n", hr);
7096 IDirect3D9_Release(d3d);
7097 DestroyWindow(window);
7098 return;
7101 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7102 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7103 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7105 hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique");
7106 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7107 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7108 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7110 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7111 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7112 effect->lpVtbl->SetInt(effect, "i", 1);
7113 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7114 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7115 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7116 effect->lpVtbl->SetInt(effect, "i", 0);
7117 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7118 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7120 hr = effect->lpVtbl->SetTechnique(effect, "tech0");
7121 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7122 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7123 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7124 hr = effect->lpVtbl->BeginPass(effect, 0);
7125 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7127 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7128 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7129 ok(!vshader, "Got non NULL vshader.\n");
7131 hr = effect->lpVtbl->EndPass(effect);
7132 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7133 hr = effect->lpVtbl->End(effect);
7134 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7136 hr = effect->lpVtbl->SetTechnique(effect, "tech1");
7137 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7138 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7139 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7140 hr = effect->lpVtbl->BeginPass(effect, 0);
7141 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7143 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7144 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7145 ok(!!vshader, "Got NULL vshader.\n");
7146 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
7147 ok(hr == D3D_OK, "Got result %x.\n", hr);
7148 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
7149 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
7150 ok(hr == D3D_OK, "Got result %x.\n", hr);
7151 ok(byte_code_size == TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN * sizeof(DWORD),
7152 "Got unexpected byte code size %u.\n", byte_code_size);
7153 ok(!memcmp(byte_code,
7154 &test_effect_unsupported_shader_blob[TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS],
7155 byte_code_size), "Incorrect shader selected.\n");
7156 HeapFree(GetProcessHeap(), 0, byte_code);
7157 IDirect3DVertexShader9_Release(vshader);
7159 effect->lpVtbl->SetInt(effect, "i", 1);
7160 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7161 hr = effect->lpVtbl->CommitChanges(effect);
7162 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7163 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7164 ok(hr == D3D_OK, "Got result %x.\n", hr);
7165 ok(!vshader, "Got non NULL vshader.\n");
7167 effect->lpVtbl->Release(effect);
7169 refcount = IDirect3DDevice9_Release(device);
7170 ok(!refcount, "Device has %u references left.\n", refcount);
7171 IDirect3D9_Release(d3d);
7172 DestroyWindow(window);
7175 #if 0
7176 vertexshader vs_arr[2];
7178 int i;
7180 technique tech0
7182 pass p0
7184 VertexShader = null;
7187 technique tech1
7189 pass p0
7191 VertexShader = vs_arr[i];
7194 #endif
7195 static const DWORD test_effect_null_shader_blob[] =
7197 0xfeff0901, 0x000000b4, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7198 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7199 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000000,
7200 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
7201 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000010, 0x00000004, 0x00000000,
7202 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002,
7203 0x00000002, 0x00000005, 0x00000004, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c,
7204 0x00000048, 0x00000000, 0x00000000, 0x0000007c, 0x00000000, 0x00000001, 0x00000074, 0x00000000,
7205 0x00000001, 0x00000092, 0x00000000, 0x00000058, 0x00000054, 0x000000a8, 0x00000000, 0x00000001,
7206 0x000000a0, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x0000008c, 0x00000088, 0x00000002,
7207 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xffffffff,
7208 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0023fffe,
7209 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000054,
7210 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069, 0x00020000, 0x00010001,
7211 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
7212 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
7213 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
7214 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
7215 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7218 static void test_effect_null_shader(void)
7220 D3DPRESENT_PARAMETERS present_parameters = {0};
7221 IDirect3DDevice9 *device;
7222 ID3DXEffect *effect;
7223 D3DXPASS_DESC desc;
7224 IDirect3D9 *d3d;
7225 D3DXHANDLE pass;
7226 ULONG refcount;
7227 HWND window;
7228 HRESULT hr;
7230 /* Creating a fresh device because the existing device can have invalid
7231 * render states from previous tests. If IDirect3DDevice9_ValidateDevice()
7232 * returns certain error codes, native ValidateTechnique() fails. */
7233 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7234 640, 480, NULL, NULL, NULL, NULL)))
7236 skip("Failed to create window.\n");
7237 return;
7239 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7241 skip("Failed to create IDirect3D9 object.\n");
7242 DestroyWindow(window);
7243 return;
7245 present_parameters.Windowed = TRUE;
7246 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7247 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7248 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7249 if (FAILED(hr))
7251 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
7252 IDirect3D9_Release(d3d);
7253 DestroyWindow(window);
7254 return;
7257 hr = D3DXCreateEffectEx(device, test_effect_null_shader_blob,
7258 sizeof(test_effect_null_shader_blob), NULL, NULL, NULL, 0, NULL, &effect, NULL);
7259 ok(hr == D3D_OK, "Failed to create effect, hr %#x.\n", hr);
7261 pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
7262 ok(!!pass, "GetPass() failed.\n");
7263 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7264 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7265 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7267 pass = effect->lpVtbl->GetPass(effect, "tech1", 0);
7268 ok(!!pass, "GetPass() failed.\n");
7269 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7270 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7271 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7273 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7274 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7275 effect->lpVtbl->SetInt(effect, "i", 0);
7276 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7277 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7278 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7279 effect->lpVtbl->SetInt(effect, "i", 1);
7280 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7281 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7282 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7284 effect->lpVtbl->SetInt(effect, "i", 2);
7285 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7286 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7287 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7289 effect->lpVtbl->Release(effect);
7291 refcount = IDirect3DDevice9_Release(device);
7292 ok(!refcount, "Device has %u references left.\n", refcount);
7293 IDirect3D9_Release(d3d);
7294 DestroyWindow(window);
7297 START_TEST(effect)
7299 HWND wnd;
7300 IDirect3D9 *d3d;
7301 IDirect3DDevice9 *device;
7302 D3DPRESENT_PARAMETERS d3dpp;
7303 HRESULT hr;
7304 ULONG refcount;
7306 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7307 640, 480, NULL, NULL, NULL, NULL)))
7309 skip("Couldn't create application window\n");
7310 return;
7312 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7314 skip("Couldn't create IDirect3D9 object\n");
7315 DestroyWindow(wnd);
7316 return;
7319 ZeroMemory(&d3dpp, sizeof(d3dpp));
7320 d3dpp.Windowed = TRUE;
7321 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
7322 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
7323 if (FAILED(hr)) {
7324 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
7325 IDirect3D9_Release(d3d);
7326 DestroyWindow(wnd);
7327 return;
7330 test_create_effect_and_pool(device);
7331 test_create_effect_compiler();
7332 test_effect_parameter_value(device);
7333 test_effect_setvalue_object(device);
7334 test_effect_variable_names(device);
7335 test_effect_compilation_errors(device);
7336 test_effect_states(device);
7337 test_effect_preshader(device);
7338 test_effect_preshader_ops(device);
7339 test_effect_isparameterused(device);
7340 test_effect_out_of_bounds_selector(device);
7341 test_effect_commitchanges(device);
7342 test_effect_preshader_relative_addressing(device);
7343 test_effect_state_manager(device);
7344 test_cross_effect_handle(device);
7345 test_effect_shared_parameters(device);
7346 test_effect_large_address_aware_flag(device);
7347 test_effect_get_pass_desc(device);
7348 test_effect_skip_constants(device);
7350 refcount = IDirect3DDevice9_Release(device);
7351 ok(!refcount, "Device has %u references left.\n", refcount);
7352 refcount = IDirect3D9_Release(d3d);
7353 ok(!refcount, "D3D9 object has %u references left.\n", refcount);
7354 DestroyWindow(wnd);
7356 test_effect_unsupported_shader();
7357 test_effect_null_shader();