d3dx9: Fix FindNextValidTechnique() when no previous technique is specified.
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blob9a8a9b65fbcd9602be6de60f859732727b6e1443
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 IDirect3DDevice9 *create_device(HWND *window)
154 D3DPRESENT_PARAMETERS present_parameters = { 0 };
155 IDirect3DDevice9 *device;
156 IDirect3D9 *d3d;
157 HRESULT hr;
158 HWND wnd;
160 *window = NULL;
162 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
163 640, 480, NULL, NULL, NULL, NULL)))
165 skip("Couldn't create application window.\n");
166 return NULL;
169 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
171 skip("Couldn't create IDirect3D9 object.\n");
172 DestroyWindow(wnd);
173 return NULL;
176 present_parameters.Windowed = TRUE;
177 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
178 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING,
179 &present_parameters, &device);
180 IDirect3D9_Release(d3d);
181 if (FAILED(hr))
183 skip("Failed to create IDirect3DDevice9 object %#x.\n", hr);
184 DestroyWindow(wnd);
185 return NULL;
188 *window = wnd;
189 return device;
192 static char temp_path[MAX_PATH];
194 static BOOL create_file(const char *filename, const char *data, const unsigned int size, char *out_path)
196 DWORD written;
197 HANDLE hfile;
198 char path[MAX_PATH];
200 if (!*temp_path)
201 GetTempPathA(sizeof(temp_path), temp_path);
203 strcpy(path, temp_path);
204 strcat(path, filename);
205 hfile = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
206 if (hfile == INVALID_HANDLE_VALUE)
207 return FALSE;
209 if (WriteFile(hfile, data, size, &written, NULL))
211 CloseHandle(hfile);
213 if (out_path)
214 strcpy(out_path, path);
215 return TRUE;
218 CloseHandle(hfile);
219 return FALSE;
222 static void delete_file(const char *filename)
224 char path[MAX_PATH];
226 strcpy(path, temp_path);
227 strcat(path, filename);
228 DeleteFileA(path);
231 static BOOL create_directory(const char *name)
233 char path[MAX_PATH];
235 strcpy(path, temp_path);
236 strcat(path, name);
237 return CreateDirectoryA(path, NULL);
240 static void delete_directory(const char *name)
242 char path[MAX_PATH];
244 strcpy(path, temp_path);
245 strcat(path, name);
246 RemoveDirectoryA(path);
249 static const char effect_desc[] =
250 "Technique\n"
251 "{\n"
252 "}\n";
254 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
256 HRESULT hr;
257 ID3DXEffect *effect;
258 ID3DXBaseEffect *base;
259 ULONG count;
260 IDirect3DDevice9 *device2;
261 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
262 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
264 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
265 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
267 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
268 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
270 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
271 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
273 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
274 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
276 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
277 todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
278 if (FAILED(hr))
280 skip("Failed to compile effect, skipping test.\n");
281 return;
284 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
285 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
287 hr = effect->lpVtbl->GetStateManager(effect, NULL);
288 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
290 hr = effect->lpVtbl->GetStateManager(effect, &manager);
291 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
292 ok(!manager, "GetStateManager failed, got %p\n", manager);
294 /* this works, but it is not recommended! */
295 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
296 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
298 hr = effect->lpVtbl->GetStateManager(effect, &manager);
299 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
300 ok(manager != NULL, "GetStateManager failed\n");
302 IDirect3DDevice9_AddRef(device);
303 count = IDirect3DDevice9_Release(device);
304 ok(count == 4, "Release failed, got %u, expected 4\n", count);
306 count = IUnknown_Release(manager);
307 ok(count == 3, "Release failed, got %u, expected 3\n", count);
309 hr = effect->lpVtbl->SetStateManager(effect, NULL);
310 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
312 hr = effect->lpVtbl->GetPool(effect, &pool);
313 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
314 ok(!pool, "GetPool failed, got %p\n", pool);
316 hr = effect->lpVtbl->GetPool(effect, NULL);
317 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
319 hr = effect->lpVtbl->GetDevice(effect, &device2);
320 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
322 hr = effect->lpVtbl->GetDevice(effect, NULL);
323 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
325 count = IDirect3DDevice9_Release(device2);
326 ok(count == 2, "Release failed, got %u, expected 2\n", count);
328 count = effect->lpVtbl->Release(effect);
329 ok(count == 0, "Release failed %u\n", count);
331 hr = D3DXCreateEffectPool(NULL);
332 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
334 hr = D3DXCreateEffectPool(&pool);
335 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
337 count = pool->lpVtbl->Release(pool);
338 ok(count == 0, "Release failed %u\n", count);
340 hr = D3DXCreateEffectPool(&pool);
341 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
343 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
344 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
346 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
347 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
348 ok(pool == pool2, "Release failed, got %p, expected %p\n", pool2, pool);
350 count = pool2->lpVtbl->Release(pool2);
351 ok(count == 1, "Release failed, got %u, expected 1\n", count);
353 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
354 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
356 count = IDirect3DDevice9_Release(device2);
357 ok(count == 1, "Release failed, got %u, expected 1\n", count);
359 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
360 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
362 hr = effect->lpVtbl->GetPool(effect, &pool);
363 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
364 ok(pool == pool2, "GetPool failed, got %p, expected %p\n", pool2, pool);
366 count = pool2->lpVtbl->Release(pool2);
367 ok(count == 2, "Release failed, got %u, expected 2\n", count);
369 count = effect->lpVtbl->Release(effect);
370 ok(count == 0, "Release failed %u\n", count);
372 count = pool->lpVtbl->Release(pool);
373 ok(count == 0, "Release failed %u\n", count);
376 static void test_create_effect_compiler(void)
378 HRESULT hr;
379 ID3DXEffectCompiler *compiler, *compiler2;
380 ID3DXBaseEffect *base;
381 IUnknown *unknown;
382 ULONG count;
384 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
385 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
387 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
388 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
390 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
391 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
392 if (FAILED(hr))
394 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
395 return;
398 count = compiler->lpVtbl->Release(compiler);
399 ok(count == 0, "Release failed %u\n", count);
401 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
402 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
404 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
405 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
407 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
408 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
410 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
411 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
413 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
414 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
416 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
417 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
419 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
420 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
422 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
423 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
425 count = unknown->lpVtbl->Release(unknown);
426 ok(count == 2, "Release failed, got %u, expected %u\n", count, 2);
428 count = compiler2->lpVtbl->Release(compiler2);
429 ok(count == 1, "Release failed, got %u, expected %u\n", count, 1);
431 count = compiler->lpVtbl->Release(compiler);
432 ok(count == 0, "Release failed %u\n", count);
436 * Parameter value test
438 struct test_effect_parameter_value_result
440 const char *full_name;
441 D3DXPARAMETER_DESC desc;
442 UINT value_offset; /* start position for the value in the blob */
446 * fxc.exe /Tfx_2_0
448 #if 0
449 float f = 0.1;
450 float1 f1 = {1.1};
451 float2 f2 = {2.1, 2.2};
452 float3 f3 = {3.1, 3.2, 3.3};
453 float4 f4 = {4.1, 4.2, 4.3, 4.4};
454 float1x1 f11 = {11.1};
455 float1x2 f12 = {12.1, 12.2};
456 float1x3 f13 = {13.1, 13.2, 13.3};
457 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
458 float2x1 f21 = {{21.11, 21.21}};
459 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
460 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
461 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
462 float3x1 f31 = {{31.11, 31.21, 31.31}};
463 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
464 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
465 {33.13, 33.23, 33.33}};
466 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
467 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
468 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
469 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
470 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
471 {43.13, 43.23, 43.33, 43.43}};
472 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
473 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
474 float f_2[2] = {0.101, 0.102};
475 float1 f1_2[2] = {{1.101}, {1.102}};
476 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
477 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
478 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
479 float1x1 f11_2[2] = {{11.101}, {11.102}};
480 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
481 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
482 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
483 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
484 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
485 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
486 {23.1202, 23.2202}, {23.1302, 23.2302}}};
487 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
488 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
489 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
490 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
491 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
492 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
493 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
494 {33.1302, 33.2302, 33.3302}}};
495 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
496 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
497 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
498 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
499 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
500 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
501 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
502 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
503 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
504 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
505 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
506 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
507 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
508 technique t { pass p { } }
509 #endif
510 static const DWORD test_effect_parameter_value_blob_float[] =
512 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
513 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
514 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
515 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
516 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
517 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
518 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
519 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
520 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
521 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
522 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
523 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
524 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
525 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
526 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
527 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
528 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
529 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
530 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
531 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
532 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
533 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
534 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
535 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
536 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
537 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
538 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
539 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
540 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
541 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
542 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
543 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
544 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
545 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
546 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
547 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
548 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
549 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
550 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
551 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
552 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
553 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
554 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
555 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
556 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
557 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
558 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
559 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
560 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
561 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
562 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
563 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
564 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
565 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
566 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
567 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
568 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
569 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
570 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
571 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
572 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
573 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
574 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
575 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
576 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
577 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
578 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
579 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
580 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
581 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
582 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
583 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
584 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
585 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
586 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
587 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
588 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
589 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
590 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
591 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
592 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
593 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
594 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
595 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
596 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
597 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
598 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
599 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
600 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
601 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
602 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
603 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
604 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
605 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
606 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
607 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
608 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
609 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
610 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
611 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
612 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
613 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
614 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
615 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
616 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
617 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
618 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
619 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
620 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
621 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
622 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
623 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
624 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
625 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
626 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
629 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
631 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
632 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
633 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
634 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
635 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
636 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
637 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
638 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
639 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
640 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
641 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
642 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
643 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
644 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
645 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
646 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
647 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
648 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
649 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
650 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
651 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
652 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
653 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
654 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
655 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
656 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
657 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
658 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
659 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
660 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
661 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
662 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
663 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
664 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
665 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
666 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
667 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
668 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
669 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
670 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
671 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
672 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
676 * fxc.exe /Tfx_2_0
678 #if 0
679 int i = 1;
680 int1 i1 = {11};
681 int2 i2 = {21, 22};
682 int3 i3 = {31, 32, 33};
683 int4 i4 = {41, 42, 43, 44};
684 int1x1 i11 = {111};
685 int1x2 i12 = {121, 122};
686 int1x3 i13 = {131, 132, 133};
687 int1x4 i14 = {141, 142, 143, 144};
688 int2x1 i21 = {{2111, 2121}};
689 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
690 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
691 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
692 int3x1 i31 = {{3111, 3121, 3131}};
693 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
694 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
695 {3313, 3323, 3333}};
696 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
697 {3413, 3423, 3433}, {3414, 3424, 3434}};
698 int4x1 i41 = {{4111, 4121, 4131, 4141}};
699 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
700 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
701 {4313, 4323, 4333, 4343}};
702 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
703 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
704 int i_2[2] = {0101, 0102};
705 int1 i1_2[2] = {{1101}, {1102}};
706 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
707 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
708 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
709 int1x1 i11_2[2] = {{11101}, {11102}};
710 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
711 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
712 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
713 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
714 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
715 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
716 {231202, 232202}, {231302, 232302}}};
717 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
718 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
719 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
720 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
721 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
722 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
723 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
724 {331302, 332302, 333302}}};
725 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
726 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
727 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
728 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
729 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
730 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
731 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
732 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
733 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
734 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
735 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
736 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
737 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
738 technique t { pass p { } }
739 #endif
740 static const DWORD test_effect_parameter_value_blob_int[] =
742 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
743 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
744 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
745 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
746 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
747 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
748 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
749 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
750 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
751 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
752 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
753 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
754 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
755 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
756 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
757 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
758 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
759 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
760 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
761 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
762 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
763 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
764 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
765 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
766 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
767 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
768 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
769 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
770 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
771 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
772 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
773 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
774 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
775 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
776 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
777 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
778 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
779 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
780 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
781 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
782 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
783 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
784 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
785 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
786 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
787 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
788 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
789 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
790 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
791 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
792 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
793 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
794 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
795 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
796 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
797 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
798 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
799 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
800 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
801 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
802 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
803 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
804 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
805 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
806 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
807 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
808 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
809 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
810 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
811 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
812 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
813 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
814 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
815 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
816 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
817 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
818 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
819 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
820 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
821 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
822 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
823 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
824 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
825 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
826 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
827 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
828 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
829 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
830 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
831 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
832 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
833 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
834 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
835 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
836 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
837 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
838 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
839 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
840 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
841 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
842 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
843 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
844 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
845 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
846 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
847 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
848 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
849 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
850 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
851 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
852 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
853 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
854 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
855 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
856 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
859 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
861 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
862 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
863 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
864 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
865 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
866 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
867 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
868 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
869 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
870 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
871 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
872 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
873 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
874 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
875 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
876 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
877 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
878 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
879 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
880 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
881 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
882 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
883 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
884 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
885 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
886 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
887 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
888 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
889 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
890 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
891 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
892 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
893 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
894 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
895 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
896 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
897 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
898 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
899 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
900 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
901 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
902 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
906 * fxc.exe /Tfx_2_0
908 #if 0
909 string s = "test";
910 string s_2[2] = {"test1", "test2"};
911 texture2D tex;
912 Vertexshader v;
913 Vertexshader v_2[2];
914 Pixelshader p;
915 Pixelshader p_2[2];
916 technique t { pass p { } }
917 #endif
918 static const DWORD test_effect_parameter_value_blob_object[] =
920 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
921 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
922 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
923 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
924 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
925 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
926 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
927 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
928 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
929 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
930 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
931 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
932 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
933 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
934 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
935 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
936 0x00000001, 0x00000005, 0x74736574, 0x00000000,
939 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
941 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
942 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
943 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
944 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
945 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
946 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
947 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
951 * fxc.exe /Tfx_2_0
953 #if 0
954 float3 f3 = {-3.1, 153.2, 283.3};
955 float3 f3min = {-31.1, -31.2, -31.3};
956 float3 f3max = {320.1, 320.2, 320.3};
957 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
958 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
959 float4 f4max = {420.1, 42.20, 420.3, 420.4};
960 technique t { pass p { } }
961 #endif
962 static const DWORD test_effect_parameter_value_blob_special[] =
964 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
965 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
966 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
967 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
968 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
969 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
970 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
971 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
972 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
973 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
974 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
975 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
976 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
977 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
978 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
979 0x00000000, 0x00000000,
982 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
984 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
985 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
986 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
987 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
988 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
989 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
992 #define ADD_PARAMETER_VALUE(x) {\
993 test_effect_parameter_value_blob_ ## x,\
994 sizeof(test_effect_parameter_value_blob_ ## x),\
995 test_effect_parameter_value_result_ ## x,\
996 sizeof(test_effect_parameter_value_result_ ## x)/sizeof(*test_effect_parameter_value_result_ ## x),\
999 static const struct
1001 const DWORD *blob;
1002 UINT blob_size;
1003 const struct test_effect_parameter_value_result *res;
1004 UINT res_count;
1006 test_effect_parameter_value_data[] =
1008 ADD_PARAMETER_VALUE(float),
1009 ADD_PARAMETER_VALUE(int),
1010 ADD_PARAMETER_VALUE(object),
1011 ADD_PARAMETER_VALUE(special),
1014 #undef ADD_PARAMETER_VALUE
1016 /* Multiple of 16 to cover complete matrices */
1017 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
1018 /* Constants for special INT/FLOAT conversation */
1019 #define INT_FLOAT_MULTI 255.0f
1020 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
1022 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
1023 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1025 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1026 const char *res_full_name = res->full_name;
1027 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1028 HRESULT hr;
1029 UINT l;
1031 memset(value, 0xab, sizeof(value));
1032 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
1033 if (res_desc->Class == D3DXPC_SCALAR
1034 || res_desc->Class == D3DXPC_VECTOR
1035 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1037 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1039 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
1041 ok(value[l] == res_value[l], "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1042 i, res_full_name, l, value[l], res_value[l]);
1045 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1047 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1048 i, res_full_name, l, value[l], 0xabababab);
1051 else if (res_desc->Class == D3DXPC_OBJECT)
1053 switch (res_desc->Type)
1055 case D3DXPT_PIXELSHADER:
1056 case D3DXPT_VERTEXSHADER:
1057 case D3DXPT_TEXTURE2D:
1058 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1060 for (l = 0; l < (res_desc->Elements ? res_desc->Elements : 1); ++l)
1062 IUnknown *unk = *((IUnknown **)value + l);
1063 if (unk) IUnknown_Release(unk);
1065 break;
1067 case D3DXPT_STRING:
1068 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1069 break;
1071 default:
1072 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1073 break;
1076 else
1078 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1079 i, res_full_name, hr, D3DERR_INVALIDCALL);
1081 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1083 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1084 i, res_full_name, l, value[l], 0xabababab);
1089 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
1090 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1092 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1093 const char *res_full_name = res->full_name;
1094 BOOL bvalue = 0xabababab;
1095 HRESULT hr;
1097 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
1098 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1100 ok(hr == D3D_OK, "%u - %s: GetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1101 ok(bvalue == get_bool(res_value), "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1102 i, res_full_name, bvalue, get_bool(res_value));
1104 else
1106 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1107 i, res_full_name, hr, D3DERR_INVALIDCALL);
1108 ok(bvalue == 0xabababab, "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1109 i, res_full_name, bvalue, 0xabababab);
1113 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
1114 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1116 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1117 const char *res_full_name = res->full_name;
1118 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1119 HRESULT hr;
1120 UINT l, err = 0;
1122 memset(bavalue, 0xab, sizeof(bavalue));
1123 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1124 if (res_desc->Class == D3DXPC_SCALAR
1125 || res_desc->Class == D3DXPC_VECTOR
1126 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1128 ok(hr == D3D_OK, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1130 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1132 if (bavalue[l] != get_bool(&res_value[l])) ++err;
1135 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1137 if (bavalue[l] != 0xabababab) ++err;
1140 else
1142 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1143 i, res_full_name, hr, D3DERR_INVALIDCALL);
1145 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (bavalue[l] != 0xabababab) ++err;
1147 ok(!err, "%u - %s: GetBoolArray failed with %u errors\n", i, res_full_name, err);
1150 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1151 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1153 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1154 const char *res_full_name = res->full_name;
1155 INT ivalue = 0xabababab;
1156 HRESULT hr;
1158 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1159 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1161 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1162 ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1163 i, res_full_name, ivalue, get_int(res_desc->Type, res_value));
1165 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1166 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1167 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1169 INT tmp;
1171 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1173 tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1174 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1175 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1176 if (res_desc->Columns * res_desc->Rows > 3)
1178 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1181 ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n",
1182 i, res_full_name, ivalue, tmp);
1184 else
1186 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1187 i, res_full_name, hr, D3DERR_INVALIDCALL);
1188 ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1189 i, res_full_name, ivalue, 0xabababab);
1193 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1194 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1196 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1197 const char *res_full_name = res->full_name;
1198 INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1199 HRESULT hr;
1200 UINT l, err = 0;
1202 memset(iavalue, 0xab, sizeof(iavalue));
1203 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1204 if (res_desc->Class == D3DXPC_SCALAR
1205 || res_desc->Class == D3DXPC_VECTOR
1206 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1208 ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1210 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1212 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1215 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1217 if (iavalue[l] != 0xabababab) ++err;
1220 else
1222 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1223 i, res_full_name, hr, D3DERR_INVALIDCALL);
1225 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1227 ok(!err, "%u - %s: GetIntArray failed with %u errors\n", i, res_full_name, err);
1230 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1231 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1233 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1234 const char *res_full_name = res->full_name;
1235 HRESULT hr;
1236 DWORD cmp = 0xabababab;
1237 FLOAT fvalue = *(FLOAT *)&cmp;
1239 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1240 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1242 ok(hr == D3D_OK, "%u - %s: GetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1243 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1244 i, res_full_name, fvalue, get_float(res_desc->Type, res_value));
1246 else
1248 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1249 i, res_full_name, hr, D3DERR_INVALIDCALL);
1250 ok(fvalue == *(FLOAT *)&cmp, "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1251 i, res_full_name, fvalue, *(FLOAT *)&cmp);
1255 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1256 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1258 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1259 const char *res_full_name = res->full_name;
1260 FLOAT favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1261 HRESULT hr;
1262 UINT l, err = 0;
1263 DWORD cmp = 0xabababab;
1265 memset(favalue, 0xab, sizeof(favalue));
1266 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1267 if (res_desc->Class == D3DXPC_SCALAR
1268 || res_desc->Class == D3DXPC_VECTOR
1269 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1271 ok(hr == D3D_OK, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1273 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1275 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1278 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1280 if (favalue[l] != *(FLOAT *)&cmp) ++err;
1283 else
1285 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1286 i, res_full_name, hr, D3DERR_INVALIDCALL);
1288 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1290 ok(!err, "%u - %s: GetFloatArray failed with %u errors\n", i, res_full_name, err);
1293 static void test_effect_parameter_value_GetVector(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 DWORD cmp = 0xabababab;
1300 FLOAT fvalue[4];
1301 UINT l, err = 0;
1303 memset(fvalue, 0xab, sizeof(fvalue));
1304 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1305 if (!res_desc->Elements &&
1306 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1307 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1309 DWORD tmp;
1311 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1313 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1314 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1315 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1316 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1318 if (*res_value != tmp) ++err;
1320 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1322 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1324 for (l = 0; l < res_desc->Columns; ++l)
1326 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1329 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l] != 0.0f) ++err;
1331 else
1333 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1334 i, res_full_name, hr, D3DERR_INVALIDCALL);
1336 for (l = 0; l < 4; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1338 ok(!err, "%u - %s: GetVector failed with %u errors\n", i, res_full_name, err);
1341 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1342 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1344 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1345 const char *res_full_name = res->full_name;
1346 HRESULT hr;
1347 DWORD cmp = 0xabababab;
1348 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1349 UINT l, k, element, err = 0;
1351 for (element = 0; element <= res_desc->Elements + 1; ++element)
1353 memset(fvalue, 0xab, sizeof(fvalue));
1354 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1355 if (!element)
1357 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1359 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1361 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1363 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1365 for (k = 0; k < element; ++k)
1367 for (l = 0; l < res_desc->Columns; ++l)
1369 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1370 &res_value[l + k * res_desc->Columns]), 512))
1371 ++err;
1374 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l + k * 4] != 0.0f) ++err;
1377 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1379 else
1381 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n",
1382 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1384 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1386 ok(!err, "%u - %s[%u]: GetVectorArray failed with %u errors\n", i, res_full_name, element, err);
1390 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1391 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1393 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1394 const char *res_full_name = res->full_name;
1395 HRESULT hr;
1396 union
1398 DWORD d;
1399 float f;
1400 } cmp;
1401 float fvalue[16];
1402 UINT l, k, err = 0;
1404 cmp.d = 0xabababab;
1405 memset(fvalue, 0xab, sizeof(fvalue));
1406 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1407 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1409 ok(hr == D3D_OK, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1411 for (k = 0; k < 4; ++k)
1413 for (l = 0; l < 4; ++l)
1415 if (k < res_desc->Columns && l < res_desc->Rows)
1417 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1418 &res_value[l * res_desc->Columns + k]), 512))
1419 ++err;
1421 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1425 else
1427 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n",
1428 i, res_full_name, hr, D3DERR_INVALIDCALL);
1430 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1431 if (fvalue[l] != cmp.f)
1432 ++err;
1434 ok(!err, "%u - %s: GetMatrix failed with %u errors.\n", i, res_full_name, err);
1437 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1438 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1440 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1441 const char *res_full_name = res->full_name;
1442 HRESULT hr;
1443 DWORD cmp = 0xabababab;
1444 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1445 UINT l, k, m, element, err = 0;
1447 for (element = 0; element <= res_desc->Elements + 1; ++element)
1449 memset(fvalue, 0xab, sizeof(fvalue));
1450 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1451 if (!element)
1453 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1455 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1457 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1459 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1461 for (m = 0; m < element; ++m)
1463 for (k = 0; k < 4; ++k)
1465 for (l = 0; l < 4; ++l)
1467 if (k < res_desc->Columns && l < res_desc->Rows)
1469 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1470 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1471 ++err;
1473 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1478 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1480 else
1482 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n",
1483 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1485 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1487 ok(!err, "%u - %s[%u]: GetMatrixArray failed with %u errors\n", i, res_full_name, element, err);
1491 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1492 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1494 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1495 const char *res_full_name = res->full_name;
1496 HRESULT hr;
1497 DWORD cmp = 0xabababab;
1498 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1499 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1500 UINT l, k, m, element, err = 0;
1502 for (element = 0; element <= res_desc->Elements + 1; ++element)
1504 memset(fvalue, 0xab, sizeof(fvalue));
1505 for (l = 0; l < element; ++l)
1507 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1509 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
1510 if (!element)
1512 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1513 i, res_full_name, element, hr, D3D_OK);
1515 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1517 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1519 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1520 i, res_full_name, element, hr, D3D_OK);
1522 for (m = 0; m < element; ++m)
1524 for (k = 0; k < 4; ++k)
1526 for (l = 0; l < 4; ++l)
1528 if (k < res_desc->Columns && l < res_desc->Rows)
1530 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1531 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1532 ++err;
1534 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1539 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1541 else
1543 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1545 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1546 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1548 ok(!err, "%u - %s[%u]: GetMatrixPointerArray failed with %u errors\n", i, res_full_name, element, err);
1552 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1553 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1555 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1556 const char *res_full_name = res->full_name;
1557 HRESULT hr;
1558 union
1560 DWORD d;
1561 float f;
1562 } cmp;
1563 float fvalue[16];
1564 UINT l, k, err = 0;
1566 cmp.d = 0xabababab;
1567 memset(fvalue, 0xab, sizeof(fvalue));
1568 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1569 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1571 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1573 for (k = 0; k < 4; ++k)
1575 for (l = 0; l < 4; ++l)
1577 if (k < res_desc->Columns && l < res_desc->Rows)
1579 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1580 &res_value[l * res_desc->Columns + k]), 512))
1581 ++err;
1583 else if (fvalue[l + k * 4] != 0.0f) ++err;
1587 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1589 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1591 for (k = 0; k < 4; ++k)
1593 for (l = 0; l < 4; ++l)
1595 if (k < res_desc->Columns && l < res_desc->Rows)
1597 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1598 &res_value[l * res_desc->Columns + k]), 512))
1599 ++err;
1601 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1605 else
1607 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n",
1608 i, res_full_name, hr, D3DERR_INVALIDCALL);
1610 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1611 if (fvalue[l] != cmp.f)
1612 ++err;
1614 ok(!err, "%u - %s: GetMatrixTranspose failed with %u errors.\n", i, res_full_name, err);
1617 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1618 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1620 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1621 const char *res_full_name = res->full_name;
1622 HRESULT hr;
1623 DWORD cmp = 0xabababab;
1624 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1625 UINT l, k, m, element, err = 0;
1627 for (element = 0; element <= res_desc->Elements + 1; ++element)
1629 memset(fvalue, 0xab, sizeof(fvalue));
1630 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1631 if (!element)
1633 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1634 i, res_full_name, element, hr, D3D_OK);
1636 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1638 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1640 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1641 i, res_full_name, element, hr, D3D_OK);
1643 for (m = 0; m < element; ++m)
1645 for (k = 0; k < 4; ++k)
1647 for (l = 0; l < 4; ++l)
1649 if (k < res_desc->Columns && l < res_desc->Rows)
1651 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1652 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1653 ++err;
1655 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1660 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1662 else
1664 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1665 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1667 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1669 ok(!err, "%u - %s[%u]: GetMatrixTransposeArray failed with %u errors\n", i, res_full_name, element, err);
1673 static void test_effect_parameter_value_GetMatrixTransposePointerArray(const struct test_effect_parameter_value_result *res,
1674 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1676 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1677 const char *res_full_name = res->full_name;
1678 HRESULT hr;
1679 DWORD cmp = 0xabababab;
1680 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1681 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1682 UINT l, k, m, element, err = 0;
1684 for (element = 0; element <= res_desc->Elements + 1; ++element)
1686 memset(fvalue, 0xab, sizeof(fvalue));
1687 for (l = 0; l < element; ++l)
1689 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1691 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
1692 if (!element)
1694 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1695 i, res_full_name, element, hr, D3D_OK);
1697 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1699 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1701 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1702 i, res_full_name, element, hr, D3D_OK);
1704 for (m = 0; m < element; ++m)
1706 for (k = 0; k < 4; ++k)
1708 for (l = 0; l < 4; ++l)
1710 if (k < res_desc->Columns && l < res_desc->Rows)
1712 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1713 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1714 ++err;
1716 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1721 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1723 else
1725 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1726 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1728 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1730 ok(!err, "%u - %s[%u]: GetMatrixTransposePointerArray failed with %u errors\n", i, res_full_name, element, err);
1734 static void test_effect_parameter_value_GetTestGroup(const struct test_effect_parameter_value_result *res,
1735 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1737 test_effect_parameter_value_GetValue(res, effect, res_value, parameter, i);
1738 test_effect_parameter_value_GetBool(res, effect, res_value, parameter, i);
1739 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter, i);
1740 test_effect_parameter_value_GetInt(res, effect, res_value, parameter, i);
1741 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter, i);
1742 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter, i);
1743 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter, i);
1744 test_effect_parameter_value_GetVector(res, effect, res_value, parameter, i);
1745 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter, i);
1746 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter, i);
1747 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter, i);
1748 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter, i);
1749 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter, i);
1750 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter, i);
1751 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter, i);
1754 static void test_effect_parameter_value_ResetValue(const struct test_effect_parameter_value_result *res,
1755 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1757 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1758 const char *res_full_name = res->full_name;
1759 HRESULT hr;
1761 if (res_desc->Class == D3DXPC_SCALAR
1762 || res_desc->Class == D3DXPC_VECTOR
1763 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1765 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1766 ok(hr == D3D_OK, "%u - %s: SetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1768 else
1770 /* nothing to do */
1771 switch (res_desc->Type)
1773 case D3DXPT_PIXELSHADER:
1774 case D3DXPT_VERTEXSHADER:
1775 case D3DXPT_TEXTURE2D:
1776 case D3DXPT_STRING:
1777 break;
1779 default:
1780 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1781 break;
1786 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1788 unsigned int effect_count = ARRAY_SIZE(test_effect_parameter_value_data), i;
1790 for (i = 0; i < effect_count; ++i)
1792 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1793 UINT res_count = test_effect_parameter_value_data[i].res_count;
1794 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1795 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1796 HRESULT hr;
1797 ID3DXEffect *effect;
1798 D3DXEFFECT_DESC edesc;
1799 ULONG count;
1800 UINT k;
1802 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1803 ok(hr == D3D_OK, "%u: D3DXCreateEffect failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1805 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1806 ok(hr == D3D_OK, "%u: GetDesc failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1807 ok(edesc.Parameters == res_count, "%u: Parameters failed, got %u, expected %u\n",
1808 i, edesc.Parameters, res_count);
1810 for (k = 0; k < res_count; ++k)
1812 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1813 const char *res_full_name = res[k].full_name;
1814 UINT res_value_offset = res[k].value_offset;
1815 D3DXHANDLE parameter;
1816 D3DXPARAMETER_DESC pdesc;
1817 BOOL bvalue = TRUE;
1818 INT ivalue = 42;
1819 FLOAT fvalue = 2.71828f;
1820 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1821 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1822 UINT l, n, m, element;
1823 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/sizeof(D3DXMATRIX)];
1825 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1826 ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
1828 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1829 ok(hr == D3D_OK, "%u - %s: GetParameterDesc failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1831 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1832 "%u - %s: GetParameterDesc Name failed, got \"%s\", expected \"%s\"\n",
1833 i, res_full_name, pdesc.Name, res_desc->Name);
1834 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1835 "%u - %s: GetParameterDesc Semantic failed, got \"%s\", expected \"%s\"\n",
1836 i, res_full_name, pdesc.Semantic, res_desc->Semantic);
1837 ok(res_desc->Class == pdesc.Class, "%u - %s: GetParameterDesc Class failed, got %#x, expected %#x\n",
1838 i, res_full_name, pdesc.Class, res_desc->Class);
1839 ok(res_desc->Type == pdesc.Type, "%u - %s: GetParameterDesc Type failed, got %#x, expected %#x\n",
1840 i, res_full_name, pdesc.Type, res_desc->Type);
1841 ok(res_desc->Rows == pdesc.Rows, "%u - %s: GetParameterDesc Rows failed, got %u, expected %u\n",
1842 i, res_full_name, pdesc.Rows, res_desc->Rows);
1843 ok(res_desc->Columns == pdesc.Columns, "%u - %s: GetParameterDesc Columns failed, got %u, expected %u\n",
1844 i, res_full_name, pdesc.Columns, res_desc->Columns);
1845 ok(res_desc->Elements == pdesc.Elements, "%u - %s: GetParameterDesc Elements failed, got %u, expected %u\n",
1846 i, res_full_name, pdesc.Elements, res_desc->Elements);
1847 ok(res_desc->Annotations == pdesc.Annotations, "%u - %s: GetParameterDesc Annotations failed, got %u, expected %u\n",
1848 i, res_full_name, pdesc.Annotations, res_desc->Annotations);
1849 ok(res_desc->StructMembers == pdesc.StructMembers, "%u - %s: GetParameterDesc StructMembers failed, got %u, expected %u\n",
1850 i, res_full_name, pdesc.StructMembers, res_desc->StructMembers);
1851 ok(res_desc->Flags == pdesc.Flags, "%u - %s: GetParameterDesc Flags failed, got %u, expected %u\n",
1852 i, res_full_name, pdesc.Flags, res_desc->Flags);
1853 ok(res_desc->Bytes == pdesc.Bytes, "%u - %s: GetParameterDesc Bytes, got %u, expected %u\n",
1854 i, res_full_name, pdesc.Bytes, res_desc->Bytes);
1856 /* check size */
1857 ok(EFFECT_PARAMETER_VALUE_ARRAY_SIZE >= res_desc->Bytes / 4 +
1858 (res_desc->Elements ? res_desc->Bytes / 4 / res_desc->Elements : 0),
1859 "%u - %s: Warning: Array size too small\n", i, res_full_name);
1861 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1862 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1863 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1866 * check invalid calls
1867 * These will crash:
1868 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1869 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1870 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1871 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1872 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1873 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1874 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1875 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1876 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1877 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1878 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1879 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1880 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1881 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1883 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1884 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1885 i, res_full_name, hr, D3DERR_INVALIDCALL);
1887 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1888 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1889 i, res_full_name, hr, D3DERR_INVALIDCALL);
1891 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1892 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1893 i, res_full_name, hr, D3DERR_INVALIDCALL);
1895 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1896 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1897 i, res_full_name, hr, D3DERR_INVALIDCALL);
1899 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1900 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1901 i, res_full_name, hr, D3DERR_INVALIDCALL);
1903 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1904 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1905 i, res_full_name, hr, D3DERR_INVALIDCALL);
1907 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1908 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
1909 i, res_full_name, hr, D3DERR_INVALIDCALL);
1911 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1912 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1913 i, res_full_name, hr, D3DERR_INVALIDCALL);
1915 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1916 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1917 i, res_full_name, hr, D3DERR_INVALIDCALL);
1919 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1920 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
1921 i, res_full_name, hr, D3DERR_INVALIDCALL);
1923 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1924 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1925 i, res_full_name, hr, D3DERR_INVALIDCALL);
1927 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1928 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1929 i, res_full_name, hr, D3DERR_INVALIDCALL);
1931 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1932 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
1933 i, res_full_name, hr, D3DERR_INVALIDCALL);
1935 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1936 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1937 i, res_full_name, hr, D3DERR_INVALIDCALL);
1939 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1940 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1941 i, res_full_name, hr, D3DERR_INVALIDCALL);
1943 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1944 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
1945 i, res_full_name, hr, D3DERR_INVALIDCALL);
1947 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1948 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1949 i, res_full_name, hr, D3DERR_INVALIDCALL);
1951 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1952 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1953 i, res_full_name, hr, D3DERR_INVALIDCALL);
1955 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1956 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
1957 i, res_full_name, hr, D3DERR_INVALIDCALL);
1959 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1960 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1961 i, res_full_name, hr, D3DERR_INVALIDCALL);
1963 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1964 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1965 i, res_full_name, hr, D3DERR_INVALIDCALL);
1967 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1968 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
1969 i, res_full_name, hr, D3DERR_INVALIDCALL);
1971 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1972 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1973 i, res_full_name, hr, D3DERR_INVALIDCALL);
1975 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1976 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1977 i, res_full_name, hr, D3DERR_INVALIDCALL);
1979 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1980 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
1981 i, res_full_name, hr, D3DERR_INVALIDCALL);
1983 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1984 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1985 i, res_full_name, hr, D3DERR_INVALIDCALL);
1987 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1988 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
1989 i, res_full_name, hr, D3DERR_INVALIDCALL);
1991 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1992 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1993 i, res_full_name, hr, D3DERR_INVALIDCALL);
1995 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1996 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1997 i, res_full_name, hr, D3DERR_INVALIDCALL);
1999 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
2000 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2001 i, res_full_name, hr, D3DERR_INVALIDCALL);
2003 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
2004 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2005 i, res_full_name, hr, D3DERR_INVALIDCALL);
2007 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
2008 ok(hr == D3D_OK, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
2009 i, res_full_name, hr, D3D_OK);
2011 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
2012 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
2013 i, res_full_name, hr, D3DERR_INVALIDCALL);
2015 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2016 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
2017 i, res_full_name, hr, D3DERR_INVALIDCALL);
2019 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
2020 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2021 i, res_full_name, hr, D3DERR_INVALIDCALL);
2023 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
2024 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
2025 i, res_full_name, hr, D3DERR_INVALIDCALL);
2027 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
2028 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
2029 i, res_full_name, hr, D3DERR_INVALIDCALL);
2031 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2032 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2033 i, res_full_name, hr, D3DERR_INVALIDCALL);
2035 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2036 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
2037 i, res_full_name, hr, D3DERR_INVALIDCALL);
2039 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2040 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
2041 i, res_full_name, hr, D3DERR_INVALIDCALL);
2043 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
2044 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2045 i, res_full_name, hr, D3DERR_INVALIDCALL);
2047 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
2048 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2049 i, res_full_name, hr, D3DERR_INVALIDCALL);
2051 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
2052 ok(hr == D3D_OK, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2053 i, res_full_name, hr, D3D_OK);
2055 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
2056 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2057 i, res_full_name, hr, D3DERR_INVALIDCALL);
2059 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2060 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2061 i, res_full_name, hr, D3DERR_INVALIDCALL);
2063 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
2064 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
2065 i, res_full_name, hr, D3DERR_INVALIDCALL);
2067 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2068 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
2069 i, res_full_name, hr, D3DERR_INVALIDCALL);
2071 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
2072 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
2073 i, res_full_name, hr, D3DERR_INVALIDCALL);
2075 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2076 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
2077 i, res_full_name, hr, D3DERR_INVALIDCALL);
2079 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
2081 /* SetBool */
2082 bvalue = 5;
2083 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2084 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
2085 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2087 bvalue = TRUE;
2088 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
2089 ok(hr == D3D_OK, "%u - %s: SetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2091 else
2093 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
2094 i, res_full_name, hr, D3DERR_INVALIDCALL);
2096 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2097 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2099 /* SetBoolArray */
2100 *input_value = 1;
2101 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
2103 *(input_value + l) = *(input_value + l - 1) + 1;
2105 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2106 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
2107 if (res_desc->Class == D3DXPC_SCALAR
2108 || res_desc->Class == D3DXPC_VECTOR
2109 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2111 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2113 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
2115 ok(hr == D3D_OK, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2117 else
2119 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
2120 i, res_full_name, hr, D3DERR_INVALIDCALL);
2122 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2123 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2125 /* SetInt */
2126 ivalue = 0x1fbf02ff;
2127 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2128 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2129 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2131 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2132 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2134 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2135 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2136 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2138 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2139 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2140 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2141 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2142 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2143 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2144 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2145 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2147 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2148 i, res_full_name, hr, D3D_OK);
2150 else
2152 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2153 i, res_full_name, hr, D3DERR_INVALIDCALL);
2155 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2156 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2158 /* SetIntArray */
2159 *input_value = 123456;
2160 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2162 *(input_value + l) = *(input_value + l - 1) + 23;
2164 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2165 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2166 if (res_desc->Class == D3DXPC_SCALAR
2167 || res_desc->Class == D3DXPC_VECTOR
2168 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2170 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2172 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2174 ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2176 else
2178 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
2179 i, res_full_name, hr, D3DERR_INVALIDCALL);
2181 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2182 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2184 /* SetFloat */
2185 fvalue = 1.33;
2186 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2187 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2188 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2190 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2191 ok(hr == D3D_OK, "%u - %s: SetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2193 else
2195 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
2196 i, res_full_name, hr, D3DERR_INVALIDCALL);
2198 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2199 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2201 /* SetFloatArray */
2202 fvalue = 1.33;
2203 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2205 *(input_value + l) = *(DWORD *)&fvalue;
2206 fvalue += 1.12;
2208 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2209 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2210 if (res_desc->Class == D3DXPC_SCALAR
2211 || res_desc->Class == D3DXPC_VECTOR
2212 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2214 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2216 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2218 ok(hr == D3D_OK, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2220 else
2222 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
2223 i, res_full_name, hr, D3DERR_INVALIDCALL);
2225 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2226 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2228 /* SetVector */
2229 fvalue = -1.33;
2230 for (l = 0; l < 4; ++l)
2232 *(input_value + l) = *(DWORD *)&fvalue;
2233 fvalue += 1.12;
2235 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2236 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2237 if (!res_desc->Elements &&
2238 (res_desc->Class == D3DXPC_SCALAR
2239 || res_desc->Class == D3DXPC_VECTOR))
2241 /* only values between 0 and INT_FLOAT_MULTI are valid */
2242 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2244 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2245 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2246 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2247 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2249 else
2251 for (l = 0; l < 4; ++l)
2253 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2256 ok(hr == D3D_OK, "%u - %s: SetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2258 else
2260 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
2261 i, res_full_name, hr, D3DERR_INVALIDCALL);
2263 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2264 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2266 /* SetVectorArray */
2267 for (element = 0; element < res_desc->Elements + 1; ++element)
2269 fvalue = 1.33;
2270 for (l = 0; l < element * 4; ++l)
2272 *(input_value + l) = *(DWORD *)&fvalue;
2273 fvalue += 1.12;
2275 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2276 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
2277 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
2279 for (m = 0; m < element; ++m)
2281 for (l = 0; l < res_desc->Columns; ++l)
2283 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2286 ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2288 else
2290 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
2291 i, res_full_name, hr, D3DERR_INVALIDCALL);
2293 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2294 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2297 /* SetMatrix */
2298 fvalue = 1.33;
2299 for (l = 0; l < 16; ++l)
2301 *(input_value + l) = *(DWORD *)&fvalue;
2302 fvalue += 1.12;
2304 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2305 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2306 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2308 for (l = 0; l < 4; ++l)
2310 for (m = 0; m < 4; ++m)
2312 if (m < res_desc->Rows && l < res_desc->Columns)
2313 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2314 input_value + l + m * 4, D3DXPT_FLOAT);
2318 ok(hr == D3D_OK, "%u - %s: SetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2320 else
2322 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
2323 i, res_full_name, hr, D3DERR_INVALIDCALL);
2325 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2326 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2328 /* SetMatrixArray */
2329 for (element = 0; element < res_desc->Elements + 1; ++element)
2331 fvalue = 1.33;
2332 for (l = 0; l < element * 16; ++l)
2334 *(input_value + l) = *(DWORD *)&fvalue;
2335 fvalue += 1.12;
2337 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2338 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2339 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2341 for (n = 0; n < element; ++n)
2343 for (l = 0; l < 4; ++l)
2345 for (m = 0; m < 4; ++m)
2347 if (m < res_desc->Rows && l < res_desc->Columns)
2348 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2349 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2354 ok(hr == D3D_OK, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2356 else
2358 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
2359 i, res_full_name, hr, D3DERR_INVALIDCALL);
2361 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2362 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2365 /* SetMatrixPointerArray */
2366 for (element = 0; element < res_desc->Elements + 1; ++element)
2368 fvalue = 1.33;
2369 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2371 *(input_value + l) = *(DWORD *)&fvalue;
2372 fvalue += 1.12;
2374 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2375 for (l = 0; l < element; ++l)
2377 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2379 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
2380 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2382 for (n = 0; n < element; ++n)
2384 for (l = 0; l < 4; ++l)
2386 for (m = 0; m < 4; ++m)
2388 if (m < res_desc->Rows && l < res_desc->Columns)
2389 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2390 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2395 ok(hr == D3D_OK, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2396 i, res_full_name, hr, D3D_OK);
2398 else
2400 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2401 i, res_full_name, hr, D3DERR_INVALIDCALL);
2403 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2404 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2407 /* SetMatrixTranspose */
2408 fvalue = 1.33;
2409 for (l = 0; l < 16; ++l)
2411 *(input_value + l) = *(DWORD *)&fvalue;
2412 fvalue += 1.12;
2414 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2415 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2416 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2418 for (l = 0; l < 4; ++l)
2420 for (m = 0; m < 4; ++m)
2422 if (m < res_desc->Rows && l < res_desc->Columns)
2423 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2424 input_value + l * 4 + m, D3DXPT_FLOAT);
2428 ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2430 else
2432 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2433 i, res_full_name, hr, D3DERR_INVALIDCALL);
2435 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2436 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2438 /* SetMatrixTransposeArray */
2439 for (element = 0; element < res_desc->Elements + 1; ++element)
2441 fvalue = 1.33;
2442 for (l = 0; l < element * 16; ++l)
2444 *(input_value + l) = *(DWORD *)&fvalue;
2445 fvalue += 1.12;
2447 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2448 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2449 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2451 for (n = 0; n < element; ++n)
2453 for (l = 0; l < 4; ++l)
2455 for (m = 0; m < 4; ++m)
2457 if (m < res_desc->Rows && l < res_desc->Columns)
2458 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2459 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2464 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2466 else
2468 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2469 i, res_full_name, hr, D3DERR_INVALIDCALL);
2471 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2472 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2475 /* SetMatrixTransposePointerArray */
2476 for (element = 0; element < res_desc->Elements + 1; ++element)
2478 fvalue = 1.33;
2479 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2481 *(input_value + l) = *(DWORD *)&fvalue;
2482 fvalue += 1.12;
2484 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2485 for (l = 0; l < element; ++l)
2487 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2489 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
2490 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2492 for (n = 0; n < element; ++n)
2494 for (l = 0; l < 4; ++l)
2496 for (m = 0; m < 4; ++m)
2498 if (m < res_desc->Rows && l < res_desc->Columns)
2499 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2500 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2505 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2506 i, res_full_name, hr, D3D_OK);
2508 else
2510 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2511 i, res_full_name, hr, D3DERR_INVALIDCALL);
2513 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2514 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2518 count = effect->lpVtbl->Release(effect);
2519 ok(!count, "Release failed %u\n", count);
2523 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2525 static const char expected_string[] = "test_string_1";
2526 static const char expected_string2[] = "test_longer_string_2";
2527 static const char *expected_string_array[] = {expected_string, expected_string2};
2528 const char *string_array[ARRAY_SIZE(expected_string_array)];
2529 const char *string, *string2;
2530 IDirect3DTexture9 *texture_set;
2531 IDirect3DTexture9 *texture;
2532 D3DXHANDLE parameter;
2533 ID3DXEffect *effect;
2534 unsigned int i;
2535 ULONG count;
2536 HRESULT hr;
2538 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2539 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2540 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2542 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2543 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2545 texture = NULL;
2546 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2547 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2548 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2549 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2550 texture_set = NULL;
2551 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2552 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2553 ok(texture == texture_set, "Texture does not match.\n");
2555 count = IDirect3DTexture9_Release(texture_set);
2556 ok(count == 2, "Got reference count %u, expected 2.\n", count);
2557 texture_set = NULL;
2558 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2559 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2560 count = IDirect3DTexture9_Release(texture);
2561 ok(!count, "Got reference count %u, expected 0.\n", count);
2563 hr = effect->lpVtbl->SetString(effect, "s", expected_string);
2564 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2565 string = NULL;
2566 hr = effect->lpVtbl->GetString(effect, "s", &string);
2567 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2568 hr = effect->lpVtbl->GetString(effect, "s", &string2);
2569 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2571 ok(string != expected_string, "String pointers are the same.\n");
2572 ok(string == string2, "String pointers differ.\n");
2573 ok(!strcmp(string, expected_string), "Unexpected string '%s'.\n", string);
2575 string = expected_string2;
2576 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) - 1);
2577 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
2578 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string));
2579 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2580 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) * 2);
2581 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2582 string = NULL;
2583 hr = effect->lpVtbl->GetValue(effect, "s", &string, sizeof(string));
2584 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2586 ok(string != expected_string2, "String pointers are the same.\n");
2587 ok(!strcmp(string, expected_string2), "Unexpected string '%s'.\n", string);
2589 hr = effect->lpVtbl->SetValue(effect, "s_2", expected_string_array,
2590 sizeof(expected_string_array));
2591 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2592 hr = effect->lpVtbl->GetValue(effect, "s_2", string_array,
2593 sizeof(string_array));
2594 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2595 for (i = 0; i < ARRAY_SIZE(expected_string_array); ++i)
2597 ok(!strcmp(string_array[i], expected_string_array[i]), "Unexpected string '%s', i %u.\n",
2598 string_array[i], i);
2600 effect->lpVtbl->Release(effect);
2604 * fxc.exe /Tfx_2_0
2606 #if 0
2607 float a = 2.1;
2608 float b[1];
2609 float c <float d = 3;>;
2610 struct {float e;} f;
2611 float g <float h[1] = {3};>;
2612 struct s {float j;};
2613 float i <s k[1] = {4};>;
2614 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2615 #endif
2616 static const DWORD test_effect_variable_names_blob[] =
2618 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2619 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2620 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2621 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2622 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2623 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2624 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2625 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2626 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2627 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2628 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2629 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2630 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2631 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2632 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2633 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2634 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2635 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2636 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2637 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2638 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2639 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2640 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2641 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2642 0x000001f4, 0x00000000, 0x00000000,
2645 static void test_effect_variable_names(IDirect3DDevice9 *device)
2647 ID3DXEffect *effect;
2648 ULONG count;
2649 HRESULT hr;
2650 D3DXHANDLE parameter, p;
2652 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2653 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2654 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2657 * check invalid calls
2658 * This will crash:
2659 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2661 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2662 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2664 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2665 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2667 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2668 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2670 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2671 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2673 /* float a; */
2674 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2675 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2677 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2678 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2680 /* members */
2681 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2682 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2684 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2685 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2687 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2688 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2690 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2691 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2693 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2694 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2696 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2697 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2699 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2700 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2702 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2703 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2705 /* elements */
2706 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2707 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2709 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2710 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2712 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2713 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2715 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2716 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2718 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2719 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2721 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2722 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2724 /* annotations */
2725 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2726 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2728 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2729 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2731 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2732 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2734 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2735 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2737 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2738 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2740 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2741 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2743 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2744 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2746 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2747 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2749 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2750 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2752 /* float b[1]; */
2753 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2754 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2756 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2757 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2759 /* elements */
2760 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2761 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2763 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2764 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2766 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2767 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2769 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2770 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2772 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2773 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2775 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2776 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2778 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2779 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2781 /* float c <float d = 3;>; */
2782 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2783 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2785 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2786 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2788 /* annotations */
2789 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2790 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2792 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2793 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2795 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2796 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2798 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2799 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2801 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2802 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2804 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2805 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2807 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2808 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2810 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2811 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2813 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2814 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2816 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2817 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2819 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2820 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2822 /* struct {float e;} f; */
2823 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2824 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2826 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2827 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2829 /* members */
2830 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2831 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2833 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2834 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2836 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2837 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2839 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2840 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2842 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2843 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2845 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2846 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2848 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2849 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2851 /* float g <float h[1] = {3};>; */
2852 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2853 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2855 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2856 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2858 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2859 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2861 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2862 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2864 /* struct s {float j;}; float i <s k[1] = {4};>; */
2865 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2866 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2868 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2869 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2871 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2872 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2874 /* technique t <s l[1] = {5};> */
2875 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2876 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2878 /* pass p <s m[1] = {6};> */
2879 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2880 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2882 count = effect->lpVtbl->Release(effect);
2883 ok(!count, "Release failed %u\n", count);
2886 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2888 ID3DXEffect *effect;
2889 ID3DXBuffer *compilation_errors;
2890 HRESULT hr;
2892 /* Test binary effect */
2893 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2894 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2895 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
2896 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2898 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2899 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2900 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2901 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2902 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2903 effect->lpVtbl->Release(effect);
2907 * fxc.exe /Tfx_2_0
2909 #if 0
2910 vertexshader vs_arr1[2] =
2914 vs_1_1
2915 def c0, 1, 1, 1, 1
2916 mov oPos, c0
2920 vs_2_0
2921 def c0, 2, 2, 2, 2
2922 mov oPos, c0
2926 sampler sampler1 =
2927 sampler_state
2929 MipFilter = LINEAR;
2932 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};
2933 technique tech0
2935 pass p0
2937 vertexshader = vs_arr1[1];
2938 VertexShaderConstant1[3] = {2,2,2,2};
2939 BlendOp = 2;
2940 AlphaOp[3] = 4;
2941 ZEnable = true;
2942 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};
2943 ViewTransform=(camera);
2944 LightEnable[2] = TRUE;
2945 LightType[2] = POINT;
2946 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2947 Sampler[1] = sampler1;
2950 #endif
2951 static const DWORD test_effect_states_effect_blob[] =
2953 0xfeff0901, 0x000002e8, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2954 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2955 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2956 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2957 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2958 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2959 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2960 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2961 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40000000, 0x40000000,
2962 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2963 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2964 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2965 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2966 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2967 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2968 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2969 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2970 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2971 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2972 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2973 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2974 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2975 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2976 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2977 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2978 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x000002dc, 0x00000000, 0x00000001, 0x000002d4,
2979 0x00000000, 0x0000000b, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000003,
2980 0x00000120, 0x00000110, 0x0000004b, 0x00000000, 0x00000140, 0x0000013c, 0x0000006b, 0x00000003,
2981 0x00000160, 0x0000015c, 0x00000000, 0x00000000, 0x00000180, 0x0000017c, 0x0000007d, 0x00000001,
2982 0x000001dc, 0x0000019c, 0x0000007c, 0x00000000, 0x00000238, 0x000001f8, 0x00000091, 0x00000002,
2983 0x00000258, 0x00000254, 0x00000084, 0x00000002, 0x00000278, 0x00000274, 0x00000088, 0x00000002,
2984 0x000002a0, 0x00000294, 0x000000b2, 0x00000001, 0x000002c0, 0x000002bc, 0x00000002, 0x00000003,
2985 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
2986 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200,
2987 0x05000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x02000001, 0xc00f0000,
2988 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000000a, 0x00000001, 0x00000009,
2989 0x706d6173, 0x3172656c, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000006, 0x00000000,
2990 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443, 0x0000001c, 0x0000008b, 0x46580200, 0x00000001,
2991 0x0000001c, 0x20000100, 0x00000088, 0x00000030, 0x00000002, 0x00000004, 0x00000038, 0x00000048,
2992 0x656d6163, 0xab006172, 0x00030003, 0x00040004, 0x00000001, 0x00000000, 0x40800000, 0x00000000,
2993 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2994 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369,
2995 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2996 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
2997 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
2998 0x00000000, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
2999 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000004,
3000 0x00000008, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000004,
3001 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
3002 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272, 0x00005d31,
3004 #define TEST_EFFECT_STATES_VSHADER_POS 271
3006 static void test_effect_states(IDirect3DDevice9 *device)
3008 D3DMATRIX test_mat =
3010 -1.0f, 0.0f, 0.0f, 0.0f,
3011 0.0f, 0.0f, 0.0f, 0.0f,
3012 0.0f, 0.0f, 0.0f, 0.0f,
3013 0.0f, 0.0f, 0.0f, 0.0f
3014 }}};
3015 D3DMATRIX test_mat_camera =
3017 4.0f, 0.0f, 0.0f, 0.0f,
3018 0.0f, 0.0f, 0.0f, 0.0f,
3019 0.0f, 0.0f, 0.0f, 0.0f,
3020 0.0f, 0.0f, 0.0f, 6.0f
3021 }}};
3022 D3DMATRIX test_mat_world1 =
3024 2.0f, 0.0f, 0.0f, 0.0f,
3025 0.0f, 0.0f, 0.0f, 0.0f,
3026 0.0f, 0.0f, 0.0f, 0.0f,
3027 0.0f, 0.0f, 0.0f, 4.0f
3028 }}};
3029 D3DMATRIX mat;
3030 HRESULT hr;
3031 ID3DXEffect *effect;
3032 UINT npasses;
3033 DWORD value;
3034 IDirect3DVertexShader9 *vshader;
3035 void *byte_code;
3036 UINT byte_code_size;
3037 BOOL bval;
3038 D3DLIGHT9 light;
3039 float float_data[4];
3041 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
3042 NULL, NULL, 0, NULL, &effect, NULL);
3043 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3045 /* State affected in passes saved/restored even if no pass
3046 was performed. States not present in passes are not saved &
3047 restored */
3048 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3049 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3050 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
3051 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3053 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3054 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3055 ok(npasses == 1, "Expected 1 pass, got %u\n", npasses);
3057 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3058 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3059 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
3060 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3062 hr = effect->lpVtbl->End(effect);
3063 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3065 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3066 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3067 ok(value == 1, "Got result %u, expected %u.\n", value, 1);
3068 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
3069 ok(value == 2, "Got result %u, expected %u.\n", value, 2);
3071 /* Test states application in BeginPass. No states are restored
3072 on EndPass. */
3073 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
3074 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3075 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
3076 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3078 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3079 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3080 if (hr == D3D_OK)
3081 ok(!bval, "Got result %u, expected 0.\n", bval);
3083 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
3084 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3085 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3087 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3088 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3089 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
3091 hr = effect->lpVtbl->BeginPass(effect, 0);
3092 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3094 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3095 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3096 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
3098 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
3099 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3100 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
3102 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3103 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3104 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3106 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3107 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3108 ok(vshader != NULL, "Got NULL vshader.\n");
3109 if (vshader)
3111 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
3112 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3113 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
3114 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
3115 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3116 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
3117 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
3118 "Incorrect shader selected.\n");
3119 HeapFree(GetProcessHeap(), 0, byte_code);
3120 IDirect3DVertexShader9_Release(vshader);
3123 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3124 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3125 if (hr == D3D_OK)
3126 ok(bval, "Got result %u, expected TRUE.\n", bval);
3127 hr = IDirect3DDevice9_GetLight(device, 2, &light);
3128 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3129 if (hr == D3D_OK)
3130 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
3131 "Got unexpected light position (%f, %f, %f).\n", light.Position.x, light.Position.y, light.Position.z);
3132 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, float_data, 1);
3133 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3134 ok(float_data[0] == 2.0f && float_data[1] == 2.0f && float_data[2] == 2.0f && float_data[3] == 2.0f,
3135 "Got unexpected vertex shader floats: (%f %f %f %f).\n",
3136 float_data[0], float_data[1], float_data[2], float_data[3]);
3138 hr = effect->lpVtbl->EndPass(effect);
3139 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3140 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3141 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3142 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3144 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
3145 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3146 ok(value, "Got result %u, expected TRUE.\n", value);
3148 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
3149 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3150 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %u.\n", value);
3152 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
3153 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3154 ok(value == 4, "Unexpected texture stage 3 AlphaOp %u.\n", value);
3156 hr = effect->lpVtbl->End(effect);
3157 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3159 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3160 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3161 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
3163 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3164 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3165 if (hr == D3D_OK)
3166 ok(!bval, "Got result %u, expected 0.\n", bval);
3168 /* State is not restored if effect is released without End call */
3169 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3170 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3172 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3173 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3175 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3176 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3178 effect->lpVtbl->Release(effect);
3180 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3181 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3182 ok(value == 3, "Got result %u, expected %u.\n", value, 1);
3186 * fxc.exe /Tfx_2_0
3188 #if 0
3189 float4 g_Pos1;
3190 float4 g_Pos2;
3191 float4 g_Selector[3] = {{0, 0, 0, 0}, {10, 10, 10, 10}, {5001, 5002, 5003, 5004}};
3193 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3194 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3195 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3197 float4 vect_sampler = {1, 2, 3, 4};
3199 float3 vec3 = {1001, 1002, 1003};
3201 int4 g_iVect = {4, 3, 2, 1};
3203 vertexshader vs_arr[3] =
3207 vs_1_0
3208 def c0, 1, 1, 1, 1
3209 mov oPos, c0
3213 vs_1_1
3214 def c0, 2, 2, 2, 2
3215 mov oPos, c0
3219 vs_2_0
3220 def c0, 3, 3, 3, 3
3221 mov oPos, c0
3225 float4x4 m4x4 = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}, {41, 42, 43, 44}};
3227 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3228 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3229 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3230 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3231 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3232 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3233 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3234 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3235 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3236 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3238 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3239 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3241 struct test_struct
3243 float3 v1;
3244 float fv;
3245 float4 v2;
3248 struct struct_array
3250 test_struct ts[2];
3253 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3254 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3255 struct_array ts3 = {{{1, 2, 3}, 4, {5, 6, 7, 8}}, {{9, 10, 11}, 12, {13, 14, 15, 16}}};
3257 float arr1[1] = {91};
3258 shared float arr2[2] = {92, 93};
3260 Texture2D tex1;
3261 Texture2D tex2;
3262 sampler sampler1 =
3263 sampler_state
3265 Texture = tex1;
3266 MinFilter = g_iVect.y;
3267 MagFilter = vect_sampler.x + vect_sampler.y;
3270 sampler samplers_array[2] =
3272 sampler_state
3274 MinFilter = 1;
3275 MagFilter = vect_sampler.x;
3277 sampler_state
3279 MinFilter = 2;
3280 MagFilter = vect_sampler.y;
3284 struct VS_OUTPUT
3286 float4 Position : POSITION;
3287 float2 TextureUV : TEXCOORD0;
3288 float4 Diffuse : COLOR0;
3290 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3291 float3 vNormal : NORMAL,
3292 float2 vTexCoord0 : TEXCOORD0,
3293 uniform int nNumLights,
3294 uniform bool bTexture)
3296 VS_OUTPUT Output;
3298 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3299 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3300 else
3301 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3302 Output.TextureUV = float2(0, 0);
3303 Output.Diffuse = 0;
3304 Output.Diffuse.xyz = mul(vPos, m4x3column);
3305 Output.Diffuse += mul(vPos, m3x4column);
3306 Output.Diffuse += mul(vPos, m3x4row);
3307 Output.Diffuse.xyz += mul(vPos, m4x3row);
3308 Output.Diffuse += mul(vPos, ts1[0].fv);
3309 Output.Diffuse += mul(vPos, ts1[0].v2);
3310 Output.Diffuse += mul(vPos, ts2[1].fv);
3311 Output.Diffuse += mul(vPos, ts2[1].v2);
3312 Output.Diffuse += mul(vPos, arr1[0]);
3313 Output.Diffuse += mul(vPos, arr2[1]);
3314 Output.Diffuse += mul(vPos, ts3.ts[1].fv);
3315 Output.Diffuse += mul(vPos, ts3.ts[1].v2);
3316 Output.Diffuse += tex2Dlod(sampler1, g_Pos1);
3317 Output.Diffuse += tex2Dlod(samplers_array[1], g_Pos1);
3318 return Output;
3321 VS_OUTPUT RenderSceneVS2(float4 vPos : POSITION)
3323 VS_OUTPUT Output;
3325 Output.Position = g_Pos1;
3326 Output.TextureUV = float2(0, 0);
3327 Output.Diffuse = 0;
3328 return Output;
3331 struct PS_OUTPUT
3333 float4 RGBColor : COLOR0; /* Pixel color */
3335 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3337 PS_OUTPUT Output;
3338 int i;
3340 Output.RGBColor = In.Diffuse;
3341 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3342 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3343 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3344 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3345 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3346 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3347 for (i = 0; i < g_iVect.x; ++i)
3348 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3349 if (mb[1][1])
3351 Output.RGBColor += sin(Output.RGBColor);
3352 Output.RGBColor += cos(Output.RGBColor);
3353 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3354 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3355 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3356 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3358 if (mb2x3column[0][0])
3360 Output.RGBColor += sin(Output.RGBColor);
3361 Output.RGBColor += cos(Output.RGBColor);
3362 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3363 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3364 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3365 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3367 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3368 Output.RGBColor += tex2D(samplers_array[0], In.TextureUV);
3369 return Output;
3372 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3373 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3375 technique tech0
3377 pass p0
3379 VertexShader = vs_arr2[g_iVect.w - 1];
3380 PixelShader = ps_arr[g_iVect.w - 1];
3382 LightEnable[0] = TRUE;
3383 LightEnable[1] = TRUE;
3384 LightEnable[2] = TRUE;
3385 LightEnable[3] = TRUE;
3386 LightEnable[4] = TRUE;
3387 LightEnable[5] = TRUE;
3388 LightEnable[6] = TRUE;
3389 LightEnable[7] = TRUE;
3390 LightType[0] = POINT;
3391 LightType[1] = POINT;
3392 LightType[2] = POINT;
3393 LightType[3] = POINT;
3394 LightType[4] = POINT;
3395 LightType[5] = POINT;
3396 LightType[6] = POINT;
3397 LightType[7] = POINT;
3398 LightDiffuse[0] = 1 / opvect1;
3399 LightDiffuse[1] = rsqrt(opvect1);
3400 LightDiffuse[2] = opvect1 * opvect2;
3401 LightDiffuse[3] = opvect1 + opvect2;
3402 LightDiffuse[4] = float4(opvect1 < opvect2);
3403 LightDiffuse[5] = float4(opvect1 >= opvect2);
3404 LightDiffuse[6] = -opvect1;
3405 LightDiffuse[7] = rcp(opvect1);
3407 LightAmbient[0] = frac(opvect1);
3408 LightAmbient[1] = min(opvect1, opvect2);
3409 LightAmbient[2] = max(opvect1, opvect2);
3410 LightAmbient[3] = sin(opvect1);
3411 LightAmbient[4] = cos(opvect1);
3412 LightAmbient[5] = 1e-2 / opvect1;
3413 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3414 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3416 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3417 dot(opvect1.zzzx, opvect2.xxyy), 0);
3418 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3419 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3420 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3421 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3422 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3424 FogEnable = TRUE;
3425 FogDensity = ts2[0].fv;
3426 FogStart = ts2[1].fv;
3427 PointScale_A = ts3.ts[0].fv;
3428 PointScale_B = ts3.ts[1].fv;
3430 pass p1
3432 VertexShader = vs_arr[g_iVect.z];
3435 #endif
3436 static const DWORD test_effect_preshader_effect_blob[] =
3438 0xfeff0901, 0x00001160, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3439 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3440 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3441 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3442 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3443 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3444 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3445 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3446 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3447 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3448 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3449 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3450 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3451 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3452 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3453 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3454 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3455 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3456 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3457 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3458 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3459 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3460 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3461 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3462 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3463 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3464 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3465 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3466 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3467 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3468 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3469 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3470 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3471 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3472 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3473 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3474 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3475 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3476 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3477 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3478 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3479 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3480 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3481 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3482 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3483 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3484 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3485 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3486 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3487 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3488 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3489 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3490 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3491 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3492 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3493 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3494 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3495 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3496 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3497 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3498 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3499 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3500 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3501 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3502 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3503 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3504 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3505 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3506 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3507 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3508 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3509 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3510 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3511 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3512 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3513 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3514 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3515 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3516 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3517 0x00000000, 0x0000000a, 0x00000004, 0x00000ab8, 0x00000000, 0x00000002, 0x00000001, 0x00000002,
3518 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3519 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3520 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3521 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000aa,
3522 0x00000100, 0x000009f4, 0x000009f0, 0x000000a9, 0x00000100, 0x00000a14, 0x00000a10, 0x00000002,
3523 0x000000aa, 0x00000100, 0x00000a34, 0x00000a30, 0x000000a9, 0x00000100, 0x00000a54, 0x00000a50,
3524 0x0000000f, 0x706d6173, 0x7372656c, 0x7272615f, 0x00007961, 0x00000010, 0x00000004, 0x00000ae8,
3525 0x00000000, 0x00000002, 0x00000007, 0x00000008, 0x00000008, 0x615f7376, 0x00327272, 0x0000000f,
3526 0x00000004, 0x00000b0c, 0x00000000, 0x00000001, 0x00000009, 0x00000007, 0x615f7370, 0x00007272,
3527 0x0000000a, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x0000000b, 0x0000000f,
3528 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3529 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3530 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3531 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3532 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3533 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3534 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3535 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3536 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3537 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3538 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3539 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3540 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3541 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3542 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3543 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3544 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3545 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3546 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3547 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3548 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3549 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3550 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3551 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3552 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3553 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3554 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3555 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3556 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3557 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3558 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3559 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3560 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3561 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3562 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3563 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3564 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3565 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3566 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3567 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3568 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3569 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3570 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3571 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3572 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3573 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3574 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3575 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x0000000c,
3576 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006,
3577 0x68636574, 0x00000030, 0x00000022, 0x00000001, 0x0000000e, 0x0000000d, 0x00000004, 0x00000020,
3578 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000, 0x00000000, 0x00000074, 0x00000090,
3579 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
3580 0x00000000, 0x00000000, 0x00000140, 0x0000015c, 0x00000000, 0x00000000, 0x00000178, 0x00000194,
3581 0x00000000, 0x00000000, 0x000001b8, 0x000001d4, 0x00000000, 0x00000000, 0x000001ec, 0x00000208,
3582 0x00000000, 0x00000000, 0x00000224, 0x00000238, 0x00000000, 0x00000000, 0x00000250, 0x0000026c,
3583 0x00000000, 0x00000000, 0x000002b8, 0x000002d4, 0x00000000, 0x00000000, 0x00000310, 0x0000032c,
3584 0x00000000, 0x00000000, 0x00000368, 0x00000384, 0x00000000, 0x00000000, 0x000003c4, 0x000003e0,
3585 0x00000000, 0x00000000, 0x00000420, 0x0000043c, 0x00000000, 0x00000000, 0x00000458, 0x00000474,
3586 0x00000000, 0x00000000, 0x00000494, 0x000004b0, 0x00000000, 0x00000000, 0x000004d4, 0x000004f0,
3587 0x00000000, 0x00000000, 0x00000518, 0x00000534, 0x00000000, 0x00000000, 0x00000558, 0x00000574,
3588 0x00000000, 0x00000000, 0x0000059c, 0x000005b8, 0x00000000, 0x00000000, 0x000005e0, 0x000005fc,
3589 0x00000000, 0x00000000, 0x00000624, 0x00000690, 0x00000000, 0x00000000, 0x000006d0, 0x0000073c,
3590 0x00000001, 0x00000000, 0x0000079c, 0x00000820, 0x00000000, 0x00000000, 0x00000888, 0x000008a4,
3591 0x00000000, 0x00000000, 0x000008b4, 0x000008d0, 0x00000001, 0x00000000, 0x000008e4, 0x000008f8,
3592 0x00000000, 0x00000000, 0x00000908, 0x0000091c, 0x00000000, 0x00000000, 0x0000092c, 0x00000998,
3593 0x00000000, 0x00000000, 0x000009dc, 0x00000a70, 0x00000000, 0x00000000, 0x00000acc, 0x00000ae0,
3594 0x00000001, 0x00000000, 0x00000af4, 0x00000b08, 0x00000000, 0x00000000, 0x00001154, 0x00000000,
3595 0x00000002, 0x0000112c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000b1c, 0x00000b18,
3596 0x00000093, 0x00000000, 0x00000b34, 0x00000b30, 0x00000091, 0x00000000, 0x00000b4c, 0x00000b48,
3597 0x00000091, 0x00000001, 0x00000b6c, 0x00000b68, 0x00000091, 0x00000002, 0x00000b8c, 0x00000b88,
3598 0x00000091, 0x00000003, 0x00000bac, 0x00000ba8, 0x00000091, 0x00000004, 0x00000bcc, 0x00000bc8,
3599 0x00000091, 0x00000005, 0x00000bec, 0x00000be8, 0x00000091, 0x00000006, 0x00000c0c, 0x00000c08,
3600 0x00000091, 0x00000007, 0x00000c2c, 0x00000c28, 0x00000084, 0x00000000, 0x00000c4c, 0x00000c48,
3601 0x00000084, 0x00000001, 0x00000c6c, 0x00000c68, 0x00000084, 0x00000002, 0x00000c8c, 0x00000c88,
3602 0x00000084, 0x00000003, 0x00000cac, 0x00000ca8, 0x00000084, 0x00000004, 0x00000ccc, 0x00000cc8,
3603 0x00000084, 0x00000005, 0x00000cec, 0x00000ce8, 0x00000084, 0x00000006, 0x00000d0c, 0x00000d08,
3604 0x00000084, 0x00000007, 0x00000d2c, 0x00000d28, 0x00000085, 0x00000000, 0x00000d58, 0x00000d48,
3605 0x00000085, 0x00000001, 0x00000d84, 0x00000d74, 0x00000085, 0x00000002, 0x00000db0, 0x00000da0,
3606 0x00000085, 0x00000003, 0x00000ddc, 0x00000dcc, 0x00000085, 0x00000004, 0x00000e08, 0x00000df8,
3607 0x00000085, 0x00000005, 0x00000e34, 0x00000e24, 0x00000085, 0x00000006, 0x00000e60, 0x00000e50,
3608 0x00000085, 0x00000007, 0x00000e8c, 0x00000e7c, 0x00000087, 0x00000000, 0x00000eb8, 0x00000ea8,
3609 0x00000087, 0x00000001, 0x00000ee4, 0x00000ed4, 0x00000087, 0x00000002, 0x00000f10, 0x00000f00,
3610 0x00000087, 0x00000003, 0x00000f3c, 0x00000f2c, 0x00000087, 0x00000004, 0x00000f68, 0x00000f58,
3611 0x00000087, 0x00000005, 0x00000f94, 0x00000f84, 0x00000087, 0x00000006, 0x00000fc0, 0x00000fb0,
3612 0x00000087, 0x00000007, 0x00000fec, 0x00000fdc, 0x00000086, 0x00000000, 0x00001018, 0x00001008,
3613 0x00000086, 0x00000001, 0x00001044, 0x00001034, 0x00000086, 0x00000002, 0x00001070, 0x00001060,
3614 0x0000000e, 0x00000000, 0x00001090, 0x0000108c, 0x00000014, 0x00000000, 0x000010b0, 0x000010ac,
3615 0x00000012, 0x00000000, 0x000010d0, 0x000010cc, 0x00000041, 0x00000000, 0x000010f0, 0x000010ec,
3616 0x00000042, 0x00000000, 0x00001110, 0x0000110c, 0x0000114c, 0x00000000, 0x00000001, 0x00000092,
3617 0x00000000, 0x00001138, 0x00001134, 0x00000008, 0x0000001f, 0x00000009, 0x00000ad0, 0xffff0300,
3618 0x00d9fffe, 0x42415443, 0x0000001c, 0x0000032f, 0xffff0300, 0x0000000b, 0x0000001c, 0x00000000,
3619 0x00000328, 0x000000f8, 0x00000001, 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x00080002,
3620 0x00000002, 0x0000012c, 0x0000013c, 0x0000015c, 0x00060002, 0x00000002, 0x00000164, 0x00000174,
3621 0x00000194, 0x00000002, 0x00000003, 0x000001a0, 0x000001b0, 0x000001e0, 0x000a0002, 0x00000002,
3622 0x000001e8, 0x000001f8, 0x00000218, 0x000c0002, 0x00000002, 0x00000224, 0x00000234, 0x00000254,
3623 0x00030002, 0x00000003, 0x0000025c, 0x0000026c, 0x0000029c, 0x00050000, 0x00000001, 0x000002a8,
3624 0x000002b8, 0x000002d0, 0x00000000, 0x00000005, 0x000002dc, 0x000002b8, 0x000002ec, 0x00000003,
3625 0x00000001, 0x000002f8, 0x00000000, 0x00000308, 0x00010003, 0x00000001, 0x00000318, 0x00000000,
3626 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x00000004, 0x00000003,
3627 0x00000002, 0x00000001, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001,
3628 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3629 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3630 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d,
3631 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3632 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000,
3633 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000,
3634 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3635 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000,
3636 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d,
3637 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3638 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000,
3639 0x00000000, 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00010003, 0x00030002, 0x00000001, 0x00000000,
3640 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x7832626d, 0x776f7233,
3641 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, 0x706d6173, 0x3172656c, 0xababab00,
3642 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c, 0x7272615f, 0xab007961,
3643 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x335f7370, 0x4d00305f, 0x6f726369, 0x74666f73,
3644 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3645 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, 0x3f800000, 0xbe22f983,
3646 0x05000051, 0xa00f000f, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x05000051, 0xa00f0010,
3647 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x0200001f, 0x80000005, 0x90030000, 0x0200001f,
3648 0x8000000a, 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801,
3649 0x03000005, 0x80030000, 0xa0e40007, 0x90550001, 0x04000004, 0x80030000, 0x90000001, 0xa0e40006,
3650 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40001, 0x02000001, 0x80010001, 0xa0000010,
3651 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3652 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000,
3653 0xa0440004, 0x90550001, 0x04000004, 0x800c0000, 0x90000001, 0xa0440003, 0x80e40000, 0x04000004,
3654 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000,
3655 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d,
3656 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, 0x90550001,
3657 0x04000004, 0x800e0001, 0x90000001, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001,
3658 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000,
3659 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002,
3660 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, 0x02000001,
3661 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000, 0x03000002, 0x80070003, 0x80e40002, 0x80e40003,
3662 0x00000027, 0x01000028, 0xe0e40804, 0x02000001, 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000,
3663 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000,
3664 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004,
3665 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002,
3666 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002,
3667 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003,
3668 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e,
3669 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, 0xa000000f,
3670 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002,
3671 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010, 0x04000004,
3672 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004,
3673 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003,
3674 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a,
3675 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002,
3676 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x800e0001, 0x80550000,
3677 0xa090000b, 0x04000004, 0x800e0001, 0x80000000, 0xa090000a, 0x80e40001, 0x03000002, 0x80070003,
3678 0x80e40000, 0x80f90001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000,
3679 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000,
3680 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000, 0x04000004,
3681 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000,
3682 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001, 0x0000002b, 0x01000028, 0xe0e40805, 0x04000004,
3683 0x800f0000, 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004,
3684 0x800f0000, 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000,
3685 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3686 0x80e40002, 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004,
3687 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002,
3688 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000,
3689 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3690 0xa000000f, 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004,
3691 0x80e40002, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010,
3692 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002,
3693 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002,
3694 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001,
3695 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003,
3696 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x80070001,
3697 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000, 0xa0e4000a, 0x80e40001, 0x03000002,
3698 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008,
3699 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005,
3700 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000,
3701 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000,
3702 0x80e40000, 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0000,
3703 0x80e40000, 0x80e40003, 0x03000042, 0x800f0001, 0x90e40000, 0xa0e40801, 0x03000002, 0x800f0800,
3704 0x80e40000, 0x80e40001, 0x0000ffff, 0x00000007, 0x00000b6c, 0xfffe0300, 0x013cfffe, 0x42415443,
3705 0x0000001c, 0x000004bb, 0xfffe0300, 0x0000000c, 0x0000001c, 0x00000000, 0x000004b4, 0x0000010c,
3706 0x00200002, 0x00000001, 0x00000114, 0x00000124, 0x00000134, 0x001d0002, 0x00000002, 0x0000013c,
3707 0x0000014c, 0x0000016c, 0x001f0002, 0x00000001, 0x00000174, 0x00000184, 0x00000194, 0x00100002,
3708 0x00000004, 0x000001a0, 0x000001b0, 0x000001f0, 0x00140002, 0x00000003, 0x000001f8, 0x00000208,
3709 0x00000238, 0x00170002, 0x00000003, 0x00000244, 0x00000254, 0x00000284, 0x000c0002, 0x00000004,
3710 0x0000028c, 0x0000029c, 0x000002dc, 0x00020003, 0x00000001, 0x000002e8, 0x00000000, 0x000002f8,
3711 0x00000003, 0x00000002, 0x00000308, 0x00000000, 0x00000318, 0x001a0002, 0x00000003, 0x00000370,
3712 0x00000380, 0x000003b0, 0x00000002, 0x00000006, 0x000003b4, 0x000003c4, 0x00000424, 0x00060002,
3713 0x00000006, 0x00000444, 0x00000454, 0x31727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001,
3714 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, 0x32727261, 0xababab00, 0x00030000,
3715 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, 0x00000000, 0x00000000, 0x42ba0000,
3716 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3717 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63, 0xab006e6d,
3718 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x00000000,
3719 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000, 0x00000000,
3720 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002, 0x00040003,
3721 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3722 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d, 0x756c6f63,
3723 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3724 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000,
3725 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000, 0x41300000,
3726 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, 0x41f80000,
3727 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000, 0x706d6173,
3728 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c,
3729 0x7272615f, 0xab007961, 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x00317374, 0xab003176,
3730 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3731 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0000031c, 0x00000320,
3732 0x00000330, 0x00000334, 0x00000344, 0x00000348, 0x00000005, 0x00080001, 0x00030001, 0x00000358,
3733 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000,
3734 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005, 0x00080001, 0x00030002,
3735 0x00000358, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3736 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000,
3737 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3738 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001, 0x00030002, 0x00000358, 0x00000428,
3739 0x0000042c, 0x00000005, 0x00100001, 0x00010001, 0x0000043c, 0x3f800000, 0x40000000, 0x40400000,
3740 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3741 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000,
3742 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x335f7376, 0x4d00305f, 0x6f726369,
3743 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3744 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250, 0x46580201, 0x0047fffe, 0x42415443,
3745 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c, 0x00000100, 0x000000e4, 0x00000058,
3746 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088,
3747 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173,
3748 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3749 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c,
3750 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3751 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800,
3752 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3753 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250,
3754 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000021,
3755 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018, 0x00000000, 0x00000000,
3756 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3757 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3758 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3759 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3fe00000,
3760 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000, 0x00000000, 0x40100000,
3761 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000, 0x0064fffe, 0x434c5846,
3762 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011, 0x00000000, 0x00000002,
3763 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3764 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000004, 0xa0500004,
3765 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002, 0x0000000c, 0x00000000,
3766 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3767 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004, 0x00000001, 0x00000000,
3768 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000,
3769 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x0000000c,
3770 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000002, 0x00000005,
3771 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3772 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004, 0x20400004, 0x00000002,
3773 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004,
3774 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f0022, 0x00000000, 0x00000000,
3775 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0801,
3776 0x0200001f, 0x90000000, 0xa00f0802, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005,
3777 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017,
3778 0x03000009, 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019,
3779 0x03000008, 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011,
3780 0x03000008, 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013,
3781 0x02000001, 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005,
3782 0x800f0001, 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001,
3783 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000,
3784 0x80e40001, 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000,
3785 0xa0e4000c, 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004,
3786 0x80070001, 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001,
3787 0x04000004, 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000,
3788 0xa0e4001c, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000,
3789 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000,
3790 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004,
3791 0x800f0000, 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a,
3792 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000,
3793 0x80000001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40802, 0x03000002, 0x800f0000, 0x80e40000,
3794 0x80e40001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40801, 0x03000002, 0xe00f0002, 0x80e40000,
3795 0x80e40001, 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff,
3796 0x00000008, 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300,
3797 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73,
3798 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3799 0x332e3235, 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c,
3800 0x0000005b, 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3801 0x00000001, 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3802 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3803 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3804 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3805 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe,
3806 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000,
3807 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3808 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000,
3809 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001,
3810 0xe00f0000, 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001,
3811 0x0000ffff, 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101,
3812 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000,
3813 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000,
3814 0x40000000, 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003,
3815 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000,
3816 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
3817 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443,
3818 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
3819 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
3820 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
3821 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3822 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3823 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3824 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029,
3825 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200,
3826 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4,
3827 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3828 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3829 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064,
3830 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001,
3831 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3832 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3833 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3834 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3835 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3836 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3837 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3838 0x00000000, 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe,
3839 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114,
3840 0x00000030, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031,
3841 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3842 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c,
3843 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074,
3844 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000,
3845 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3846 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3847 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369,
3848 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3849 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3850 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3851 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027,
3852 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200,
3853 0x00000001, 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088,
3854 0x00000098, 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3855 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3856 0x00000000, 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005,
3857 0x00080001, 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3858 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3859 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3860 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3861 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3862 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001,
3863 0x00000000, 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3864 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200,
3865 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3866 0x000000f8, 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176,
3867 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3868 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038,
3869 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070,
3870 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3871 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000,
3872 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000,
3873 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3874 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3875 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004,
3876 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3877 0xffffffff, 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c,
3878 0x000001fb, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002,
3879 0x00000001, 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac,
3880 0x000000ec, 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001,
3881 0x000001d8, 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
3882 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004,
3883 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000,
3884 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000,
3885 0x42080000, 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001,
3886 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001,
3887 0x00040001, 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c,
3888 0x00000120, 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005,
3889 0x00100001, 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3890 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000,
3891 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000,
3892 0x41600000, 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001,
3893 0x00000000, 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3894 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3895 0x332e3235, 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000,
3896 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3897 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3898 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3899 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3900 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3901 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3902 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3903 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3904 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3905 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3906 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3907 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3908 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3909 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3910 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3911 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000,
3912 0x3ff00000, 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e,
3913 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e,
3914 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000,
3915 0x00000002, 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000,
3916 0x00000007, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001,
3917 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004,
3918 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3919 0x0000003c, 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3920 0x0000002f, 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004,
3921 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001,
3922 0x00000030, 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3923 0x0000001c, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007,
3924 0x00000009, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007,
3925 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002,
3926 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3927 0x00000000, 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3928 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002,
3929 0x00000000, 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030,
3930 0x00000000, 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041,
3931 0x00000000, 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002,
3932 0x0000002f, 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031,
3933 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003,
3934 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040,
3935 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000,
3936 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3937 0x00000000, 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe,
3938 0x42415443, 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130,
3939 0x0000006c, 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001,
3940 0x000000c0, 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108,
3941 0x00090002, 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3942 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3943 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67,
3944 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000,
3945 0x3f800000, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3946 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3947 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3948 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3949 0x332e3235, 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
3950 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3951 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3952 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3953 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3954 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3955 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3956 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3957 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3958 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3959 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3960 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3961 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3962 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3963 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3964 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008,
3965 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a,
3966 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000,
3967 0x00000002, 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000,
3968 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000,
3969 0x00000002, 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000,
3970 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
3971 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028,
3972 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001,
3973 0xa0400001, 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001,
3974 0x00000002, 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001,
3975 0x00000002, 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002,
3976 0x0000002b, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
3977 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200,
3978 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3979 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3980 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3981 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3982 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3983 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3984 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
3985 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3986 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3987 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0061fffe,
3988 0x434c5846, 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3989 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000,
3990 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001,
3991 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
3992 0x00000000, 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002,
3993 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3994 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
3995 0x00000004, 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3996 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3997 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002,
3998 0x00000005, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
3999 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
4000 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248,
4001 0x46580200, 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c,
4002 0x20000100, 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
4003 0x00010002, 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0,
4004 0x00000070, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4005 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
4006 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001,
4007 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4008 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4009 0x0022fffe, 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4010 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4011 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4012 0x00000000, 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000,
4013 0x00000000, 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002,
4014 0x00000000, 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
4015 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002,
4016 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002,
4017 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
4018 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4019 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0,
4020 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4021 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4022 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4023 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4024 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4025 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4026 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c,
4027 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4028 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4029 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4030 0x002afffe, 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4031 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002,
4032 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4033 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4034 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4035 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f,
4036 0x00000000, 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4037 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4038 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4039 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4040 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4041 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4042 0x00000000, 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000,
4043 0x00000000, 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001,
4044 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001,
4045 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001,
4046 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001,
4047 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002,
4048 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
4049 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e,
4050 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4051 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4052 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4053 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4054 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4055 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001,
4056 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4057 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200,
4058 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4059 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4060 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4061 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4062 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4063 0x000cfffe, 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4064 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4065 0xffffffff, 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
4066 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
4067 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
4068 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
4069 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4070 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4071 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4072 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004,
4073 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4074 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4075 0x0000001b, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
4076 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
4077 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
4078 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
4079 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
4080 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4081 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4082 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002,
4083 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4084 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a,
4085 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4086 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4087 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4088 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4089 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4090 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001,
4091 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4092 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200,
4093 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4094 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4095 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4096 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4097 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4098 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4099 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4100 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002,
4101 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003,
4102 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4103 0xffffffff, 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
4104 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
4105 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4106 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
4107 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
4108 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
4109 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
4110 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000,
4111 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
4112 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
4113 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
4114 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
4115 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
4116 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4117 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4118 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002,
4119 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4120 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124,
4121 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4122 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4123 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4124 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4125 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4126 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4127 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4128 0x000ffffe, 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4129 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4130 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200,
4131 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
4132 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
4133 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4134 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
4135 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
4136 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4137 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4138 0x434c5846, 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4139 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4140 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
4141 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
4142 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4143 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4144 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4145 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
4146 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4147 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4148 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
4149 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4150 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4151 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4152 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4153 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
4154 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4155 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4156 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4157 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4158 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4159 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4160 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012,
4161 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4162 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4163 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4164 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4165 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4166 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001,
4167 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001,
4168 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001,
4169 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001,
4170 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4171 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008,
4172 0x615f7370, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4173 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4174 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
4175 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4176 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4177 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4178 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000,
4179 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002,
4180 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004,
4181 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
4182 0x00000002, 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443,
4183 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
4184 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4185 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4186 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4187 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000,
4188 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000,
4189 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846,
4190 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001,
4191 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4192 0x0000001f, 0x00000001, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443,
4193 0x0000001c, 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030,
4194 0x00000002, 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00,
4195 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000,
4196 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4197 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4198 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4199 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001f,
4200 0x00000000, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c,
4201 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002,
4202 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001,
4203 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874,
4204 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4205 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4206 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4207 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000,
4208 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c, 0x00000063,
4209 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002, 0x00000001,
4210 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001, 0x00040001,
4211 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874, 0x6f726369,
4212 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4213 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4214 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
4215 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4216 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443,
4217 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4218 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4219 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4220 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4221 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
4222 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4223 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000, 0x00000000,
4224 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4226 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2991
4227 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4229 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4230 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4231 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4232 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4234 unsigned int i = 0;
4236 todo_wine_if(todo)
4237 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4239 if (!bytecode)
4240 return;
4242 while (bytecode[i++] != 0x0000ffff)
4245 if (!bytecode_size)
4246 bytecode_size = i * sizeof(*bytecode);
4247 else
4248 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4250 todo_wine_if(todo)
4251 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4252 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4253 "Incorrect shader selected.\n");
4256 #define test_effect_preshader_compare_shader(a, b, c) \
4257 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4258 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4259 int expected_shader_index, BOOL todo)
4261 IDirect3DVertexShader9 *vshader;
4262 void *byte_code;
4263 unsigned int byte_code_size;
4264 HRESULT hr;
4266 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4267 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#x.\n", hr);
4269 todo_wine_if(todo)
4270 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4271 if (!vshader)
4272 return;
4274 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4275 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#x.\n", hr);
4276 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4278 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
4279 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4280 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4282 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4283 byte_code_size, expected_shader_index, todo);
4285 HeapFree(GetProcessHeap(), 0, byte_code);
4286 IDirect3DVertexShader9_Release(vshader);
4289 static const struct
4291 const char *comment;
4292 BOOL todo[4];
4293 unsigned int result[4];
4294 unsigned int ulps;
4296 test_effect_preshader_op_expected[] =
4298 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4299 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4300 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4301 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4302 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4303 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4304 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4305 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4307 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4308 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4309 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4310 #if __x86_64__
4311 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4312 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4313 #else
4314 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4315 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4316 #endif
4317 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4318 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4319 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4321 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4322 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4323 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4326 enum expected_state_update
4328 EXPECTED_STATE_ZERO,
4329 EXPECTED_STATE_UPDATED,
4330 EXPECTED_STATE_ANYTHING
4333 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4334 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4335 const enum expected_state_update *expected_state, const char *updated_param)
4337 static const D3DCOLORVALUE black = {0.0f};
4338 unsigned int i, j;
4339 D3DLIGHT9 light;
4340 const float *v;
4341 HRESULT hr;
4343 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4345 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4346 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4348 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4349 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4351 for (j = 0; j < 4; ++j)
4353 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4354 ok_(__FILE__, line)(compare_float(v[j],
4355 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4356 test_effect_preshader_op_expected[i].ulps),
4357 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4358 test_effect_preshader_op_expected[i].comment, j,
4359 test_effect_preshader_op_expected[i].result[j],
4360 ((const unsigned int *)v)[j], v[j]);
4363 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4365 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4366 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4367 updated_param, i, test_effect_preshader_op_expected[i].comment);
4372 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
4374 static void test_effect_preshader_clear_vconsts(IDirect3DDevice9 *device)
4376 unsigned int i;
4377 HRESULT hr;
4379 for (i = 0; i < 256; ++i)
4381 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
4382 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4386 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4388 {0.0f, 0.0f, 0.0f, 0.0f},
4389 {0.0f, 0.0f, 0.0f, 0.0f},
4390 {0.0f, 0.0f, 0.0f, 0.0f},
4391 {1.0f, 2.0f, 3.0f, 0.0f},
4392 {4.0f, 0.0f, 0.0f, 0.0f},
4393 {5.0f, 6.0f, 7.0f, 8.0f},
4394 {1.0f, 2.0f, 3.0f, 0.0f},
4395 {4.0f, 0.0f, 0.0f, 0.0f},
4396 {5.0f, 6.0f, 7.0f, 8.0f},
4397 {9.0f, 10.0f, 11.0f, 0.0f},
4398 {12.0f, 0.0f, 0.0f, 0.0f},
4399 {13.0f, 14.0f, 15.0f, 16.0f},
4400 {11.0f, 12.0f, 13.0f, 0.0f},
4401 {21.0f, 22.0f, 23.0f, 0.0f},
4402 {31.0f, 32.0f, 33.0f, 0.0f},
4403 {41.0f, 42.0f, 43.0f, 0.0f},
4404 {11.0f, 21.0f, 31.0f, 0.0f},
4405 {12.0f, 22.0f, 32.0f, 0.0f},
4406 {13.0f, 23.0f, 33.0f, 0.0f},
4407 {14.0f, 24.0f, 34.0f, 0.0f},
4408 {11.0f, 12.0f, 13.0f, 14.0f},
4409 {21.0f, 22.0f, 23.0f, 24.0f},
4410 {31.0f, 32.0f, 33.0f, 34.0f},
4411 {11.0f, 21.0f, 31.0f, 41.0f},
4412 {12.0f, 22.0f, 32.0f, 42.0f},
4413 {13.0f, 23.0f, 33.0f, 43.0f},
4414 {9.0f, 10.0f, 11.0f, 0.0f},
4415 {12.0f, 0.0f, 0.0f, 0.0f},
4416 {13.0f, 14.0f, 15.0f, 16.0f},
4417 {92.0f, 0.0f, 0.0f, 0.0f},
4418 {93.0f, 0.0f, 0.0f, 0.0f},
4419 {0.0f, 0.0f, 0.0f, 0.0f},
4420 {91.0f, 0.0f, 0.0f, 0.0f},
4421 {4.0f, 5.0f, 6.0f, 7.0f},
4423 #define TEST_EFFECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4425 #define test_effect_preshader_compare_vconsts(a, b, c) \
4426 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4427 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4428 const unsigned int *const_updated_mask, const char *updated_param)
4430 HRESULT hr;
4431 unsigned int i;
4432 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4434 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4435 ARRAY_SIZE(test_effect_preshader_fvect_v));
4436 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4438 if (!const_updated_mask)
4440 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4441 "Vertex shader float constants do not match.\n");
4443 else
4445 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4447 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4448 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4450 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4451 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), "
4452 "got (%g, %g, %g, %g), parameter %s.\n",
4453 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4454 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4455 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4457 else
4459 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4460 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4465 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4467 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4468 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4469 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4470 "Vertex shader float constants do not match.\n");
4474 static const BOOL test_effect_preshader_bconsts[] =
4476 TRUE, FALSE, TRUE, FALSE, TRUE, TRUE
4479 static void test_effect_preshader_clear_pbool_consts(IDirect3DDevice9 *device)
4481 BOOL bval;
4482 unsigned int i;
4483 HRESULT hr;
4485 for (i = 0; i < 16; ++i)
4487 bval = i < ARRAY_SIZE(test_effect_preshader_bconsts) ? !test_effect_preshader_bconsts[i] : FALSE;
4488 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4489 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4493 #define test_effect_preshader_compare_pbool_consts(a, b, c) \
4494 test_effect_preshader_compare_pbool_consts_(__LINE__, a, b, c)
4495 static void test_effect_preshader_compare_pbool_consts_(unsigned int line, IDirect3DDevice9 *device,
4496 const unsigned int *const_updated_mask, const char *updated_param)
4498 unsigned int i;
4499 BOOL bdata[16];
4500 HRESULT hr;
4502 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, ARRAY_SIZE(bdata));
4503 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4505 if (!const_updated_mask)
4507 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4509 /* The negation on both sides is actually needed, sometimes you
4510 * get 0xffffffff instead of 1 on native. */
4511 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4512 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u.\n",
4513 test_effect_preshader_bconsts[i], bdata[i], i);
4516 else
4518 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4520 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4521 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4523 /* The negation on both sides is actually needed, sometimes
4524 * you get 0xffffffff instead of 1 on native. */
4525 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4526 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u, parameter %s.\n",
4527 test_effect_preshader_bconsts[i], bdata[i], i, updated_param);
4529 else
4531 ok_(__FILE__, line)(bdata[i] == !test_effect_preshader_bconsts[i],
4532 "Pixel shader boolean constants updated unexpectedly, parameter %s.\n", updated_param);
4537 for (; i < 16; ++i)
4539 ok_(__FILE__, line)(!bdata[i], "Got result %#x, boolean register value %u.\n", hr, bdata[i]);
4543 static void test_effect_preshader(IDirect3DDevice9 *device)
4545 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4547 {11.0f, 21.0f, 0.0f, 0.0f},
4548 {12.0f, 22.0f, 0.0f, 0.0f},
4549 {13.0f, 23.0f, 0.0f, 0.0f},
4550 {11.0f, 12.0f, 0.0f, 0.0f},
4551 {21.0f, 22.0f, 0.0f, 0.0f},
4552 {31.0f, 32.0f, 0.0f, 0.0f},
4553 {11.0f, 12.0f, 0.0f, 0.0f},
4554 {21.0f, 22.0f, 0.0f, 0.0f},
4555 {11.0f, 21.0f, 0.0f, 0.0f},
4556 {12.0f, 22.0f, 0.0f, 0.0f},
4557 {11.0f, 12.0f, 13.0f, 0.0f},
4558 {21.0f, 22.0f, 23.0f, 0.0f},
4559 {11.0f, 21.0f, 31.0f, 0.0f},
4560 {12.0f, 22.0f, 32.0f, 0.0f}
4562 static const int test_effect_preshader_iconsts[][4] =
4564 {4, 3, 2, 1}
4566 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4567 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4568 static const int ivect_empty[4] = {-1, -1, -1, -1};
4569 HRESULT hr;
4570 ID3DXEffect *effect;
4571 D3DXHANDLE par;
4572 unsigned int npasses;
4573 DWORD value;
4574 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4575 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4576 IDirect3DVertexShader9 *vshader;
4577 unsigned int i;
4578 D3DCAPS9 caps;
4580 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4581 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
4582 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4583 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4585 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4586 return;
4589 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4590 NULL, NULL, 0, NULL, &effect, NULL);
4591 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4593 test_effect_preshader_clear_vconsts(device);
4595 for (i = 0; i < 224; ++i)
4597 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4598 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4601 test_effect_preshader_clear_pbool_consts(device);
4603 for (i = 0; i < 16; ++i)
4605 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4606 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4609 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4612 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4613 ok(par != NULL, "GetParameterByName failed.\n");
4615 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4616 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4618 hr = effect->lpVtbl->BeginPass(effect, 0);
4619 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4621 hr = effect->lpVtbl->BeginPass(effect, 0);
4622 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4624 hr = effect->lpVtbl->BeginPass(effect, 1);
4625 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4627 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4629 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4630 ARRAY_SIZE(test_effect_preshader_fvect_p));
4631 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4632 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4633 "Pixel shader float constants do not match.\n");
4634 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4636 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4637 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4638 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4639 "Pixel shader float constants do not match.\n");
4641 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4642 ARRAY_SIZE(test_effect_preshader_iconsts));
4643 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4644 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4645 "Pixel shader integer constants do not match.\n");
4646 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4648 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4649 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4650 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4651 "Pixel shader integer constants do not match.\n");
4654 test_effect_preshader_compare_pbool_consts(device, NULL, NULL);
4656 test_effect_preshader_op_results(device, NULL, NULL);
4658 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4659 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4660 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4661 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4662 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4663 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4665 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4666 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4667 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4668 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4669 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4670 todo_wine
4671 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4673 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4674 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4675 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4676 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4677 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4678 todo_wine
4679 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4681 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4682 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4683 todo_wine
4684 ok(value == 0, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4685 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4686 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4687 todo_wine
4688 ok(value == 0, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4690 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4691 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4692 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4693 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4694 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4695 todo_wine ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4697 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4698 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4699 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4700 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4701 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4702 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4703 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4704 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4705 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4706 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4707 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4708 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4710 hr = effect->lpVtbl->EndPass(effect);
4712 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4713 ok(par != NULL, "GetParameterByName failed.\n");
4714 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4715 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4716 hr = effect->lpVtbl->BeginPass(effect, 1);
4717 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4719 test_effect_preshader_compare_shader(device, 1, FALSE);
4721 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4722 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4724 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4725 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4726 hr = effect->lpVtbl->CommitChanges(effect);
4727 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4728 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4729 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4730 ok(!vshader, "Incorrect shader selected.\n");
4732 hr = effect->lpVtbl->EndPass(effect);
4733 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4735 hr = effect->lpVtbl->End(effect);
4736 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4738 effect->lpVtbl->Release(effect);
4740 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4741 NULL, NULL, 0, NULL, &effect, NULL);
4742 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4744 hr = effect->lpVtbl->Begin(effect, &npasses, D3DXFX_DONOTSAVESTATE);
4745 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4747 hr = effect->lpVtbl->BeginPass(effect, 0);
4748 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4750 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4751 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4752 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4753 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4754 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4755 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4757 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4758 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4759 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4760 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4761 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4762 todo_wine
4763 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4765 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4766 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4767 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4768 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4769 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4770 todo_wine
4771 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4773 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4774 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4775 ok(value == 2, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4776 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4777 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4778 todo_wine
4779 ok(value == 2, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4781 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4782 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4783 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4784 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4785 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4786 todo_wine
4787 ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4789 hr = effect->lpVtbl->EndPass(effect);
4790 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4791 hr = effect->lpVtbl->End(effect);
4792 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4793 effect->lpVtbl->Release(effect);
4797 * fxc.exe /Tfx_2_0
4799 #if 0
4800 float4 opvect1;
4801 float4 opvect2;
4802 float4 opvect3;
4804 technique tech0
4806 pass p0
4808 LightEnable[0] = TRUE;
4809 LightEnable[1] = TRUE;
4810 LightEnable[2] = TRUE;
4811 LightEnable[3] = TRUE;
4812 LightEnable[4] = TRUE;
4813 LightEnable[5] = TRUE;
4814 LightEnable[6] = TRUE;
4815 LightEnable[7] = TRUE;
4816 LightType[0] = POINT;
4817 LightType[1] = POINT;
4818 LightType[2] = POINT;
4819 LightType[3] = POINT;
4820 LightType[4] = POINT;
4821 LightType[5] = POINT;
4822 LightType[6] = POINT;
4823 LightType[7] = POINT;
4825 LightDiffuse[0] = exp(opvect1);
4826 LightDiffuse[1] = log(opvect1);
4827 LightDiffuse[2] = asin(opvect1);
4828 LightDiffuse[3] = acos(opvect1);
4829 LightDiffuse[4] = atan(opvect1);
4830 LightDiffuse[5] = atan2(opvect1, opvect2);
4831 LightDiffuse[6] = opvect1 * opvect2;
4833 /* Placeholder for 'div' instruction manually edited in binary blob. */
4834 LightDiffuse[7] = opvect1 * opvect2;
4836 /* Placeholder for 'cmp' instruction manually edited in binary blob. */
4837 LightAmbient[0] = opvect1 + opvect2 + opvect3;
4840 #endif
4841 static const DWORD test_effect_preshader_ops_blob[] =
4843 0xfeff0901, 0x0000044c, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
4844 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f,
4845 0x00317463, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4846 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003,
4847 0x00000001, 0x000000a0, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4848 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00337463, 0x00000001, 0x00000002, 0x00000002,
4849 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4850 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4851 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4852 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4853 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4854 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4855 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4856 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4857 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4858 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4859 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4860 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4861 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4862 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4863 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4864 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4865 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4866 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
4867 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
4868 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4869 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
4870 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
4871 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4872 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
4873 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4874 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
4875 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4876 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4877 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000001,
4878 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000,
4879 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000001,
4880 0x00000438, 0x00000000, 0x00000019, 0x00000091, 0x00000000, 0x000000b0, 0x000000ac, 0x00000091,
4881 0x00000001, 0x000000d0, 0x000000cc, 0x00000091, 0x00000002, 0x000000f0, 0x000000ec, 0x00000091,
4882 0x00000003, 0x00000110, 0x0000010c, 0x00000091, 0x00000004, 0x00000130, 0x0000012c, 0x00000091,
4883 0x00000005, 0x00000150, 0x0000014c, 0x00000091, 0x00000006, 0x00000170, 0x0000016c, 0x00000091,
4884 0x00000007, 0x00000190, 0x0000018c, 0x00000084, 0x00000000, 0x000001b0, 0x000001ac, 0x00000084,
4885 0x00000001, 0x000001d0, 0x000001cc, 0x00000084, 0x00000002, 0x000001f0, 0x000001ec, 0x00000084,
4886 0x00000003, 0x00000210, 0x0000020c, 0x00000084, 0x00000004, 0x00000230, 0x0000022c, 0x00000084,
4887 0x00000005, 0x00000250, 0x0000024c, 0x00000084, 0x00000006, 0x00000270, 0x0000026c, 0x00000084,
4888 0x00000007, 0x00000290, 0x0000028c, 0x00000085, 0x00000000, 0x000002bc, 0x000002ac, 0x00000085,
4889 0x00000001, 0x000002e8, 0x000002d8, 0x00000085, 0x00000002, 0x00000314, 0x00000304, 0x00000085,
4890 0x00000003, 0x00000340, 0x00000330, 0x00000085, 0x00000004, 0x0000036c, 0x0000035c, 0x00000085,
4891 0x00000005, 0x00000398, 0x00000388, 0x00000085, 0x00000006, 0x000003c4, 0x000003b4, 0x00000085,
4892 0x00000007, 0x000003f0, 0x000003e0, 0x00000087, 0x00000000, 0x0000041c, 0x0000040c, 0x00000000,
4893 0x00000009, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, 0x00000000, 0x0000016c, 0x46580200,
4894 0x003afffe, 0x42415443, 0x0000001c, 0x000000b3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
4895 0x000000b0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
4896 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00020002, 0x00000001, 0x000000a0, 0x00000070,
4897 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4898 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4899 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
4900 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4901 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4902 /* FXLC for LightAmbient[0] start. */
4903 0x001afffe, 0x434c5846,
4904 0x00000001, /* Instruction count, set to 1. */
4905 0x30000004, /* Operation code (bits 20-30) set to 'cmp' opcode 0x300. */
4906 0x00000003, /* Input arguments count set to 3. */
4907 /* Argument 1. */
4908 0x00000000, /* Relative addressing flag. */
4909 0x00000002, /* Register table ("c", float constants). */
4910 0x00000000, /* Register offset. */
4911 /* Argument 2. */
4912 0x00000000, 0x00000002, 0x00000004,
4913 /* Argument 3. */
4914 0x00000000, 0x00000002, 0x00000008,
4915 /* Output register. */
4916 0x00000000, 0x00000004, 0x00000000,
4917 /* End mark. */
4918 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4919 /* Padding to match placeholder length. */
4920 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4921 /* FXLC for LightAmbient[0] end. */
4922 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000114,
4923 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c,
4924 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4925 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4926 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463,
4927 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4928 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4929 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4930 /* FXLC for LightDiffuse[7] start. */
4931 0x000ffffe, 0x434c5846,
4932 0x00000001, /* Instruction count. */
4933 0x20800004, /* Operation code (bits 20-30) set to 'div' opcode 0x208. */
4934 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4935 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4936 /* FXLC for LightDiffuse[7] end. */
4937 0x00000000, 0x00000000, 0xffffffff,
4938 0x00000016, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087,
4939 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001,
4940 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f,
4941 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4942 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
4943 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4944 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4945 0x434c5846, 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4946 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4947 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe,
4948 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084,
4949 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4950 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4951 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4952 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4953 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4954 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20600004, 0x00000002, 0x00000000,
4955 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4956 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000,
4957 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
4958 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
4959 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4960 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4961 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4962 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10c00004, 0x00000001, 0x00000000,
4963 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4964 0x00000000, 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4965 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4966 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
4967 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
4968 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4969 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4970 0x434c5846, 0x00000001, 0x10b00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4971 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4972 0x00000012, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
4973 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
4974 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4975 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4976 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4977 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10a00004,
4978 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4979 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000011, 0x00000000, 0x0000013c,
4980 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
4981 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
4982 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4983 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4984 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4985 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4986 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4987 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4988 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4989 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4990 0x00000000, 0xffffffff, 0x00000010, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4991 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4992 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4993 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
4994 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4995 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4996 0x00000004, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4997 0x00000000, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4998 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4999 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
5000 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
5003 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
5005 static D3DLIGHT9 light;
5006 const struct
5008 const char *mnem;
5009 unsigned int expected_result[4];
5010 unsigned int result_index;
5011 float *result;
5012 D3DXVECTOR4 opvect1, opvect2, opvect3;
5013 unsigned int ulps;
5014 BOOL todo[4];
5016 op_tests[] =
5018 {"exp", {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000}, 0, &light.Diffuse.r,
5019 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5020 {"log", {0, 0x40000000, 0x3f9199b7, 0x43000000}, 1, &light.Diffuse.r,
5021 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5022 {"asin", {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000}, 2, &light.Diffuse.r,
5023 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5024 {"acos", {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000}, 3, &light.Diffuse.r,
5025 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5026 {"atan", {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb}, 4, &light.Diffuse.r,
5027 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5028 {"atan2 test #1", {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000}, 5, &light.Diffuse.r,
5029 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
5030 {"atan2 test #2", {0xbfc90fdb, 0, 0xc0490fdb, 0}, 5, &light.Diffuse.r,
5031 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
5032 {"div", {0, 0, 0, 0}, 7, &light.Diffuse.r,
5033 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
5034 {"cmp", {0x40a00000, 0x40000000, 0x40400000, 0x41000000}, 0, &light.Ambient.r,
5035 {-0.3f, 0.0f, 2.2f, NAN}, {1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 6.0f, 7.0f, 8.0f}},
5036 {"0 * INF", {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000}, 6, &light.Diffuse.r,
5037 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
5039 unsigned int i, j, passes_count;
5040 ID3DXEffect *effect;
5041 HRESULT hr;
5043 hr = D3DXCreateEffect(device, test_effect_preshader_ops_blob, sizeof(test_effect_preshader_ops_blob),
5044 NULL, NULL, 0, NULL, &effect, NULL);
5045 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5046 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5047 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5048 hr = effect->lpVtbl->BeginPass(effect, 0);
5049 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5051 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
5053 const float *result = op_tests[i].result;
5054 const float *expected_float = (float *)op_tests[i].expected_result;
5056 hr = effect->lpVtbl->SetVector(effect, "opvect1", &op_tests[i].opvect1);
5057 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5058 hr = effect->lpVtbl->SetVector(effect, "opvect2", &op_tests[i].opvect2);
5059 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5060 hr = effect->lpVtbl->SetVector(effect, "opvect3", &op_tests[i].opvect3);
5061 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5062 hr = effect->lpVtbl->CommitChanges(effect);
5063 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5065 hr = IDirect3DDevice9_GetLight(device, op_tests[i].result_index, &light);
5066 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5067 for (j = 0; j < 4; ++j)
5069 todo_wine_if(op_tests[i].todo[j])
5070 ok(compare_float(result[j], expected_float[j], op_tests[i].ulps),
5071 "Operation %s, component %u, expected %#x (%.8e), got %#x (%.8e).\n", op_tests[i].mnem,
5072 j, op_tests[i].expected_result[j], expected_float[j],
5073 ((unsigned int *)result)[j], result[j]);
5077 hr = effect->lpVtbl->End(effect);
5078 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5079 effect->lpVtbl->Release(effect);
5082 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
5083 D3DXHANDLE tech, D3DXHANDLE param)
5085 D3DXPARAMETER_DESC desc;
5086 D3DXHANDLE param_child;
5087 unsigned int i, child_count;
5088 HRESULT hr;
5090 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
5091 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#x.\n", hr);
5092 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
5093 for (i = 0; i < child_count; ++i)
5095 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
5096 : effect->lpVtbl->GetParameter(effect, param, i);
5097 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
5098 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
5099 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
5100 test_isparameterused_children(line, effect, tech, param_child);
5104 #define test_isparameterused_param_with_children(args...) \
5105 test_isparameterused_param_with_children_(__LINE__, args)
5106 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
5107 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
5109 D3DXHANDLE param;
5111 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
5112 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
5114 if (effect2)
5115 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
5116 else
5117 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
5118 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
5120 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
5121 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
5123 test_isparameterused_children(line, effect, tech, param);
5126 static void test_effect_isparameterused(IDirect3DDevice9 *device)
5128 static const struct
5130 const char *name;
5131 BOOL expected_result;
5133 check_parameters[] =
5135 {"g_Pos1", TRUE},
5136 {"g_Pos2", TRUE},
5137 {"g_Selector", TRUE},
5138 {"opvect1", TRUE},
5139 {"opvect2", TRUE},
5140 {"opvect3", TRUE},
5141 {"arr2", TRUE},
5142 {"vs_arr", TRUE},
5143 {"g_iVect", TRUE},
5144 {"vect_sampler", TRUE},
5145 {"tex1", TRUE},
5146 {"tex2", FALSE},
5147 {"sampler1", TRUE},
5148 {"ts1", TRUE},
5149 {"ts2", TRUE},
5150 {"ts3", TRUE},
5152 ID3DXEffect *effect, *effect2;
5153 HRESULT hr;
5154 D3DXHANDLE tech;
5155 unsigned int i;
5157 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5158 NULL, NULL, 0, NULL, &effect, NULL);
5159 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5161 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
5162 ok(!!tech, "GetTechniqueByName failed.\n");
5164 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5165 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
5166 check_parameters[i].expected_result);
5168 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5169 NULL, NULL, 0, NULL, &effect2, NULL);
5170 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5172 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5173 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
5174 check_parameters[i].expected_result);
5176 effect2->lpVtbl->Release(effect2);
5178 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
5179 NULL, NULL, 0, NULL, &effect2, NULL);
5180 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5182 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
5183 effect2->lpVtbl->Release(effect2);
5185 effect->lpVtbl->Release(effect);
5188 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
5190 ID3DXEffect *effect;
5191 HRESULT hr;
5192 D3DXHANDLE param;
5193 int ivect[4];
5194 unsigned int passes_count;
5195 IDirect3DVertexShader9 *vshader;
5197 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5198 NULL, NULL, 0, NULL, &effect, NULL);
5200 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5201 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5203 ivect[0] = ivect[1] = ivect[3] = 1;
5205 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5206 ok(!!param, "GetParameterByName failed.\n");
5207 ivect[2] = 3;
5208 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5209 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5211 hr = effect->lpVtbl->BeginPass(effect, 0);
5212 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5213 hr = effect->lpVtbl->EndPass(effect);
5214 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5216 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5217 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5219 hr = effect->lpVtbl->BeginPass(effect, 1);
5220 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5222 /* Second try reports success and selects array element used previously.
5223 * Probably array index is not recomputed and previous index value is used. */
5224 hr = effect->lpVtbl->BeginPass(effect, 1);
5225 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5226 test_effect_preshader_compare_shader(device, 2, FALSE);
5228 /* Confirm that array element selected is the previous good one and does not depend
5229 * on computed (out of bound) index value. */
5230 ivect[2] = 1;
5231 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5232 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5233 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5234 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5235 hr = effect->lpVtbl->CommitChanges(effect);
5236 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5237 test_effect_preshader_compare_shader(device, 1, FALSE);
5238 hr = effect->lpVtbl->EndPass(effect);
5239 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5240 ivect[2] = 3;
5241 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5242 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5243 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5244 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5245 hr = effect->lpVtbl->BeginPass(effect, 1);
5246 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5247 hr = effect->lpVtbl->BeginPass(effect, 1);
5248 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5249 test_effect_preshader_compare_shader(device, 1, FALSE);
5251 /* End and begin effect again to ensure it will not trigger array
5252 * index recompute and error return from BeginPass. */
5253 hr = effect->lpVtbl->EndPass(effect);
5254 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5255 hr = effect->lpVtbl->End(effect);
5256 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5257 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5258 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5259 hr = effect->lpVtbl->BeginPass(effect, 1);
5260 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5261 test_effect_preshader_compare_shader(device, 1, FALSE);
5262 hr = effect->lpVtbl->EndPass(effect);
5263 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5266 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5267 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5269 ivect[2] = -2;
5270 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5271 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5273 hr = effect->lpVtbl->BeginPass(effect, 1);
5274 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5276 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5277 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5278 ok(!vshader, "Got non NULL vshader.\n");
5280 hr = effect->lpVtbl->BeginPass(effect, 1);
5281 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5283 test_effect_preshader_compare_shader(device, 1, FALSE);
5285 hr = effect->lpVtbl->EndPass(effect);
5286 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5288 ivect[2] = -1;
5289 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5290 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5292 hr = effect->lpVtbl->BeginPass(effect, 1);
5293 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5295 test_effect_preshader_compare_shader(device, 0, FALSE);
5297 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5298 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5300 ivect[2] = 3;
5301 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5302 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5303 hr = effect->lpVtbl->CommitChanges(effect);
5304 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5306 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5307 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5308 ok(!vshader, "Got non NULL vshader.\n");
5310 ivect[2] = -1;
5311 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5312 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5313 hr = effect->lpVtbl->CommitChanges(effect);
5314 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5316 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5317 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5318 ok(!vshader, "Got non NULL vshader.\n");
5320 ivect[2] = 1;
5321 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5322 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5323 hr = effect->lpVtbl->CommitChanges(effect);
5324 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5326 test_effect_preshader_compare_shader(device, 1, FALSE);
5328 hr = effect->lpVtbl->EndPass(effect);
5329 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5331 hr = effect->lpVtbl->End(effect);
5332 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5334 effect->lpVtbl->Release(effect);
5337 static void test_effect_commitchanges(IDirect3DDevice9 *device)
5339 static const struct
5341 const char *param_name;
5342 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
5344 check_op_parameters[] =
5346 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5347 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5348 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5349 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5350 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5351 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5352 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5353 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5354 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5355 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5356 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5357 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
5358 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5359 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
5360 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
5362 static const struct
5364 const char *param_name;
5365 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5366 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5368 check_vconsts_parameters[] =
5370 {"g_Selector", {0x00000000, 0x00000002}},
5371 {"g_Pos1", {0x80000000, 0x00000002}},
5372 {"g_Pos2", {0x00000000, 0x00000002}},
5373 {"m4x3column", {0x03800000, 0x00000000}},
5374 {"m3x4column", {0x000f0000, 0x00000000}},
5375 {"m4x3row", {0x0000f000, 0x00000000}},
5376 {"m3x4row", {0x00700000, 0x00000000}},
5377 {"ts1", {0x1c000000, 0x00000000}},
5378 {"ts2", {0x0000003f, 0x00000000}},
5379 {"arr1", {0x00000000, 0x00000001}},
5380 {"arr2", {0x60000000, 0x00000000}},
5381 {"ts3", {0x00000fc0, 0x00000000}},
5383 static const struct
5385 const char *param_name;
5386 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_bconsts)
5387 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5389 check_bconsts_parameters[] =
5391 {"mb2x3row", {0x0000001f}},
5392 {"mb2x3column", {0x00000060}},
5394 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5395 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5396 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
5398 ID3DXEffect *effect;
5399 HRESULT hr;
5400 D3DXHANDLE param;
5401 unsigned int i, passes_count, value;
5402 int ivect[4];
5403 D3DXVECTOR4 fvect;
5404 IDirect3DVertexShader9 *vshader;
5405 unsigned char buffer[256];
5408 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5409 NULL, NULL, 0, NULL, &effect, NULL);
5410 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5412 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5413 ok(!!param, "GetParameterByName failed.\n");
5415 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5416 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5418 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5419 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5421 hr = effect->lpVtbl->BeginPass(effect, 0);
5422 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5424 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
5426 unsigned int j;
5428 for (j = 0; j < 8; ++j)
5430 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
5431 ok(hr == D3D_OK, "Got result %#x, i %u, j %u.\n", hr, i, j);
5433 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
5434 ok(!!param, "Failed to get parameter (test %u).\n", i);
5435 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
5436 ok(hr == D3D_OK, "Failed to get parameter value, hr %#x (test %u).\n", hr, i);
5437 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
5438 ok(hr == D3D_OK, "Failed to set parameter value, hr %#x (test %u).\n", hr, i);
5439 hr = effect->lpVtbl->CommitChanges(effect);
5440 ok(hr == D3D_OK, "Failed to commit changes, hr %#x (test %u).\n", hr, i);
5442 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
5443 check_op_parameters[i].param_name);
5446 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
5448 test_effect_preshader_clear_vconsts(device);
5449 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
5450 ok(!!param, "GetParameterByName failed.\n");
5451 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5452 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5453 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5454 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5455 hr = effect->lpVtbl->CommitChanges(effect);
5456 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5458 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
5459 check_vconsts_parameters[i].param_name);
5462 for (i = 0; i < ARRAY_SIZE(check_bconsts_parameters); ++i)
5464 test_effect_preshader_clear_pbool_consts(device);
5465 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_bconsts_parameters[i].param_name);
5466 ok(!!param, "GetParameterByName failed.\n");
5467 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5468 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5469 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5470 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5471 hr = effect->lpVtbl->CommitChanges(effect);
5472 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5474 test_effect_preshader_compare_pbool_consts(device, check_bconsts_parameters[i].const_updated_mask,
5475 check_bconsts_parameters[i].param_name);
5478 test_effect_preshader_clear_vconsts(device);
5479 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
5480 ok(!!param, "GetParameterByName failed.\n");
5481 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5482 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
5483 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5484 hr = effect->lpVtbl->CommitChanges(effect);
5485 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5486 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
5487 check_vconsts_parameters[0].param_name);
5489 test_effect_preshader_clear_vconsts(device);
5490 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5491 ok(!!param, "GetParameterByName failed.\n");
5492 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5493 ok(!!param, "GetParameterElement failed.\n");
5494 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
5495 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5496 hr = effect->lpVtbl->CommitChanges(effect);
5497 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5498 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5499 check_vconsts_parameters[10].param_name);
5501 test_effect_preshader_clear_vconsts(device);
5502 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5503 ok(!!param, "GetParameterByName failed.\n");
5504 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5505 ok(!!param, "GetParameterElement failed.\n");
5506 fvect.x = 93.0f;
5507 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
5508 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5509 hr = effect->lpVtbl->CommitChanges(effect);
5510 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5511 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5512 check_vconsts_parameters[10].param_name);
5514 test_effect_preshader_clear_vconsts(device);
5515 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5516 ok(!!param, "GetParameterByName failed.\n");
5517 fvect.x = 92.0f;
5518 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
5519 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5520 hr = effect->lpVtbl->CommitChanges(effect);
5521 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5522 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5523 check_vconsts_parameters[10].param_name);
5525 test_effect_preshader_clear_vconsts(device);
5526 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5527 ok(!!param, "GetParameterByName failed.\n");
5528 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5529 ok(!!param, "GetParameterElement failed.\n");
5530 hr = effect->lpVtbl->SetInt(effect, param, 93);
5531 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5532 hr = effect->lpVtbl->CommitChanges(effect);
5533 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5534 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5535 check_vconsts_parameters[10].param_name);
5537 test_effect_preshader_clear_vconsts(device);
5538 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5539 ok(!!param, "GetParameterByName failed.\n");
5540 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5541 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
5542 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5543 hr = effect->lpVtbl->CommitChanges(effect);
5544 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5545 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5546 check_vconsts_parameters[1].param_name);
5548 test_effect_preshader_clear_vconsts(device);
5549 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
5550 ok(!!param, "GetParameterByName failed.\n");
5551 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5552 ok(!!param, "GetParameterByName failed.\n");
5553 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5554 ok(!!param, "GetParameterByName failed.\n");
5555 fvect.x = 12;
5556 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5557 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5558 hr = effect->lpVtbl->CommitChanges(effect);
5559 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5560 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5561 check_vconsts_parameters[7].param_name);
5563 *(float *)&value = 9999.0f;
5564 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5565 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5566 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5567 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5568 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5569 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5570 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5571 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5572 test_effect_preshader_clear_vconsts(device);
5573 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5574 ok(!!param, "GetParameterByName failed.\n");
5575 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5576 ok(!!param, "GetParameterByName failed.\n");
5577 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5578 ok(!!param, "GetParameterByName failed.\n");
5579 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5580 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5581 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5582 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5583 hr = effect->lpVtbl->CommitChanges(effect);
5584 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5585 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5586 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5587 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
5588 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5589 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5590 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
5591 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5592 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5593 ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5594 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5595 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5596 ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5597 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5598 check_vconsts_parameters[8].param_name);
5600 *(float *)&value = 9999.0f;
5601 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5602 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5603 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5604 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5605 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5606 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5607 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5608 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5609 test_effect_preshader_clear_vconsts(device);
5610 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5611 ok(!!param, "GetParameterByName failed.\n");
5612 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5613 ok(!!param, "GetParameterByName failed.\n");
5614 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5615 ok(!!param, "GetParameterByName failed.\n");
5616 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5617 ok(!!param, "GetParameterByName failed.\n");
5618 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5619 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5620 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5621 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5622 hr = effect->lpVtbl->CommitChanges(effect);
5623 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5624 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5625 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5626 ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
5627 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5628 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5629 ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
5630 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5631 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5632 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5633 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5634 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5635 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5636 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5637 check_vconsts_parameters[11].param_name);
5639 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5640 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5641 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5642 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5643 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5644 todo_wine
5645 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5646 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5647 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5648 ok(value == 3, "Unexpected sampler 2 minfilter %u.\n", value);
5650 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5651 ok(!!param, "GetParameterByName failed.\n");
5652 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5653 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5654 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5656 for (i = 0; i < 3; ++i)
5658 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MINFILTER, 0);
5659 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5660 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MAGFILTER, 0);
5661 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5664 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5665 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5666 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5667 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5669 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5670 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5671 test_effect_preshader_clear_vconsts(device);
5673 hr = effect->lpVtbl->CommitChanges(effect);
5674 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5676 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5677 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5678 ok(!vshader, "Got non NULL vshader.\n");
5679 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5680 "selector g_iVect");
5682 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5683 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5684 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5685 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5686 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5687 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5689 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5690 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5691 ok(value == 1, "Unexpected sampler 2 minfilter %u.\n", value);
5692 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
5693 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5694 ok(value == 0, "Unexpected sampler 2 minfilter %u.\n", value);
5695 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5696 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5697 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5698 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5699 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5700 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5702 ivect[3] = 2;
5703 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5704 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5705 ivect[3] = 1;
5706 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5707 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5708 hr = effect->lpVtbl->CommitChanges(effect);
5709 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5710 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5711 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5712 ok(!vshader, "Got non NULL vshader.\n");
5713 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5714 "selector g_iVect");
5715 ivect[3] = 2;
5716 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5717 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5718 hr = effect->lpVtbl->CommitChanges(effect);
5719 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5720 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5721 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5722 ok(!!vshader, "Got NULL vshader.\n");
5723 IDirect3DVertexShader9_Release(vshader);
5724 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5725 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5726 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5727 "Vertex shader float constants do not match.\n");
5728 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5729 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5730 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5731 "selector g_iVect");
5732 ivect[3] = 1;
5733 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5734 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5735 hr = effect->lpVtbl->CommitChanges(effect);
5736 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5737 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5739 hr = effect->lpVtbl->EndPass(effect);
5740 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5742 hr = effect->lpVtbl->End(effect);
5743 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5745 effect->lpVtbl->Release(effect);
5748 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5750 static const struct
5752 D3DXVECTOR4 opvect2;
5753 D3DXVECTOR4 g_ivect;
5754 unsigned int expected[4];
5756 test_out_of_bounds_index[] =
5758 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5759 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5760 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5761 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5762 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5763 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5764 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5765 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5766 {0x447ac000, 0x448ae000, 0, 0}},
5767 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5768 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5769 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5770 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5771 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5772 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5773 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5774 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5775 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5776 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5777 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5778 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5779 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5780 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5781 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5782 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5783 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5784 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5785 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5786 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5787 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5788 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5789 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5790 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5791 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5793 static const struct
5795 unsigned int zw[2];
5797 expected_light_specular[] =
5799 {{0, 0x44fa2000}},
5800 {{0x447a8000, 0x453b9000}},
5801 {{0x40000000, 0x459c4800}},
5802 {{0xbf800000, 0}},
5803 {{0x447a4000, 0}},
5804 {{0x3f800000, 0}},
5805 {{0xbf800000, 0}},
5806 {{0, 0}},
5807 {{0, 0x447a4000}},
5808 {{0x44fa4000, 0x3f800000}},
5809 {{0x453ba000, 0xbf800000}},
5810 {{0x459c5000, 0}},
5811 {{0x44fa2000, 0}},
5812 {{0x453b9000, 0}},
5813 {{0x459c4800, 0}},
5814 {{0, 0}},
5816 static const struct
5818 int index_value;
5819 unsigned int expected[4];
5821 test_index_to_immediate_table[] =
5823 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5824 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5825 {-32, {0x448d4000, 0x40800000, 0, 0}},
5826 {-31, {0x45843000, 0x41400000, 0, 0}},
5827 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5828 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5829 {-28, {0, 0, 0x447ac000, 0x40400000}},
5830 {-27, {0, 0x3f800000, 0, 0}},
5831 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5832 {-25, {0, 0x41300000, 0, 0}},
5833 {-24, {0, 0x41600000, 0, 0}},
5834 {-23, {0, 0, 0, 0}},
5835 {-22, {0, 0, 0, 0}},
5836 {-21, {0, 0x40a00000, 0, 0}},
5837 {-20, {0, 0x41500000, 0, 0}},
5838 {-19, {0, 0x41500000, 0, 0}},
5839 {-18, {0, 0xc1900000, 0, 0}},
5840 {-17, {0, 0, 0, 0}},
5841 {-16, {0, 0x40800000, 0, 0}},
5842 {-15, {0, 0x41400000, 0, 0}},
5843 {-14, {0, 0x41400000, 0, 0}},
5844 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5845 {-12, {0, 0, 0, 0}},
5846 {-11, {0, 0x3f800000, 0, 0}},
5847 {-10, {0, 0x41100000, 0, 0}},
5848 {-9, {0, 0x41300000, 0, 0}},
5849 {-8, {0, 0x41600000, 0, 0}},
5850 {-7, {0, 0, 0, 0}},
5851 {-6, {0, 0, 0, 0}},
5852 {-5, {0, 0x40a00000, 0, 0}},
5853 {-4, {0, 0x41500000, 0, 0}},
5854 {-3, {0, 0x41500000, 0, 0}},
5855 {-2, {0, 0xc0000000, 0, 0}},
5856 {-1, {0, 0, 0, 0}},
5857 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5858 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5859 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5860 {3, {0, 0x447a4000, 0, 0}},
5861 {4, {0, 0, 0x45bbd800, 0x41300000}},
5862 {5, {0, 0x3f800000, 0, 0}},
5863 {6, {0, 0x41100000, 0, 0}},
5864 {7, {0, 0x41300000, 0, 0}},
5865 {8, {0, 0x41600000, 0, 0}},
5866 {9, {0, 0, 0, 0}},
5867 {10, {0, 0, 0, 0}},
5868 {11, {0, 0x40a00000, 0, 0}},
5869 {12, {0, 0x41500000, 0, 0}},
5870 {13, {0, 0x41500000, 0, 0}},
5871 {14, {0, 0x41600000, 0, 0}},
5872 {15, {0, 0, 0, 0}},
5873 {16, {0, 0x40800000, 0, 0}},
5874 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5875 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5876 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5877 {20, {0, 0, 0, 0}},
5878 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5879 {22, {0, 0x41100000, 0, 0}},
5880 {23, {0, 0x41300000, 0, 0}},
5881 {24, {0, 0x41600000, 0, 0}},
5882 {25, {0, 0, 0, 0}},
5883 {26, {0, 0, 0, 0}},
5884 {27, {0, 0x40a00000, 0, 0}},
5885 {28, {0, 0x41500000, 0, 0}},
5886 {29, {0, 0x41500000, 0, 0}},
5887 {30, {0, 0x41f00000, 0, 0}},
5888 {31, {0, 0, 0, 0}},
5889 {1001, {0, 0, 0, 0}},
5890 {1000000, {0, 0x40800000, 0, 0}},
5892 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5893 {1.0f, 1.0f, 1.0f, 1.0f}};
5894 unsigned int j, passes_count;
5895 const unsigned int *expected;
5896 const float *expected_float;
5897 ID3DXEffect *effect;
5898 D3DXVECTOR4 fvect;
5899 D3DLIGHT9 light;
5900 const float *v;
5901 HRESULT hr;
5902 int i;
5904 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5905 NULL, NULL, 0, NULL, &effect, NULL);
5906 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5908 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5909 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5910 hr = effect->lpVtbl->BeginPass(effect, 0);
5911 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5913 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5914 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5915 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5917 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5918 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5919 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5921 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5922 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5923 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5925 v = &light.Specular.r;
5926 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5928 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5929 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5930 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5931 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5933 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5934 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5936 hr = effect->lpVtbl->CommitChanges(effect);
5937 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5939 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5940 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5942 expected = test_out_of_bounds_index[i].expected;
5943 expected_float = (const float *)expected;
5945 for (j = 0; j < 4; ++j)
5947 ok(compare_float(v[j], expected_float[j], 0),
5948 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5949 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5953 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5954 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5955 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5956 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5958 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5959 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5961 fvect = test_out_of_bounds_index[7].g_ivect;
5962 v = &light.Specular.b;
5963 for (i = -100; i < 100; ++i)
5965 fvect.w = i;
5966 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5967 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5968 hr = effect->lpVtbl->CommitChanges(effect);
5969 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5971 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5972 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5974 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5975 expected_float = (const float *)expected;
5977 for (j = 0; j < 2; ++j)
5979 ok(compare_float(v[j], expected_float[j], 0),
5980 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
5981 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5985 v = &light.Specular.r;
5986 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
5988 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
5989 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5990 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5991 hr = effect->lpVtbl->CommitChanges(effect);
5992 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5994 hr = IDirect3DDevice9_GetLight(device, 2, &light);
5995 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5997 expected = test_index_to_immediate_table[i].expected;
5998 expected_float = (const float *)expected;
6000 for (j = 0; j < 4; ++j)
6002 ok(compare_float(v[j], expected_float[j], 0),
6003 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
6004 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
6008 hr = effect->lpVtbl->EndPass(effect);
6009 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6010 hr = effect->lpVtbl->End(effect);
6011 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6013 effect->lpVtbl->Release(effect);
6016 struct test_state_manager_update
6018 unsigned int state_op;
6019 DWORD param1;
6020 DWORD param2;
6023 struct test_manager
6025 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
6026 LONG ref;
6028 IDirect3DDevice9 *device;
6029 struct test_state_manager_update *update_record;
6030 unsigned int update_record_count;
6031 unsigned int update_record_size;
6034 #define INITIAL_UPDATE_RECORD_SIZE 64
6036 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
6038 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
6041 static void free_test_effect_state_manager(struct test_manager *state_manager)
6043 HeapFree(GetProcessHeap(), 0, state_manager->update_record);
6044 state_manager->update_record = NULL;
6046 IDirect3DDevice9_Release(state_manager->device);
6049 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
6051 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6053 return InterlockedIncrement(&state_manager->ref);
6056 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
6058 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6059 ULONG ref = InterlockedDecrement(&state_manager->ref);
6061 if (!ref)
6063 free_test_effect_state_manager(state_manager);
6064 HeapFree(GetProcessHeap(), 0, state_manager);
6066 return ref;
6069 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
6070 unsigned int state_op, DWORD param1, DWORD param2)
6072 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6074 if (state_manager->update_record_count == state_manager->update_record_size)
6076 if (!state_manager->update_record_size)
6078 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
6079 state_manager->update_record = HeapAlloc(GetProcessHeap(), 0,
6080 sizeof(*state_manager->update_record) * state_manager->update_record_size);
6082 else
6084 state_manager->update_record_size *= 2;
6085 state_manager->update_record = HeapReAlloc(GetProcessHeap(), 0, state_manager->update_record,
6086 sizeof(*state_manager->update_record) * state_manager->update_record_size);
6089 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
6090 state_manager->update_record[state_manager->update_record_count].param1 = param1;
6091 state_manager->update_record[state_manager->update_record_count].param2 = param2;
6092 ++state_manager->update_record_count;
6093 return D3D_OK;
6096 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
6097 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
6099 return test_process_set_state(iface, 0, state, 0);
6102 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
6103 const D3DMATERIAL9 *material)
6105 return test_process_set_state(iface, 1, 0, 0);
6108 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
6109 DWORD index, const D3DLIGHT9 *light)
6111 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6113 IDirect3DDevice9_SetLight(state_manager->device, index, light);
6114 return test_process_set_state(iface, 2, index, 0);
6117 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
6118 DWORD index, BOOL enable)
6120 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6122 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
6123 return test_process_set_state(iface, 3, index, 0);
6126 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
6127 D3DRENDERSTATETYPE state, DWORD value)
6129 return test_process_set_state(iface, 4, state, 0);
6132 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
6133 DWORD stage, struct IDirect3DBaseTexture9 *texture)
6135 return test_process_set_state(iface, 5, stage, 0);
6138 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
6139 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
6141 return test_process_set_state(iface, 6, stage, type);
6144 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
6145 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
6147 return test_process_set_state(iface, 7, sampler, type);
6150 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
6151 FLOAT num_segments)
6153 return test_process_set_state(iface, 8, 0, 0);
6156 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
6157 DWORD format)
6159 return test_process_set_state(iface, 9, 0, 0);
6162 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
6163 struct IDirect3DVertexShader9 *shader)
6165 return test_process_set_state(iface, 10, 0, 0);
6168 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
6169 UINT register_index, const FLOAT *constant_data, UINT register_count)
6171 return test_process_set_state(iface, 11, register_index, register_count);
6174 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
6175 UINT register_index, const INT *constant_data, UINT register_count)
6177 return test_process_set_state(iface, 12, register_index, register_count);
6180 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
6181 UINT register_index, const BOOL *constant_data, UINT register_count)
6183 return test_process_set_state(iface, 13, register_index, register_count);
6186 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
6187 struct IDirect3DPixelShader9 *shader)
6189 return test_process_set_state(iface, 14, 0, 0);
6192 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
6193 UINT register_index, const FLOAT *constant_data, UINT register_count)
6195 return test_process_set_state(iface, 15, register_index, register_count);
6198 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
6199 UINT register_index, const INT *constant_data, UINT register_count)
6201 return test_process_set_state(iface, 16, register_index, register_count);
6204 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
6205 UINT register_index, const BOOL *constant_data, UINT register_count)
6207 return test_process_set_state(iface, 17, register_index, register_count);
6210 static void test_effect_state_manager_init(struct test_manager *state_manager,
6211 IDirect3DDevice9 *device)
6213 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
6215 /*** IUnknown methods ***/
6216 NULL,
6217 test_manager_AddRef,
6218 test_manager_Release,
6219 /*** ID3DXEffectStateManager methods ***/
6220 test_manager_SetTransform,
6221 test_manager_SetMaterial,
6222 test_manager_SetLight,
6223 test_manager_LightEnable,
6224 test_manager_SetRenderState,
6225 test_manager_SetTexture,
6226 test_manager_SetTextureStageState,
6227 test_manager_SetSamplerState,
6228 test_manager_SetNPatchMode,
6229 test_manager_SetFVF,
6230 test_manager_SetVertexShader,
6231 test_manager_SetVertexShaderConstantF,
6232 test_manager_SetVertexShaderConstantI,
6233 test_manager_SetVertexShaderConstantB,
6234 test_manager_SetPixelShader,
6235 test_manager_SetPixelShaderConstantF,
6236 test_manager_SetPixelShaderConstantI,
6237 test_manager_SetPixelShaderConstantB,
6240 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
6241 state_manager->ref = 1;
6243 IDirect3DDevice9_AddRef(device);
6244 state_manager->device = device;
6247 static const char *test_effect_state_manager_state_names[] =
6249 "SetTransform",
6250 "SetMaterial",
6251 "SetLight",
6252 "LightEnable",
6253 "SetRenderState",
6254 "SetTexture",
6255 "SetTextureStageState",
6256 "SetSamplerState",
6257 "SetNPatchMode",
6258 "SetFVF",
6259 "SetVertexShader",
6260 "SetVertexShaderConstantF",
6261 "SetVertexShaderConstantI",
6262 "SetVertexShaderConstantB",
6263 "SetPixelShader",
6264 "SetPixelShaderConstantF",
6265 "SetPixelShaderConstantI",
6266 "SetPixelShaderConstantB",
6269 static int compare_update_record(const void *a, const void *b)
6271 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
6272 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
6274 if (r1->state_op != r2->state_op)
6275 return r1->state_op - r2->state_op;
6276 if (r1->param1 != r2->param1)
6277 return r1->param1 - r2->param1;
6278 return r1->param2 - r2->param2;
6281 static void test_effect_state_manager(IDirect3DDevice9 *device)
6283 static const struct test_state_manager_update expected_updates[] =
6285 {2, 0, 0},
6286 {2, 1, 0},
6287 {2, 2, 0},
6288 {2, 3, 0},
6289 {2, 4, 0},
6290 {2, 5, 0},
6291 {2, 6, 0},
6292 {2, 7, 0},
6293 {3, 0, 0},
6294 {3, 1, 0},
6295 {3, 2, 0},
6296 {3, 3, 0},
6297 {3, 4, 0},
6298 {3, 5, 0},
6299 {3, 6, 0},
6300 {3, 7, 0},
6301 {4, 28, 0},
6302 {4, 36, 0},
6303 {4, 38, 0},
6304 {4, 158, 0},
6305 {4, 159, 0},
6306 {5, 0, 0},
6307 {5, 259, 0},
6308 {7, 0, 5},
6309 {7, 0, 6},
6310 {7, 1, 5},
6311 {7, 1, 6},
6312 {7, 257, 5},
6313 {7, 257, 6},
6314 {7, 258, 5},
6315 {7, 258, 6},
6316 {7, 259, 5},
6317 {7, 259, 6},
6318 {10, 0, 0},
6319 {11, 0, 34},
6320 {14, 0, 0},
6321 {15, 0, 14},
6322 {16, 0, 1},
6323 {17, 0, 6},
6325 static D3DLIGHT9 light_filler =
6326 {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}};
6327 struct test_manager *state_manager;
6328 unsigned int passes_count, i, n;
6329 ID3DXEffect *effect;
6330 ULONG refcount;
6331 HRESULT hr;
6333 state_manager = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*state_manager));
6334 test_effect_state_manager_init(state_manager, device);
6336 for (i = 0; i < 8; ++i)
6338 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
6339 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6342 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6343 NULL, NULL, 0, NULL, &effect, NULL);
6344 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6346 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
6347 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6349 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6350 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6352 hr = effect->lpVtbl->BeginPass(effect, 0);
6353 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6355 hr = effect->lpVtbl->EndPass(effect);
6356 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6358 hr = effect->lpVtbl->End(effect);
6359 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6361 effect->lpVtbl->Release(effect);
6363 qsort(state_manager->update_record, state_manager->update_record_count,
6364 sizeof(*state_manager->update_record), compare_update_record);
6366 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
6367 "Got %u update records.\n", state_manager->update_record_count);
6368 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
6369 for (i = 0; i < n; ++i)
6371 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
6372 sizeof(expected_updates[i])),
6373 "Update record mismatch, expected %s, %u, %u, got %s, %u, %u.\n",
6374 test_effect_state_manager_state_names[expected_updates[i].state_op],
6375 expected_updates[i].param1, expected_updates[i].param2,
6376 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
6377 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
6380 for (i = 0; i < 8; ++i)
6382 D3DLIGHT9 light;
6384 hr = IDirect3DDevice9_GetLight(device, i, &light);
6385 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6386 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
6389 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
6390 &state_manager->ID3DXEffectStateManager_iface);
6391 ok(!refcount, "State manager was not properly freed, refcount %u.\n", refcount);
6394 static void test_cross_effect_handle(IDirect3DDevice9 *device)
6396 ID3DXEffect *effect1, *effect2;
6397 D3DXHANDLE param1, param2;
6398 static int expected_ivect[4] = {28, 29, 30, 31};
6399 int ivect[4];
6400 HRESULT hr;
6402 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6403 NULL, NULL, 0, NULL, &effect1, NULL);
6404 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6405 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6406 NULL, NULL, 0, NULL, &effect2, NULL);
6407 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6409 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
6411 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
6412 ok(!!param1, "GetParameterByName failed.\n");
6414 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
6415 ok(!!param2, "GetParameterByName failed.\n");
6417 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
6419 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
6420 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6422 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
6423 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6425 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6427 effect2->lpVtbl->Release(effect2);
6428 effect1->lpVtbl->Release(effect1);
6431 #if 0
6432 struct test_struct
6434 float3 v1_2;
6435 float fv_2;
6436 float4 v2_2;
6439 shared float arr2[1];
6440 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
6442 struct VS_OUTPUT
6444 float4 Position : POSITION;
6447 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6449 VS_OUTPUT Output;
6451 Output.Position = arr2[0] * vPos;
6452 return Output;
6455 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
6457 technique tech0
6459 pass p0
6461 FogEnable = TRUE;
6462 FogDensity = arr2[0];
6463 PointScale_A = ts2[0].fv_2;
6464 VertexShader = vs_arr2[0];
6467 pass p1
6469 VertexShader = vs_arr2[1];
6472 #endif
6473 static const DWORD test_effect_shared_parameters_blob[] =
6475 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
6476 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
6477 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
6478 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
6479 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
6480 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6481 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
6482 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
6483 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
6484 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
6485 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6486 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6487 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
6488 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
6489 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
6490 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
6491 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
6492 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
6493 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
6494 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
6495 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
6496 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
6497 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
6498 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
6499 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
6500 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
6501 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
6502 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
6503 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
6504 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
6505 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
6506 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
6507 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
6508 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
6509 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
6510 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
6511 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6512 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
6513 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
6514 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6515 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6516 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6517 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6518 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
6519 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
6520 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
6521 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
6522 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
6523 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
6524 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6525 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6528 #define test_effect_shared_vs_arr_compare_helper(args...) \
6529 test_effect_shared_vs_arr_compare_helper_(__LINE__, args)
6530 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
6531 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
6532 BOOL todo)
6534 struct IDirect3DVertexShader9 *vshader2;
6535 D3DXHANDLE param_child2;
6536 HRESULT hr;
6538 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
6539 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
6540 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6541 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
6542 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6543 todo_wine_if(todo)
6544 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
6545 if (vshader2)
6546 IDirect3DVertexShader9_Release(vshader2);
6549 #define test_effect_shared_parameters_compare_vconst(args...) \
6550 test_effect_shared_parameters_compare_vconst_(__LINE__, args)
6551 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
6552 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6554 D3DXVECTOR4 fvect;
6555 HRESULT hr;
6557 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6558 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6559 todo_wine_if(todo)
6560 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6561 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6564 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6566 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6567 ID3DXEffectPool *pool;
6568 HRESULT hr;
6569 D3DXHANDLE param, param_child, param2, param_child2;
6570 unsigned int i, passes_count;
6571 ULONG refcount;
6572 D3DXVECTOR4 fvect;
6573 float fval[2];
6575 hr = D3DXCreateEffectPool(&pool);
6576 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6578 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6579 NULL, NULL, 0, pool, &effect2, NULL);
6580 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6581 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6582 effect2->lpVtbl->Release(effect2);
6584 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6585 NULL, NULL, 0, pool, &effect2, NULL);
6586 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6587 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6588 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6589 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6591 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6592 NULL, NULL, 0, pool, &effect1, NULL);
6593 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6595 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6596 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6598 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6599 NULL, NULL, 0, pool, &effect3, NULL);
6600 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6601 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6602 NULL, NULL, 0, pool, &effect4, NULL);
6603 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6605 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6606 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6608 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6609 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6610 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6611 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6612 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6613 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6614 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6616 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6617 ok(!!param, "GetParameterByName failed.\n");
6618 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6619 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6621 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6622 ok(!!param, "GetParameterByName failed.\n");
6623 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6624 "Unexpected IsParameterUsed result.\n");
6626 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6627 ok(!!param, "GetParameterByName failed.\n");
6628 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6629 "Unexpected IsParameterUsed result.\n");
6631 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6632 ok(!!param, "GetParameterByName failed.\n");
6633 todo_wine
6634 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6635 "Unexpected IsParameterUsed result.\n");
6637 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6638 "Unexpected IsParameterUsed result.\n");
6639 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6640 "Unexpected IsParameterUsed result.\n");
6641 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6642 "Unexpected IsParameterUsed result.\n");
6644 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6645 "Unexpected IsParameterUsed result.\n");
6647 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6648 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6650 if (0)
6652 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6653 * but initialized with different shaders using different parameters. */
6654 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6655 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6657 hr = effect3->lpVtbl->EndPass(effect3);
6658 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6661 test_effect_preshader_clear_vconsts(device);
6662 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6663 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6664 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6665 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6666 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6668 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6669 todo_wine
6670 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6672 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6673 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6674 todo_wine
6675 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6676 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6678 hr = effect3->lpVtbl->EndPass(effect3);
6679 todo_wine
6680 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6682 hr = effect3->lpVtbl->End(effect3);
6683 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6685 for (i = 0; i < 2; ++i)
6687 struct IDirect3DVertexShader9 *vshader1;
6689 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6690 ok(!!param_child, "GetParameterElement failed.\n");
6691 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6692 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6694 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6695 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6696 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6697 IDirect3DVertexShader9_Release(vshader1);
6700 effect3->lpVtbl->Release(effect3);
6701 effect4->lpVtbl->Release(effect4);
6703 fval[0] = 1.0f;
6704 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6705 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6706 fval[0] = 0.0f;
6707 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6708 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6709 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6711 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6712 ok(!!param, "GetParameterByName failed.\n");
6713 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6714 ok(!!param, "GetParameterByName failed.\n");
6715 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6716 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6717 ok(!!param_child, "GetParameterElement failed.\n");
6718 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6719 ok(!!param_child2, "GetParameterElement failed.\n");
6720 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6722 fval[0] = 33.0f;
6723 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6724 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6725 fval[0] = 0.0f;
6726 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6727 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6728 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6729 fval[0] = 0.0f;
6730 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6731 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6732 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6734 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6735 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6737 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6738 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6740 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6741 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6743 fvect.x = 1.0f;
6744 fvect.y = fvect.z = fvect.w = 0.0f;
6745 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6747 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6748 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6750 fvect.x = 91.0f;
6751 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6752 fvect.x = 33.0f;
6753 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6755 fval[0] = 28.0f;
6756 fval[1] = -1.0f;
6757 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6758 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6760 test_effect_preshader_clear_vconsts(device);
6762 hr = effect1->lpVtbl->CommitChanges(effect1);
6763 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6765 fvect.x = 28.0f;
6766 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6767 fvect.x = -1.0f;
6768 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6770 test_effect_preshader_clear_vconsts(device);
6772 hr = effect1->lpVtbl->CommitChanges(effect1);
6773 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6775 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6776 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6778 hr = effect2->lpVtbl->CommitChanges(effect2);
6779 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6781 fvect.x = 28.0f;
6782 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6783 fvect.x = -1.0f;
6784 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6786 fval[0] = -2.0f;
6787 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6788 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6789 hr = effect1->lpVtbl->CommitChanges(effect1);
6790 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6792 fvect.x = -2.0f;
6793 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6794 fvect.x = -1.0f;
6795 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6797 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6798 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6799 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6801 hr = effect1->lpVtbl->CommitChanges(effect1);
6802 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6803 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6805 hr = effect1->lpVtbl->CommitChanges(effect2);
6806 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6807 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6809 hr = effect1->lpVtbl->End(effect1);
6810 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6812 hr = effect2->lpVtbl->End(effect2);
6813 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6815 if (0)
6817 refcount = pool->lpVtbl->Release(pool);
6818 ok(refcount == 2, "Unexpected refcount %u.\n", refcount);
6820 refcount = pool->lpVtbl->Release(pool);
6821 ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
6823 refcount = pool->lpVtbl->Release(pool);
6824 ok(!refcount, "Unexpected refcount %u.\n", refcount);
6826 /* Native d3dx crashes in GetFloat(). */
6827 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6830 effect1->lpVtbl->Release(effect1);
6831 effect2->lpVtbl->Release(effect2);
6833 refcount = pool->lpVtbl->Release(pool);
6834 ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount);
6837 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6839 ID3DXEffect *effect;
6840 D3DXHANDLE param;
6841 static int expected_ivect[4] = {28, 29, 30, 31};
6842 int ivect[4];
6843 HRESULT hr;
6845 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6846 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6847 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6849 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6850 ok(!!param, "GetParameterByName failed.\n");
6852 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6853 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6855 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6856 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6858 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6860 if (0)
6862 /* Native d3dx crashes in GetValue(). */
6863 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6864 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6867 effect->lpVtbl->Release(effect);
6870 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6872 unsigned int passes_count;
6873 ID3DXEffect *effect;
6874 D3DXPASS_DESC desc;
6875 D3DXVECTOR4 fvect;
6876 D3DXHANDLE pass;
6877 HRESULT hr;
6879 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6880 NULL, NULL, 0, NULL, &effect, NULL);
6881 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6883 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6884 ok(!!pass, "GetPass() failed.\n");
6886 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6887 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6888 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6890 fvect.x = fvect.y = fvect.w = 0.0f;
6891 fvect.z = 0.0f;
6892 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6893 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6895 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6896 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6897 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6899 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6901 fvect.z = 3.0f;
6902 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6903 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6905 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6906 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6907 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6909 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6910 * as it is not the case sometimes for BeginPass() with out of bound access. */
6911 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6912 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6913 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6915 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6916 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6918 hr = effect->lpVtbl->BeginPass(effect, 1);
6919 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6921 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6922 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6924 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6926 fvect.z = 2.0f;
6927 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6928 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6929 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6930 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6932 effect->lpVtbl->Release(effect);
6934 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6935 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6936 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6938 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6939 ok(!!pass, "GetPass() failed.\n");
6941 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6942 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6944 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6945 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6947 effect->lpVtbl->Release(effect);
6950 #if 0
6951 float v1 : register(c2);
6952 float v2 : register(c3);
6953 float v3;
6954 float v4 : register(c4);
6955 float v5;
6956 float v6[2] : register(c5) = {11, 22};
6958 struct VS_OUTPUT
6960 float4 Position : POSITION;
6963 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6965 VS_OUTPUT Output;
6967 Output.Position = v1 * v2 * vPos + v2 + v3 + v4;
6968 Output.Position += v6[0] + v6[1];
6969 return Output;
6972 technique tech0
6974 pass p0
6976 PointScale_A = v4;
6977 VertexShader = compile vs_3_0 RenderSceneVS();
6980 #endif
6981 static const DWORD test_effect_skip_constants_blob[] =
6983 0xfeff0901, 0x00000144, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
6984 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003176, 0x00000003, 0x00000000, 0x0000004c,
6985 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003276, 0x00000003,
6986 0x00000000, 0x00000074, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6987 0x00003376, 0x00000003, 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6988 0x00000000, 0x00000003, 0x00003476, 0x00000003, 0x00000000, 0x000000c4, 0x00000000, 0x00000000,
6989 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003576, 0x00000003, 0x00000000, 0x000000f0,
6990 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41300000, 0x41b00000, 0x00000003, 0x00003676,
6991 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6992 0x00000001, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070,
6993 0x00000006, 0x68636574, 0x00000030, 0x00000006, 0x00000001, 0x00000002, 0x00000002, 0x00000004,
6994 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054,
6995 0x00000070, 0x00000000, 0x00000000, 0x0000007c, 0x00000098, 0x00000000, 0x00000000, 0x000000a4,
6996 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e8, 0x00000000, 0x00000000, 0x00000138,
6997 0x00000000, 0x00000001, 0x00000130, 0x00000000, 0x00000002, 0x00000041, 0x00000000, 0x000000fc,
6998 0x000000f8, 0x00000092, 0x00000000, 0x0000011c, 0x00000118, 0x00000000, 0x00000002, 0x00000000,
6999 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000001bc, 0xfffe0300, 0x0047fffe, 0x42415443,
7000 0x0000001c, 0x000000e7, 0xfffe0300, 0x00000005, 0x0000001c, 0x20000000, 0x000000e0, 0x00000080,
7001 0x00020002, 0x000a0001, 0x00000084, 0x00000094, 0x000000a4, 0x00030002, 0x000e0001, 0x00000084,
7002 0x00000094, 0x000000a7, 0x00000002, 0x00000001, 0x00000084, 0x00000094, 0x000000aa, 0x00040002,
7003 0x00120001, 0x00000084, 0x00000094, 0x000000ad, 0x00050002, 0x00160002, 0x000000b0, 0x000000c0,
7004 0xab003176, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7005 0x00000000, 0x76003276, 0x34760033, 0x00367600, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
7006 0x41300000, 0x00000000, 0x00000000, 0x00000000, 0x41b00000, 0x00000000, 0x00000000, 0x00000000,
7007 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7008 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000,
7009 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0x80010000, 0xa0000003, 0x03000005,
7010 0x80010000, 0x80000000, 0xa0000002, 0x04000004, 0x800f0000, 0x80000000, 0x90e40000, 0xa0000003,
7011 0x03000002, 0x800f0000, 0x80e40000, 0xa0000000, 0x03000002, 0x800f0000, 0x80e40000, 0xa0000004,
7012 0x02000001, 0x80010001, 0xa0000005, 0x03000002, 0x80010001, 0x80000001, 0xa0000006, 0x03000002,
7013 0xe00f0000, 0x80e40000, 0x80000001, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
7014 0x00000000, 0x000000d8, 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200,
7015 0x00000001, 0x0000001c, 0x20000100, 0x00000054, 0x00000030, 0x00040002, 0x00120001, 0x00000034,
7016 0x00000044, 0xab003476, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
7017 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
7018 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
7019 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
7020 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7023 static void test_effect_skip_constants(IDirect3DDevice9 *device)
7025 HRESULT hr;
7026 ID3DXEffect *effect;
7027 unsigned int passes_count;
7028 D3DXVECTOR4 fvect;
7029 unsigned int i;
7031 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7032 NULL, NULL, "v3", 0, NULL, &effect, NULL);
7033 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7034 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7035 NULL, NULL, "v4", 0, NULL, &effect, NULL);
7036 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7037 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7038 NULL, NULL, "v1;v5;v4", 0, NULL, &effect, NULL);
7039 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7041 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7042 NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL);
7043 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7045 ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"),
7046 "Unexpected IsParameterUsed result.\n");
7047 ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"),
7048 "Unexpected IsParameterUsed result.\n");
7049 ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"),
7050 "Unexpected IsParameterUsed result.\n");
7051 ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"),
7052 "Unexpected IsParameterUsed result.\n");
7053 ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"),
7054 "Unexpected IsParameterUsed result.\n");
7055 ok(!effect->lpVtbl->IsParameterUsed(effect, "v6", "tech0"),
7056 "Unexpected IsParameterUsed result.\n");
7058 hr = effect->lpVtbl->SetFloat(effect, "v1", 28.0f);
7059 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7060 hr = effect->lpVtbl->SetFloat(effect, "v2", 29.0f);
7061 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7062 hr = effect->lpVtbl->SetFloat(effect, "v3", 30.0f);
7063 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7064 hr = effect->lpVtbl->SetFloat(effect, "v4", 31.0f);
7065 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7066 hr = effect->lpVtbl->SetFloat(effect, "v5", 32.0f);
7067 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7069 test_effect_preshader_clear_vconsts(device);
7071 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7072 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7073 hr = effect->lpVtbl->BeginPass(effect, 0);
7074 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7076 fvect.y = fvect.z = fvect.w = 0.0f;
7077 fvect.x = 30.0f;
7078 test_effect_shared_parameters_compare_vconst(device, 0, &fvect, FALSE);
7079 for (i = 1; i < 4; ++i)
7080 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7081 fvect.x = 31.0f;
7082 test_effect_shared_parameters_compare_vconst(device, 4, &fvect, FALSE);
7083 for (i = 5; i < 256; ++i)
7084 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7086 hr = effect->lpVtbl->EndPass(effect);
7087 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7088 hr = effect->lpVtbl->End(effect);
7089 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7091 effect->lpVtbl->Release(effect);
7094 #if 0
7095 vertexshader vs_arr[2] =
7099 vs_3_0
7100 def c0, 1, 1, 1, 1
7101 dcl_position o0
7102 mov o0, c0
7107 vs_3_sw
7108 def c256, 1, 1, 1, 1
7109 dcl_position o0
7110 mov o0, c256
7114 int i;
7116 technique tech0
7118 pass p0
7120 VertexShader = vs_arr[1];
7123 technique tech1
7125 pass p0
7127 VertexShader = vs_arr[i];
7130 #endif
7131 static const DWORD test_effect_unsupported_shader_blob[] =
7133 0xfeff0901, 0x000000ac, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7134 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7135 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000003,
7136 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006,
7137 0x68636574, 0x00000030, 0x00000004, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
7138 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002, 0x00000002, 0x00000006,
7139 0x00000005, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
7140 0x00000000, 0x00000074, 0x00000000, 0x00000001, 0x0000006c, 0x00000000, 0x00000001, 0x00000092,
7141 0x00000000, 0x00000058, 0x00000054, 0x000000a0, 0x00000000, 0x00000001, 0x00000098, 0x00000000,
7142 0x00000001, 0x00000092, 0x00000000, 0x00000084, 0x00000080, 0x00000002, 0x00000002, 0x00000001,
7143 0x00000038, 0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7144 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40000, 0x0000ffff, 0x00000002,
7145 0x00000038, 0xfffe03ff, 0x05000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7146 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40100, 0x0000ffff, 0x00000001,
7147 0x00000000, 0xffffffff, 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272,
7148 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c,
7149 0x00000100, 0x00000054, 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069,
7150 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7151 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
7152 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
7153 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
7154 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
7155 0xffffffff, 0x00000000, 0x00000001, 0x0000000a, 0x615f7376, 0x315b7272, 0x0000005d,
7158 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS 81
7159 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN 14
7161 static void test_effect_unsupported_shader(void)
7163 IDirect3DVertexShader9 *vshader;
7164 unsigned int passes_count;
7165 IDirect3DDevice9 *device;
7166 UINT byte_code_size;
7167 ID3DXEffect *effect;
7168 void *byte_code;
7169 ULONG refcount;
7170 HWND window;
7171 HRESULT hr;
7173 if (!(device = create_device(&window)))
7174 return;
7176 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7177 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7178 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7180 hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique");
7181 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7182 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7183 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7185 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7186 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7187 effect->lpVtbl->SetInt(effect, "i", 1);
7188 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7189 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7190 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7191 effect->lpVtbl->SetInt(effect, "i", 0);
7192 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7193 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7195 hr = effect->lpVtbl->SetTechnique(effect, "tech0");
7196 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7197 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7198 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7199 hr = effect->lpVtbl->BeginPass(effect, 0);
7200 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7202 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7203 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7204 ok(!vshader, "Got non NULL vshader.\n");
7206 hr = effect->lpVtbl->EndPass(effect);
7207 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7208 hr = effect->lpVtbl->End(effect);
7209 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7211 hr = effect->lpVtbl->SetTechnique(effect, "tech1");
7212 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7213 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7214 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7215 hr = effect->lpVtbl->BeginPass(effect, 0);
7216 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7218 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7219 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7220 ok(!!vshader, "Got NULL vshader.\n");
7221 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
7222 ok(hr == D3D_OK, "Got result %x.\n", hr);
7223 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
7224 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
7225 ok(hr == D3D_OK, "Got result %x.\n", hr);
7226 ok(byte_code_size == TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN * sizeof(DWORD),
7227 "Got unexpected byte code size %u.\n", byte_code_size);
7228 ok(!memcmp(byte_code,
7229 &test_effect_unsupported_shader_blob[TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS],
7230 byte_code_size), "Incorrect shader selected.\n");
7231 HeapFree(GetProcessHeap(), 0, byte_code);
7232 IDirect3DVertexShader9_Release(vshader);
7234 effect->lpVtbl->SetInt(effect, "i", 1);
7235 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7236 hr = effect->lpVtbl->CommitChanges(effect);
7237 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7238 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7239 ok(hr == D3D_OK, "Got result %x.\n", hr);
7240 ok(!vshader, "Got non NULL vshader.\n");
7242 effect->lpVtbl->Release(effect);
7244 refcount = IDirect3DDevice9_Release(device);
7245 ok(!refcount, "Device has %u references left.\n", refcount);
7246 DestroyWindow(window);
7249 #if 0
7250 vertexshader vs_arr[2];
7252 int i;
7254 technique tech0
7256 pass p0
7258 VertexShader = null;
7261 technique tech1
7263 pass p0
7265 VertexShader = vs_arr[i];
7268 #endif
7269 static const DWORD test_effect_null_shader_blob[] =
7271 0xfeff0901, 0x000000b4, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7272 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7273 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000000,
7274 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
7275 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000010, 0x00000004, 0x00000000,
7276 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002,
7277 0x00000002, 0x00000005, 0x00000004, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c,
7278 0x00000048, 0x00000000, 0x00000000, 0x0000007c, 0x00000000, 0x00000001, 0x00000074, 0x00000000,
7279 0x00000001, 0x00000092, 0x00000000, 0x00000058, 0x00000054, 0x000000a8, 0x00000000, 0x00000001,
7280 0x000000a0, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x0000008c, 0x00000088, 0x00000002,
7281 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xffffffff,
7282 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0023fffe,
7283 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000054,
7284 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069, 0x00020000, 0x00010001,
7285 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
7286 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
7287 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
7288 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
7289 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7292 static void test_effect_null_shader(void)
7294 IDirect3DDevice9 *device;
7295 ID3DXEffect *effect;
7296 D3DXPASS_DESC desc;
7297 D3DXHANDLE pass;
7298 ULONG refcount;
7299 HWND window;
7300 HRESULT hr;
7302 /* Creating a fresh device because the existing device can have invalid
7303 * render states from previous tests. If IDirect3DDevice9_ValidateDevice()
7304 * returns certain error codes, native ValidateTechnique() fails. */
7305 if (!(device = create_device(&window)))
7306 return;
7308 hr = D3DXCreateEffectEx(device, test_effect_null_shader_blob,
7309 sizeof(test_effect_null_shader_blob), NULL, NULL, NULL, 0, NULL, &effect, NULL);
7310 ok(hr == D3D_OK, "Failed to create effect, hr %#x.\n", hr);
7312 pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
7313 ok(!!pass, "GetPass() failed.\n");
7314 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7315 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7316 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7318 pass = effect->lpVtbl->GetPass(effect, "tech1", 0);
7319 ok(!!pass, "GetPass() failed.\n");
7320 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7321 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7322 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7324 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7325 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7326 effect->lpVtbl->SetInt(effect, "i", 0);
7327 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7328 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7329 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7330 effect->lpVtbl->SetInt(effect, "i", 1);
7331 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7332 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7333 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7335 effect->lpVtbl->SetInt(effect, "i", 2);
7336 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7337 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7338 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7340 effect->lpVtbl->Release(effect);
7342 refcount = IDirect3DDevice9_Release(device);
7343 ok(!refcount, "Device has %u references left.\n", refcount);
7344 DestroyWindow(window);
7347 static void test_effect_clone(void)
7349 IDirect3DDevice9 *device, *device2, *device3;
7350 ID3DXEffect *effect, *cloned;
7351 HWND window, window2;
7352 ULONG refcount;
7353 HRESULT hr;
7355 if (!(device = create_device(&window)))
7356 return;
7358 /* D3DXFX_NOT_CLONEABLE */
7359 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
7360 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
7361 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7363 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7364 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7366 cloned = (void *)0xdeadbeef;
7367 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7368 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7369 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7371 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7372 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7374 cloned = (void *)0xdeadbeef;
7375 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7376 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7377 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7379 effect->lpVtbl->Release(effect);
7381 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
7382 NULL, NULL, 0, NULL, &effect, NULL);
7383 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7385 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7386 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7388 cloned = (void *)0xdeadbeef;
7389 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7390 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7391 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7393 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7394 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7396 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7397 todo_wine
7398 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7399 if (hr == D3D_OK)
7401 ok(cloned != effect, "Expected new effect instance.\n");
7402 cloned->lpVtbl->Release(cloned);
7404 /* Try with different device. */
7405 device2 = create_device(&window2);
7406 hr = effect->lpVtbl->CloneEffect(effect, device2, &cloned);
7407 todo_wine
7408 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7409 if (hr == D3D_OK)
7411 ok(cloned != effect, "Expected new effect instance.\n");
7413 hr = cloned->lpVtbl->GetDevice(cloned, &device3);
7414 ok(hr == S_OK, "Failed to get effect device.\n");
7415 ok(device3 == device2, "Unexpected device instance.\n");
7416 IDirect3DDevice9_Release(device3);
7418 cloned->lpVtbl->Release(cloned);
7420 IDirect3DDevice9_Release(device2);
7421 DestroyWindow(window2);
7422 effect->lpVtbl->Release(effect);
7423 refcount = IDirect3DDevice9_Release(device);
7424 ok(!refcount, "Device has %u references left.\n", refcount);
7425 DestroyWindow(window);
7428 static unsigned int get_texture_refcount(IDirect3DTexture9 *iface)
7430 IDirect3DTexture9_AddRef(iface);
7431 return IDirect3DTexture9_Release(iface);
7434 static void test_refcount(void)
7436 IDirect3DTexture9 *texture, *cur_texture, *managed_texture, *sysmem_texture;
7437 unsigned int passes_count;
7438 IDirect3DDevice9 *device;
7439 ID3DXEffect *effect;
7440 ULONG refcount;
7441 HWND window;
7442 HRESULT hr;
7444 if (!(device = create_device(&window)))
7445 return;
7447 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL);
7448 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7450 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob,
7451 sizeof(test_effect_preshader_effect_blob), NULL, NULL,
7452 D3DXFX_DONOTSAVESTATE, NULL, &effect, NULL);
7453 ok(hr == D3D_OK, "Failed to create effect, hr %#x.\n", hr);
7455 hr = effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)texture);
7456 ok(hr == D3D_OK, "Failed to set texture parameter, hr %#x.\n", hr);
7458 hr = effect->lpVtbl->Begin(effect, &passes_count, D3DXFX_DONOTSAVESTATE);
7459 ok(hr == D3D_OK, "Begin() failed, hr %#x.\n", hr);
7461 hr = effect->lpVtbl->BeginPass(effect, 0);
7462 ok(hr == D3D_OK, "BeginPass() failed, hr %#x.\n", hr);
7464 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7465 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7466 IDirect3DTexture9_Release(cur_texture);
7468 IDirect3DDevice9_SetTexture(device, 0, NULL);
7469 effect->lpVtbl->CommitChanges(effect);
7471 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7472 ok(cur_texture == NULL, "Unexpected current texture %p.\n", cur_texture);
7474 hr = effect->lpVtbl->EndPass(effect);
7475 ok(hr == D3D_OK, "EndPass() failed, hr %#x.\n", hr);
7477 hr = effect->lpVtbl->BeginPass(effect, 0);
7478 ok(hr == D3D_OK, "BeginPass() failed, hr %#x.\n", hr);
7480 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7481 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7482 IDirect3DTexture9_Release(cur_texture);
7484 hr = effect->lpVtbl->EndPass(effect);
7485 ok(hr == D3D_OK, "EndPass() failed, hr %#x.\n", hr);
7486 hr = effect->lpVtbl->End(effect);
7487 ok(hr == D3D_OK, "End() failed, hr %#x.\n", hr);
7489 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7490 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7491 IDirect3DTexture9_Release(cur_texture);
7492 refcount = get_texture_refcount(texture);
7493 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7495 hr = effect->lpVtbl->OnLostDevice(effect);
7496 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7497 refcount = get_texture_refcount(texture);
7498 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7500 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED,
7501 &managed_texture, NULL);
7502 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7503 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)managed_texture);
7505 refcount = get_texture_refcount(managed_texture);
7506 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7507 hr = effect->lpVtbl->OnLostDevice(effect);
7508 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7509 refcount = get_texture_refcount(managed_texture);
7510 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7512 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM,
7513 &sysmem_texture, NULL);
7514 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7515 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)sysmem_texture);
7517 refcount = get_texture_refcount(managed_texture);
7518 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7519 IDirect3DTexture9_Release(managed_texture);
7520 refcount = get_texture_refcount(sysmem_texture);
7521 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7522 hr = effect->lpVtbl->OnLostDevice(effect);
7523 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7524 refcount = get_texture_refcount(sysmem_texture);
7525 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7527 effect->lpVtbl->Release(effect);
7529 refcount = get_texture_refcount(sysmem_texture);
7530 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7531 IDirect3DTexture9_Release(sysmem_texture);
7533 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7534 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7535 IDirect3DTexture9_Release(cur_texture);
7536 refcount = get_texture_refcount(texture);
7537 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7538 IDirect3DTexture9_Release(texture);
7540 refcount = IDirect3DDevice9_Release(device);
7541 ok(!refcount, "Device has %u references left.\n", refcount);
7542 DestroyWindow(window);
7545 static HRESULT WINAPI d3dxinclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type,
7546 const char *filename, const void *parent_data, const void **data, UINT *bytes)
7548 static const char include1[] =
7549 "float4 light;\n"
7550 "float4x4 mat;\n"
7551 "float4 color;\n"
7552 "\n"
7553 "struct vs_input\n"
7554 "{\n"
7555 " float4 position : POSITION;\n"
7556 " float3 normal : NORMAL;\n"
7557 "};\n"
7558 "\n"
7559 "struct vs_output\n"
7560 "{\n"
7561 " float4 position : POSITION;\n"
7562 " float4 diffuse : COLOR;\n"
7563 "};\n";
7564 static const char include2[] =
7565 "#include \"include1.h\"\n"
7566 "\n"
7567 "vs_output vs_main(const vs_input v)\n"
7568 "{\n"
7569 " vs_output o;\n"
7570 " const float4 scaled_color = 0.5 * color;\n"
7571 "\n"
7572 " o.position = mul(v.position, mat);\n"
7573 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7574 "\n"
7575 " return o;\n"
7576 "}\n";
7577 static const char effect2[] =
7578 "#include \"include\\include2.h\"\n"
7579 "\n"
7580 "technique t\n"
7581 "{\n"
7582 " pass p\n"
7583 " {\n"
7584 " VertexShader = compile vs_2_0 vs_main();\n"
7585 " }\n"
7586 "}\n";
7587 char *buffer;
7589 trace("filename %s.\n", filename);
7590 trace("parent_data %p: %s.\n", parent_data, parent_data ? (char *)parent_data : "(null)");
7592 if (!strcmp(filename, "effect2.fx"))
7594 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(effect2));
7595 memcpy(buffer, effect2, sizeof(effect2));
7596 *bytes = sizeof(effect2);
7597 ok(!parent_data, "Unexpected parent_data value.\n");
7599 else if (!strcmp(filename, "include1.h"))
7601 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include1));
7602 memcpy(buffer, include1, sizeof(include1));
7603 *bytes = sizeof(include1);
7604 ok(!strncmp(parent_data, include2, strlen(include2)), "Unexpected parent_data value.\n");
7606 else if (!strcmp(filename, "include\\include2.h"))
7608 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2));
7609 memcpy(buffer, include2, sizeof(include2));
7610 *bytes = sizeof(include2);
7611 todo_wine ok(parent_data && !strncmp(parent_data, effect2, strlen(effect2)),
7612 "unexpected parent_data value.\n");
7614 else
7616 ok(0, "Unexpected #include for file %s.\n", filename);
7617 return D3DERR_INVALIDCALL;
7619 *data = buffer;
7620 return S_OK;
7623 static HRESULT WINAPI d3dxinclude_close(ID3DXInclude *iface, const void *data)
7625 HeapFree(GetProcessHeap(), 0, (void *)data);
7626 return S_OK;
7629 static const struct ID3DXIncludeVtbl d3dxinclude_vtbl =
7631 d3dxinclude_open,
7632 d3dxinclude_close
7635 struct d3dxinclude
7637 ID3DXInclude ID3DXInclude_iface;
7640 static void test_create_effect_from_file(void)
7642 static const char effect1[] =
7643 "float4 light;\n"
7644 "float4x4 mat;\n"
7645 "float4 color;\n"
7646 "\n"
7647 "struct vs_input\n"
7648 "{\n"
7649 " float4 position : POSITION;\n"
7650 " float3 normal : NORMAL;\n"
7651 "};\n"
7652 "\n"
7653 "struct vs_output\n"
7654 "{\n"
7655 " float4 position : POSITION;\n"
7656 " float4 diffuse : COLOR;\n"
7657 "};\n"
7658 "\n"
7659 "vs_output vs_main(const vs_input v)\n"
7660 "{\n"
7661 " vs_output o;\n"
7662 " const float4 scaled_color = 0.5 * color;\n"
7663 "\n"
7664 " o.position = mul(v.position, mat);\n"
7665 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7666 "\n"
7667 " return o;\n"
7668 "}\n"
7669 "\n"
7670 "technique t\n"
7671 "{\n"
7672 " pass p\n"
7673 " {\n"
7674 " VertexShader = compile vs_2_0 vs_main();\n"
7675 " }\n"
7676 "}\n";
7677 static const char include1[] =
7678 "float4 light;\n"
7679 "float4x4 mat;\n"
7680 "float4 color;\n"
7681 "\n"
7682 "struct vs_input\n"
7683 "{\n"
7684 " float4 position : POSITION;\n"
7685 " float3 normal : NORMAL;\n"
7686 "};\n"
7687 "\n"
7688 "struct vs_output\n"
7689 "{\n"
7690 " float4 position : POSITION;\n"
7691 " float4 diffuse : COLOR;\n"
7692 "};\n";
7693 static const char include1_wrong[] =
7694 "#error \"wrong include\"\n";
7695 static const char include2[] =
7696 "#include \"include1.h\"\n"
7697 "\n"
7698 "vs_output vs_main(const vs_input v)\n"
7699 "{\n"
7700 " vs_output o;\n"
7701 " const float4 scaled_color = 0.5 * color;\n"
7702 "\n"
7703 " o.position = mul(v.position, mat);\n"
7704 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7705 "\n"
7706 " return o;\n"
7707 "}\n";
7708 static const char effect2[] =
7709 "#include \"include\\include2.h\"\n"
7710 "\n"
7711 "technique t\n"
7712 "{\n"
7713 " pass p\n"
7714 " {\n"
7715 " VertexShader = compile vs_2_0 vs_main();\n"
7716 " }\n"
7717 "}\n";
7718 static const WCHAR effect1_filename_w[] = {'e','f','f','e','c','t','1','.','f','x',0};
7719 static const WCHAR effect2_filename_w[] = {'e','f','f','e','c','t','2','.','f','x',0};
7720 WCHAR effect_path_w[MAX_PATH], filename_w[MAX_PATH];
7721 char effect_path[MAX_PATH], filename[MAX_PATH];
7722 D3DPRESENT_PARAMETERS present_parameters = {0};
7723 unsigned int filename_size;
7724 struct d3dxinclude include;
7725 IDirect3DDevice9 *device;
7726 ID3DXBuffer *messages;
7727 ID3DXEffect *effect;
7728 IDirect3D9 *d3d;
7729 ULONG refcount;
7730 HWND window;
7731 HRESULT hr;
7733 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7734 640, 480, NULL, NULL, NULL, NULL)))
7736 skip("Failed to create window.\n");
7737 return;
7739 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7741 skip("Failed to create IDirect3D9 object.\n");
7742 DestroyWindow(window);
7743 return;
7745 present_parameters.Windowed = TRUE;
7746 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7747 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7748 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7749 if (FAILED(hr))
7751 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
7752 IDirect3D9_Release(d3d);
7753 DestroyWindow(window);
7754 return;
7757 if (!create_file("effect1.fx", effect1, sizeof(effect1) - 1, filename))
7759 skip("Couldn't create temporary file, skipping test.\n");
7760 return;
7763 filename_size = strlen(filename);
7764 filename_size -= sizeof("effect1.fx") - 1;
7765 memcpy(effect_path, filename, filename_size);
7766 effect_path[filename_size] = 0;
7767 MultiByteToWideChar(CP_ACP, 0, effect_path, -1, effect_path_w, sizeof(effect_path_w));
7769 create_directory("include");
7770 create_file("effect2.fx", effect2, sizeof(effect2) - 1, NULL);
7771 create_file("include\\include1.h", include1, sizeof(include1) - 1, NULL);
7772 create_file("include\\include2.h", include2, sizeof(include2) - 1, NULL);
7773 create_file("include1.h", include1_wrong, sizeof(include1_wrong) - 1, NULL);
7775 lstrcpyW(filename_w, effect_path_w);
7776 lstrcatW(filename_w, effect1_filename_w);
7777 effect = NULL;
7778 messages = NULL;
7779 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
7780 0, NULL, &effect, &messages);
7781 todo_wine ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr);
7782 if (messages)
7784 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7785 ID3DXBuffer_Release(messages);
7787 if (effect)
7788 effect->lpVtbl->Release(effect);
7790 lstrcpyW(filename_w, effect_path_w);
7791 lstrcatW(filename_w, effect2_filename_w);
7792 effect = NULL;
7793 messages = NULL;
7794 /* This is apparently broken on native, it ends up using the wrong include. */
7795 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
7796 0, NULL, &effect, &messages);
7797 todo_wine ok(hr == E_FAIL, "Unexpected error, hr %#x.\n", hr);
7798 if (messages)
7800 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7801 ID3DXBuffer_Release(messages);
7803 if (effect)
7804 effect->lpVtbl->Release(effect);
7806 delete_file("effect1.fx");
7807 delete_file("effect2.fx");
7808 delete_file("include\\include1.h");
7809 delete_file("include\\include2.h");
7810 delete_file("include2.h");
7811 delete_directory("include");
7813 lstrcpyW(filename_w, effect2_filename_w);
7814 effect = NULL;
7815 messages = NULL;
7816 include.ID3DXInclude_iface.lpVtbl = &d3dxinclude_vtbl;
7817 /* This is actually broken in native d3dx9 (manually tried multiple
7818 * versions, all are affected). For reference, the message printed below
7819 * is "ID3DXEffectCompiler: There were no techniques" */
7820 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, &include.ID3DXInclude_iface, NULL,
7821 0, NULL, &effect, &messages);
7822 todo_wine ok(hr == E_FAIL, "D3DXInclude test failed with error %#x.\n", hr);
7823 if (messages)
7825 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7826 ID3DXBuffer_Release(messages);
7829 refcount = IDirect3DDevice9_Release(device);
7830 ok(!refcount, "Device has %u references left.\n", refcount);
7831 IDirect3D9_Release(d3d);
7832 DestroyWindow(window);
7835 #if 0
7836 technique tech0
7838 pass p0
7840 LightEnable[0] = FALSE;
7841 FogEnable = FALSE;
7844 technique tech1
7846 pass p0
7848 LightEnable[0] = TRUE;
7849 FogEnable = TRUE;
7852 #endif
7853 static const DWORD test_two_techniques_blob[] =
7855 0xfeff0901, 0x000000ac, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
7856 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
7857 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030,
7858 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7859 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7860 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000000, 0x00000002, 0x00000002,
7861 0x00000001, 0x0000004c, 0x00000000, 0x00000001, 0x00000044, 0x00000000, 0x00000002, 0x00000091,
7862 0x00000000, 0x00000008, 0x00000004, 0x0000000e, 0x00000000, 0x00000028, 0x00000024, 0x000000a0,
7863 0x00000000, 0x00000001, 0x00000098, 0x00000000, 0x00000002, 0x00000091, 0x00000000, 0x0000005c,
7864 0x00000058, 0x0000000e, 0x00000000, 0x0000007c, 0x00000078, 0x00000000, 0x00000000,
7867 static void test_effect_find_next_valid_technique(void)
7869 D3DPRESENT_PARAMETERS present_parameters = {0};
7870 IDirect3DDevice9 *device;
7871 D3DXTECHNIQUE_DESC desc;
7872 ID3DXEffect *effect;
7873 IDirect3D9 *d3d;
7874 D3DXHANDLE tech;
7875 ULONG refcount;
7876 HWND window;
7877 HRESULT hr;
7879 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7880 640, 480, NULL, NULL, NULL, NULL)))
7882 skip("Failed to create window.\n");
7883 return;
7885 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7887 skip("Failed to create IDirect3D9 object.\n");
7888 DestroyWindow(window);
7889 return;
7891 present_parameters.Windowed = TRUE;
7892 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7893 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7894 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7895 if (FAILED(hr))
7897 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
7898 IDirect3D9_Release(d3d);
7899 DestroyWindow(window);
7900 return;
7903 hr = D3DXCreateEffectEx(device, test_two_techniques_blob, sizeof(test_two_techniques_blob),
7904 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7905 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7907 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7908 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7909 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7910 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7911 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7913 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7914 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7915 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7916 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7917 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7919 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7920 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7921 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7922 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7923 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7925 effect->lpVtbl->Release(effect);
7927 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7928 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7929 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7931 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7932 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7933 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7934 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7935 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7937 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7938 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7939 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7940 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7941 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7943 effect->lpVtbl->SetInt(effect, "i", 1);
7944 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7946 tech = (D3DXHANDLE)0xdeadbeef;
7947 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7948 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7949 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7950 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7951 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7953 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7954 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7956 effect->lpVtbl->SetInt(effect, "i", 0);
7958 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7959 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7960 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7961 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7962 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7964 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7965 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7967 hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech);
7968 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7970 effect->lpVtbl->Release(effect);
7972 refcount = IDirect3DDevice9_Release(device);
7973 ok(!refcount, "Device has %u references left.\n", refcount);
7974 IDirect3D9_Release(d3d);
7975 DestroyWindow(window);
7978 START_TEST(effect)
7980 IDirect3DDevice9 *device;
7981 ULONG refcount;
7982 HWND wnd;
7984 if (!(device = create_device(&wnd)))
7985 return;
7987 test_create_effect_and_pool(device);
7988 test_create_effect_compiler();
7989 test_effect_parameter_value(device);
7990 test_effect_setvalue_object(device);
7991 test_effect_variable_names(device);
7992 test_effect_compilation_errors(device);
7993 test_effect_states(device);
7994 test_effect_preshader(device);
7995 test_effect_preshader_ops(device);
7996 test_effect_isparameterused(device);
7997 test_effect_out_of_bounds_selector(device);
7998 test_effect_commitchanges(device);
7999 test_effect_preshader_relative_addressing(device);
8000 test_effect_state_manager(device);
8001 test_cross_effect_handle(device);
8002 test_effect_shared_parameters(device);
8003 test_effect_large_address_aware_flag(device);
8004 test_effect_get_pass_desc(device);
8005 test_effect_skip_constants(device);
8007 refcount = IDirect3DDevice9_Release(device);
8008 ok(!refcount, "Device has %u references left.\n", refcount);
8009 DestroyWindow(wnd);
8011 test_effect_unsupported_shader();
8012 test_effect_null_shader();
8013 test_effect_clone();
8014 test_refcount();
8015 test_create_effect_from_file();
8016 test_effect_find_next_valid_technique();