mfplat: Read queue subscriber within the critical section.
[wine/zf.git] / dlls / d3dx9_36 / tests / effect.c
blobae6f65d52d5d828b3e068d4726f567e8e1b9d44d
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 /* helper functions */
26 static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps)
28 INT x = *(INT *)&f;
29 INT y = *(INT *)&g;
31 if (x < 0)
32 x = INT_MIN - x;
33 if (y < 0)
34 y = INT_MIN - y;
36 if (abs(x - y) > ulps)
37 return FALSE;
39 return TRUE;
42 static inline INT get_int(D3DXPARAMETER_TYPE type, const void *data)
44 INT i;
46 switch (type)
48 case D3DXPT_FLOAT:
49 i = *(FLOAT *)data;
50 break;
52 case D3DXPT_INT:
53 i = *(INT *)data;
54 break;
56 case D3DXPT_BOOL:
57 i = *(BOOL *)data;
58 break;
60 default:
61 i = 0;
62 ok(0, "Unhandled type %x.\n", type);
63 break;
66 return i;
69 static inline float get_float(D3DXPARAMETER_TYPE type, const void *data)
71 float f;
73 switch (type)
75 case D3DXPT_FLOAT:
76 f = *(FLOAT *)data;
77 break;
79 case D3DXPT_INT:
80 f = *(INT *)data;
81 break;
83 case D3DXPT_BOOL:
84 f = *(BOOL *)data;
85 break;
87 default:
88 f = 0.0f;
89 ok(0, "Unhandled type %x.\n", type);
90 break;
93 return f;
96 static inline BOOL get_bool(const void *data)
98 return !!*(BOOL *)data;
101 static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
103 switch (outtype)
105 case D3DXPT_FLOAT:
106 *(FLOAT *)outdata = get_float(intype, indata);
107 break;
109 case D3DXPT_BOOL:
110 *(BOOL *)outdata = get_bool(indata);
111 break;
113 case D3DXPT_INT:
114 *(INT *)outdata = get_int(intype, indata);
115 break;
117 case D3DXPT_PIXELSHADER:
118 case D3DXPT_VERTEXSHADER:
119 case D3DXPT_TEXTURE2D:
120 case D3DXPT_STRING:
121 *(INT *)outdata = 0x12345678;
122 break;
124 default:
125 ok(0, "Unhandled type %x.\n", outtype);
126 *(INT *)outdata = 0;
127 break;
131 static IDirect3DDevice9 *create_device(HWND *window)
133 D3DPRESENT_PARAMETERS present_parameters = { 0 };
134 IDirect3DDevice9 *device;
135 IDirect3D9 *d3d;
136 HRESULT hr;
137 HWND wnd;
139 *window = NULL;
141 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
142 640, 480, NULL, NULL, NULL, NULL)))
144 skip("Couldn't create application window.\n");
145 return NULL;
148 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
150 skip("Couldn't create IDirect3D9 object.\n");
151 DestroyWindow(wnd);
152 return NULL;
155 present_parameters.Windowed = TRUE;
156 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
157 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING,
158 &present_parameters, &device);
159 IDirect3D9_Release(d3d);
160 if (FAILED(hr))
162 skip("Failed to create IDirect3DDevice9 object %#x.\n", hr);
163 DestroyWindow(wnd);
164 return NULL;
167 *window = wnd;
168 return device;
171 static char temp_path[MAX_PATH];
173 static BOOL create_file(const char *filename, const char *data, const unsigned int size, char *out_path)
175 DWORD written;
176 HANDLE hfile;
177 char path[MAX_PATH];
179 if (!*temp_path)
180 GetTempPathA(sizeof(temp_path), temp_path);
182 strcpy(path, temp_path);
183 strcat(path, filename);
184 hfile = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
185 if (hfile == INVALID_HANDLE_VALUE)
186 return FALSE;
188 if (WriteFile(hfile, data, size, &written, NULL))
190 CloseHandle(hfile);
192 if (out_path)
193 strcpy(out_path, path);
194 return TRUE;
197 CloseHandle(hfile);
198 return FALSE;
201 static void delete_file(const char *filename)
203 char path[MAX_PATH];
205 strcpy(path, temp_path);
206 strcat(path, filename);
207 DeleteFileA(path);
210 static BOOL create_directory(const char *name)
212 char path[MAX_PATH];
214 strcpy(path, temp_path);
215 strcat(path, name);
216 return CreateDirectoryA(path, NULL);
219 static void delete_directory(const char *name)
221 char path[MAX_PATH];
223 strcpy(path, temp_path);
224 strcat(path, name);
225 RemoveDirectoryA(path);
228 static const char effect_desc[] =
229 "Technique\n"
230 "{\n"
231 "}\n";
233 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
235 HRESULT hr;
236 ID3DXEffect *effect;
237 ID3DXBaseEffect *base;
238 ULONG count;
239 IDirect3DDevice9 *device2;
240 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
241 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
243 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
244 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
246 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
247 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
249 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
250 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
252 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
253 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
255 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
256 todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
257 if (FAILED(hr))
259 skip("Failed to compile effect, skipping test.\n");
260 return;
263 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
264 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
266 hr = effect->lpVtbl->GetStateManager(effect, NULL);
267 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
269 hr = effect->lpVtbl->GetStateManager(effect, &manager);
270 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
271 ok(!manager, "GetStateManager failed, got %p\n", manager);
273 /* this works, but it is not recommended! */
274 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
275 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
277 hr = effect->lpVtbl->GetStateManager(effect, &manager);
278 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
279 ok(manager != NULL, "GetStateManager failed\n");
281 IDirect3DDevice9_AddRef(device);
282 count = IDirect3DDevice9_Release(device);
283 ok(count == 4, "Release failed, got %u, expected 4\n", count);
285 count = IUnknown_Release(manager);
286 ok(count == 3, "Release failed, got %u, expected 3\n", count);
288 hr = effect->lpVtbl->SetStateManager(effect, NULL);
289 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
291 hr = effect->lpVtbl->GetPool(effect, &pool);
292 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
293 ok(!pool, "GetPool failed, got %p\n", pool);
295 hr = effect->lpVtbl->GetPool(effect, NULL);
296 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
298 hr = effect->lpVtbl->GetDevice(effect, &device2);
299 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
301 hr = effect->lpVtbl->GetDevice(effect, NULL);
302 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
304 count = IDirect3DDevice9_Release(device2);
305 ok(count == 2, "Release failed, got %u, expected 2\n", count);
307 count = effect->lpVtbl->Release(effect);
308 ok(count == 0, "Release failed %u\n", count);
310 hr = D3DXCreateEffectPool(NULL);
311 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
313 hr = D3DXCreateEffectPool(&pool);
314 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
316 count = pool->lpVtbl->Release(pool);
317 ok(count == 0, "Release failed %u\n", count);
319 hr = D3DXCreateEffectPool(&pool);
320 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
322 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
323 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
325 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
326 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
327 ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
329 count = pool2->lpVtbl->Release(pool2);
330 ok(count == 1, "Release failed, got %u, expected 1\n", count);
332 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
333 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
335 count = IDirect3DDevice9_Release(device2);
336 ok(count == 1, "Release failed, got %u, expected 1\n", count);
338 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
339 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
341 hr = effect->lpVtbl->GetPool(effect, &pool);
342 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
343 ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
345 count = pool2->lpVtbl->Release(pool2);
346 ok(count == 2, "Release failed, got %u, expected 2\n", count);
348 count = effect->lpVtbl->Release(effect);
349 ok(count == 0, "Release failed %u\n", count);
351 count = pool->lpVtbl->Release(pool);
352 ok(count == 0, "Release failed %u\n", count);
355 static void test_create_effect_compiler(void)
357 HRESULT hr;
358 ID3DXEffectCompiler *compiler, *compiler2;
359 ID3DXBaseEffect *base;
360 IUnknown *unknown;
361 ULONG count;
363 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
364 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
366 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
367 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
369 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
370 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
371 if (FAILED(hr))
373 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
374 return;
377 count = compiler->lpVtbl->Release(compiler);
378 ok(count == 0, "Release failed %u\n", count);
380 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
381 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
383 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
384 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
386 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
387 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
389 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
390 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
392 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
393 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
395 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
396 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
398 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
399 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
401 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
402 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
404 count = unknown->lpVtbl->Release(unknown);
405 ok(count == 2, "Release failed, got %u, expected %u\n", count, 2);
407 count = compiler2->lpVtbl->Release(compiler2);
408 ok(count == 1, "Release failed, got %u, expected %u\n", count, 1);
410 count = compiler->lpVtbl->Release(compiler);
411 ok(count == 0, "Release failed %u\n", count);
415 * Parameter value test
417 struct test_effect_parameter_value_result
419 const char *full_name;
420 D3DXPARAMETER_DESC desc;
421 UINT value_offset; /* start position for the value in the blob */
425 * fxc.exe /Tfx_2_0
427 #if 0
428 float f = 0.1;
429 float1 f1 = {1.1};
430 float2 f2 = {2.1, 2.2};
431 float3 f3 = {3.1, 3.2, 3.3};
432 float4 f4 = {4.1, 4.2, 4.3, 4.4};
433 float1x1 f11 = {11.1};
434 float1x2 f12 = {12.1, 12.2};
435 float1x3 f13 = {13.1, 13.2, 13.3};
436 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
437 float2x1 f21 = {{21.11, 21.21}};
438 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
439 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
440 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
441 float3x1 f31 = {{31.11, 31.21, 31.31}};
442 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
443 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
444 {33.13, 33.23, 33.33}};
445 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
446 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
447 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
448 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
449 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
450 {43.13, 43.23, 43.33, 43.43}};
451 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
452 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
453 float f_2[2] = {0.101, 0.102};
454 float1 f1_2[2] = {{1.101}, {1.102}};
455 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
456 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
457 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
458 float1x1 f11_2[2] = {{11.101}, {11.102}};
459 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
460 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
461 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
462 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
463 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
464 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
465 {23.1202, 23.2202}, {23.1302, 23.2302}}};
466 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
467 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
468 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
469 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
470 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
471 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
472 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
473 {33.1302, 33.2302, 33.3302}}};
474 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
475 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
476 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
477 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
478 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
479 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
480 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
481 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
482 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
483 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
484 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
485 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
486 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
487 technique t { pass p { } }
488 #endif
489 static const DWORD test_effect_parameter_value_blob_float[] =
491 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
492 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
493 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
494 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
495 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
496 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
497 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
498 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
499 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
500 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
501 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
502 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
503 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
504 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
505 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
506 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
507 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
508 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
509 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
510 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
511 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
512 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
513 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
514 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
515 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
516 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
517 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
518 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
519 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
520 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
521 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
522 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
523 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
524 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
525 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
526 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
527 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
528 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
529 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
530 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
531 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
532 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
533 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
534 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
535 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
536 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
537 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
538 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
539 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
540 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
541 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
542 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
543 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
544 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
545 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
546 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
547 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
548 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
549 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
550 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
551 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
552 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
553 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
554 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
555 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
556 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
557 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
558 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
559 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
560 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
561 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
562 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
563 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
564 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
565 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
566 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
567 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
568 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
569 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
570 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
571 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
572 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
573 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
574 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
575 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
576 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
577 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
578 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
579 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
580 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
581 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
582 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
583 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
584 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
585 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
586 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
587 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
588 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
589 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
590 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
591 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
592 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
593 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
594 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
595 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
596 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
597 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
598 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
599 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
600 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
601 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
602 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
603 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
604 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
605 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
608 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
610 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
611 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
612 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
613 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
614 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
615 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
616 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
617 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
618 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
619 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
620 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
621 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
622 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
623 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
624 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
625 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
626 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
627 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
628 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
629 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
630 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
631 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
632 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
633 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
634 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
635 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
636 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
637 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
638 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
639 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
640 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
641 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
642 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
643 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
644 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
645 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
646 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
647 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
648 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
649 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
650 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
651 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
655 * fxc.exe /Tfx_2_0
657 #if 0
658 int i = 1;
659 int1 i1 = {11};
660 int2 i2 = {21, 22};
661 int3 i3 = {31, 32, 33};
662 int4 i4 = {41, 42, 43, 44};
663 int1x1 i11 = {111};
664 int1x2 i12 = {121, 122};
665 int1x3 i13 = {131, 132, 133};
666 int1x4 i14 = {141, 142, 143, 144};
667 int2x1 i21 = {{2111, 2121}};
668 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
669 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
670 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
671 int3x1 i31 = {{3111, 3121, 3131}};
672 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
673 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
674 {3313, 3323, 3333}};
675 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
676 {3413, 3423, 3433}, {3414, 3424, 3434}};
677 int4x1 i41 = {{4111, 4121, 4131, 4141}};
678 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
679 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
680 {4313, 4323, 4333, 4343}};
681 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
682 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
683 int i_2[2] = {0101, 0102};
684 int1 i1_2[2] = {{1101}, {1102}};
685 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
686 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
687 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
688 int1x1 i11_2[2] = {{11101}, {11102}};
689 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
690 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
691 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
692 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
693 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
694 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
695 {231202, 232202}, {231302, 232302}}};
696 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
697 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
698 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
699 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
700 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
701 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
702 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
703 {331302, 332302, 333302}}};
704 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
705 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
706 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
707 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
708 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
709 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
710 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
711 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
712 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
713 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
714 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
715 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
716 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
717 technique t { pass p { } }
718 #endif
719 static const DWORD test_effect_parameter_value_blob_int[] =
721 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
722 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
723 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
724 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
725 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
726 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
727 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
728 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
729 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
730 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
731 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
732 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
733 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
734 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
735 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
736 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
737 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
738 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
739 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
740 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
741 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
742 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
743 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
744 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
745 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
746 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
747 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
748 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
749 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
750 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
751 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
752 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
753 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
754 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
755 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
756 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
757 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
758 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
759 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
760 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
761 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
762 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
763 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
764 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
765 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
766 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
767 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
768 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
769 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
770 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
771 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
772 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
773 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
774 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
775 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
776 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
777 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
778 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
779 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
780 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
781 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
782 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
783 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
784 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
785 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
786 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
787 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
788 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
789 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
790 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
791 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
792 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
793 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
794 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
795 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
796 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
797 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
798 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
799 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
800 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
801 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
802 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
803 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
804 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
805 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
806 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
807 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
808 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
809 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
810 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
811 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
812 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
813 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
814 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
815 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
816 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
817 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
818 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
819 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
820 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
821 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
822 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
823 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
824 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
825 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
826 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
827 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
828 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
829 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
830 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
831 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
832 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
833 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
834 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
835 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
838 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
840 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
841 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
842 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
843 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
844 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
845 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
846 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
847 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
848 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
849 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
850 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
851 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
852 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
853 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
854 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
855 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
856 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
857 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
858 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
859 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
860 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
861 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
862 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
863 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
864 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
865 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
866 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
867 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
868 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
869 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
870 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
871 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
872 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
873 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
874 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
875 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
876 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
877 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
878 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
879 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
880 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
881 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
885 * fxc.exe /Tfx_2_0
887 #if 0
888 string s = "test";
889 string s_2[2] = {"test1", "test2"};
890 texture2D tex;
891 Vertexshader v;
892 Vertexshader v_2[2];
893 Pixelshader p;
894 Pixelshader p_2[2];
895 technique t { pass p { } }
896 #endif
897 static const DWORD test_effect_parameter_value_blob_object[] =
899 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
900 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
901 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
902 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
903 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
904 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
905 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
906 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
907 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
908 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
909 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
910 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
911 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
912 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
913 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
914 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
915 0x00000001, 0x00000005, 0x74736574, 0x00000000,
918 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
920 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
921 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
922 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
923 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
924 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
925 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
926 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
930 * fxc.exe /Tfx_2_0
932 #if 0
933 float3 f3 = {-3.1, 153.2, 283.3};
934 float3 f3min = {-31.1, -31.2, -31.3};
935 float3 f3max = {320.1, 320.2, 320.3};
936 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
937 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
938 float4 f4max = {420.1, 42.20, 420.3, 420.4};
939 technique t { pass p { } }
940 #endif
941 static const DWORD test_effect_parameter_value_blob_special[] =
943 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
944 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
945 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
946 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
947 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
948 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
949 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
950 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
951 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
952 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
953 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
954 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
955 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
956 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
957 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
958 0x00000000, 0x00000000,
961 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
963 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
964 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
965 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
966 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
967 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
968 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
971 #define ADD_PARAMETER_VALUE(x) {\
972 test_effect_parameter_value_blob_ ## x,\
973 sizeof(test_effect_parameter_value_blob_ ## x),\
974 test_effect_parameter_value_result_ ## x,\
975 ARRAY_SIZE(test_effect_parameter_value_result_ ## x),\
978 static const struct
980 const DWORD *blob;
981 UINT blob_size;
982 const struct test_effect_parameter_value_result *res;
983 UINT res_count;
985 test_effect_parameter_value_data[] =
987 ADD_PARAMETER_VALUE(float),
988 ADD_PARAMETER_VALUE(int),
989 ADD_PARAMETER_VALUE(object),
990 ADD_PARAMETER_VALUE(special),
993 #undef ADD_PARAMETER_VALUE
995 /* Multiple of 16 to cover complete matrices */
996 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
997 /* Constants for special INT/FLOAT conversation */
998 #define INT_FLOAT_MULTI 255.0f
999 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
1001 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
1002 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1004 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1005 const char *res_full_name = res->full_name;
1006 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1007 HRESULT hr;
1008 UINT l;
1010 memset(value, 0xab, sizeof(value));
1011 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
1012 if (res_desc->Class == D3DXPC_SCALAR
1013 || res_desc->Class == D3DXPC_VECTOR
1014 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1016 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1018 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
1020 ok(value[l] == res_value[l], "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1021 i, res_full_name, l, value[l], res_value[l]);
1024 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1026 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1027 i, res_full_name, l, value[l], 0xabababab);
1030 else if (res_desc->Class == D3DXPC_OBJECT)
1032 switch (res_desc->Type)
1034 case D3DXPT_PIXELSHADER:
1035 case D3DXPT_VERTEXSHADER:
1036 case D3DXPT_TEXTURE2D:
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->Elements ? res_desc->Elements : 1); ++l)
1041 IUnknown *unk = *((IUnknown **)value + l);
1042 if (unk) IUnknown_Release(unk);
1044 break;
1046 case D3DXPT_STRING:
1047 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1048 break;
1050 default:
1051 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1052 break;
1055 else
1057 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1058 i, res_full_name, hr, D3DERR_INVALIDCALL);
1060 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1062 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
1063 i, res_full_name, l, value[l], 0xabababab);
1068 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
1069 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1071 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1072 const char *res_full_name = res->full_name;
1073 BOOL bvalue = 0xabababab;
1074 HRESULT hr;
1076 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
1077 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1079 ok(hr == D3D_OK, "%u - %s: GetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1080 ok(bvalue == get_bool(res_value), "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1081 i, res_full_name, bvalue, get_bool(res_value));
1083 else
1085 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1086 i, res_full_name, hr, D3DERR_INVALIDCALL);
1087 ok(bvalue == 0xabababab, "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1088 i, res_full_name, bvalue, 0xabababab);
1092 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
1093 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1095 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1096 const char *res_full_name = res->full_name;
1097 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1098 HRESULT hr;
1099 UINT l, err = 0;
1101 memset(bavalue, 0xab, sizeof(bavalue));
1102 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1103 if (res_desc->Class == D3DXPC_SCALAR
1104 || res_desc->Class == D3DXPC_VECTOR
1105 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1107 ok(hr == D3D_OK, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1109 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1111 if (bavalue[l] != get_bool(&res_value[l])) ++err;
1114 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1116 if (bavalue[l] != 0xabababab) ++err;
1119 else
1121 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1122 i, res_full_name, hr, D3DERR_INVALIDCALL);
1124 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (bavalue[l] != 0xabababab) ++err;
1126 ok(!err, "%u - %s: GetBoolArray failed with %u errors\n", i, res_full_name, err);
1129 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1130 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1132 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1133 const char *res_full_name = res->full_name;
1134 INT ivalue = 0xabababab;
1135 HRESULT hr;
1137 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1138 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1140 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1141 ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1142 i, res_full_name, ivalue, get_int(res_desc->Type, res_value));
1144 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1145 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1146 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1148 INT tmp;
1150 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1152 tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1153 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1154 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1155 if (res_desc->Columns * res_desc->Rows > 3)
1157 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1160 ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n",
1161 i, res_full_name, ivalue, tmp);
1163 else
1165 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1166 i, res_full_name, hr, D3DERR_INVALIDCALL);
1167 ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1168 i, res_full_name, ivalue, 0xabababab);
1172 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1173 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1175 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1176 const char *res_full_name = res->full_name;
1177 INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1178 HRESULT hr;
1179 UINT l, err = 0;
1181 memset(iavalue, 0xab, sizeof(iavalue));
1182 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1183 if (res_desc->Class == D3DXPC_SCALAR
1184 || res_desc->Class == D3DXPC_VECTOR
1185 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1187 ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1189 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1191 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1194 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1196 if (iavalue[l] != 0xabababab) ++err;
1199 else
1201 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1202 i, res_full_name, hr, D3DERR_INVALIDCALL);
1204 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1206 ok(!err, "%u - %s: GetIntArray failed with %u errors\n", i, res_full_name, err);
1209 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1210 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1212 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1213 const char *res_full_name = res->full_name;
1214 HRESULT hr;
1215 DWORD cmp = 0xabababab;
1216 FLOAT fvalue = *(FLOAT *)&cmp;
1218 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1219 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1221 ok(hr == D3D_OK, "%u - %s: GetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1222 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1223 i, res_full_name, fvalue, get_float(res_desc->Type, res_value));
1225 else
1227 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1228 i, res_full_name, hr, D3DERR_INVALIDCALL);
1229 ok(fvalue == *(FLOAT *)&cmp, "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1230 i, res_full_name, fvalue, *(FLOAT *)&cmp);
1234 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1235 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1237 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1238 const char *res_full_name = res->full_name;
1239 FLOAT favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1240 HRESULT hr;
1241 UINT l, err = 0;
1242 DWORD cmp = 0xabababab;
1244 memset(favalue, 0xab, sizeof(favalue));
1245 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1246 if (res_desc->Class == D3DXPC_SCALAR
1247 || res_desc->Class == D3DXPC_VECTOR
1248 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1250 ok(hr == D3D_OK, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1252 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1254 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1257 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1259 if (favalue[l] != *(FLOAT *)&cmp) ++err;
1262 else
1264 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1265 i, res_full_name, hr, D3DERR_INVALIDCALL);
1267 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1269 ok(!err, "%u - %s: GetFloatArray failed with %u errors\n", i, res_full_name, err);
1272 static void test_effect_parameter_value_GetVector(const struct test_effect_parameter_value_result *res,
1273 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1275 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1276 const char *res_full_name = res->full_name;
1277 HRESULT hr;
1278 DWORD cmp = 0xabababab;
1279 FLOAT fvalue[4];
1280 UINT l, err = 0;
1282 memset(fvalue, 0xab, sizeof(fvalue));
1283 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1284 if (!res_desc->Elements &&
1285 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1286 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1288 DWORD tmp;
1290 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1292 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1293 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1294 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1295 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1297 if (*res_value != tmp) ++err;
1299 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1301 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1303 for (l = 0; l < res_desc->Columns; ++l)
1305 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1308 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l] != 0.0f) ++err;
1310 else
1312 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1313 i, res_full_name, hr, D3DERR_INVALIDCALL);
1315 for (l = 0; l < 4; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1317 ok(!err, "%u - %s: GetVector failed with %u errors\n", i, res_full_name, err);
1320 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1321 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1323 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1324 const char *res_full_name = res->full_name;
1325 HRESULT hr;
1326 DWORD cmp = 0xabababab;
1327 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1328 UINT l, k, element, err = 0;
1330 for (element = 0; element <= res_desc->Elements + 1; ++element)
1332 memset(fvalue, 0xab, sizeof(fvalue));
1333 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1334 if (!element)
1336 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1338 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1340 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1342 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1344 for (k = 0; k < element; ++k)
1346 for (l = 0; l < res_desc->Columns; ++l)
1348 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1349 &res_value[l + k * res_desc->Columns]), 512))
1350 ++err;
1353 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l + k * 4] != 0.0f) ++err;
1356 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1358 else
1360 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n",
1361 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1363 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1365 ok(!err, "%u - %s[%u]: GetVectorArray failed with %u errors\n", i, res_full_name, element, err);
1369 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1370 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1372 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1373 const char *res_full_name = res->full_name;
1374 HRESULT hr;
1375 union
1377 DWORD d;
1378 float f;
1379 } cmp;
1380 float fvalue[16];
1381 UINT l, k, err = 0;
1383 cmp.d = 0xabababab;
1384 memset(fvalue, 0xab, sizeof(fvalue));
1385 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1386 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1388 ok(hr == D3D_OK, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1390 for (k = 0; k < 4; ++k)
1392 for (l = 0; l < 4; ++l)
1394 if (k < res_desc->Columns && l < res_desc->Rows)
1396 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1397 &res_value[l * res_desc->Columns + k]), 512))
1398 ++err;
1400 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1404 else
1406 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x.\n",
1407 i, res_full_name, hr, D3DERR_INVALIDCALL);
1409 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1410 if (fvalue[l] != cmp.f)
1411 ++err;
1413 ok(!err, "%u - %s: GetMatrix failed with %u errors.\n", i, res_full_name, err);
1416 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1417 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1419 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1420 const char *res_full_name = res->full_name;
1421 HRESULT hr;
1422 DWORD cmp = 0xabababab;
1423 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1424 UINT l, k, m, element, err = 0;
1426 for (element = 0; element <= res_desc->Elements + 1; ++element)
1428 memset(fvalue, 0xab, sizeof(fvalue));
1429 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1430 if (!element)
1432 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1434 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1436 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1438 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1440 for (m = 0; m < element; ++m)
1442 for (k = 0; k < 4; ++k)
1444 for (l = 0; l < 4; ++l)
1446 if (k < res_desc->Columns && l < res_desc->Rows)
1448 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1449 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1450 ++err;
1452 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1457 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1459 else
1461 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n",
1462 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1464 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1466 ok(!err, "%u - %s[%u]: GetMatrixArray failed with %u errors\n", i, res_full_name, element, err);
1470 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1471 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1473 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1474 const char *res_full_name = res->full_name;
1475 HRESULT hr;
1476 DWORD cmp = 0xabababab;
1477 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1478 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1479 UINT l, k, m, element, err = 0;
1481 for (element = 0; element <= res_desc->Elements + 1; ++element)
1483 memset(fvalue, 0xab, sizeof(fvalue));
1484 for (l = 0; l < element; ++l)
1486 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1488 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
1489 if (!element)
1491 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1492 i, res_full_name, element, hr, D3D_OK);
1494 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1496 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1498 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1499 i, res_full_name, element, hr, D3D_OK);
1501 for (m = 0; m < element; ++m)
1503 for (k = 0; k < 4; ++k)
1505 for (l = 0; l < 4; ++l)
1507 if (k < res_desc->Columns && l < res_desc->Rows)
1509 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1510 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1511 ++err;
1513 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1518 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1520 else
1522 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1524 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1525 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1527 ok(!err, "%u - %s[%u]: GetMatrixPointerArray failed with %u errors\n", i, res_full_name, element, err);
1531 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1532 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1534 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1535 const char *res_full_name = res->full_name;
1536 HRESULT hr;
1537 union
1539 DWORD d;
1540 float f;
1541 } cmp;
1542 float fvalue[16];
1543 UINT l, k, err = 0;
1545 cmp.d = 0xabababab;
1546 memset(fvalue, 0xab, sizeof(fvalue));
1547 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1548 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1550 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1552 for (k = 0; k < 4; ++k)
1554 for (l = 0; l < 4; ++l)
1556 if (k < res_desc->Columns && l < res_desc->Rows)
1558 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1559 &res_value[l * res_desc->Columns + k]), 512))
1560 ++err;
1562 else if (fvalue[l + k * 4] != 0.0f) ++err;
1566 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1568 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n", i, res_full_name, hr, D3D_OK);
1570 for (k = 0; k < 4; ++k)
1572 for (l = 0; l < 4; ++l)
1574 if (k < res_desc->Columns && l < res_desc->Rows)
1576 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1577 &res_value[l * res_desc->Columns + k]), 512))
1578 ++err;
1580 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1584 else
1586 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x.\n",
1587 i, res_full_name, hr, D3DERR_INVALIDCALL);
1589 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1590 if (fvalue[l] != cmp.f)
1591 ++err;
1593 ok(!err, "%u - %s: GetMatrixTranspose failed with %u errors.\n", i, res_full_name, err);
1596 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1597 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1599 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1600 const char *res_full_name = res->full_name;
1601 HRESULT hr;
1602 DWORD cmp = 0xabababab;
1603 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1604 UINT l, k, m, element, err = 0;
1606 for (element = 0; element <= res_desc->Elements + 1; ++element)
1608 memset(fvalue, 0xab, sizeof(fvalue));
1609 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1610 if (!element)
1612 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1613 i, res_full_name, element, hr, D3D_OK);
1615 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1617 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1619 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1620 i, res_full_name, element, hr, D3D_OK);
1622 for (m = 0; m < element; ++m)
1624 for (k = 0; k < 4; ++k)
1626 for (l = 0; l < 4; ++l)
1628 if (k < res_desc->Columns && l < res_desc->Rows)
1630 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1631 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1632 ++err;
1634 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1639 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1641 else
1643 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1644 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1646 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1648 ok(!err, "%u - %s[%u]: GetMatrixTransposeArray failed with %u errors\n", i, res_full_name, element, err);
1652 static void test_effect_parameter_value_GetMatrixTransposePointerArray(const struct test_effect_parameter_value_result *res,
1653 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1655 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1656 const char *res_full_name = res->full_name;
1657 HRESULT hr;
1658 DWORD cmp = 0xabababab;
1659 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1660 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1661 UINT l, k, m, element, err = 0;
1663 for (element = 0; element <= res_desc->Elements + 1; ++element)
1665 memset(fvalue, 0xab, sizeof(fvalue));
1666 for (l = 0; l < element; ++l)
1668 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1670 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
1671 if (!element)
1673 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1674 i, res_full_name, element, hr, D3D_OK);
1676 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1678 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1680 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1681 i, res_full_name, element, hr, D3D_OK);
1683 for (m = 0; m < element; ++m)
1685 for (k = 0; k < 4; ++k)
1687 for (l = 0; l < 4; ++l)
1689 if (k < res_desc->Columns && l < res_desc->Rows)
1691 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1692 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1693 ++err;
1695 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1700 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1702 else
1704 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1705 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1707 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1709 ok(!err, "%u - %s[%u]: GetMatrixTransposePointerArray failed with %u errors\n", i, res_full_name, element, err);
1713 static void test_effect_parameter_value_GetTestGroup(const struct test_effect_parameter_value_result *res,
1714 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1716 test_effect_parameter_value_GetValue(res, effect, res_value, parameter, i);
1717 test_effect_parameter_value_GetBool(res, effect, res_value, parameter, i);
1718 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter, i);
1719 test_effect_parameter_value_GetInt(res, effect, res_value, parameter, i);
1720 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter, i);
1721 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter, i);
1722 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter, i);
1723 test_effect_parameter_value_GetVector(res, effect, res_value, parameter, i);
1724 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter, i);
1725 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter, i);
1726 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter, i);
1727 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter, i);
1728 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter, i);
1729 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter, i);
1730 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter, i);
1733 static void test_effect_parameter_value_ResetValue(const struct test_effect_parameter_value_result *res,
1734 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1736 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1737 const char *res_full_name = res->full_name;
1738 HRESULT hr;
1740 if (res_desc->Class == D3DXPC_SCALAR
1741 || res_desc->Class == D3DXPC_VECTOR
1742 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1744 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1745 ok(hr == D3D_OK, "%u - %s: SetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1747 else
1749 /* nothing to do */
1750 switch (res_desc->Type)
1752 case D3DXPT_PIXELSHADER:
1753 case D3DXPT_VERTEXSHADER:
1754 case D3DXPT_TEXTURE2D:
1755 case D3DXPT_STRING:
1756 break;
1758 default:
1759 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1760 break;
1765 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1767 unsigned int effect_count = ARRAY_SIZE(test_effect_parameter_value_data), i;
1769 for (i = 0; i < effect_count; ++i)
1771 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1772 UINT res_count = test_effect_parameter_value_data[i].res_count;
1773 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1774 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1775 HRESULT hr;
1776 ID3DXEffect *effect;
1777 D3DXEFFECT_DESC edesc;
1778 ULONG count;
1779 UINT k;
1781 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1782 ok(hr == D3D_OK, "%u: D3DXCreateEffect failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1784 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1785 ok(hr == D3D_OK, "%u: GetDesc failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1786 ok(edesc.Parameters == res_count, "%u: Parameters failed, got %u, expected %u\n",
1787 i, edesc.Parameters, res_count);
1789 for (k = 0; k < res_count; ++k)
1791 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1792 const char *res_full_name = res[k].full_name;
1793 UINT res_value_offset = res[k].value_offset;
1794 D3DXHANDLE parameter;
1795 D3DXPARAMETER_DESC pdesc;
1796 BOOL bvalue = TRUE;
1797 INT ivalue = 42;
1798 FLOAT fvalue = 2.71828f;
1799 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1800 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1801 UINT l, n, m, element;
1802 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/sizeof(D3DXMATRIX)];
1804 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1805 ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
1807 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1808 ok(hr == D3D_OK, "%u - %s: GetParameterDesc failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1810 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1811 "%u - %s: GetParameterDesc Name failed, got \"%s\", expected \"%s\"\n",
1812 i, res_full_name, pdesc.Name, res_desc->Name);
1813 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1814 "%u - %s: GetParameterDesc Semantic failed, got \"%s\", expected \"%s\"\n",
1815 i, res_full_name, pdesc.Semantic, res_desc->Semantic);
1816 ok(res_desc->Class == pdesc.Class, "%u - %s: GetParameterDesc Class failed, got %#x, expected %#x\n",
1817 i, res_full_name, pdesc.Class, res_desc->Class);
1818 ok(res_desc->Type == pdesc.Type, "%u - %s: GetParameterDesc Type failed, got %#x, expected %#x\n",
1819 i, res_full_name, pdesc.Type, res_desc->Type);
1820 ok(res_desc->Rows == pdesc.Rows, "%u - %s: GetParameterDesc Rows failed, got %u, expected %u\n",
1821 i, res_full_name, pdesc.Rows, res_desc->Rows);
1822 ok(res_desc->Columns == pdesc.Columns, "%u - %s: GetParameterDesc Columns failed, got %u, expected %u\n",
1823 i, res_full_name, pdesc.Columns, res_desc->Columns);
1824 ok(res_desc->Elements == pdesc.Elements, "%u - %s: GetParameterDesc Elements failed, got %u, expected %u\n",
1825 i, res_full_name, pdesc.Elements, res_desc->Elements);
1826 ok(res_desc->Annotations == pdesc.Annotations, "%u - %s: GetParameterDesc Annotations failed, got %u, expected %u\n",
1827 i, res_full_name, pdesc.Annotations, res_desc->Annotations);
1828 ok(res_desc->StructMembers == pdesc.StructMembers, "%u - %s: GetParameterDesc StructMembers failed, got %u, expected %u\n",
1829 i, res_full_name, pdesc.StructMembers, res_desc->StructMembers);
1830 ok(res_desc->Flags == pdesc.Flags, "%u - %s: GetParameterDesc Flags failed, got %u, expected %u\n",
1831 i, res_full_name, pdesc.Flags, res_desc->Flags);
1832 ok(res_desc->Bytes == pdesc.Bytes, "%u - %s: GetParameterDesc Bytes, got %u, expected %u\n",
1833 i, res_full_name, pdesc.Bytes, res_desc->Bytes);
1835 /* check size */
1836 ok(EFFECT_PARAMETER_VALUE_ARRAY_SIZE >= res_desc->Bytes / 4 +
1837 (res_desc->Elements ? res_desc->Bytes / 4 / res_desc->Elements : 0),
1838 "%u - %s: Warning: Array size too small\n", i, res_full_name);
1840 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1841 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1842 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1845 * check invalid calls
1846 * These will crash:
1847 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1848 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1849 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1850 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1851 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1852 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1853 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1854 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1855 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1856 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1857 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1858 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1859 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1860 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1862 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1863 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1864 i, res_full_name, hr, D3DERR_INVALIDCALL);
1866 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1867 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1868 i, res_full_name, hr, D3DERR_INVALIDCALL);
1870 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1871 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1872 i, res_full_name, hr, D3DERR_INVALIDCALL);
1874 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1875 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1876 i, res_full_name, hr, D3DERR_INVALIDCALL);
1878 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1879 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1880 i, res_full_name, hr, D3DERR_INVALIDCALL);
1882 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1883 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1884 i, res_full_name, hr, D3DERR_INVALIDCALL);
1886 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1887 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
1888 i, res_full_name, hr, D3DERR_INVALIDCALL);
1890 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1891 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1892 i, res_full_name, hr, D3DERR_INVALIDCALL);
1894 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1895 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1896 i, res_full_name, hr, D3DERR_INVALIDCALL);
1898 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1899 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
1900 i, res_full_name, hr, D3DERR_INVALIDCALL);
1902 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1903 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1904 i, res_full_name, hr, D3DERR_INVALIDCALL);
1906 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1907 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1908 i, res_full_name, hr, D3DERR_INVALIDCALL);
1910 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1911 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
1912 i, res_full_name, hr, D3DERR_INVALIDCALL);
1914 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1915 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1916 i, res_full_name, hr, D3DERR_INVALIDCALL);
1918 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1919 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1920 i, res_full_name, hr, D3DERR_INVALIDCALL);
1922 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1923 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
1924 i, res_full_name, hr, D3DERR_INVALIDCALL);
1926 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1927 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1928 i, res_full_name, hr, D3DERR_INVALIDCALL);
1930 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1931 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1932 i, res_full_name, hr, D3DERR_INVALIDCALL);
1934 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1935 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
1936 i, res_full_name, hr, D3DERR_INVALIDCALL);
1938 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1939 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1940 i, res_full_name, hr, D3DERR_INVALIDCALL);
1942 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1943 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1944 i, res_full_name, hr, D3DERR_INVALIDCALL);
1946 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1947 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
1948 i, res_full_name, hr, D3DERR_INVALIDCALL);
1950 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1951 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1952 i, res_full_name, hr, D3DERR_INVALIDCALL);
1954 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1955 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1956 i, res_full_name, hr, D3DERR_INVALIDCALL);
1958 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1959 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
1960 i, res_full_name, hr, D3DERR_INVALIDCALL);
1962 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1963 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1964 i, res_full_name, hr, D3DERR_INVALIDCALL);
1966 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1967 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
1968 i, res_full_name, hr, D3DERR_INVALIDCALL);
1970 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1971 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1972 i, res_full_name, hr, D3DERR_INVALIDCALL);
1974 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1975 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1976 i, res_full_name, hr, D3DERR_INVALIDCALL);
1978 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1979 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1980 i, res_full_name, hr, D3DERR_INVALIDCALL);
1982 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
1983 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1984 i, res_full_name, hr, D3DERR_INVALIDCALL);
1986 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
1987 ok(hr == D3D_OK, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1988 i, res_full_name, hr, D3D_OK);
1990 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1991 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1992 i, res_full_name, hr, D3DERR_INVALIDCALL);
1994 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1995 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1996 i, res_full_name, hr, D3DERR_INVALIDCALL);
1998 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1999 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2000 i, res_full_name, hr, D3DERR_INVALIDCALL);
2002 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
2003 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
2004 i, res_full_name, hr, D3DERR_INVALIDCALL);
2006 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
2007 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
2008 i, res_full_name, hr, D3DERR_INVALIDCALL);
2010 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2011 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2012 i, res_full_name, hr, D3DERR_INVALIDCALL);
2014 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2015 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
2016 i, res_full_name, hr, D3DERR_INVALIDCALL);
2018 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2019 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
2020 i, res_full_name, hr, D3DERR_INVALIDCALL);
2022 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
2023 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2024 i, res_full_name, hr, D3DERR_INVALIDCALL);
2026 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
2027 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2028 i, res_full_name, hr, D3DERR_INVALIDCALL);
2030 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
2031 ok(hr == D3D_OK, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2032 i, res_full_name, hr, D3D_OK);
2034 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
2035 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2036 i, res_full_name, hr, D3DERR_INVALIDCALL);
2038 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2039 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2040 i, res_full_name, hr, D3DERR_INVALIDCALL);
2042 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
2043 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
2044 i, res_full_name, hr, D3DERR_INVALIDCALL);
2046 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2047 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
2048 i, res_full_name, hr, D3DERR_INVALIDCALL);
2050 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
2051 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
2052 i, res_full_name, hr, D3DERR_INVALIDCALL);
2054 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2055 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
2056 i, res_full_name, hr, D3DERR_INVALIDCALL);
2058 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
2060 /* SetBool */
2061 bvalue = 5;
2062 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2063 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
2064 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2066 bvalue = TRUE;
2067 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
2068 ok(hr == D3D_OK, "%u - %s: SetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2070 else
2072 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
2073 i, res_full_name, hr, D3DERR_INVALIDCALL);
2075 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2076 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2078 /* SetBoolArray */
2079 *input_value = 1;
2080 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
2082 *(input_value + l) = *(input_value + l - 1) + 1;
2084 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2085 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
2086 if (res_desc->Class == D3DXPC_SCALAR
2087 || res_desc->Class == D3DXPC_VECTOR
2088 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2090 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2092 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
2094 ok(hr == D3D_OK, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2096 else
2098 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
2099 i, res_full_name, hr, D3DERR_INVALIDCALL);
2101 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2102 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2104 /* SetInt */
2105 ivalue = 0x1fbf02ff;
2106 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2107 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2108 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2110 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2111 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2113 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2114 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2115 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2117 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2118 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2119 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2120 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2121 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2122 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2123 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2124 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2126 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2127 i, res_full_name, hr, D3D_OK);
2129 else
2131 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2132 i, res_full_name, hr, D3DERR_INVALIDCALL);
2134 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2135 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2137 /* SetIntArray */
2138 *input_value = 123456;
2139 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2141 *(input_value + l) = *(input_value + l - 1) + 23;
2143 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2144 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2145 if (res_desc->Class == D3DXPC_SCALAR
2146 || res_desc->Class == D3DXPC_VECTOR
2147 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2149 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2151 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2153 ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2155 else
2157 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
2158 i, res_full_name, hr, D3DERR_INVALIDCALL);
2160 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2161 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2163 /* SetFloat */
2164 fvalue = 1.33;
2165 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2166 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2167 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2169 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2170 ok(hr == D3D_OK, "%u - %s: SetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2172 else
2174 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
2175 i, res_full_name, hr, D3DERR_INVALIDCALL);
2177 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2178 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2180 /* SetFloatArray */
2181 fvalue = 1.33;
2182 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2184 *(input_value + l) = *(DWORD *)&fvalue;
2185 fvalue += 1.12;
2187 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2188 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2189 if (res_desc->Class == D3DXPC_SCALAR
2190 || res_desc->Class == D3DXPC_VECTOR
2191 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2193 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2195 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2197 ok(hr == D3D_OK, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2199 else
2201 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
2202 i, res_full_name, hr, D3DERR_INVALIDCALL);
2204 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2205 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2207 /* SetVector */
2208 fvalue = -1.33;
2209 for (l = 0; l < 4; ++l)
2211 *(input_value + l) = *(DWORD *)&fvalue;
2212 fvalue += 1.12;
2214 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2215 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2216 if (!res_desc->Elements &&
2217 (res_desc->Class == D3DXPC_SCALAR
2218 || res_desc->Class == D3DXPC_VECTOR))
2220 /* only values between 0 and INT_FLOAT_MULTI are valid */
2221 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2223 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2224 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2225 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2226 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2228 else
2230 for (l = 0; l < 4; ++l)
2232 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2235 ok(hr == D3D_OK, "%u - %s: SetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2237 else
2239 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
2240 i, res_full_name, hr, D3DERR_INVALIDCALL);
2242 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2243 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2245 /* SetVectorArray */
2246 for (element = 0; element < res_desc->Elements + 1; ++element)
2248 fvalue = 1.33;
2249 for (l = 0; l < element * 4; ++l)
2251 *(input_value + l) = *(DWORD *)&fvalue;
2252 fvalue += 1.12;
2254 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2255 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
2256 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
2258 for (m = 0; m < element; ++m)
2260 for (l = 0; l < res_desc->Columns; ++l)
2262 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2265 ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2267 else
2269 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
2270 i, res_full_name, hr, D3DERR_INVALIDCALL);
2272 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2273 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2276 /* SetMatrix */
2277 fvalue = 1.33;
2278 for (l = 0; l < 16; ++l)
2280 *(input_value + l) = *(DWORD *)&fvalue;
2281 fvalue += 1.12;
2283 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2284 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2285 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2287 for (l = 0; l < 4; ++l)
2289 for (m = 0; m < 4; ++m)
2291 if (m < res_desc->Rows && l < res_desc->Columns)
2292 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2293 input_value + l + m * 4, D3DXPT_FLOAT);
2297 ok(hr == D3D_OK, "%u - %s: SetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2299 else
2301 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
2302 i, res_full_name, hr, D3DERR_INVALIDCALL);
2304 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2305 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2307 /* SetMatrixArray */
2308 for (element = 0; element < res_desc->Elements + 1; ++element)
2310 fvalue = 1.33;
2311 for (l = 0; l < element * 16; ++l)
2313 *(input_value + l) = *(DWORD *)&fvalue;
2314 fvalue += 1.12;
2316 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2317 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2318 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2320 for (n = 0; n < element; ++n)
2322 for (l = 0; l < 4; ++l)
2324 for (m = 0; m < 4; ++m)
2326 if (m < res_desc->Rows && l < res_desc->Columns)
2327 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2328 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2333 ok(hr == D3D_OK, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2335 else
2337 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
2338 i, res_full_name, hr, D3DERR_INVALIDCALL);
2340 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2341 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2344 /* SetMatrixPointerArray */
2345 for (element = 0; element < res_desc->Elements + 1; ++element)
2347 fvalue = 1.33;
2348 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2350 *(input_value + l) = *(DWORD *)&fvalue;
2351 fvalue += 1.12;
2353 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2354 for (l = 0; l < element; ++l)
2356 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2358 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
2359 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2361 for (n = 0; n < element; ++n)
2363 for (l = 0; l < 4; ++l)
2365 for (m = 0; m < 4; ++m)
2367 if (m < res_desc->Rows && l < res_desc->Columns)
2368 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2369 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2374 ok(hr == D3D_OK, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2375 i, res_full_name, hr, D3D_OK);
2377 else
2379 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2380 i, res_full_name, hr, D3DERR_INVALIDCALL);
2382 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2383 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2386 /* SetMatrixTranspose */
2387 fvalue = 1.33;
2388 for (l = 0; l < 16; ++l)
2390 *(input_value + l) = *(DWORD *)&fvalue;
2391 fvalue += 1.12;
2393 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2394 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2395 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2397 for (l = 0; l < 4; ++l)
2399 for (m = 0; m < 4; ++m)
2401 if (m < res_desc->Rows && l < res_desc->Columns)
2402 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2403 input_value + l * 4 + m, D3DXPT_FLOAT);
2407 ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2409 else
2411 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2412 i, res_full_name, hr, D3DERR_INVALIDCALL);
2414 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2415 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2417 /* SetMatrixTransposeArray */
2418 for (element = 0; element < res_desc->Elements + 1; ++element)
2420 fvalue = 1.33;
2421 for (l = 0; l < element * 16; ++l)
2423 *(input_value + l) = *(DWORD *)&fvalue;
2424 fvalue += 1.12;
2426 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2427 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2428 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2430 for (n = 0; n < element; ++n)
2432 for (l = 0; l < 4; ++l)
2434 for (m = 0; m < 4; ++m)
2436 if (m < res_desc->Rows && l < res_desc->Columns)
2437 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2438 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2443 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2445 else
2447 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2448 i, res_full_name, hr, D3DERR_INVALIDCALL);
2450 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2451 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2454 /* SetMatrixTransposePointerArray */
2455 for (element = 0; element < res_desc->Elements + 1; ++element)
2457 fvalue = 1.33;
2458 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2460 *(input_value + l) = *(DWORD *)&fvalue;
2461 fvalue += 1.12;
2463 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2464 for (l = 0; l < element; ++l)
2466 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2468 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
2469 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2471 for (n = 0; n < element; ++n)
2473 for (l = 0; l < 4; ++l)
2475 for (m = 0; m < 4; ++m)
2477 if (m < res_desc->Rows && l < res_desc->Columns)
2478 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2479 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2484 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2485 i, res_full_name, hr, D3D_OK);
2487 else
2489 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2490 i, res_full_name, hr, D3DERR_INVALIDCALL);
2492 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2493 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2497 count = effect->lpVtbl->Release(effect);
2498 ok(!count, "Release failed %u\n", count);
2502 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2504 static const char expected_string[] = "test_string_1";
2505 static const char expected_string2[] = "test_longer_string_2";
2506 static const char *expected_string_array[] = {expected_string, expected_string2};
2507 const char *string_array[ARRAY_SIZE(expected_string_array)];
2508 const char *string, *string2;
2509 IDirect3DTexture9 *texture_set;
2510 IDirect3DTexture9 *texture;
2511 D3DXHANDLE parameter;
2512 ID3DXEffect *effect;
2513 unsigned int i;
2514 ULONG count;
2515 HRESULT hr;
2517 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2518 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2519 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2521 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2522 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2524 texture = NULL;
2525 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2526 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2527 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2528 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2529 texture_set = NULL;
2530 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2531 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2532 ok(texture == texture_set, "Texture does not match.\n");
2534 count = IDirect3DTexture9_Release(texture_set);
2535 ok(count == 2, "Got reference count %u, expected 2.\n", count);
2536 texture_set = NULL;
2537 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2538 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2539 count = IDirect3DTexture9_Release(texture);
2540 ok(!count, "Got reference count %u, expected 0.\n", count);
2542 hr = effect->lpVtbl->SetString(effect, "s", expected_string);
2543 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2544 string = NULL;
2545 hr = effect->lpVtbl->GetString(effect, "s", &string);
2546 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2547 hr = effect->lpVtbl->GetString(effect, "s", &string2);
2548 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2550 ok(string != expected_string, "String pointers are the same.\n");
2551 ok(string == string2, "String pointers differ.\n");
2552 ok(!strcmp(string, expected_string), "Unexpected string '%s'.\n", string);
2554 string = expected_string2;
2555 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) - 1);
2556 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
2557 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string));
2558 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2559 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) * 2);
2560 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2561 string = NULL;
2562 hr = effect->lpVtbl->GetValue(effect, "s", &string, sizeof(string));
2563 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2565 ok(string != expected_string2, "String pointers are the same.\n");
2566 ok(!strcmp(string, expected_string2), "Unexpected string '%s'.\n", string);
2568 hr = effect->lpVtbl->SetValue(effect, "s_2", expected_string_array,
2569 sizeof(expected_string_array));
2570 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2571 hr = effect->lpVtbl->GetValue(effect, "s_2", string_array,
2572 sizeof(string_array));
2573 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2574 for (i = 0; i < ARRAY_SIZE(expected_string_array); ++i)
2576 ok(!strcmp(string_array[i], expected_string_array[i]), "Unexpected string '%s', i %u.\n",
2577 string_array[i], i);
2579 effect->lpVtbl->Release(effect);
2583 * fxc.exe /Tfx_2_0
2585 #if 0
2586 float a = 2.1;
2587 float b[1];
2588 float c <float d = 3;>;
2589 struct {float e;} f;
2590 float g <float h[1] = {3};>;
2591 struct s {float j;};
2592 float i <s k[1] = {4};>;
2593 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2594 #endif
2595 static const DWORD test_effect_variable_names_blob[] =
2597 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2598 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2599 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2600 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2601 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2602 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2603 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2604 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2605 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2606 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2607 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2608 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2609 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2610 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2611 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2612 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2613 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2614 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2615 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2616 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2617 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2618 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2619 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2620 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2621 0x000001f4, 0x00000000, 0x00000000,
2624 static void test_effect_variable_names(IDirect3DDevice9 *device)
2626 ID3DXEffect *effect;
2627 ULONG count;
2628 HRESULT hr;
2629 D3DXHANDLE parameter, p;
2631 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2632 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2633 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2636 * check invalid calls
2637 * This will crash:
2638 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2640 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2641 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2643 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2644 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2646 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2647 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2649 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2650 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2652 /* float a; */
2653 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2654 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2656 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2657 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2659 /* members */
2660 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2661 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2663 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2664 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2666 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2667 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2669 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2670 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2672 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2673 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2675 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2676 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2678 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2679 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2681 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2682 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2684 /* elements */
2685 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2686 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2688 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2689 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2691 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2692 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2694 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2695 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2697 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2698 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2700 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2701 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2703 /* annotations */
2704 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2705 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2707 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2708 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2710 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2711 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2713 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2714 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2716 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2717 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2719 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2720 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2722 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2723 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2725 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2726 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2728 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2729 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2731 /* float b[1]; */
2732 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2733 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2735 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2736 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2738 /* elements */
2739 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2740 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2742 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2743 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2745 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2746 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2748 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2749 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2751 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2752 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2754 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2755 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2757 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2758 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2760 /* float c <float d = 3;>; */
2761 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2762 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2764 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2765 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2767 /* annotations */
2768 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2769 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2771 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2772 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2774 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2775 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2777 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2778 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2780 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2781 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2783 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2784 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2786 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2787 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2789 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2790 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2792 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2793 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2795 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2796 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2798 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2799 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2801 /* struct {float e;} f; */
2802 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2803 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2805 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2806 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2808 /* members */
2809 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2810 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2812 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2813 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2815 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2816 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2818 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2819 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2821 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2822 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2824 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2825 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2827 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2828 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2830 /* float g <float h[1] = {3};>; */
2831 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2832 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2834 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2835 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2837 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2838 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2840 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2841 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2843 /* struct s {float j;}; float i <s k[1] = {4};>; */
2844 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2845 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2847 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2848 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2850 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2851 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2853 /* technique t <s l[1] = {5};> */
2854 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2855 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2857 /* pass p <s m[1] = {6};> */
2858 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2859 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2861 count = effect->lpVtbl->Release(effect);
2862 ok(!count, "Release failed %u\n", count);
2865 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2867 ID3DXEffect *effect;
2868 ID3DXBuffer *compilation_errors;
2869 HRESULT hr;
2871 /* Test binary effect */
2872 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2873 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2874 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
2875 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2877 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2878 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2879 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2880 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2881 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2882 effect->lpVtbl->Release(effect);
2886 * fxc.exe /Tfx_2_0
2888 #if 0
2889 vertexshader vs_arr1[2] =
2893 vs_1_1
2894 def c0, 1, 1, 1, 1
2895 mov oPos, c0
2899 vs_2_0
2900 def c0, 2, 2, 2, 2
2901 mov oPos, c0
2905 sampler sampler1 =
2906 sampler_state
2908 MipFilter = LINEAR;
2911 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};
2912 technique tech0
2914 pass p0
2916 vertexshader = vs_arr1[1];
2917 VertexShaderConstant1[1] = 3.0f;
2918 VertexShaderConstant4[2] = 1;
2919 VertexShaderConstant1[3] = {2, 2, 2, 2};
2920 VertexShaderConstant4[4] = {4, 4, 4, 4, 5, 5, 5, 5, 6};
2921 BlendOp = 2;
2922 AlphaOp[3] = 4;
2923 ZEnable = true;
2924 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};
2925 ViewTransform=(camera);
2926 LightEnable[2] = TRUE;
2927 LightType[2] = POINT;
2928 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2929 Sampler[1] = sampler1;
2932 #endif
2933 static const DWORD test_effect_states_effect_blob[] =
2935 0xfeff0901, 0x00000368, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2936 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2937 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2938 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2939 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2940 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2941 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2942 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2943 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40400000, 0x00000003,
2944 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f800000, 0x00000003,
2945 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40000000, 0x40000000,
2946 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2947 0x00000001, 0x40800000, 0x40800000, 0x40800000, 0x40800000, 0x40a00000, 0x40a00000, 0x40a00000,
2948 0x40a00000, 0x40c00000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000009,
2949 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2950 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2951 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2952 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2953 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2954 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2955 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2956 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2957 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2958 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2959 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2960 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2961 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2962 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2963 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2964 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x0000035c, 0x00000000, 0x00000001, 0x00000354,
2965 0x00000000, 0x0000000e, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000001,
2966 0x00000114, 0x00000110, 0x0000009b, 0x00000002, 0x00000134, 0x00000130, 0x00000098, 0x00000003,
2967 0x00000160, 0x00000150, 0x0000009b, 0x00000004, 0x000001a0, 0x0000017c, 0x0000004b, 0x00000000,
2968 0x000001c0, 0x000001bc, 0x0000006b, 0x00000003, 0x000001e0, 0x000001dc, 0x00000000, 0x00000000,
2969 0x00000200, 0x000001fc, 0x0000007d, 0x00000001, 0x0000025c, 0x0000021c, 0x0000007c, 0x00000000,
2970 0x000002b8, 0x00000278, 0x00000091, 0x00000002, 0x000002d8, 0x000002d4, 0x00000084, 0x00000002,
2971 0x000002f8, 0x000002f4, 0x00000088, 0x00000002, 0x00000320, 0x00000314, 0x000000b2, 0x00000001,
2972 0x00000340, 0x0000033c, 0x00000002, 0x00000003, 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051,
2973 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000,
2974 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40000000, 0x40000000,
2975 0x40000000, 0x40000000, 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000,
2976 0xffffffff, 0x0000000d, 0x00000001, 0x00000009, 0x706d6173, 0x3172656c, 0x00000000, 0x00000000,
2977 0x00000000, 0xffffffff, 0x00000009, 0x00000000, 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443,
2978 0x0000001c, 0x0000008b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000088, 0x00000030,
2979 0x00000002, 0x00000004, 0x00000038, 0x00000048, 0x656d6163, 0xab006172, 0x00030003, 0x00040004,
2980 0x00000001, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2981 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2982 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
2983 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
2984 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10000004, 0x00000001, 0x00000000,
2985 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000004, 0x00000001, 0x00000000,
2986 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000004, 0x10000004, 0x00000001, 0x00000000,
2987 0x00000002, 0x00000008, 0x00000000, 0x00000004, 0x00000008, 0x10000004, 0x00000001, 0x00000000,
2988 0x00000002, 0x0000000c, 0x00000000, 0x00000004, 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
2989 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272,
2990 0x00005d31,
2992 #define TEST_EFFECT_STATES_VSHADER_POS 315
2994 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
2996 static void test_effect_clear_vconsts(IDirect3DDevice9 *device)
2998 unsigned int i;
2999 HRESULT hr;
3001 for (i = 0; i < 256; ++i)
3003 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
3004 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3008 static void test_effect_states(IDirect3DDevice9 *device)
3010 static const D3DMATRIX test_mat =
3012 -1.0f, 0.0f, 0.0f, 0.0f,
3013 0.0f, 0.0f, 0.0f, 0.0f,
3014 0.0f, 0.0f, 0.0f, 0.0f,
3015 0.0f, 0.0f, 0.0f, 0.0f
3016 }}};
3017 static const D3DMATRIX test_mat_camera =
3019 4.0f, 0.0f, 0.0f, 0.0f,
3020 0.0f, 0.0f, 0.0f, 0.0f,
3021 0.0f, 0.0f, 0.0f, 0.0f,
3022 0.0f, 0.0f, 0.0f, 6.0f
3023 }}};
3024 static const D3DMATRIX test_mat_world1 =
3026 2.0f, 0.0f, 0.0f, 0.0f,
3027 0.0f, 0.0f, 0.0f, 0.0f,
3028 0.0f, 0.0f, 0.0f, 0.0f,
3029 0.0f, 0.0f, 0.0f, 4.0f
3030 }}};
3032 IDirect3DVertexShader9 *vshader;
3033 ID3DXEffect *effect;
3034 UINT byte_code_size;
3035 D3DXVECTOR4 fvect;
3036 void *byte_code;
3037 D3DLIGHT9 light;
3038 D3DMATRIX mat;
3039 UINT npasses;
3040 DWORD value;
3041 HRESULT hr;
3042 BOOL bval;
3044 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
3045 NULL, NULL, 0, NULL, &effect, NULL);
3046 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3048 /* State affected in passes saved/restored even if no pass
3049 was performed. States not present in passes are not saved &
3050 restored */
3051 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3052 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3053 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
3054 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3056 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3057 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3058 ok(npasses == 1, "Expected 1 pass, got %u\n", npasses);
3060 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3061 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3062 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
3063 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3065 hr = effect->lpVtbl->End(effect);
3066 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3068 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3069 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3070 ok(value == 1, "Got result %u, expected %u.\n", value, 1);
3071 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
3072 ok(value == 2, "Got result %u, expected %u.\n", value, 2);
3074 /* Test states application in BeginPass. No states are restored
3075 on EndPass. */
3076 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
3077 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3078 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
3079 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3081 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3082 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3083 if (hr == D3D_OK)
3084 ok(!bval, "Got result %u, expected 0.\n", bval);
3086 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
3087 hr = effect->lpVtbl->Begin(effect, NULL, 0);
3088 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3090 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3091 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3092 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
3094 test_effect_clear_vconsts(device);
3096 hr = effect->lpVtbl->BeginPass(effect, 0);
3097 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3099 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3100 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3101 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
3103 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
3104 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3105 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
3107 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3108 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3109 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3111 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3112 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3113 ok(vshader != NULL, "Got NULL vshader.\n");
3114 if (vshader)
3116 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
3117 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3118 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
3119 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
3120 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3121 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
3122 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
3123 "Incorrect shader selected.\n");
3124 HeapFree(GetProcessHeap(), 0, byte_code);
3125 IDirect3DVertexShader9_Release(vshader);
3128 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3129 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3130 if (hr == D3D_OK)
3131 ok(bval, "Got result %u, expected TRUE.\n", bval);
3132 hr = IDirect3DDevice9_GetLight(device, 2, &light);
3133 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3134 if (hr == D3D_OK)
3135 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
3136 "Got unexpected light position (%f, %f, %f).\n", light.Position.x, light.Position.y, light.Position.z);
3138 /* Testing first value only for constants 1, 2 as the rest of the vector seem to
3139 * contain garbage data on native. */
3140 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, &fvect.x, 1);
3141 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3142 ok(fvect.x == 3.0f, "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3143 fvect.x, fvect.y, fvect.z, fvect.w);
3144 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 2, &fvect.x, 1);
3145 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3146 ok(fvect.x == 1.0f, "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3147 fvect.x, fvect.y, fvect.z, fvect.w);
3149 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, &fvect.x, 1);
3150 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3151 ok(fvect.x == 2.0f && fvect.y == 2.0f && fvect.z == 2.0f && fvect.w == 2.0f,
3152 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3153 fvect.x, fvect.y, fvect.z, fvect.w);
3155 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 4, &fvect.x, 1);
3156 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3157 ok(fvect.x == 4.0f && fvect.y == 4.0f && fvect.z == 4.0f && fvect.w == 4.0f,
3158 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3159 fvect.x, fvect.y, fvect.z, fvect.w);
3160 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 5, &fvect.x, 1);
3161 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3162 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
3163 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3164 fvect.x, fvect.y, fvect.z, fvect.w);
3165 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 6, &fvect.x, 1);
3166 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3167 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
3168 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3169 fvect.x, fvect.y, fvect.z, fvect.w);
3170 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 7, &fvect.x, 1);
3171 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3172 ok(!memcmp(&fvect, &fvect_filler, sizeof(fvect_filler)),
3173 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3174 fvect.x, fvect.y, fvect.z, fvect.w);
3176 hr = effect->lpVtbl->EndPass(effect);
3177 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3178 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3179 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3180 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3182 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
3183 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3184 ok(value, "Got result %u, expected TRUE.\n", value);
3186 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
3187 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3188 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %u.\n", value);
3190 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
3191 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3192 ok(value == 4, "Unexpected texture stage 3 AlphaOp %u.\n", value);
3194 hr = effect->lpVtbl->End(effect);
3195 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3197 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3198 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3199 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
3201 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3202 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3203 if (hr == D3D_OK)
3204 ok(!bval, "Got result %u, expected 0.\n", bval);
3206 /* State is not restored if effect is released without End call */
3207 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3208 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3210 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3211 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3213 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3214 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3216 effect->lpVtbl->Release(effect);
3218 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3219 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3220 ok(value == 3, "Got result %u, expected %u.\n", value, 1);
3224 * fxc.exe /Tfx_2_0
3226 #if 0
3227 float4 g_Pos1;
3228 float4 g_Pos2;
3229 float4 g_Selector[3] = {{0, 0, 0, 0}, {10, 10, 10, 10}, {5001, 5002, 5003, 5004}};
3231 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3232 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3233 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3235 float4 vect_sampler = {1, 2, 3, 4};
3237 float3 vec3 = {1001, 1002, 1003};
3239 int4 g_iVect = {4, 3, 2, 1};
3241 vertexshader vs_arr[3] =
3245 vs_1_0
3246 def c0, 1, 1, 1, 1
3247 mov oPos, c0
3251 vs_1_1
3252 def c0, 2, 2, 2, 2
3253 mov oPos, c0
3257 vs_2_0
3258 def c0, 3, 3, 3, 3
3259 mov oPos, c0
3263 float4x4 m4x4 = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}, {41, 42, 43, 44}};
3265 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3266 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3267 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3268 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3269 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3270 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3271 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3272 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3273 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3274 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3276 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3277 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3279 struct test_struct
3281 float3 v1;
3282 float fv;
3283 float4 v2;
3286 struct struct_array
3288 test_struct ts[2];
3291 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3292 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3293 struct_array ts3 = {{{1, 2, 3}, 4, {5, 6, 7, 8}}, {{9, 10, 11}, 12, {13, 14, 15, 16}}};
3295 float arr1[1] = {91};
3296 shared float arr2[2] = {92, 93};
3298 Texture2D tex1;
3299 Texture2D tex2;
3300 sampler sampler1 =
3301 sampler_state
3303 Texture = tex1;
3304 MinFilter = g_iVect.y;
3305 MagFilter = vect_sampler.x + vect_sampler.y;
3308 sampler samplers_array[2] =
3310 sampler_state
3312 MinFilter = 1;
3313 MagFilter = vect_sampler.x;
3315 sampler_state
3317 MinFilter = 2;
3318 MagFilter = vect_sampler.y;
3322 struct VS_OUTPUT
3324 float4 Position : POSITION;
3325 float2 TextureUV : TEXCOORD0;
3326 float4 Diffuse : COLOR0;
3328 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3329 float3 vNormal : NORMAL,
3330 float2 vTexCoord0 : TEXCOORD0,
3331 uniform int nNumLights,
3332 uniform bool bTexture)
3334 VS_OUTPUT Output;
3336 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3337 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3338 else
3339 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3340 Output.TextureUV = float2(0, 0);
3341 Output.Diffuse = 0;
3342 Output.Diffuse.xyz = mul(vPos, m4x3column);
3343 Output.Diffuse += mul(vPos, m3x4column);
3344 Output.Diffuse += mul(vPos, m3x4row);
3345 Output.Diffuse.xyz += mul(vPos, m4x3row);
3346 Output.Diffuse += mul(vPos, ts1[0].fv);
3347 Output.Diffuse += mul(vPos, ts1[0].v2);
3348 Output.Diffuse += mul(vPos, ts2[1].fv);
3349 Output.Diffuse += mul(vPos, ts2[1].v2);
3350 Output.Diffuse += mul(vPos, arr1[0]);
3351 Output.Diffuse += mul(vPos, arr2[1]);
3352 Output.Diffuse += mul(vPos, ts3.ts[1].fv);
3353 Output.Diffuse += mul(vPos, ts3.ts[1].v2);
3354 Output.Diffuse += tex2Dlod(sampler1, g_Pos1);
3355 Output.Diffuse += tex2Dlod(samplers_array[1], g_Pos1);
3356 return Output;
3359 VS_OUTPUT RenderSceneVS2(float4 vPos : POSITION)
3361 VS_OUTPUT Output;
3363 Output.Position = g_Pos1;
3364 Output.TextureUV = float2(0, 0);
3365 Output.Diffuse = 0;
3366 return Output;
3369 struct PS_OUTPUT
3371 float4 RGBColor : COLOR0; /* Pixel color */
3373 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3375 PS_OUTPUT Output;
3376 int i;
3378 Output.RGBColor = In.Diffuse;
3379 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3380 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3381 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3382 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3383 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3384 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3385 for (i = 0; i < g_iVect.x; ++i)
3386 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3387 if (mb[1][1])
3389 Output.RGBColor += sin(Output.RGBColor);
3390 Output.RGBColor += cos(Output.RGBColor);
3391 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3392 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3393 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3394 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3396 if (mb2x3column[0][0])
3398 Output.RGBColor += sin(Output.RGBColor);
3399 Output.RGBColor += cos(Output.RGBColor);
3400 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3401 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3402 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3403 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3405 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3406 Output.RGBColor += tex2D(samplers_array[0], In.TextureUV);
3407 return Output;
3410 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3411 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3413 technique tech0
3415 pass p0
3417 VertexShader = vs_arr2[g_iVect.w - 1];
3418 PixelShader = ps_arr[g_iVect.w - 1];
3420 LightEnable[0] = TRUE;
3421 LightEnable[1] = TRUE;
3422 LightEnable[2] = TRUE;
3423 LightEnable[3] = TRUE;
3424 LightEnable[4] = TRUE;
3425 LightEnable[5] = TRUE;
3426 LightEnable[6] = TRUE;
3427 LightEnable[7] = TRUE;
3428 LightType[0] = POINT;
3429 LightType[1] = POINT;
3430 LightType[2] = POINT;
3431 LightType[3] = POINT;
3432 LightType[4] = POINT;
3433 LightType[5] = POINT;
3434 LightType[6] = POINT;
3435 LightType[7] = POINT;
3436 LightDiffuse[0] = 1 / opvect1;
3437 LightDiffuse[1] = rsqrt(opvect1);
3438 LightDiffuse[2] = opvect1 * opvect2;
3439 LightDiffuse[3] = opvect1 + opvect2;
3440 LightDiffuse[4] = float4(opvect1 < opvect2);
3441 LightDiffuse[5] = float4(opvect1 >= opvect2);
3442 LightDiffuse[6] = -opvect1;
3443 LightDiffuse[7] = rcp(opvect1);
3445 LightAmbient[0] = frac(opvect1);
3446 LightAmbient[1] = min(opvect1, opvect2);
3447 LightAmbient[2] = max(opvect1, opvect2);
3448 LightAmbient[3] = sin(opvect1);
3449 LightAmbient[4] = cos(opvect1);
3450 LightAmbient[5] = 1e-2 / opvect1;
3451 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3452 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3454 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3455 dot(opvect1.zzzx, opvect2.xxyy), 0);
3456 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3457 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3458 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3459 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3460 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3462 FogEnable = TRUE;
3463 FogDensity = ts2[0].fv;
3464 FogStart = ts2[1].fv;
3465 PointScale_A = ts3.ts[0].fv;
3466 PointScale_B = ts3.ts[1].fv;
3468 pass p1
3470 VertexShader = vs_arr[g_iVect.z];
3473 #endif
3474 static const DWORD test_effect_preshader_effect_blob[] =
3476 0xfeff0901, 0x00001160, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3477 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3478 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3479 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3480 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3481 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3482 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3483 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3484 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3485 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3486 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3487 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3488 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3489 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3490 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3491 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3492 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3493 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3494 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3495 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3496 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3497 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3498 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3499 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3500 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3501 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3502 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3503 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3504 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3505 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3506 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3507 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3508 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3509 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3510 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3511 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3512 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3513 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3514 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3515 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3516 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3517 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3518 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3519 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3520 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3521 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3522 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3523 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3524 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3525 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3526 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3527 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3528 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3529 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3530 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3531 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3532 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3533 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3534 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3535 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3536 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3537 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3538 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3539 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3540 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3541 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3542 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3543 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3544 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3545 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3546 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3547 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3548 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3549 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3550 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3551 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3552 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3553 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3554 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3555 0x00000000, 0x0000000a, 0x00000004, 0x00000ab8, 0x00000000, 0x00000002, 0x00000001, 0x00000002,
3556 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3557 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3558 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3559 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000aa,
3560 0x00000100, 0x000009f4, 0x000009f0, 0x000000a9, 0x00000100, 0x00000a14, 0x00000a10, 0x00000002,
3561 0x000000aa, 0x00000100, 0x00000a34, 0x00000a30, 0x000000a9, 0x00000100, 0x00000a54, 0x00000a50,
3562 0x0000000f, 0x706d6173, 0x7372656c, 0x7272615f, 0x00007961, 0x00000010, 0x00000004, 0x00000ae8,
3563 0x00000000, 0x00000002, 0x00000007, 0x00000008, 0x00000008, 0x615f7376, 0x00327272, 0x0000000f,
3564 0x00000004, 0x00000b0c, 0x00000000, 0x00000001, 0x00000009, 0x00000007, 0x615f7370, 0x00007272,
3565 0x0000000a, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x0000000b, 0x0000000f,
3566 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3567 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3568 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3569 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3570 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3571 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3572 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3573 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3574 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3575 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3576 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3577 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3578 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3579 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3580 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3581 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3582 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3583 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3584 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3585 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3586 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3587 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3588 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3589 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3590 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3591 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3592 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3593 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3594 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3595 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3596 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3597 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3598 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3599 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3600 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3601 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3602 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3603 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3604 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3605 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3606 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3607 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3608 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3609 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3610 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3611 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3612 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3613 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x0000000c,
3614 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006,
3615 0x68636574, 0x00000030, 0x00000022, 0x00000001, 0x0000000e, 0x0000000d, 0x00000004, 0x00000020,
3616 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000, 0x00000000, 0x00000074, 0x00000090,
3617 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
3618 0x00000000, 0x00000000, 0x00000140, 0x0000015c, 0x00000000, 0x00000000, 0x00000178, 0x00000194,
3619 0x00000000, 0x00000000, 0x000001b8, 0x000001d4, 0x00000000, 0x00000000, 0x000001ec, 0x00000208,
3620 0x00000000, 0x00000000, 0x00000224, 0x00000238, 0x00000000, 0x00000000, 0x00000250, 0x0000026c,
3621 0x00000000, 0x00000000, 0x000002b8, 0x000002d4, 0x00000000, 0x00000000, 0x00000310, 0x0000032c,
3622 0x00000000, 0x00000000, 0x00000368, 0x00000384, 0x00000000, 0x00000000, 0x000003c4, 0x000003e0,
3623 0x00000000, 0x00000000, 0x00000420, 0x0000043c, 0x00000000, 0x00000000, 0x00000458, 0x00000474,
3624 0x00000000, 0x00000000, 0x00000494, 0x000004b0, 0x00000000, 0x00000000, 0x000004d4, 0x000004f0,
3625 0x00000000, 0x00000000, 0x00000518, 0x00000534, 0x00000000, 0x00000000, 0x00000558, 0x00000574,
3626 0x00000000, 0x00000000, 0x0000059c, 0x000005b8, 0x00000000, 0x00000000, 0x000005e0, 0x000005fc,
3627 0x00000000, 0x00000000, 0x00000624, 0x00000690, 0x00000000, 0x00000000, 0x000006d0, 0x0000073c,
3628 0x00000001, 0x00000000, 0x0000079c, 0x00000820, 0x00000000, 0x00000000, 0x00000888, 0x000008a4,
3629 0x00000000, 0x00000000, 0x000008b4, 0x000008d0, 0x00000001, 0x00000000, 0x000008e4, 0x000008f8,
3630 0x00000000, 0x00000000, 0x00000908, 0x0000091c, 0x00000000, 0x00000000, 0x0000092c, 0x00000998,
3631 0x00000000, 0x00000000, 0x000009dc, 0x00000a70, 0x00000000, 0x00000000, 0x00000acc, 0x00000ae0,
3632 0x00000001, 0x00000000, 0x00000af4, 0x00000b08, 0x00000000, 0x00000000, 0x00001154, 0x00000000,
3633 0x00000002, 0x0000112c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000b1c, 0x00000b18,
3634 0x00000093, 0x00000000, 0x00000b34, 0x00000b30, 0x00000091, 0x00000000, 0x00000b4c, 0x00000b48,
3635 0x00000091, 0x00000001, 0x00000b6c, 0x00000b68, 0x00000091, 0x00000002, 0x00000b8c, 0x00000b88,
3636 0x00000091, 0x00000003, 0x00000bac, 0x00000ba8, 0x00000091, 0x00000004, 0x00000bcc, 0x00000bc8,
3637 0x00000091, 0x00000005, 0x00000bec, 0x00000be8, 0x00000091, 0x00000006, 0x00000c0c, 0x00000c08,
3638 0x00000091, 0x00000007, 0x00000c2c, 0x00000c28, 0x00000084, 0x00000000, 0x00000c4c, 0x00000c48,
3639 0x00000084, 0x00000001, 0x00000c6c, 0x00000c68, 0x00000084, 0x00000002, 0x00000c8c, 0x00000c88,
3640 0x00000084, 0x00000003, 0x00000cac, 0x00000ca8, 0x00000084, 0x00000004, 0x00000ccc, 0x00000cc8,
3641 0x00000084, 0x00000005, 0x00000cec, 0x00000ce8, 0x00000084, 0x00000006, 0x00000d0c, 0x00000d08,
3642 0x00000084, 0x00000007, 0x00000d2c, 0x00000d28, 0x00000085, 0x00000000, 0x00000d58, 0x00000d48,
3643 0x00000085, 0x00000001, 0x00000d84, 0x00000d74, 0x00000085, 0x00000002, 0x00000db0, 0x00000da0,
3644 0x00000085, 0x00000003, 0x00000ddc, 0x00000dcc, 0x00000085, 0x00000004, 0x00000e08, 0x00000df8,
3645 0x00000085, 0x00000005, 0x00000e34, 0x00000e24, 0x00000085, 0x00000006, 0x00000e60, 0x00000e50,
3646 0x00000085, 0x00000007, 0x00000e8c, 0x00000e7c, 0x00000087, 0x00000000, 0x00000eb8, 0x00000ea8,
3647 0x00000087, 0x00000001, 0x00000ee4, 0x00000ed4, 0x00000087, 0x00000002, 0x00000f10, 0x00000f00,
3648 0x00000087, 0x00000003, 0x00000f3c, 0x00000f2c, 0x00000087, 0x00000004, 0x00000f68, 0x00000f58,
3649 0x00000087, 0x00000005, 0x00000f94, 0x00000f84, 0x00000087, 0x00000006, 0x00000fc0, 0x00000fb0,
3650 0x00000087, 0x00000007, 0x00000fec, 0x00000fdc, 0x00000086, 0x00000000, 0x00001018, 0x00001008,
3651 0x00000086, 0x00000001, 0x00001044, 0x00001034, 0x00000086, 0x00000002, 0x00001070, 0x00001060,
3652 0x0000000e, 0x00000000, 0x00001090, 0x0000108c, 0x00000014, 0x00000000, 0x000010b0, 0x000010ac,
3653 0x00000012, 0x00000000, 0x000010d0, 0x000010cc, 0x00000041, 0x00000000, 0x000010f0, 0x000010ec,
3654 0x00000042, 0x00000000, 0x00001110, 0x0000110c, 0x0000114c, 0x00000000, 0x00000001, 0x00000092,
3655 0x00000000, 0x00001138, 0x00001134, 0x00000008, 0x0000001f, 0x00000009, 0x00000ad0, 0xffff0300,
3656 0x00d9fffe, 0x42415443, 0x0000001c, 0x0000032f, 0xffff0300, 0x0000000b, 0x0000001c, 0x00000000,
3657 0x00000328, 0x000000f8, 0x00000001, 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x00080002,
3658 0x00000002, 0x0000012c, 0x0000013c, 0x0000015c, 0x00060002, 0x00000002, 0x00000164, 0x00000174,
3659 0x00000194, 0x00000002, 0x00000003, 0x000001a0, 0x000001b0, 0x000001e0, 0x000a0002, 0x00000002,
3660 0x000001e8, 0x000001f8, 0x00000218, 0x000c0002, 0x00000002, 0x00000224, 0x00000234, 0x00000254,
3661 0x00030002, 0x00000003, 0x0000025c, 0x0000026c, 0x0000029c, 0x00050000, 0x00000001, 0x000002a8,
3662 0x000002b8, 0x000002d0, 0x00000000, 0x00000005, 0x000002dc, 0x000002b8, 0x000002ec, 0x00000003,
3663 0x00000001, 0x000002f8, 0x00000000, 0x00000308, 0x00010003, 0x00000001, 0x00000318, 0x00000000,
3664 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x00000004, 0x00000003,
3665 0x00000002, 0x00000001, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001,
3666 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3667 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3668 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d,
3669 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3670 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000,
3671 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000,
3672 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3673 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000,
3674 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d,
3675 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3676 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000,
3677 0x00000000, 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00010003, 0x00030002, 0x00000001, 0x00000000,
3678 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x7832626d, 0x776f7233,
3679 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, 0x706d6173, 0x3172656c, 0xababab00,
3680 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c, 0x7272615f, 0xab007961,
3681 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x335f7370, 0x4d00305f, 0x6f726369, 0x74666f73,
3682 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3683 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, 0x3f800000, 0xbe22f983,
3684 0x05000051, 0xa00f000f, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x05000051, 0xa00f0010,
3685 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x0200001f, 0x80000005, 0x90030000, 0x0200001f,
3686 0x8000000a, 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801,
3687 0x03000005, 0x80030000, 0xa0e40007, 0x90550001, 0x04000004, 0x80030000, 0x90000001, 0xa0e40006,
3688 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40001, 0x02000001, 0x80010001, 0xa0000010,
3689 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3690 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000,
3691 0xa0440004, 0x90550001, 0x04000004, 0x800c0000, 0x90000001, 0xa0440003, 0x80e40000, 0x04000004,
3692 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000,
3693 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d,
3694 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, 0x90550001,
3695 0x04000004, 0x800e0001, 0x90000001, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001,
3696 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000,
3697 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002,
3698 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, 0x02000001,
3699 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000, 0x03000002, 0x80070003, 0x80e40002, 0x80e40003,
3700 0x00000027, 0x01000028, 0xe0e40804, 0x02000001, 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000,
3701 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000,
3702 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004,
3703 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002,
3704 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002,
3705 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003,
3706 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e,
3707 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, 0xa000000f,
3708 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002,
3709 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010, 0x04000004,
3710 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004,
3711 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003,
3712 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a,
3713 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002,
3714 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x800e0001, 0x80550000,
3715 0xa090000b, 0x04000004, 0x800e0001, 0x80000000, 0xa090000a, 0x80e40001, 0x03000002, 0x80070003,
3716 0x80e40000, 0x80f90001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000,
3717 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000,
3718 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000, 0x04000004,
3719 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000,
3720 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001, 0x0000002b, 0x01000028, 0xe0e40805, 0x04000004,
3721 0x800f0000, 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004,
3722 0x800f0000, 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000,
3723 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3724 0x80e40002, 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004,
3725 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002,
3726 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000,
3727 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3728 0xa000000f, 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004,
3729 0x80e40002, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010,
3730 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002,
3731 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002,
3732 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001,
3733 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003,
3734 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x80070001,
3735 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000, 0xa0e4000a, 0x80e40001, 0x03000002,
3736 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008,
3737 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005,
3738 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000,
3739 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000,
3740 0x80e40000, 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0000,
3741 0x80e40000, 0x80e40003, 0x03000042, 0x800f0001, 0x90e40000, 0xa0e40801, 0x03000002, 0x800f0800,
3742 0x80e40000, 0x80e40001, 0x0000ffff, 0x00000007, 0x00000b6c, 0xfffe0300, 0x013cfffe, 0x42415443,
3743 0x0000001c, 0x000004bb, 0xfffe0300, 0x0000000c, 0x0000001c, 0x00000000, 0x000004b4, 0x0000010c,
3744 0x00200002, 0x00000001, 0x00000114, 0x00000124, 0x00000134, 0x001d0002, 0x00000002, 0x0000013c,
3745 0x0000014c, 0x0000016c, 0x001f0002, 0x00000001, 0x00000174, 0x00000184, 0x00000194, 0x00100002,
3746 0x00000004, 0x000001a0, 0x000001b0, 0x000001f0, 0x00140002, 0x00000003, 0x000001f8, 0x00000208,
3747 0x00000238, 0x00170002, 0x00000003, 0x00000244, 0x00000254, 0x00000284, 0x000c0002, 0x00000004,
3748 0x0000028c, 0x0000029c, 0x000002dc, 0x00020003, 0x00000001, 0x000002e8, 0x00000000, 0x000002f8,
3749 0x00000003, 0x00000002, 0x00000308, 0x00000000, 0x00000318, 0x001a0002, 0x00000003, 0x00000370,
3750 0x00000380, 0x000003b0, 0x00000002, 0x00000006, 0x000003b4, 0x000003c4, 0x00000424, 0x00060002,
3751 0x00000006, 0x00000444, 0x00000454, 0x31727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001,
3752 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, 0x32727261, 0xababab00, 0x00030000,
3753 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, 0x00000000, 0x00000000, 0x42ba0000,
3754 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3755 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63, 0xab006e6d,
3756 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x00000000,
3757 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000, 0x00000000,
3758 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002, 0x00040003,
3759 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3760 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d, 0x756c6f63,
3761 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3762 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000,
3763 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000, 0x41300000,
3764 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, 0x41f80000,
3765 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000, 0x706d6173,
3766 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c,
3767 0x7272615f, 0xab007961, 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x00317374, 0xab003176,
3768 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3769 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0000031c, 0x00000320,
3770 0x00000330, 0x00000334, 0x00000344, 0x00000348, 0x00000005, 0x00080001, 0x00030001, 0x00000358,
3771 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000,
3772 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005, 0x00080001, 0x00030002,
3773 0x00000358, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3774 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000,
3775 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3776 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001, 0x00030002, 0x00000358, 0x00000428,
3777 0x0000042c, 0x00000005, 0x00100001, 0x00010001, 0x0000043c, 0x3f800000, 0x40000000, 0x40400000,
3778 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3779 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000,
3780 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x335f7376, 0x4d00305f, 0x6f726369,
3781 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3782 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250, 0x46580201, 0x0047fffe, 0x42415443,
3783 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c, 0x00000100, 0x000000e4, 0x00000058,
3784 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088,
3785 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173,
3786 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3787 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c,
3788 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3789 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800,
3790 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3791 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250,
3792 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000021,
3793 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018, 0x00000000, 0x00000000,
3794 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3795 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3796 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3797 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3fe00000,
3798 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000, 0x00000000, 0x40100000,
3799 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000, 0x0064fffe, 0x434c5846,
3800 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011, 0x00000000, 0x00000002,
3801 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3802 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000004, 0xa0500004,
3803 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002, 0x0000000c, 0x00000000,
3804 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3805 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004, 0x00000001, 0x00000000,
3806 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000,
3807 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x0000000c,
3808 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000002, 0x00000005,
3809 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3810 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004, 0x20400004, 0x00000002,
3811 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004,
3812 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f0022, 0x00000000, 0x00000000,
3813 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0801,
3814 0x0200001f, 0x90000000, 0xa00f0802, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005,
3815 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017,
3816 0x03000009, 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019,
3817 0x03000008, 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011,
3818 0x03000008, 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013,
3819 0x02000001, 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005,
3820 0x800f0001, 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001,
3821 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000,
3822 0x80e40001, 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000,
3823 0xa0e4000c, 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004,
3824 0x80070001, 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001,
3825 0x04000004, 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000,
3826 0xa0e4001c, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000,
3827 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000,
3828 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004,
3829 0x800f0000, 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a,
3830 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000,
3831 0x80000001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40802, 0x03000002, 0x800f0000, 0x80e40000,
3832 0x80e40001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40801, 0x03000002, 0xe00f0002, 0x80e40000,
3833 0x80e40001, 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff,
3834 0x00000008, 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300,
3835 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73,
3836 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3837 0x332e3235, 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c,
3838 0x0000005b, 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3839 0x00000001, 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3840 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3841 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3842 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3843 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe,
3844 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000,
3845 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3846 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000,
3847 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001,
3848 0xe00f0000, 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001,
3849 0x0000ffff, 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101,
3850 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000,
3851 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000,
3852 0x40000000, 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003,
3853 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000,
3854 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
3855 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443,
3856 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
3857 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
3858 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
3859 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3860 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3861 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3862 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029,
3863 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200,
3864 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4,
3865 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3866 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3867 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064,
3868 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001,
3869 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3870 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3871 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3872 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3873 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3874 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3875 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3876 0x00000000, 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe,
3877 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114,
3878 0x00000030, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031,
3879 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3880 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c,
3881 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074,
3882 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000,
3883 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3884 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3885 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369,
3886 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3887 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3888 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3889 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027,
3890 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200,
3891 0x00000001, 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088,
3892 0x00000098, 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3893 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3894 0x00000000, 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005,
3895 0x00080001, 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3896 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3897 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3898 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3899 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3900 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001,
3901 0x00000000, 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3902 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200,
3903 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3904 0x000000f8, 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176,
3905 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3906 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038,
3907 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070,
3908 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3909 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000,
3910 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000,
3911 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3912 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3913 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004,
3914 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3915 0xffffffff, 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c,
3916 0x000001fb, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002,
3917 0x00000001, 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac,
3918 0x000000ec, 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001,
3919 0x000001d8, 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
3920 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004,
3921 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000,
3922 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000,
3923 0x42080000, 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001,
3924 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001,
3925 0x00040001, 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c,
3926 0x00000120, 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005,
3927 0x00100001, 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3928 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000,
3929 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000,
3930 0x41600000, 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001,
3931 0x00000000, 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3932 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3933 0x332e3235, 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000,
3934 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3935 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3936 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3937 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3938 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3939 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3940 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3941 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3942 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3943 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3944 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3945 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3946 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3947 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3948 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3949 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000,
3950 0x3ff00000, 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e,
3951 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e,
3952 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000,
3953 0x00000002, 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000,
3954 0x00000007, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001,
3955 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004,
3956 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3957 0x0000003c, 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3958 0x0000002f, 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004,
3959 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001,
3960 0x00000030, 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3961 0x0000001c, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007,
3962 0x00000009, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007,
3963 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002,
3964 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3965 0x00000000, 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3966 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002,
3967 0x00000000, 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030,
3968 0x00000000, 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041,
3969 0x00000000, 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002,
3970 0x0000002f, 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031,
3971 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003,
3972 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040,
3973 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000,
3974 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3975 0x00000000, 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe,
3976 0x42415443, 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130,
3977 0x0000006c, 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001,
3978 0x000000c0, 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108,
3979 0x00090002, 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3980 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3981 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67,
3982 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000,
3983 0x3f800000, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3984 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3985 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3986 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3987 0x332e3235, 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
3988 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3989 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3990 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3991 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3992 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3993 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3994 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3995 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3996 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3997 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3998 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3999 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4000 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4001 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4002 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008,
4003 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a,
4004 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000,
4005 0x00000002, 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000,
4006 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000,
4007 0x00000002, 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000,
4008 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
4009 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028,
4010 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001,
4011 0xa0400001, 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001,
4012 0x00000002, 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001,
4013 0x00000002, 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002,
4014 0x0000002b, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4015 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200,
4016 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
4017 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
4018 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4019 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
4020 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
4021 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4022 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
4023 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4024 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4025 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0061fffe,
4026 0x434c5846, 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
4027 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000,
4028 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001,
4029 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
4030 0x00000000, 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002,
4031 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
4032 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
4033 0x00000004, 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
4034 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4035 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002,
4036 0x00000005, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
4037 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
4038 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248,
4039 0x46580200, 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c,
4040 0x20000100, 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
4041 0x00010002, 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0,
4042 0x00000070, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4043 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
4044 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001,
4045 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4046 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4047 0x0022fffe, 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4048 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4049 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4050 0x00000000, 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000,
4051 0x00000000, 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002,
4052 0x00000000, 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
4053 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002,
4054 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002,
4055 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
4056 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4057 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0,
4058 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4059 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4060 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4061 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4062 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4063 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4064 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c,
4065 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4066 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4067 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4068 0x002afffe, 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4069 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002,
4070 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4071 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4072 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4073 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f,
4074 0x00000000, 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4075 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4076 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4077 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4078 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4079 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4080 0x00000000, 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000,
4081 0x00000000, 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001,
4082 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001,
4083 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001,
4084 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001,
4085 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002,
4086 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
4087 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e,
4088 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4089 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4090 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4091 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4092 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4093 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001,
4094 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4095 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200,
4096 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4097 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4098 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4099 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4100 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4101 0x000cfffe, 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4102 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4103 0xffffffff, 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
4104 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
4105 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
4106 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
4107 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4108 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4109 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4110 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004,
4111 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4112 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4113 0x0000001b, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
4114 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
4115 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
4116 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
4117 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
4118 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4119 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4120 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002,
4121 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4122 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a,
4123 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4124 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4125 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4126 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4127 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4128 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001,
4129 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4130 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200,
4131 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4132 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4133 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4134 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4135 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4136 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4137 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4138 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002,
4139 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003,
4140 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4141 0xffffffff, 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
4142 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
4143 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4144 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
4145 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
4146 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
4147 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
4148 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000,
4149 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
4150 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
4151 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
4152 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
4153 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
4154 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4155 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4156 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002,
4157 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4158 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124,
4159 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4160 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4161 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4162 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4163 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4164 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4165 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4166 0x000ffffe, 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4167 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4168 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200,
4169 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
4170 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
4171 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4172 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
4173 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
4174 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4175 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4176 0x434c5846, 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4177 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4178 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
4179 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
4180 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4181 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4182 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4183 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
4184 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4185 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4186 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
4187 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4188 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4189 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4190 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4191 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
4192 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4193 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4194 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4195 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4196 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4197 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4198 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012,
4199 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4200 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4201 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4202 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4203 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4204 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001,
4205 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001,
4206 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001,
4207 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001,
4208 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4209 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008,
4210 0x615f7370, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4211 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4212 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
4213 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4214 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4215 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4216 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000,
4217 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002,
4218 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004,
4219 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
4220 0x00000002, 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443,
4221 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
4222 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4223 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4224 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4225 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000,
4226 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000,
4227 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846,
4228 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001,
4229 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4230 0x0000001f, 0x00000001, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443,
4231 0x0000001c, 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030,
4232 0x00000002, 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00,
4233 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000,
4234 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4235 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4236 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4237 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001f,
4238 0x00000000, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c,
4239 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002,
4240 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001,
4241 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874,
4242 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4243 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4244 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4245 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000,
4246 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c, 0x00000063,
4247 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002, 0x00000001,
4248 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001, 0x00040001,
4249 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874, 0x6f726369,
4250 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4251 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4252 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
4253 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4254 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443,
4255 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4256 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4257 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4258 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4259 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
4260 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4261 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000, 0x00000000,
4262 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4264 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2991
4265 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4267 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4268 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4269 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4270 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4272 unsigned int i = 0;
4274 todo_wine_if(todo)
4275 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4277 if (!bytecode)
4278 return;
4280 while (bytecode[i++] != 0x0000ffff)
4283 if (!bytecode_size)
4284 bytecode_size = i * sizeof(*bytecode);
4285 else
4286 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4288 todo_wine_if(todo)
4289 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4290 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4291 "Incorrect shader selected.\n");
4294 #define test_effect_preshader_compare_shader(a, b, c) \
4295 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4296 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4297 int expected_shader_index, BOOL todo)
4299 IDirect3DVertexShader9 *vshader;
4300 void *byte_code;
4301 unsigned int byte_code_size;
4302 HRESULT hr;
4304 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4305 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#x.\n", hr);
4307 todo_wine_if(todo)
4308 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4309 if (!vshader)
4310 return;
4312 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4313 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#x.\n", hr);
4314 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4316 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
4317 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4318 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4320 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4321 byte_code_size, expected_shader_index, todo);
4323 HeapFree(GetProcessHeap(), 0, byte_code);
4324 IDirect3DVertexShader9_Release(vshader);
4327 static const struct
4329 const char *comment;
4330 BOOL todo[4];
4331 unsigned int result[4];
4332 unsigned int ulps;
4334 test_effect_preshader_op_expected[] =
4336 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4337 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4338 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4339 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4340 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4341 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4342 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4343 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4345 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4346 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4347 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4348 #if __x86_64__
4349 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4350 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4351 #else
4352 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4353 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4354 #endif
4355 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4356 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4357 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4359 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4360 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4361 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4364 enum expected_state_update
4366 EXPECTED_STATE_ZERO,
4367 EXPECTED_STATE_UPDATED,
4368 EXPECTED_STATE_ANYTHING
4371 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4372 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4373 const enum expected_state_update *expected_state, const char *updated_param)
4375 static const D3DCOLORVALUE black = {0.0f};
4376 unsigned int i, j;
4377 D3DLIGHT9 light;
4378 const float *v;
4379 HRESULT hr;
4381 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4383 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4384 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4386 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4387 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4389 for (j = 0; j < 4; ++j)
4391 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4392 ok_(__FILE__, line)(compare_float(v[j],
4393 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4394 test_effect_preshader_op_expected[i].ulps),
4395 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4396 test_effect_preshader_op_expected[i].comment, j,
4397 test_effect_preshader_op_expected[i].result[j],
4398 ((const unsigned int *)v)[j], v[j]);
4401 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4403 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4404 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4405 updated_param, i, test_effect_preshader_op_expected[i].comment);
4410 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4412 {0.0f, 0.0f, 0.0f, 0.0f},
4413 {0.0f, 0.0f, 0.0f, 0.0f},
4414 {0.0f, 0.0f, 0.0f, 0.0f},
4415 {1.0f, 2.0f, 3.0f, 0.0f},
4416 {4.0f, 0.0f, 0.0f, 0.0f},
4417 {5.0f, 6.0f, 7.0f, 8.0f},
4418 {1.0f, 2.0f, 3.0f, 0.0f},
4419 {4.0f, 0.0f, 0.0f, 0.0f},
4420 {5.0f, 6.0f, 7.0f, 8.0f},
4421 {9.0f, 10.0f, 11.0f, 0.0f},
4422 {12.0f, 0.0f, 0.0f, 0.0f},
4423 {13.0f, 14.0f, 15.0f, 16.0f},
4424 {11.0f, 12.0f, 13.0f, 0.0f},
4425 {21.0f, 22.0f, 23.0f, 0.0f},
4426 {31.0f, 32.0f, 33.0f, 0.0f},
4427 {41.0f, 42.0f, 43.0f, 0.0f},
4428 {11.0f, 21.0f, 31.0f, 0.0f},
4429 {12.0f, 22.0f, 32.0f, 0.0f},
4430 {13.0f, 23.0f, 33.0f, 0.0f},
4431 {14.0f, 24.0f, 34.0f, 0.0f},
4432 {11.0f, 12.0f, 13.0f, 14.0f},
4433 {21.0f, 22.0f, 23.0f, 24.0f},
4434 {31.0f, 32.0f, 33.0f, 34.0f},
4435 {11.0f, 21.0f, 31.0f, 41.0f},
4436 {12.0f, 22.0f, 32.0f, 42.0f},
4437 {13.0f, 23.0f, 33.0f, 43.0f},
4438 {9.0f, 10.0f, 11.0f, 0.0f},
4439 {12.0f, 0.0f, 0.0f, 0.0f},
4440 {13.0f, 14.0f, 15.0f, 16.0f},
4441 {92.0f, 0.0f, 0.0f, 0.0f},
4442 {93.0f, 0.0f, 0.0f, 0.0f},
4443 {0.0f, 0.0f, 0.0f, 0.0f},
4444 {91.0f, 0.0f, 0.0f, 0.0f},
4445 {4.0f, 5.0f, 6.0f, 7.0f},
4447 #define TEST_EFFECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4449 #define test_effect_preshader_compare_vconsts(a, b, c) \
4450 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4451 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4452 const unsigned int *const_updated_mask, const char *updated_param)
4454 HRESULT hr;
4455 unsigned int i;
4456 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4458 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4459 ARRAY_SIZE(test_effect_preshader_fvect_v));
4460 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4462 if (!const_updated_mask)
4464 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4465 "Vertex shader float constants do not match.\n");
4467 else
4469 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4471 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4472 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4474 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4475 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), "
4476 "got (%g, %g, %g, %g), parameter %s.\n",
4477 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4478 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4479 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4481 else
4483 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4484 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4489 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4491 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4492 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4493 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4494 "Vertex shader float constants do not match.\n");
4498 static const BOOL test_effect_preshader_bconsts[] =
4500 TRUE, FALSE, TRUE, FALSE, TRUE, TRUE
4503 static void test_effect_preshader_clear_pbool_consts(IDirect3DDevice9 *device)
4505 BOOL bval;
4506 unsigned int i;
4507 HRESULT hr;
4509 for (i = 0; i < 16; ++i)
4511 bval = i < ARRAY_SIZE(test_effect_preshader_bconsts) ? !test_effect_preshader_bconsts[i] : FALSE;
4512 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4513 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4517 #define test_effect_preshader_compare_pbool_consts(a, b, c) \
4518 test_effect_preshader_compare_pbool_consts_(__LINE__, a, b, c)
4519 static void test_effect_preshader_compare_pbool_consts_(unsigned int line, IDirect3DDevice9 *device,
4520 const unsigned int *const_updated_mask, const char *updated_param)
4522 unsigned int i;
4523 BOOL bdata[16];
4524 HRESULT hr;
4526 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, ARRAY_SIZE(bdata));
4527 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4529 if (!const_updated_mask)
4531 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4533 /* The negation on both sides is actually needed, sometimes you
4534 * get 0xffffffff instead of 1 on native. */
4535 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4536 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u.\n",
4537 test_effect_preshader_bconsts[i], bdata[i], i);
4540 else
4542 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4544 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4545 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4547 /* The negation on both sides is actually needed, sometimes
4548 * you get 0xffffffff instead of 1 on native. */
4549 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4550 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u, parameter %s.\n",
4551 test_effect_preshader_bconsts[i], bdata[i], i, updated_param);
4553 else
4555 ok_(__FILE__, line)(bdata[i] == !test_effect_preshader_bconsts[i],
4556 "Pixel shader boolean constants updated unexpectedly, parameter %s.\n", updated_param);
4561 for (; i < 16; ++i)
4563 ok_(__FILE__, line)(!bdata[i], "Got result %#x, boolean register value %u.\n", hr, bdata[i]);
4567 static void test_effect_preshader(IDirect3DDevice9 *device)
4569 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4571 {11.0f, 21.0f, 0.0f, 0.0f},
4572 {12.0f, 22.0f, 0.0f, 0.0f},
4573 {13.0f, 23.0f, 0.0f, 0.0f},
4574 {11.0f, 12.0f, 0.0f, 0.0f},
4575 {21.0f, 22.0f, 0.0f, 0.0f},
4576 {31.0f, 32.0f, 0.0f, 0.0f},
4577 {11.0f, 12.0f, 0.0f, 0.0f},
4578 {21.0f, 22.0f, 0.0f, 0.0f},
4579 {11.0f, 21.0f, 0.0f, 0.0f},
4580 {12.0f, 22.0f, 0.0f, 0.0f},
4581 {11.0f, 12.0f, 13.0f, 0.0f},
4582 {21.0f, 22.0f, 23.0f, 0.0f},
4583 {11.0f, 21.0f, 31.0f, 0.0f},
4584 {12.0f, 22.0f, 32.0f, 0.0f}
4586 static const int test_effect_preshader_iconsts[][4] =
4588 {4, 3, 2, 1}
4590 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4591 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4592 static const int ivect_empty[4] = {-1, -1, -1, -1};
4593 HRESULT hr;
4594 ID3DXEffect *effect;
4595 D3DXHANDLE par;
4596 unsigned int npasses;
4597 DWORD value;
4598 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4599 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4600 IDirect3DVertexShader9 *vshader;
4601 unsigned int i;
4602 D3DCAPS9 caps;
4604 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4605 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
4606 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4607 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4609 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4610 return;
4613 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4614 NULL, NULL, 0, NULL, &effect, NULL);
4615 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4617 test_effect_clear_vconsts(device);
4619 for (i = 0; i < 224; ++i)
4621 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4622 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4625 test_effect_preshader_clear_pbool_consts(device);
4627 for (i = 0; i < 16; ++i)
4629 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4630 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4633 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4634 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4636 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4637 ok(par != NULL, "GetParameterByName failed.\n");
4639 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4640 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4642 hr = effect->lpVtbl->BeginPass(effect, 0);
4643 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4645 hr = effect->lpVtbl->BeginPass(effect, 0);
4646 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4648 hr = effect->lpVtbl->BeginPass(effect, 1);
4649 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4651 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4653 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4654 ARRAY_SIZE(test_effect_preshader_fvect_p));
4655 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4656 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4657 "Pixel shader float constants do not match.\n");
4658 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4660 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4661 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4662 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4663 "Pixel shader float constants do not match.\n");
4665 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4666 ARRAY_SIZE(test_effect_preshader_iconsts));
4667 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4668 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4669 "Pixel shader integer constants do not match.\n");
4670 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4672 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4673 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4674 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4675 "Pixel shader integer constants do not match.\n");
4678 test_effect_preshader_compare_pbool_consts(device, NULL, NULL);
4680 test_effect_preshader_op_results(device, NULL, NULL);
4682 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4683 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4684 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4685 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4686 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4687 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4689 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4690 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4691 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4692 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4693 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4694 todo_wine
4695 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4697 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4698 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4699 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4700 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4701 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4702 todo_wine
4703 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4705 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4706 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4707 todo_wine
4708 ok(value == 0, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4709 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4710 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4711 todo_wine
4712 ok(value == 0, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4714 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4715 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4716 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4717 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4718 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4719 todo_wine ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4721 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4722 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4723 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4724 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4725 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4726 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4727 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4728 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4729 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4730 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4731 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4732 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4734 hr = effect->lpVtbl->EndPass(effect);
4736 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4737 ok(par != NULL, "GetParameterByName failed.\n");
4738 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4739 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4740 hr = effect->lpVtbl->BeginPass(effect, 1);
4741 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4743 test_effect_preshader_compare_shader(device, 1, FALSE);
4745 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4746 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4748 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4749 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4750 hr = effect->lpVtbl->CommitChanges(effect);
4751 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4752 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4753 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4754 ok(!vshader, "Incorrect shader selected.\n");
4756 hr = effect->lpVtbl->EndPass(effect);
4757 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4759 hr = effect->lpVtbl->End(effect);
4760 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4762 effect->lpVtbl->Release(effect);
4764 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4765 NULL, NULL, 0, NULL, &effect, NULL);
4766 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4768 hr = effect->lpVtbl->Begin(effect, &npasses, D3DXFX_DONOTSAVESTATE);
4769 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4771 hr = effect->lpVtbl->BeginPass(effect, 0);
4772 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4774 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4775 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4776 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4777 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4778 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4779 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4781 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4782 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4783 ok(value == 1, "Unexpected sampler 1 minfilter %u.\n", value);
4784 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4785 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4786 todo_wine
4787 ok(value == 1, "Unexpected sampler 1 magfilter %u.\n", value);
4789 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4790 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4791 ok(value == 1, "Unexpected vertex sampler 0 minfilter %u.\n", value);
4792 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4793 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4794 todo_wine
4795 ok(value == 1, "Unexpected vertex sampler 0 magfilter %u.\n", value);
4797 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4798 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4799 ok(value == 2, "Unexpected vertex sampler 1 minfilter %u.\n", value);
4800 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4801 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4802 todo_wine
4803 ok(value == 2, "Unexpected vertex sampler 1 magfilter %u.\n", value);
4805 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4806 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4807 ok(value == 3, "Unexpected vertex sampler 2 minfilter %u.\n", value);
4808 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4809 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4810 todo_wine
4811 ok(value == 3, "Unexpected vertex sampler 2 magfilter %u.\n", value);
4813 hr = effect->lpVtbl->EndPass(effect);
4814 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4815 hr = effect->lpVtbl->End(effect);
4816 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4817 effect->lpVtbl->Release(effect);
4821 * fxc.exe /Tfx_2_0
4823 #if 0
4824 float4 opvect1;
4825 float4 opvect2;
4826 float4 opvect3;
4828 technique tech0
4830 pass p0
4832 LightEnable[0] = TRUE;
4833 LightEnable[1] = TRUE;
4834 LightEnable[2] = TRUE;
4835 LightEnable[3] = TRUE;
4836 LightEnable[4] = TRUE;
4837 LightEnable[5] = TRUE;
4838 LightEnable[6] = TRUE;
4839 LightEnable[7] = TRUE;
4840 LightType[0] = POINT;
4841 LightType[1] = POINT;
4842 LightType[2] = POINT;
4843 LightType[3] = POINT;
4844 LightType[4] = POINT;
4845 LightType[5] = POINT;
4846 LightType[6] = POINT;
4847 LightType[7] = POINT;
4849 LightDiffuse[0] = exp(opvect1);
4850 LightDiffuse[1] = log(opvect1);
4851 LightDiffuse[2] = asin(opvect1);
4852 LightDiffuse[3] = acos(opvect1);
4853 LightDiffuse[4] = atan(opvect1);
4854 LightDiffuse[5] = atan2(opvect1, opvect2);
4855 LightDiffuse[6] = opvect1 * opvect2;
4857 /* Placeholder for 'div' instruction manually edited in binary blob. */
4858 LightDiffuse[7] = opvect1 * opvect2;
4860 /* Placeholder for 'cmp' instruction manually edited in binary blob. */
4861 LightAmbient[0] = opvect1 + opvect2 + opvect3;
4864 #endif
4865 static const DWORD test_effect_preshader_ops_blob[] =
4867 0xfeff0901, 0x0000044c, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
4868 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f,
4869 0x00317463, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4870 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003,
4871 0x00000001, 0x000000a0, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4872 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00337463, 0x00000001, 0x00000002, 0x00000002,
4873 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4874 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4875 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4876 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4877 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4878 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4879 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4880 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4881 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4882 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4883 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4884 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4885 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4886 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4887 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4888 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4889 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4890 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
4891 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
4892 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4893 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
4894 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
4895 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4896 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
4897 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4898 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
4899 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4900 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4901 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000001,
4902 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000,
4903 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000001,
4904 0x00000438, 0x00000000, 0x00000019, 0x00000091, 0x00000000, 0x000000b0, 0x000000ac, 0x00000091,
4905 0x00000001, 0x000000d0, 0x000000cc, 0x00000091, 0x00000002, 0x000000f0, 0x000000ec, 0x00000091,
4906 0x00000003, 0x00000110, 0x0000010c, 0x00000091, 0x00000004, 0x00000130, 0x0000012c, 0x00000091,
4907 0x00000005, 0x00000150, 0x0000014c, 0x00000091, 0x00000006, 0x00000170, 0x0000016c, 0x00000091,
4908 0x00000007, 0x00000190, 0x0000018c, 0x00000084, 0x00000000, 0x000001b0, 0x000001ac, 0x00000084,
4909 0x00000001, 0x000001d0, 0x000001cc, 0x00000084, 0x00000002, 0x000001f0, 0x000001ec, 0x00000084,
4910 0x00000003, 0x00000210, 0x0000020c, 0x00000084, 0x00000004, 0x00000230, 0x0000022c, 0x00000084,
4911 0x00000005, 0x00000250, 0x0000024c, 0x00000084, 0x00000006, 0x00000270, 0x0000026c, 0x00000084,
4912 0x00000007, 0x00000290, 0x0000028c, 0x00000085, 0x00000000, 0x000002bc, 0x000002ac, 0x00000085,
4913 0x00000001, 0x000002e8, 0x000002d8, 0x00000085, 0x00000002, 0x00000314, 0x00000304, 0x00000085,
4914 0x00000003, 0x00000340, 0x00000330, 0x00000085, 0x00000004, 0x0000036c, 0x0000035c, 0x00000085,
4915 0x00000005, 0x00000398, 0x00000388, 0x00000085, 0x00000006, 0x000003c4, 0x000003b4, 0x00000085,
4916 0x00000007, 0x000003f0, 0x000003e0, 0x00000087, 0x00000000, 0x0000041c, 0x0000040c, 0x00000000,
4917 0x00000009, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, 0x00000000, 0x0000016c, 0x46580200,
4918 0x003afffe, 0x42415443, 0x0000001c, 0x000000b3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
4919 0x000000b0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
4920 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00020002, 0x00000001, 0x000000a0, 0x00000070,
4921 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4922 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4923 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
4924 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4925 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4926 /* FXLC for LightAmbient[0] start. */
4927 0x001afffe, 0x434c5846,
4928 0x00000001, /* Instruction count, set to 1. */
4929 0x30000004, /* Operation code (bits 20-30) set to 'cmp' opcode 0x300. */
4930 0x00000003, /* Input arguments count set to 3. */
4931 /* Argument 1. */
4932 0x00000000, /* Relative addressing flag. */
4933 0x00000002, /* Register table ("c", float constants). */
4934 0x00000000, /* Register offset. */
4935 /* Argument 2. */
4936 0x00000000, 0x00000002, 0x00000004,
4937 /* Argument 3. */
4938 0x00000000, 0x00000002, 0x00000008,
4939 /* Output register. */
4940 0x00000000, 0x00000004, 0x00000000,
4941 /* End mark. */
4942 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4943 /* Padding to match placeholder length. */
4944 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4945 /* FXLC for LightAmbient[0] end. */
4946 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000114,
4947 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c,
4948 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4949 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4950 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463,
4951 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4952 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4953 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4954 /* FXLC for LightDiffuse[7] start. */
4955 0x000ffffe, 0x434c5846,
4956 0x00000001, /* Instruction count. */
4957 0x20800004, /* Operation code (bits 20-30) set to 'div' opcode 0x208. */
4958 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4959 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4960 /* FXLC for LightDiffuse[7] end. */
4961 0x00000000, 0x00000000, 0xffffffff,
4962 0x00000016, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087,
4963 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001,
4964 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f,
4965 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4966 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
4967 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4968 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4969 0x434c5846, 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4970 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4971 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe,
4972 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084,
4973 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4974 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4975 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4976 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4977 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4978 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20600004, 0x00000002, 0x00000000,
4979 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4980 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000,
4981 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
4982 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
4983 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4984 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4985 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4986 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10c00004, 0x00000001, 0x00000000,
4987 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4988 0x00000000, 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4989 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4990 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
4991 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
4992 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4993 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4994 0x434c5846, 0x00000001, 0x10b00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4995 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4996 0x00000012, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
4997 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
4998 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4999 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
5000 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
5001 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10a00004,
5002 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
5003 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000011, 0x00000000, 0x0000013c,
5004 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
5005 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
5006 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5007 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
5008 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
5009 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
5010 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
5011 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
5012 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
5013 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
5014 0x00000000, 0xffffffff, 0x00000010, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
5015 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
5016 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
5017 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
5018 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
5019 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
5020 0x00000004, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
5021 0x00000000, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
5022 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
5023 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
5024 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
5027 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
5029 static D3DLIGHT9 light;
5030 const struct
5032 const char *mnem;
5033 unsigned int expected_result[4];
5034 unsigned int result_index;
5035 float *result;
5036 D3DXVECTOR4 opvect1, opvect2, opvect3;
5037 unsigned int ulps;
5038 BOOL todo[4];
5040 op_tests[] =
5042 {"exp", {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000}, 0, &light.Diffuse.r,
5043 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5044 {"log", {0, 0x40000000, 0x3f9199b7, 0x43000000}, 1, &light.Diffuse.r,
5045 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5046 {"asin", {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000}, 2, &light.Diffuse.r,
5047 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5048 {"acos", {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000}, 3, &light.Diffuse.r,
5049 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5050 {"atan", {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb}, 4, &light.Diffuse.r,
5051 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5052 {"atan2 test #1", {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000}, 5, &light.Diffuse.r,
5053 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
5054 {"atan2 test #2", {0xbfc90fdb, 0, 0xc0490fdb, 0}, 5, &light.Diffuse.r,
5055 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
5056 {"div", {0, 0, 0, 0}, 7, &light.Diffuse.r,
5057 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
5058 {"cmp", {0x40a00000, 0x40000000, 0x40400000, 0x41000000}, 0, &light.Ambient.r,
5059 {-0.3f, 0.0f, 2.2f, NAN}, {1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 6.0f, 7.0f, 8.0f}},
5060 {"0 * INF", {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000}, 6, &light.Diffuse.r,
5061 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
5063 unsigned int i, j, passes_count;
5064 ID3DXEffect *effect;
5065 HRESULT hr;
5067 hr = D3DXCreateEffect(device, test_effect_preshader_ops_blob, sizeof(test_effect_preshader_ops_blob),
5068 NULL, NULL, 0, NULL, &effect, NULL);
5069 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5070 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5071 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5072 hr = effect->lpVtbl->BeginPass(effect, 0);
5073 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5075 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
5077 const float *result = op_tests[i].result;
5078 const float *expected_float = (float *)op_tests[i].expected_result;
5080 hr = effect->lpVtbl->SetVector(effect, "opvect1", &op_tests[i].opvect1);
5081 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5082 hr = effect->lpVtbl->SetVector(effect, "opvect2", &op_tests[i].opvect2);
5083 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5084 hr = effect->lpVtbl->SetVector(effect, "opvect3", &op_tests[i].opvect3);
5085 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
5086 hr = effect->lpVtbl->CommitChanges(effect);
5087 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5089 hr = IDirect3DDevice9_GetLight(device, op_tests[i].result_index, &light);
5090 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5091 for (j = 0; j < 4; ++j)
5093 todo_wine_if(op_tests[i].todo[j])
5094 ok(compare_float(result[j], expected_float[j], op_tests[i].ulps),
5095 "Operation %s, component %u, expected %#x (%.8e), got %#x (%.8e).\n", op_tests[i].mnem,
5096 j, op_tests[i].expected_result[j], expected_float[j],
5097 ((unsigned int *)result)[j], result[j]);
5101 hr = effect->lpVtbl->End(effect);
5102 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5103 effect->lpVtbl->Release(effect);
5106 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
5107 D3DXHANDLE tech, D3DXHANDLE param)
5109 D3DXPARAMETER_DESC desc;
5110 D3DXHANDLE param_child;
5111 unsigned int i, child_count;
5112 HRESULT hr;
5114 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
5115 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#x.\n", hr);
5116 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
5117 for (i = 0; i < child_count; ++i)
5119 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
5120 : effect->lpVtbl->GetParameter(effect, param, i);
5121 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
5122 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
5123 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
5124 test_isparameterused_children(line, effect, tech, param_child);
5128 #define test_isparameterused_param_with_children(args...) \
5129 test_isparameterused_param_with_children_(__LINE__, args)
5130 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
5131 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
5133 D3DXHANDLE param;
5135 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
5136 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
5138 if (effect2)
5139 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
5140 else
5141 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
5142 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
5144 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
5145 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
5147 test_isparameterused_children(line, effect, tech, param);
5150 static void test_effect_isparameterused(IDirect3DDevice9 *device)
5152 static const struct
5154 const char *name;
5155 BOOL expected_result;
5157 check_parameters[] =
5159 {"g_Pos1", TRUE},
5160 {"g_Pos2", TRUE},
5161 {"g_Selector", TRUE},
5162 {"opvect1", TRUE},
5163 {"opvect2", TRUE},
5164 {"opvect3", TRUE},
5165 {"arr2", TRUE},
5166 {"vs_arr", TRUE},
5167 {"g_iVect", TRUE},
5168 {"vect_sampler", TRUE},
5169 {"tex1", TRUE},
5170 {"tex2", FALSE},
5171 {"sampler1", TRUE},
5172 {"ts1", TRUE},
5173 {"ts2", TRUE},
5174 {"ts3", TRUE},
5176 ID3DXEffect *effect, *effect2;
5177 HRESULT hr;
5178 D3DXHANDLE tech;
5179 unsigned int i;
5181 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5182 NULL, NULL, 0, NULL, &effect, NULL);
5183 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5185 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
5186 ok(!!tech, "GetTechniqueByName failed.\n");
5188 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5189 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
5190 check_parameters[i].expected_result);
5192 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5193 NULL, NULL, 0, NULL, &effect2, NULL);
5194 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5196 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5197 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
5198 check_parameters[i].expected_result);
5200 effect2->lpVtbl->Release(effect2);
5202 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
5203 NULL, NULL, 0, NULL, &effect2, NULL);
5204 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5206 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
5207 effect2->lpVtbl->Release(effect2);
5209 effect->lpVtbl->Release(effect);
5212 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
5214 ID3DXEffect *effect;
5215 HRESULT hr;
5216 D3DXHANDLE param;
5217 int ivect[4];
5218 unsigned int passes_count;
5219 IDirect3DVertexShader9 *vshader;
5221 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5222 NULL, NULL, 0, NULL, &effect, NULL);
5224 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5225 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5227 ivect[0] = ivect[1] = ivect[3] = 1;
5229 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5230 ok(!!param, "GetParameterByName failed.\n");
5231 ivect[2] = 3;
5232 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5233 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5235 hr = effect->lpVtbl->BeginPass(effect, 0);
5236 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5237 hr = effect->lpVtbl->EndPass(effect);
5238 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5240 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5241 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5243 hr = effect->lpVtbl->BeginPass(effect, 1);
5244 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5246 /* Second try reports success and selects array element used previously.
5247 * Probably array index is not recomputed and previous index value is used. */
5248 hr = effect->lpVtbl->BeginPass(effect, 1);
5249 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5250 test_effect_preshader_compare_shader(device, 2, FALSE);
5252 /* Confirm that array element selected is the previous good one and does not depend
5253 * on computed (out of bound) index value. */
5254 ivect[2] = 1;
5255 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5256 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5257 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5258 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5259 hr = effect->lpVtbl->CommitChanges(effect);
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);
5264 ivect[2] = 3;
5265 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5266 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5267 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5268 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5269 hr = effect->lpVtbl->BeginPass(effect, 1);
5270 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5271 hr = effect->lpVtbl->BeginPass(effect, 1);
5272 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5273 test_effect_preshader_compare_shader(device, 1, FALSE);
5275 /* End and begin effect again to ensure it will not trigger array
5276 * index recompute and error return from BeginPass. */
5277 hr = effect->lpVtbl->EndPass(effect);
5278 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5279 hr = effect->lpVtbl->End(effect);
5280 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5281 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5282 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5283 hr = effect->lpVtbl->BeginPass(effect, 1);
5284 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5285 test_effect_preshader_compare_shader(device, 1, FALSE);
5286 hr = effect->lpVtbl->EndPass(effect);
5287 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5290 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5291 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5293 ivect[2] = -2;
5294 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5295 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5297 hr = effect->lpVtbl->BeginPass(effect, 1);
5298 ok(hr == E_FAIL, "Got result %#x.\n", hr);
5300 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5301 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5302 ok(!vshader, "Got non NULL vshader.\n");
5304 hr = effect->lpVtbl->BeginPass(effect, 1);
5305 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5307 test_effect_preshader_compare_shader(device, 1, FALSE);
5309 hr = effect->lpVtbl->EndPass(effect);
5310 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5312 ivect[2] = -1;
5313 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5314 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5316 hr = effect->lpVtbl->BeginPass(effect, 1);
5317 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5319 test_effect_preshader_compare_shader(device, 0, FALSE);
5321 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5322 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5324 ivect[2] = 3;
5325 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5326 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5327 hr = effect->lpVtbl->CommitChanges(effect);
5328 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5330 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5331 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5332 ok(!vshader, "Got non NULL vshader.\n");
5334 ivect[2] = -1;
5335 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5336 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5337 hr = effect->lpVtbl->CommitChanges(effect);
5338 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5340 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5341 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5342 ok(!vshader, "Got non NULL vshader.\n");
5344 ivect[2] = 1;
5345 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5346 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5347 hr = effect->lpVtbl->CommitChanges(effect);
5348 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5350 test_effect_preshader_compare_shader(device, 1, FALSE);
5352 hr = effect->lpVtbl->EndPass(effect);
5353 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5355 hr = effect->lpVtbl->End(effect);
5356 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5358 effect->lpVtbl->Release(effect);
5361 static void test_effect_commitchanges(IDirect3DDevice9 *device)
5363 static const struct
5365 const char *param_name;
5366 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
5368 check_op_parameters[] =
5370 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5371 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5372 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5373 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5374 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5375 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5376 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5377 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5378 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5379 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5380 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5381 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
5382 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5383 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
5384 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
5386 static const struct
5388 const char *param_name;
5389 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5390 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5392 check_vconsts_parameters[] =
5394 {"g_Selector", {0x00000000, 0x00000002}},
5395 {"g_Pos1", {0x80000000, 0x00000002}},
5396 {"g_Pos2", {0x00000000, 0x00000002}},
5397 {"m4x3column", {0x03800000, 0x00000000}},
5398 {"m3x4column", {0x000f0000, 0x00000000}},
5399 {"m4x3row", {0x0000f000, 0x00000000}},
5400 {"m3x4row", {0x00700000, 0x00000000}},
5401 {"ts1", {0x1c000000, 0x00000000}},
5402 {"ts2", {0x0000003f, 0x00000000}},
5403 {"arr1", {0x00000000, 0x00000001}},
5404 {"arr2", {0x60000000, 0x00000000}},
5405 {"ts3", {0x00000fc0, 0x00000000}},
5407 static const struct
5409 const char *param_name;
5410 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_bconsts)
5411 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5413 check_bconsts_parameters[] =
5415 {"mb2x3row", {0x0000001f}},
5416 {"mb2x3column", {0x00000060}},
5418 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5419 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5420 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
5422 ID3DXEffect *effect;
5423 HRESULT hr;
5424 D3DXHANDLE param;
5425 unsigned int i, passes_count, value;
5426 int ivect[4];
5427 D3DXVECTOR4 fvect;
5428 IDirect3DVertexShader9 *vshader;
5429 unsigned char buffer[256];
5432 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5433 NULL, NULL, 0, NULL, &effect, NULL);
5434 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5436 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5437 ok(!!param, "GetParameterByName failed.\n");
5439 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5440 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5442 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5443 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5445 hr = effect->lpVtbl->BeginPass(effect, 0);
5446 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5448 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
5450 unsigned int j;
5452 for (j = 0; j < 8; ++j)
5454 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
5455 ok(hr == D3D_OK, "Got result %#x, i %u, j %u.\n", hr, i, j);
5457 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
5458 ok(!!param, "Failed to get parameter (test %u).\n", i);
5459 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
5460 ok(hr == D3D_OK, "Failed to get parameter value, hr %#x (test %u).\n", hr, i);
5461 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
5462 ok(hr == D3D_OK, "Failed to set parameter value, hr %#x (test %u).\n", hr, i);
5463 hr = effect->lpVtbl->CommitChanges(effect);
5464 ok(hr == D3D_OK, "Failed to commit changes, hr %#x (test %u).\n", hr, i);
5466 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
5467 check_op_parameters[i].param_name);
5470 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
5472 test_effect_clear_vconsts(device);
5473 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
5474 ok(!!param, "GetParameterByName failed.\n");
5475 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5476 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5477 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5478 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5479 hr = effect->lpVtbl->CommitChanges(effect);
5480 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5482 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
5483 check_vconsts_parameters[i].param_name);
5486 for (i = 0; i < ARRAY_SIZE(check_bconsts_parameters); ++i)
5488 test_effect_preshader_clear_pbool_consts(device);
5489 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_bconsts_parameters[i].param_name);
5490 ok(!!param, "GetParameterByName failed.\n");
5491 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5492 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5493 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5494 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5495 hr = effect->lpVtbl->CommitChanges(effect);
5496 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5498 test_effect_preshader_compare_pbool_consts(device, check_bconsts_parameters[i].const_updated_mask,
5499 check_bconsts_parameters[i].param_name);
5502 test_effect_clear_vconsts(device);
5503 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
5504 ok(!!param, "GetParameterByName failed.\n");
5505 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5506 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
5507 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5508 hr = effect->lpVtbl->CommitChanges(effect);
5509 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5510 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
5511 check_vconsts_parameters[0].param_name);
5513 test_effect_clear_vconsts(device);
5514 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5515 ok(!!param, "GetParameterByName failed.\n");
5516 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5517 ok(!!param, "GetParameterElement failed.\n");
5518 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
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, const_no_update_mask,
5523 check_vconsts_parameters[10].param_name);
5525 test_effect_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 fvect.x = 93.0f;
5531 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
5532 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5533 hr = effect->lpVtbl->CommitChanges(effect);
5534 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5535 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5536 check_vconsts_parameters[10].param_name);
5538 test_effect_clear_vconsts(device);
5539 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5540 ok(!!param, "GetParameterByName failed.\n");
5541 fvect.x = 92.0f;
5542 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
5543 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5544 hr = effect->lpVtbl->CommitChanges(effect);
5545 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5546 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5547 check_vconsts_parameters[10].param_name);
5549 test_effect_clear_vconsts(device);
5550 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5551 ok(!!param, "GetParameterByName failed.\n");
5552 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5553 ok(!!param, "GetParameterElement failed.\n");
5554 hr = effect->lpVtbl->SetInt(effect, param, 93);
5555 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5556 hr = effect->lpVtbl->CommitChanges(effect);
5557 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5558 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5559 check_vconsts_parameters[10].param_name);
5561 test_effect_clear_vconsts(device);
5562 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5563 ok(!!param, "GetParameterByName failed.\n");
5564 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5565 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
5566 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5567 hr = effect->lpVtbl->CommitChanges(effect);
5568 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5569 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5570 check_vconsts_parameters[1].param_name);
5572 test_effect_clear_vconsts(device);
5573 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
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, "fv");
5578 ok(!!param, "GetParameterByName failed.\n");
5579 fvect.x = 12;
5580 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5581 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5582 hr = effect->lpVtbl->CommitChanges(effect);
5583 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5584 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5585 check_vconsts_parameters[7].param_name);
5587 *(float *)&value = 9999.0f;
5588 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5589 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5590 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5591 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5592 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5593 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5594 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5595 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5596 test_effect_clear_vconsts(device);
5597 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5598 ok(!!param, "GetParameterByName failed.\n");
5599 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5600 ok(!!param, "GetParameterByName failed.\n");
5601 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5602 ok(!!param, "GetParameterByName failed.\n");
5603 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5604 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5605 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5606 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5607 hr = effect->lpVtbl->CommitChanges(effect);
5608 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5609 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5611 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
5612 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5613 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5614 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
5615 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5616 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5617 ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5618 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5619 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5620 ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5621 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5622 check_vconsts_parameters[8].param_name);
5624 *(float *)&value = 9999.0f;
5625 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5626 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5627 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5628 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5629 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5630 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5631 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5632 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5633 test_effect_clear_vconsts(device);
5634 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5635 ok(!!param, "GetParameterByName failed.\n");
5636 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5637 ok(!!param, "GetParameterByName failed.\n");
5638 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5639 ok(!!param, "GetParameterByName failed.\n");
5640 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5641 ok(!!param, "GetParameterByName failed.\n");
5642 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5643 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5644 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5645 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5646 hr = effect->lpVtbl->CommitChanges(effect);
5647 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5648 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5649 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5650 ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
5651 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5652 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5653 ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
5654 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5655 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5656 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5657 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5658 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5659 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5660 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5661 check_vconsts_parameters[11].param_name);
5663 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5664 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5665 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5666 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5667 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5668 todo_wine
5669 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5670 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5671 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5672 ok(value == 3, "Unexpected sampler 2 minfilter %u.\n", value);
5674 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5675 ok(!!param, "GetParameterByName failed.\n");
5676 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5677 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5678 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5680 for (i = 0; i < 3; ++i)
5682 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MINFILTER, 0);
5683 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5684 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MAGFILTER, 0);
5685 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5688 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5689 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5690 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5691 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5693 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5694 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5695 test_effect_clear_vconsts(device);
5697 hr = effect->lpVtbl->CommitChanges(effect);
5698 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5700 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5701 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5702 ok(!vshader, "Got non NULL vshader.\n");
5703 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5704 "selector g_iVect");
5706 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5707 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5708 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5709 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5710 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5711 ok(value == 0, "Unexpected sampler 1 minfilter %u.\n", value);
5713 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5714 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5715 ok(value == 1, "Unexpected sampler 2 minfilter %u.\n", value);
5716 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
5717 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5718 ok(value == 0, "Unexpected sampler 2 minfilter %u.\n", value);
5719 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5720 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5721 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5722 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5723 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5724 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5726 ivect[3] = 2;
5727 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5728 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5729 ivect[3] = 1;
5730 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5731 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5732 hr = effect->lpVtbl->CommitChanges(effect);
5733 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5734 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5735 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5736 ok(!vshader, "Got non NULL vshader.\n");
5737 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5738 "selector g_iVect");
5739 ivect[3] = 2;
5740 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5741 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5742 hr = effect->lpVtbl->CommitChanges(effect);
5743 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5744 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5745 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5746 ok(!!vshader, "Got NULL vshader.\n");
5747 IDirect3DVertexShader9_Release(vshader);
5748 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5749 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5750 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5751 "Vertex shader float constants do not match.\n");
5752 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5753 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5754 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5755 "selector g_iVect");
5756 ivect[3] = 1;
5757 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5758 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5759 hr = effect->lpVtbl->CommitChanges(effect);
5760 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5761 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5763 hr = effect->lpVtbl->EndPass(effect);
5764 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5766 hr = effect->lpVtbl->End(effect);
5767 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5769 effect->lpVtbl->Release(effect);
5772 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5774 static const struct
5776 D3DXVECTOR4 opvect2;
5777 D3DXVECTOR4 g_ivect;
5778 unsigned int expected[4];
5780 test_out_of_bounds_index[] =
5782 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5783 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5784 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5785 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5786 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5787 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5788 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5789 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5790 {0x447ac000, 0x448ae000, 0, 0}},
5791 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5792 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5793 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5794 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5795 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5796 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5797 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5798 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5799 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5800 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5801 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5802 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5803 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5804 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5805 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5806 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5807 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5808 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5809 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5810 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5811 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5812 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5813 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5814 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5815 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5817 static const struct
5819 unsigned int zw[2];
5821 expected_light_specular[] =
5823 {{0, 0x44fa2000}},
5824 {{0x447a8000, 0x453b9000}},
5825 {{0x40000000, 0x459c4800}},
5826 {{0xbf800000, 0}},
5827 {{0x447a4000, 0}},
5828 {{0x3f800000, 0}},
5829 {{0xbf800000, 0}},
5830 {{0, 0}},
5831 {{0, 0x447a4000}},
5832 {{0x44fa4000, 0x3f800000}},
5833 {{0x453ba000, 0xbf800000}},
5834 {{0x459c5000, 0}},
5835 {{0x44fa2000, 0}},
5836 {{0x453b9000, 0}},
5837 {{0x459c4800, 0}},
5838 {{0, 0}},
5840 static const struct
5842 int index_value;
5843 unsigned int expected[4];
5845 test_index_to_immediate_table[] =
5847 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5848 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5849 {-32, {0x448d4000, 0x40800000, 0, 0}},
5850 {-31, {0x45843000, 0x41400000, 0, 0}},
5851 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5852 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5853 {-28, {0, 0, 0x447ac000, 0x40400000}},
5854 {-27, {0, 0x3f800000, 0, 0}},
5855 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5856 {-25, {0, 0x41300000, 0, 0}},
5857 {-24, {0, 0x41600000, 0, 0}},
5858 {-23, {0, 0, 0, 0}},
5859 {-22, {0, 0, 0, 0}},
5860 {-21, {0, 0x40a00000, 0, 0}},
5861 {-20, {0, 0x41500000, 0, 0}},
5862 {-19, {0, 0x41500000, 0, 0}},
5863 {-18, {0, 0xc1900000, 0, 0}},
5864 {-17, {0, 0, 0, 0}},
5865 {-16, {0, 0x40800000, 0, 0}},
5866 {-15, {0, 0x41400000, 0, 0}},
5867 {-14, {0, 0x41400000, 0, 0}},
5868 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5869 {-12, {0, 0, 0, 0}},
5870 {-11, {0, 0x3f800000, 0, 0}},
5871 {-10, {0, 0x41100000, 0, 0}},
5872 {-9, {0, 0x41300000, 0, 0}},
5873 {-8, {0, 0x41600000, 0, 0}},
5874 {-7, {0, 0, 0, 0}},
5875 {-6, {0, 0, 0, 0}},
5876 {-5, {0, 0x40a00000, 0, 0}},
5877 {-4, {0, 0x41500000, 0, 0}},
5878 {-3, {0, 0x41500000, 0, 0}},
5879 {-2, {0, 0xc0000000, 0, 0}},
5880 {-1, {0, 0, 0, 0}},
5881 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5882 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5883 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5884 {3, {0, 0x447a4000, 0, 0}},
5885 {4, {0, 0, 0x45bbd800, 0x41300000}},
5886 {5, {0, 0x3f800000, 0, 0}},
5887 {6, {0, 0x41100000, 0, 0}},
5888 {7, {0, 0x41300000, 0, 0}},
5889 {8, {0, 0x41600000, 0, 0}},
5890 {9, {0, 0, 0, 0}},
5891 {10, {0, 0, 0, 0}},
5892 {11, {0, 0x40a00000, 0, 0}},
5893 {12, {0, 0x41500000, 0, 0}},
5894 {13, {0, 0x41500000, 0, 0}},
5895 {14, {0, 0x41600000, 0, 0}},
5896 {15, {0, 0, 0, 0}},
5897 {16, {0, 0x40800000, 0, 0}},
5898 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5899 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5900 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5901 {20, {0, 0, 0, 0}},
5902 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5903 {22, {0, 0x41100000, 0, 0}},
5904 {23, {0, 0x41300000, 0, 0}},
5905 {24, {0, 0x41600000, 0, 0}},
5906 {25, {0, 0, 0, 0}},
5907 {26, {0, 0, 0, 0}},
5908 {27, {0, 0x40a00000, 0, 0}},
5909 {28, {0, 0x41500000, 0, 0}},
5910 {29, {0, 0x41500000, 0, 0}},
5911 {30, {0, 0x41f00000, 0, 0}},
5912 {31, {0, 0, 0, 0}},
5913 {1001, {0, 0, 0, 0}},
5914 {1000000, {0, 0x40800000, 0, 0}},
5916 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5917 {1.0f, 1.0f, 1.0f, 1.0f}};
5918 unsigned int j, passes_count;
5919 const unsigned int *expected;
5920 const float *expected_float;
5921 ID3DXEffect *effect;
5922 D3DXVECTOR4 fvect;
5923 D3DLIGHT9 light;
5924 const float *v;
5925 HRESULT hr;
5926 int i;
5928 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5929 NULL, NULL, 0, NULL, &effect, NULL);
5930 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5932 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5933 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5934 hr = effect->lpVtbl->BeginPass(effect, 0);
5935 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5937 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5938 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5939 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5941 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5942 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5943 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5945 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5946 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5947 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5949 v = &light.Specular.r;
5950 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5952 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5953 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5954 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5955 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5957 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5958 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5960 hr = effect->lpVtbl->CommitChanges(effect);
5961 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5963 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5964 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5966 expected = test_out_of_bounds_index[i].expected;
5967 expected_float = (const float *)expected;
5969 for (j = 0; j < 4; ++j)
5971 ok(compare_float(v[j], expected_float[j], 0),
5972 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5973 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5977 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5978 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5979 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5980 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5982 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5983 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5985 fvect = test_out_of_bounds_index[7].g_ivect;
5986 v = &light.Specular.b;
5987 for (i = -100; i < 100; ++i)
5989 fvect.w = i;
5990 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5991 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5992 hr = effect->lpVtbl->CommitChanges(effect);
5993 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5995 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5996 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5998 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5999 expected_float = (const float *)expected;
6001 for (j = 0; j < 2; ++j)
6003 ok(compare_float(v[j], expected_float[j], 0),
6004 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
6005 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
6009 v = &light.Specular.r;
6010 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
6012 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
6013 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6014 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6015 hr = effect->lpVtbl->CommitChanges(effect);
6016 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6018 hr = IDirect3DDevice9_GetLight(device, 2, &light);
6019 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6021 expected = test_index_to_immediate_table[i].expected;
6022 expected_float = (const float *)expected;
6024 for (j = 0; j < 4; ++j)
6026 ok(compare_float(v[j], expected_float[j], 0),
6027 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
6028 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
6032 hr = effect->lpVtbl->EndPass(effect);
6033 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6034 hr = effect->lpVtbl->End(effect);
6035 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6037 effect->lpVtbl->Release(effect);
6040 struct test_state_manager_update
6042 unsigned int state_op;
6043 DWORD param1;
6044 DWORD param2;
6047 struct test_manager
6049 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
6050 LONG ref;
6052 IDirect3DDevice9 *device;
6053 struct test_state_manager_update *update_record;
6054 unsigned int update_record_count;
6055 unsigned int update_record_size;
6058 #define INITIAL_UPDATE_RECORD_SIZE 64
6060 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
6062 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
6065 static void free_test_effect_state_manager(struct test_manager *state_manager)
6067 HeapFree(GetProcessHeap(), 0, state_manager->update_record);
6068 state_manager->update_record = NULL;
6070 IDirect3DDevice9_Release(state_manager->device);
6073 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
6075 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6077 return InterlockedIncrement(&state_manager->ref);
6080 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
6082 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6083 ULONG ref = InterlockedDecrement(&state_manager->ref);
6085 if (!ref)
6087 free_test_effect_state_manager(state_manager);
6088 HeapFree(GetProcessHeap(), 0, state_manager);
6090 return ref;
6093 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
6094 unsigned int state_op, DWORD param1, DWORD param2)
6096 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6098 if (state_manager->update_record_count == state_manager->update_record_size)
6100 if (!state_manager->update_record_size)
6102 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
6103 state_manager->update_record = HeapAlloc(GetProcessHeap(), 0,
6104 sizeof(*state_manager->update_record) * state_manager->update_record_size);
6106 else
6108 state_manager->update_record_size *= 2;
6109 state_manager->update_record = HeapReAlloc(GetProcessHeap(), 0, state_manager->update_record,
6110 sizeof(*state_manager->update_record) * state_manager->update_record_size);
6113 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
6114 state_manager->update_record[state_manager->update_record_count].param1 = param1;
6115 state_manager->update_record[state_manager->update_record_count].param2 = param2;
6116 ++state_manager->update_record_count;
6117 return D3D_OK;
6120 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
6121 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
6123 return test_process_set_state(iface, 0, state, 0);
6126 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
6127 const D3DMATERIAL9 *material)
6129 return test_process_set_state(iface, 1, 0, 0);
6132 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
6133 DWORD index, const D3DLIGHT9 *light)
6135 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6137 IDirect3DDevice9_SetLight(state_manager->device, index, light);
6138 return test_process_set_state(iface, 2, index, 0);
6141 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
6142 DWORD index, BOOL enable)
6144 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6146 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
6147 return test_process_set_state(iface, 3, index, 0);
6150 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
6151 D3DRENDERSTATETYPE state, DWORD value)
6153 return test_process_set_state(iface, 4, state, 0);
6156 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
6157 DWORD stage, struct IDirect3DBaseTexture9 *texture)
6159 return test_process_set_state(iface, 5, stage, 0);
6162 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
6163 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
6165 return test_process_set_state(iface, 6, stage, type);
6168 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
6169 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
6171 return test_process_set_state(iface, 7, sampler, type);
6174 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
6175 FLOAT num_segments)
6177 return test_process_set_state(iface, 8, 0, 0);
6180 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
6181 DWORD format)
6183 return test_process_set_state(iface, 9, 0, 0);
6186 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
6187 struct IDirect3DVertexShader9 *shader)
6189 return test_process_set_state(iface, 10, 0, 0);
6192 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
6193 UINT register_index, const FLOAT *constant_data, UINT register_count)
6195 return test_process_set_state(iface, 11, register_index, register_count);
6198 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
6199 UINT register_index, const INT *constant_data, UINT register_count)
6201 return test_process_set_state(iface, 12, register_index, register_count);
6204 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
6205 UINT register_index, const BOOL *constant_data, UINT register_count)
6207 return test_process_set_state(iface, 13, register_index, register_count);
6210 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
6211 struct IDirect3DPixelShader9 *shader)
6213 return test_process_set_state(iface, 14, 0, 0);
6216 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
6217 UINT register_index, const FLOAT *constant_data, UINT register_count)
6219 return test_process_set_state(iface, 15, register_index, register_count);
6222 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
6223 UINT register_index, const INT *constant_data, UINT register_count)
6225 return test_process_set_state(iface, 16, register_index, register_count);
6228 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
6229 UINT register_index, const BOOL *constant_data, UINT register_count)
6231 return test_process_set_state(iface, 17, register_index, register_count);
6234 static void test_effect_state_manager_init(struct test_manager *state_manager,
6235 IDirect3DDevice9 *device)
6237 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
6239 /*** IUnknown methods ***/
6240 NULL,
6241 test_manager_AddRef,
6242 test_manager_Release,
6243 /*** ID3DXEffectStateManager methods ***/
6244 test_manager_SetTransform,
6245 test_manager_SetMaterial,
6246 test_manager_SetLight,
6247 test_manager_LightEnable,
6248 test_manager_SetRenderState,
6249 test_manager_SetTexture,
6250 test_manager_SetTextureStageState,
6251 test_manager_SetSamplerState,
6252 test_manager_SetNPatchMode,
6253 test_manager_SetFVF,
6254 test_manager_SetVertexShader,
6255 test_manager_SetVertexShaderConstantF,
6256 test_manager_SetVertexShaderConstantI,
6257 test_manager_SetVertexShaderConstantB,
6258 test_manager_SetPixelShader,
6259 test_manager_SetPixelShaderConstantF,
6260 test_manager_SetPixelShaderConstantI,
6261 test_manager_SetPixelShaderConstantB,
6264 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
6265 state_manager->ref = 1;
6267 IDirect3DDevice9_AddRef(device);
6268 state_manager->device = device;
6271 static const char *test_effect_state_manager_state_names[] =
6273 "SetTransform",
6274 "SetMaterial",
6275 "SetLight",
6276 "LightEnable",
6277 "SetRenderState",
6278 "SetTexture",
6279 "SetTextureStageState",
6280 "SetSamplerState",
6281 "SetNPatchMode",
6282 "SetFVF",
6283 "SetVertexShader",
6284 "SetVertexShaderConstantF",
6285 "SetVertexShaderConstantI",
6286 "SetVertexShaderConstantB",
6287 "SetPixelShader",
6288 "SetPixelShaderConstantF",
6289 "SetPixelShaderConstantI",
6290 "SetPixelShaderConstantB",
6293 static int compare_update_record(const void *a, const void *b)
6295 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
6296 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
6298 if (r1->state_op != r2->state_op)
6299 return r1->state_op - r2->state_op;
6300 if (r1->param1 != r2->param1)
6301 return r1->param1 - r2->param1;
6302 return r1->param2 - r2->param2;
6305 static void test_effect_state_manager(IDirect3DDevice9 *device)
6307 static const struct test_state_manager_update expected_updates[] =
6309 {2, 0, 0},
6310 {2, 1, 0},
6311 {2, 2, 0},
6312 {2, 3, 0},
6313 {2, 4, 0},
6314 {2, 5, 0},
6315 {2, 6, 0},
6316 {2, 7, 0},
6317 {3, 0, 0},
6318 {3, 1, 0},
6319 {3, 2, 0},
6320 {3, 3, 0},
6321 {3, 4, 0},
6322 {3, 5, 0},
6323 {3, 6, 0},
6324 {3, 7, 0},
6325 {4, 28, 0},
6326 {4, 36, 0},
6327 {4, 38, 0},
6328 {4, 158, 0},
6329 {4, 159, 0},
6330 {5, 0, 0},
6331 {5, 259, 0},
6332 {7, 0, 5},
6333 {7, 0, 6},
6334 {7, 1, 5},
6335 {7, 1, 6},
6336 {7, 257, 5},
6337 {7, 257, 6},
6338 {7, 258, 5},
6339 {7, 258, 6},
6340 {7, 259, 5},
6341 {7, 259, 6},
6342 {10, 0, 0},
6343 {11, 0, 34},
6344 {14, 0, 0},
6345 {15, 0, 14},
6346 {16, 0, 1},
6347 {17, 0, 6},
6349 static D3DLIGHT9 light_filler =
6350 {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}};
6351 struct test_manager *state_manager;
6352 unsigned int passes_count, i, n;
6353 ID3DXEffect *effect;
6354 ULONG refcount;
6355 HRESULT hr;
6357 state_manager = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*state_manager));
6358 test_effect_state_manager_init(state_manager, device);
6360 for (i = 0; i < 8; ++i)
6362 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
6363 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6366 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6367 NULL, NULL, 0, NULL, &effect, NULL);
6368 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6370 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
6371 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6373 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6374 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6376 hr = effect->lpVtbl->BeginPass(effect, 0);
6377 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6379 hr = effect->lpVtbl->EndPass(effect);
6380 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6382 hr = effect->lpVtbl->End(effect);
6383 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6385 effect->lpVtbl->Release(effect);
6387 qsort(state_manager->update_record, state_manager->update_record_count,
6388 sizeof(*state_manager->update_record), compare_update_record);
6390 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
6391 "Got %u update records.\n", state_manager->update_record_count);
6392 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
6393 for (i = 0; i < n; ++i)
6395 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
6396 sizeof(expected_updates[i])),
6397 "Update record mismatch, expected %s, %u, %u, got %s, %u, %u.\n",
6398 test_effect_state_manager_state_names[expected_updates[i].state_op],
6399 expected_updates[i].param1, expected_updates[i].param2,
6400 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
6401 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
6404 for (i = 0; i < 8; ++i)
6406 D3DLIGHT9 light;
6408 hr = IDirect3DDevice9_GetLight(device, i, &light);
6409 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6410 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
6413 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
6414 &state_manager->ID3DXEffectStateManager_iface);
6415 ok(!refcount, "State manager was not properly freed, refcount %u.\n", refcount);
6418 static void test_cross_effect_handle(IDirect3DDevice9 *device)
6420 ID3DXEffect *effect1, *effect2;
6421 D3DXHANDLE param1, param2;
6422 static int expected_ivect[4] = {28, 29, 30, 31};
6423 int ivect[4];
6424 HRESULT hr;
6426 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6427 NULL, NULL, 0, NULL, &effect1, NULL);
6428 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6429 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6430 NULL, NULL, 0, NULL, &effect2, NULL);
6431 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6433 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
6435 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
6436 ok(!!param1, "GetParameterByName failed.\n");
6438 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
6439 ok(!!param2, "GetParameterByName failed.\n");
6441 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
6443 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
6444 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6446 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
6447 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6449 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6451 effect2->lpVtbl->Release(effect2);
6452 effect1->lpVtbl->Release(effect1);
6455 #if 0
6456 struct test_struct
6458 float3 v1_2;
6459 float fv_2;
6460 float4 v2_2;
6463 shared float arr2[1];
6464 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
6466 struct VS_OUTPUT
6468 float4 Position : POSITION;
6471 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6473 VS_OUTPUT Output;
6475 Output.Position = arr2[0] * vPos;
6476 return Output;
6479 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
6481 technique tech0
6483 pass p0
6485 FogEnable = TRUE;
6486 FogDensity = arr2[0];
6487 PointScale_A = ts2[0].fv_2;
6488 VertexShader = vs_arr2[0];
6491 pass p1
6493 VertexShader = vs_arr2[1];
6496 #endif
6497 static const DWORD test_effect_shared_parameters_blob[] =
6499 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
6500 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
6501 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
6502 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
6503 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
6504 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6505 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
6506 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
6507 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
6508 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
6509 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6510 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6511 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
6512 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
6513 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
6514 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
6515 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
6516 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
6517 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
6518 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
6519 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
6520 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
6521 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
6522 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
6523 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
6524 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
6525 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
6526 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
6527 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
6528 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
6529 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
6530 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
6531 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
6532 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
6533 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
6534 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
6535 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6536 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
6537 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
6538 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6539 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6540 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6541 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6542 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
6543 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
6544 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
6545 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
6546 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
6547 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
6548 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6549 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6552 #define test_effect_shared_vs_arr_compare_helper(args...) \
6553 test_effect_shared_vs_arr_compare_helper_(__LINE__, args)
6554 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
6555 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
6556 BOOL todo)
6558 struct IDirect3DVertexShader9 *vshader2;
6559 D3DXHANDLE param_child2;
6560 HRESULT hr;
6562 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
6563 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
6564 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6565 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
6566 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6567 todo_wine_if(todo)
6568 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
6569 if (vshader2)
6570 IDirect3DVertexShader9_Release(vshader2);
6573 #define test_effect_shared_parameters_compare_vconst(args...) \
6574 test_effect_shared_parameters_compare_vconst_(__LINE__, args)
6575 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
6576 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6578 D3DXVECTOR4 fvect;
6579 HRESULT hr;
6581 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6582 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6583 todo_wine_if(todo)
6584 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6585 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6588 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6590 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6591 ID3DXEffectPool *pool;
6592 HRESULT hr;
6593 D3DXHANDLE param, param_child, param2, param_child2;
6594 unsigned int i, passes_count;
6595 ULONG refcount;
6596 D3DXVECTOR4 fvect;
6597 float fval[2];
6599 hr = D3DXCreateEffectPool(&pool);
6600 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6602 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6603 NULL, NULL, 0, pool, &effect2, NULL);
6604 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6605 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6606 effect2->lpVtbl->Release(effect2);
6608 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6609 NULL, NULL, 0, pool, &effect2, NULL);
6610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6611 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6612 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6613 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6615 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6616 NULL, NULL, 0, pool, &effect1, NULL);
6617 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6619 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6620 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6622 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6623 NULL, NULL, 0, pool, &effect3, NULL);
6624 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6625 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6626 NULL, NULL, 0, pool, &effect4, NULL);
6627 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6629 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6630 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6632 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6633 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6634 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6635 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6636 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6637 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6638 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6640 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6641 ok(!!param, "GetParameterByName failed.\n");
6642 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6643 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6645 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6646 ok(!!param, "GetParameterByName failed.\n");
6647 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6648 "Unexpected IsParameterUsed result.\n");
6650 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6651 ok(!!param, "GetParameterByName failed.\n");
6652 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6653 "Unexpected IsParameterUsed result.\n");
6655 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6656 ok(!!param, "GetParameterByName failed.\n");
6657 todo_wine
6658 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6659 "Unexpected IsParameterUsed result.\n");
6661 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6662 "Unexpected IsParameterUsed result.\n");
6663 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6664 "Unexpected IsParameterUsed result.\n");
6665 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6666 "Unexpected IsParameterUsed result.\n");
6668 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6669 "Unexpected IsParameterUsed result.\n");
6671 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6672 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6674 if (0)
6676 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6677 * but initialized with different shaders using different parameters. */
6678 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6679 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6681 hr = effect3->lpVtbl->EndPass(effect3);
6682 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6685 test_effect_clear_vconsts(device);
6686 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6687 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6688 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6689 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6690 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6692 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6693 todo_wine
6694 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6696 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6697 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6698 todo_wine
6699 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6700 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6702 hr = effect3->lpVtbl->EndPass(effect3);
6703 todo_wine
6704 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6706 hr = effect3->lpVtbl->End(effect3);
6707 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6709 for (i = 0; i < 2; ++i)
6711 struct IDirect3DVertexShader9 *vshader1;
6713 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6714 ok(!!param_child, "GetParameterElement failed.\n");
6715 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6716 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6718 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6719 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6720 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6721 IDirect3DVertexShader9_Release(vshader1);
6724 effect3->lpVtbl->Release(effect3);
6725 effect4->lpVtbl->Release(effect4);
6727 fval[0] = 1.0f;
6728 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6729 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6730 fval[0] = 0.0f;
6731 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6732 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6733 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6735 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6736 ok(!!param, "GetParameterByName failed.\n");
6737 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6738 ok(!!param, "GetParameterByName failed.\n");
6739 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6740 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6741 ok(!!param_child, "GetParameterElement failed.\n");
6742 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6743 ok(!!param_child2, "GetParameterElement failed.\n");
6744 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6746 fval[0] = 33.0f;
6747 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6748 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6749 fval[0] = 0.0f;
6750 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6751 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6752 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6753 fval[0] = 0.0f;
6754 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6755 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6756 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6758 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6759 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6761 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6762 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6764 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6765 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6767 fvect.x = 1.0f;
6768 fvect.y = fvect.z = fvect.w = 0.0f;
6769 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6771 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6772 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6774 fvect.x = 91.0f;
6775 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6776 fvect.x = 33.0f;
6777 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6779 fval[0] = 28.0f;
6780 fval[1] = -1.0f;
6781 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6782 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6784 test_effect_clear_vconsts(device);
6786 hr = effect1->lpVtbl->CommitChanges(effect1);
6787 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6789 fvect.x = 28.0f;
6790 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6791 fvect.x = -1.0f;
6792 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6794 test_effect_clear_vconsts(device);
6796 hr = effect1->lpVtbl->CommitChanges(effect1);
6797 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6799 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6800 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6802 hr = effect2->lpVtbl->CommitChanges(effect2);
6803 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6805 fvect.x = 28.0f;
6806 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6807 fvect.x = -1.0f;
6808 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6810 fval[0] = -2.0f;
6811 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6812 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6813 hr = effect1->lpVtbl->CommitChanges(effect1);
6814 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6816 fvect.x = -2.0f;
6817 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6818 fvect.x = -1.0f;
6819 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6821 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6822 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6823 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6825 hr = effect1->lpVtbl->CommitChanges(effect1);
6826 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6827 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6829 hr = effect1->lpVtbl->CommitChanges(effect2);
6830 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6831 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6833 hr = effect1->lpVtbl->End(effect1);
6834 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6836 hr = effect2->lpVtbl->End(effect2);
6837 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6839 if (0)
6841 refcount = pool->lpVtbl->Release(pool);
6842 ok(refcount == 2, "Unexpected refcount %u.\n", refcount);
6844 refcount = pool->lpVtbl->Release(pool);
6845 ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
6847 refcount = pool->lpVtbl->Release(pool);
6848 ok(!refcount, "Unexpected refcount %u.\n", refcount);
6850 /* Native d3dx crashes in GetFloat(). */
6851 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6854 effect1->lpVtbl->Release(effect1);
6855 effect2->lpVtbl->Release(effect2);
6857 refcount = pool->lpVtbl->Release(pool);
6858 ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount);
6861 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6863 ID3DXEffect *effect;
6864 D3DXHANDLE param;
6865 static int expected_ivect[4] = {28, 29, 30, 31};
6866 int ivect[4];
6867 HRESULT hr;
6869 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6870 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6871 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6873 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6874 ok(!!param, "GetParameterByName failed.\n");
6876 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6877 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6879 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6880 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6882 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6884 if (0)
6886 /* Native d3dx crashes in GetValue(). */
6887 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6888 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6891 effect->lpVtbl->Release(effect);
6894 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6896 unsigned int passes_count;
6897 ID3DXEffect *effect;
6898 D3DXPASS_DESC desc;
6899 D3DXVECTOR4 fvect;
6900 D3DXHANDLE pass;
6901 HRESULT hr;
6903 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6904 NULL, NULL, 0, NULL, &effect, NULL);
6905 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6907 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6908 ok(!!pass, "GetPass() failed.\n");
6910 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6911 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6912 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6914 fvect.x = fvect.y = fvect.w = 0.0f;
6915 fvect.z = 0.0f;
6916 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6917 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6919 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6920 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6921 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6923 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6925 fvect.z = 3.0f;
6926 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6927 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6929 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6930 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6931 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6933 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6934 * as it is not the case sometimes for BeginPass() with out of bound access. */
6935 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6936 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6937 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6939 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6940 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6942 hr = effect->lpVtbl->BeginPass(effect, 1);
6943 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6945 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6946 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6948 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6950 fvect.z = 2.0f;
6951 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6952 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6953 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6954 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6956 effect->lpVtbl->Release(effect);
6958 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6959 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6960 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6962 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6963 ok(!!pass, "GetPass() failed.\n");
6965 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6966 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6968 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6969 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6971 effect->lpVtbl->Release(effect);
6974 #if 0
6975 float v1 : register(c2);
6976 float v2 : register(c3);
6977 float v3;
6978 float v4 : register(c4);
6979 float v5;
6980 float v6[2] : register(c5) = {11, 22};
6982 struct VS_OUTPUT
6984 float4 Position : POSITION;
6987 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6989 VS_OUTPUT Output;
6991 Output.Position = v1 * v2 * vPos + v2 + v3 + v4;
6992 Output.Position += v6[0] + v6[1];
6993 return Output;
6996 technique tech0
6998 pass p0
7000 PointScale_A = v4;
7001 VertexShader = compile vs_3_0 RenderSceneVS();
7004 #endif
7005 static const DWORD test_effect_skip_constants_blob[] =
7007 0xfeff0901, 0x00000144, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
7008 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003176, 0x00000003, 0x00000000, 0x0000004c,
7009 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003276, 0x00000003,
7010 0x00000000, 0x00000074, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
7011 0x00003376, 0x00000003, 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7012 0x00000000, 0x00000003, 0x00003476, 0x00000003, 0x00000000, 0x000000c4, 0x00000000, 0x00000000,
7013 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003576, 0x00000003, 0x00000000, 0x000000f0,
7014 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41300000, 0x41b00000, 0x00000003, 0x00003676,
7015 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7016 0x00000001, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070,
7017 0x00000006, 0x68636574, 0x00000030, 0x00000006, 0x00000001, 0x00000002, 0x00000002, 0x00000004,
7018 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054,
7019 0x00000070, 0x00000000, 0x00000000, 0x0000007c, 0x00000098, 0x00000000, 0x00000000, 0x000000a4,
7020 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e8, 0x00000000, 0x00000000, 0x00000138,
7021 0x00000000, 0x00000001, 0x00000130, 0x00000000, 0x00000002, 0x00000041, 0x00000000, 0x000000fc,
7022 0x000000f8, 0x00000092, 0x00000000, 0x0000011c, 0x00000118, 0x00000000, 0x00000002, 0x00000000,
7023 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000001bc, 0xfffe0300, 0x0047fffe, 0x42415443,
7024 0x0000001c, 0x000000e7, 0xfffe0300, 0x00000005, 0x0000001c, 0x20000000, 0x000000e0, 0x00000080,
7025 0x00020002, 0x000a0001, 0x00000084, 0x00000094, 0x000000a4, 0x00030002, 0x000e0001, 0x00000084,
7026 0x00000094, 0x000000a7, 0x00000002, 0x00000001, 0x00000084, 0x00000094, 0x000000aa, 0x00040002,
7027 0x00120001, 0x00000084, 0x00000094, 0x000000ad, 0x00050002, 0x00160002, 0x000000b0, 0x000000c0,
7028 0xab003176, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7029 0x00000000, 0x76003276, 0x34760033, 0x00367600, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
7030 0x41300000, 0x00000000, 0x00000000, 0x00000000, 0x41b00000, 0x00000000, 0x00000000, 0x00000000,
7031 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7032 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000,
7033 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0x80010000, 0xa0000003, 0x03000005,
7034 0x80010000, 0x80000000, 0xa0000002, 0x04000004, 0x800f0000, 0x80000000, 0x90e40000, 0xa0000003,
7035 0x03000002, 0x800f0000, 0x80e40000, 0xa0000000, 0x03000002, 0x800f0000, 0x80e40000, 0xa0000004,
7036 0x02000001, 0x80010001, 0xa0000005, 0x03000002, 0x80010001, 0x80000001, 0xa0000006, 0x03000002,
7037 0xe00f0000, 0x80e40000, 0x80000001, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
7038 0x00000000, 0x000000d8, 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200,
7039 0x00000001, 0x0000001c, 0x20000100, 0x00000054, 0x00000030, 0x00040002, 0x00120001, 0x00000034,
7040 0x00000044, 0xab003476, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
7041 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
7042 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
7043 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
7044 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7047 static void test_effect_skip_constants(IDirect3DDevice9 *device)
7049 HRESULT hr;
7050 ID3DXEffect *effect;
7051 unsigned int passes_count;
7052 D3DXVECTOR4 fvect;
7053 unsigned int i;
7055 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7056 NULL, NULL, "v3", 0, NULL, &effect, NULL);
7057 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7058 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7059 NULL, NULL, "v4", 0, NULL, &effect, NULL);
7060 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7061 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7062 NULL, NULL, "v1;v5;v4", 0, NULL, &effect, NULL);
7063 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7065 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7066 NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL);
7067 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7069 ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"),
7070 "Unexpected IsParameterUsed result.\n");
7071 ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"),
7072 "Unexpected IsParameterUsed result.\n");
7073 ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"),
7074 "Unexpected IsParameterUsed result.\n");
7075 ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"),
7076 "Unexpected IsParameterUsed result.\n");
7077 ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"),
7078 "Unexpected IsParameterUsed result.\n");
7079 ok(!effect->lpVtbl->IsParameterUsed(effect, "v6", "tech0"),
7080 "Unexpected IsParameterUsed result.\n");
7082 hr = effect->lpVtbl->SetFloat(effect, "v1", 28.0f);
7083 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7084 hr = effect->lpVtbl->SetFloat(effect, "v2", 29.0f);
7085 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7086 hr = effect->lpVtbl->SetFloat(effect, "v3", 30.0f);
7087 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7088 hr = effect->lpVtbl->SetFloat(effect, "v4", 31.0f);
7089 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7090 hr = effect->lpVtbl->SetFloat(effect, "v5", 32.0f);
7091 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7093 test_effect_clear_vconsts(device);
7095 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7096 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7097 hr = effect->lpVtbl->BeginPass(effect, 0);
7098 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7100 fvect.y = fvect.z = fvect.w = 0.0f;
7101 fvect.x = 30.0f;
7102 test_effect_shared_parameters_compare_vconst(device, 0, &fvect, FALSE);
7103 for (i = 1; i < 4; ++i)
7104 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7105 fvect.x = 31.0f;
7106 test_effect_shared_parameters_compare_vconst(device, 4, &fvect, FALSE);
7107 for (i = 5; i < 256; ++i)
7108 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7110 hr = effect->lpVtbl->EndPass(effect);
7111 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7112 hr = effect->lpVtbl->End(effect);
7113 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7115 effect->lpVtbl->Release(effect);
7118 #if 0
7119 vertexshader vs_arr[2] =
7123 vs_3_0
7124 def c0, 1, 1, 1, 1
7125 dcl_position o0
7126 mov o0, c0
7131 vs_3_sw
7132 def c256, 1, 1, 1, 1
7133 dcl_position o0
7134 mov o0, c256
7138 int i;
7140 technique tech0
7142 pass p0
7144 VertexShader = vs_arr[1];
7147 technique tech1
7149 pass p0
7151 VertexShader = vs_arr[i];
7154 #endif
7155 static const DWORD test_effect_unsupported_shader_blob[] =
7157 0xfeff0901, 0x000000ac, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7158 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7159 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000003,
7160 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006,
7161 0x68636574, 0x00000030, 0x00000004, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
7162 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002, 0x00000002, 0x00000006,
7163 0x00000005, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
7164 0x00000000, 0x00000074, 0x00000000, 0x00000001, 0x0000006c, 0x00000000, 0x00000001, 0x00000092,
7165 0x00000000, 0x00000058, 0x00000054, 0x000000a0, 0x00000000, 0x00000001, 0x00000098, 0x00000000,
7166 0x00000001, 0x00000092, 0x00000000, 0x00000084, 0x00000080, 0x00000002, 0x00000002, 0x00000001,
7167 0x00000038, 0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7168 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40000, 0x0000ffff, 0x00000002,
7169 0x00000038, 0xfffe03ff, 0x05000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7170 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40100, 0x0000ffff, 0x00000001,
7171 0x00000000, 0xffffffff, 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272,
7172 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c,
7173 0x00000100, 0x00000054, 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069,
7174 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7175 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
7176 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
7177 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
7178 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
7179 0xffffffff, 0x00000000, 0x00000001, 0x0000000a, 0x615f7376, 0x315b7272, 0x0000005d,
7182 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS 81
7183 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN 14
7185 static void test_effect_unsupported_shader(void)
7187 IDirect3DVertexShader9 *vshader;
7188 unsigned int passes_count;
7189 IDirect3DDevice9 *device;
7190 UINT byte_code_size;
7191 ID3DXEffect *effect;
7192 void *byte_code;
7193 ULONG refcount;
7194 HWND window;
7195 HRESULT hr;
7197 if (!(device = create_device(&window)))
7198 return;
7200 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7201 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7202 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7204 hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique");
7205 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7206 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7207 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7209 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7210 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7211 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7212 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7213 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7214 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7215 hr = effect->lpVtbl->SetInt(effect, "i", 0);
7216 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7217 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7218 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7220 hr = effect->lpVtbl->SetTechnique(effect, "tech0");
7221 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7222 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7223 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7224 hr = effect->lpVtbl->BeginPass(effect, 0);
7225 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7227 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7228 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7229 ok(!vshader, "Got non NULL vshader.\n");
7231 hr = effect->lpVtbl->EndPass(effect);
7232 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7233 hr = effect->lpVtbl->End(effect);
7234 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7236 hr = effect->lpVtbl->SetTechnique(effect, "tech1");
7237 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7238 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7239 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7240 hr = effect->lpVtbl->BeginPass(effect, 0);
7241 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7243 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7244 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
7245 ok(!!vshader, "Got NULL vshader.\n");
7246 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
7247 ok(hr == D3D_OK, "Got result %x.\n", hr);
7248 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
7249 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
7250 ok(hr == D3D_OK, "Got result %x.\n", hr);
7251 ok(byte_code_size == TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN * sizeof(DWORD),
7252 "Got unexpected byte code size %u.\n", byte_code_size);
7253 ok(!memcmp(byte_code,
7254 &test_effect_unsupported_shader_blob[TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS],
7255 byte_code_size), "Incorrect shader selected.\n");
7256 HeapFree(GetProcessHeap(), 0, byte_code);
7257 IDirect3DVertexShader9_Release(vshader);
7259 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7260 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7261 hr = effect->lpVtbl->CommitChanges(effect);
7262 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7263 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7264 ok(hr == D3D_OK, "Got result %x.\n", hr);
7265 ok(!vshader, "Got non NULL vshader.\n");
7267 effect->lpVtbl->Release(effect);
7269 refcount = IDirect3DDevice9_Release(device);
7270 ok(!refcount, "Device has %u references left.\n", refcount);
7271 DestroyWindow(window);
7274 #if 0
7275 vertexshader vs_arr[2];
7277 int i;
7279 technique tech0
7281 pass p0
7283 VertexShader = null;
7286 technique tech1
7288 pass p0
7290 VertexShader = vs_arr[i];
7293 #endif
7294 static const DWORD test_effect_null_shader_blob[] =
7296 0xfeff0901, 0x000000b4, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7297 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7298 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000000,
7299 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
7300 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000010, 0x00000004, 0x00000000,
7301 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002,
7302 0x00000002, 0x00000005, 0x00000004, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c,
7303 0x00000048, 0x00000000, 0x00000000, 0x0000007c, 0x00000000, 0x00000001, 0x00000074, 0x00000000,
7304 0x00000001, 0x00000092, 0x00000000, 0x00000058, 0x00000054, 0x000000a8, 0x00000000, 0x00000001,
7305 0x000000a0, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x0000008c, 0x00000088, 0x00000002,
7306 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xffffffff,
7307 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0023fffe,
7308 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000054,
7309 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069, 0x00020000, 0x00010001,
7310 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
7311 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
7312 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
7313 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
7314 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7317 static void test_effect_null_shader(void)
7319 IDirect3DDevice9 *device;
7320 ID3DXEffect *effect;
7321 D3DXPASS_DESC desc;
7322 D3DXHANDLE pass;
7323 ULONG refcount;
7324 HWND window;
7325 HRESULT hr;
7327 /* Creating a fresh device because the existing device can have invalid
7328 * render states from previous tests. If IDirect3DDevice9_ValidateDevice()
7329 * returns certain error codes, native ValidateTechnique() fails. */
7330 if (!(device = create_device(&window)))
7331 return;
7333 hr = D3DXCreateEffectEx(device, test_effect_null_shader_blob,
7334 sizeof(test_effect_null_shader_blob), NULL, NULL, NULL, 0, NULL, &effect, NULL);
7335 ok(hr == D3D_OK, "Failed to create effect, hr %#x.\n", hr);
7337 pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
7338 ok(!!pass, "GetPass() failed.\n");
7339 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7340 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7341 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7343 pass = effect->lpVtbl->GetPass(effect, "tech1", 0);
7344 ok(!!pass, "GetPass() failed.\n");
7345 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7346 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7347 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7349 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7350 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7351 hr = effect->lpVtbl->SetInt(effect, "i", 0);
7352 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7353 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7354 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7355 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7356 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7357 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7358 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7360 hr = effect->lpVtbl->SetInt(effect, "i", 2);
7361 ok(hr == D3D_OK, "Failed to set parameter, hr %#x.\n", hr);
7362 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7363 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7365 effect->lpVtbl->Release(effect);
7367 refcount = IDirect3DDevice9_Release(device);
7368 ok(!refcount, "Device has %u references left.\n", refcount);
7369 DestroyWindow(window);
7372 static void test_effect_clone(void)
7374 IDirect3DDevice9 *device, *device2, *device3;
7375 ID3DXEffect *effect, *cloned;
7376 HWND window, window2;
7377 ULONG refcount;
7378 HRESULT hr;
7380 if (!(device = create_device(&window)))
7381 return;
7383 /* D3DXFX_NOT_CLONEABLE */
7384 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
7385 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
7386 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7388 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7389 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7391 cloned = (void *)0xdeadbeef;
7392 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7393 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7394 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7396 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7397 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7399 cloned = (void *)0xdeadbeef;
7400 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7401 ok(hr == E_FAIL, "Got result %#x.\n", hr);
7402 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7404 effect->lpVtbl->Release(effect);
7406 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
7407 NULL, NULL, 0, NULL, &effect, NULL);
7408 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7410 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7411 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7413 cloned = (void *)0xdeadbeef;
7414 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7415 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7416 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7418 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7419 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7421 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7422 todo_wine
7423 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7424 if (hr == D3D_OK)
7426 ok(cloned != effect, "Expected new effect instance.\n");
7427 cloned->lpVtbl->Release(cloned);
7429 /* Try with different device. */
7430 device2 = create_device(&window2);
7431 hr = effect->lpVtbl->CloneEffect(effect, device2, &cloned);
7432 todo_wine
7433 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7434 if (hr == D3D_OK)
7436 ok(cloned != effect, "Expected new effect instance.\n");
7438 hr = cloned->lpVtbl->GetDevice(cloned, &device3);
7439 ok(hr == S_OK, "Failed to get effect device.\n");
7440 ok(device3 == device2, "Unexpected device instance.\n");
7441 IDirect3DDevice9_Release(device3);
7443 cloned->lpVtbl->Release(cloned);
7445 IDirect3DDevice9_Release(device2);
7446 DestroyWindow(window2);
7447 effect->lpVtbl->Release(effect);
7448 refcount = IDirect3DDevice9_Release(device);
7449 ok(!refcount, "Device has %u references left.\n", refcount);
7450 DestroyWindow(window);
7453 static unsigned int get_texture_refcount(IDirect3DTexture9 *iface)
7455 IDirect3DTexture9_AddRef(iface);
7456 return IDirect3DTexture9_Release(iface);
7459 static void test_refcount(void)
7461 IDirect3DTexture9 *texture, *cur_texture, *managed_texture, *sysmem_texture;
7462 unsigned int passes_count;
7463 IDirect3DDevice9 *device;
7464 ID3DXEffect *effect;
7465 ULONG refcount;
7466 HWND window;
7467 HRESULT hr;
7469 if (!(device = create_device(&window)))
7470 return;
7472 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL);
7473 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7475 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob,
7476 sizeof(test_effect_preshader_effect_blob), NULL, NULL,
7477 D3DXFX_DONOTSAVESTATE, NULL, &effect, NULL);
7478 ok(hr == D3D_OK, "Failed to create effect, hr %#x.\n", hr);
7480 hr = effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)texture);
7481 ok(hr == D3D_OK, "Failed to set texture parameter, hr %#x.\n", hr);
7483 hr = effect->lpVtbl->Begin(effect, &passes_count, D3DXFX_DONOTSAVESTATE);
7484 ok(hr == D3D_OK, "Begin() failed, hr %#x.\n", hr);
7486 hr = effect->lpVtbl->BeginPass(effect, 0);
7487 ok(hr == D3D_OK, "BeginPass() 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);
7493 IDirect3DDevice9_SetTexture(device, 0, NULL);
7494 effect->lpVtbl->CommitChanges(effect);
7496 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7497 ok(cur_texture == NULL, "Unexpected current texture %p.\n", cur_texture);
7499 hr = effect->lpVtbl->EndPass(effect);
7500 ok(hr == D3D_OK, "EndPass() failed, hr %#x.\n", hr);
7502 hr = effect->lpVtbl->BeginPass(effect, 0);
7503 ok(hr == D3D_OK, "BeginPass() failed, hr %#x.\n", hr);
7505 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7506 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7507 IDirect3DTexture9_Release(cur_texture);
7509 hr = effect->lpVtbl->EndPass(effect);
7510 ok(hr == D3D_OK, "EndPass() failed, hr %#x.\n", hr);
7511 hr = effect->lpVtbl->End(effect);
7512 ok(hr == D3D_OK, "End() failed, hr %#x.\n", hr);
7514 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7515 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7516 IDirect3DTexture9_Release(cur_texture);
7517 refcount = get_texture_refcount(texture);
7518 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7520 hr = effect->lpVtbl->OnLostDevice(effect);
7521 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7522 refcount = get_texture_refcount(texture);
7523 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7525 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED,
7526 &managed_texture, NULL);
7527 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7528 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)managed_texture);
7530 refcount = get_texture_refcount(managed_texture);
7531 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7532 hr = effect->lpVtbl->OnLostDevice(effect);
7533 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7534 refcount = get_texture_refcount(managed_texture);
7535 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7537 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM,
7538 &sysmem_texture, NULL);
7539 ok(hr == D3D_OK, "Failed to create texture, hr %#x.\n", hr);
7540 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)sysmem_texture);
7542 refcount = get_texture_refcount(managed_texture);
7543 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7544 IDirect3DTexture9_Release(managed_texture);
7545 refcount = get_texture_refcount(sysmem_texture);
7546 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7547 hr = effect->lpVtbl->OnLostDevice(effect);
7548 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#x.\n", hr);
7549 refcount = get_texture_refcount(sysmem_texture);
7550 ok(refcount == 2, "Unexpected texture refcount %u.\n", refcount);
7552 effect->lpVtbl->Release(effect);
7554 refcount = get_texture_refcount(sysmem_texture);
7555 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7556 IDirect3DTexture9_Release(sysmem_texture);
7558 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7559 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7560 IDirect3DTexture9_Release(cur_texture);
7561 refcount = get_texture_refcount(texture);
7562 ok(refcount == 1, "Unexpected texture refcount %u.\n", refcount);
7563 IDirect3DTexture9_Release(texture);
7565 refcount = IDirect3DDevice9_Release(device);
7566 ok(!refcount, "Device has %u references left.\n", refcount);
7567 DestroyWindow(window);
7570 static HRESULT WINAPI d3dxinclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type,
7571 const char *filename, const void *parent_data, const void **data, UINT *bytes)
7573 static const char include1[] =
7574 "float4 light;\n"
7575 "float4x4 mat;\n"
7576 "float4 color;\n"
7577 "\n"
7578 "struct vs_input\n"
7579 "{\n"
7580 " float4 position : POSITION;\n"
7581 " float3 normal : NORMAL;\n"
7582 "};\n"
7583 "\n"
7584 "struct vs_output\n"
7585 "{\n"
7586 " float4 position : POSITION;\n"
7587 " float4 diffuse : COLOR;\n"
7588 "};\n";
7589 static const char include2[] =
7590 "#include \"include1.h\"\n"
7591 "\n"
7592 "vs_output vs_main(const vs_input v)\n"
7593 "{\n"
7594 " vs_output o;\n"
7595 " const float4 scaled_color = 0.5 * color;\n"
7596 "\n"
7597 " o.position = mul(v.position, mat);\n"
7598 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7599 "\n"
7600 " return o;\n"
7601 "}\n";
7602 static const char effect2[] =
7603 "#include \"include\\include2.h\"\n"
7604 "\n"
7605 "technique t\n"
7606 "{\n"
7607 " pass p\n"
7608 " {\n"
7609 " VertexShader = compile vs_2_0 vs_main();\n"
7610 " }\n"
7611 "}\n";
7612 char *buffer;
7614 trace("filename %s.\n", filename);
7615 trace("parent_data %p: %s.\n", parent_data, parent_data ? (char *)parent_data : "(null)");
7617 if (!strcmp(filename, "effect2.fx"))
7619 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(effect2));
7620 memcpy(buffer, effect2, sizeof(effect2));
7621 *bytes = sizeof(effect2);
7622 ok(!parent_data, "Unexpected parent_data value.\n");
7624 else if (!strcmp(filename, "include1.h"))
7626 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include1));
7627 memcpy(buffer, include1, sizeof(include1));
7628 *bytes = sizeof(include1);
7629 ok(!strncmp(parent_data, include2, strlen(include2)), "Unexpected parent_data value.\n");
7631 else if (!strcmp(filename, "include\\include2.h"))
7633 buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2));
7634 memcpy(buffer, include2, sizeof(include2));
7635 *bytes = sizeof(include2);
7636 todo_wine ok(parent_data && !strncmp(parent_data, effect2, strlen(effect2)),
7637 "unexpected parent_data value.\n");
7639 else
7641 ok(0, "Unexpected #include for file %s.\n", filename);
7642 return D3DERR_INVALIDCALL;
7644 *data = buffer;
7645 return S_OK;
7648 static HRESULT WINAPI d3dxinclude_close(ID3DXInclude *iface, const void *data)
7650 HeapFree(GetProcessHeap(), 0, (void *)data);
7651 return S_OK;
7654 static const struct ID3DXIncludeVtbl d3dxinclude_vtbl =
7656 d3dxinclude_open,
7657 d3dxinclude_close
7660 struct d3dxinclude
7662 ID3DXInclude ID3DXInclude_iface;
7665 static void test_create_effect_from_file(void)
7667 static const char effect1[] =
7668 "float4 light;\n"
7669 "float4x4 mat;\n"
7670 "float4 color;\n"
7671 "\n"
7672 "struct vs_input\n"
7673 "{\n"
7674 " float4 position : POSITION;\n"
7675 " float3 normal : NORMAL;\n"
7676 "};\n"
7677 "\n"
7678 "struct vs_output\n"
7679 "{\n"
7680 " float4 position : POSITION;\n"
7681 " float4 diffuse : COLOR;\n"
7682 "};\n"
7683 "\n"
7684 "vs_output vs_main(const vs_input v)\n"
7685 "{\n"
7686 " vs_output o;\n"
7687 " const float4 scaled_color = 0.5 * color;\n"
7688 "\n"
7689 " o.position = mul(v.position, mat);\n"
7690 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7691 "\n"
7692 " return o;\n"
7693 "}\n"
7694 "\n"
7695 "technique t\n"
7696 "{\n"
7697 " pass p\n"
7698 " {\n"
7699 " VertexShader = compile vs_2_0 vs_main();\n"
7700 " }\n"
7701 "}\n";
7702 static const char include1[] =
7703 "float4 light;\n"
7704 "float4x4 mat;\n"
7705 "float4 color;\n"
7706 "\n"
7707 "struct vs_input\n"
7708 "{\n"
7709 " float4 position : POSITION;\n"
7710 " float3 normal : NORMAL;\n"
7711 "};\n"
7712 "\n"
7713 "struct vs_output\n"
7714 "{\n"
7715 " float4 position : POSITION;\n"
7716 " float4 diffuse : COLOR;\n"
7717 "};\n";
7718 static const char include1_wrong[] =
7719 "#error \"wrong include\"\n";
7720 static const char include2[] =
7721 "#include \"include1.h\"\n"
7722 "\n"
7723 "vs_output vs_main(const vs_input v)\n"
7724 "{\n"
7725 " vs_output o;\n"
7726 " const float4 scaled_color = 0.5 * color;\n"
7727 "\n"
7728 " o.position = mul(v.position, mat);\n"
7729 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7730 "\n"
7731 " return o;\n"
7732 "}\n";
7733 static const char effect2[] =
7734 "#include \"include\\include2.h\"\n"
7735 "\n"
7736 "technique t\n"
7737 "{\n"
7738 " pass p\n"
7739 " {\n"
7740 " VertexShader = compile vs_2_0 vs_main();\n"
7741 " }\n"
7742 "}\n";
7743 WCHAR effect_path_w[MAX_PATH], filename_w[MAX_PATH];
7744 char effect_path[MAX_PATH], filename[MAX_PATH];
7745 D3DPRESENT_PARAMETERS present_parameters = {0};
7746 unsigned int filename_size;
7747 struct d3dxinclude include;
7748 IDirect3DDevice9 *device;
7749 ID3DXBuffer *messages;
7750 ID3DXEffect *effect;
7751 IDirect3D9 *d3d;
7752 ULONG refcount;
7753 HWND window;
7754 HRESULT hr;
7756 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7757 640, 480, NULL, NULL, NULL, NULL)))
7759 skip("Failed to create window.\n");
7760 return;
7762 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7764 skip("Failed to create IDirect3D9 object.\n");
7765 DestroyWindow(window);
7766 return;
7768 present_parameters.Windowed = TRUE;
7769 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7770 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7771 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7772 if (FAILED(hr))
7774 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
7775 IDirect3D9_Release(d3d);
7776 DestroyWindow(window);
7777 return;
7780 if (!create_file("effect1.fx", effect1, sizeof(effect1) - 1, filename))
7782 skip("Couldn't create temporary file, skipping test.\n");
7783 return;
7786 filename_size = strlen(filename);
7787 filename_size -= sizeof("effect1.fx") - 1;
7788 memcpy(effect_path, filename, filename_size);
7789 effect_path[filename_size] = 0;
7790 MultiByteToWideChar(CP_ACP, 0, effect_path, -1, effect_path_w, ARRAY_SIZE(effect_path_w));
7792 create_directory("include");
7793 create_file("effect2.fx", effect2, sizeof(effect2) - 1, NULL);
7794 create_file("include\\include1.h", include1, sizeof(include1) - 1, NULL);
7795 create_file("include\\include2.h", include2, sizeof(include2) - 1, NULL);
7796 create_file("include1.h", include1_wrong, sizeof(include1_wrong) - 1, NULL);
7798 lstrcpyW(filename_w, effect_path_w);
7799 lstrcatW(filename_w, L"effect1.fx");
7800 effect = NULL;
7801 messages = NULL;
7802 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
7803 0, NULL, &effect, &messages);
7804 todo_wine ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr);
7805 if (messages)
7807 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7808 ID3DXBuffer_Release(messages);
7810 if (effect)
7811 effect->lpVtbl->Release(effect);
7813 lstrcpyW(filename_w, effect_path_w);
7814 lstrcatW(filename_w, L"effect2.fx");
7815 effect = NULL;
7816 messages = NULL;
7817 /* This is apparently broken on native, it ends up using the wrong include. */
7818 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
7819 0, NULL, &effect, &messages);
7820 todo_wine ok(hr == E_FAIL, "Unexpected error, hr %#x.\n", hr);
7821 if (messages)
7823 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7824 ID3DXBuffer_Release(messages);
7826 if (effect)
7827 effect->lpVtbl->Release(effect);
7829 delete_file("effect1.fx");
7830 delete_file("effect2.fx");
7831 delete_file("include\\include1.h");
7832 delete_file("include\\include2.h");
7833 delete_file("include2.h");
7834 delete_directory("include");
7836 lstrcpyW(filename_w, L"effect2.fx");
7837 effect = NULL;
7838 messages = NULL;
7839 include.ID3DXInclude_iface.lpVtbl = &d3dxinclude_vtbl;
7840 /* This is actually broken in native d3dx9 (manually tried multiple
7841 * versions, all are affected). For reference, the message printed below
7842 * is "ID3DXEffectCompiler: There were no techniques" */
7843 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, &include.ID3DXInclude_iface, NULL,
7844 0, NULL, &effect, &messages);
7845 todo_wine ok(hr == E_FAIL, "D3DXInclude test failed with error %#x.\n", hr);
7846 if (messages)
7848 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
7849 ID3DXBuffer_Release(messages);
7852 refcount = IDirect3DDevice9_Release(device);
7853 ok(!refcount, "Device has %u references left.\n", refcount);
7854 IDirect3D9_Release(d3d);
7855 DestroyWindow(window);
7858 #if 0
7859 technique tech0
7861 pass p0
7863 LightEnable[0] = FALSE;
7864 FogEnable = FALSE;
7867 technique tech1
7869 pass p0
7871 LightEnable[0] = TRUE;
7872 FogEnable = TRUE;
7875 #endif
7876 static const DWORD test_two_techniques_blob[] =
7878 0xfeff0901, 0x000000ac, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
7879 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
7880 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030,
7881 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7882 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
7883 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000000, 0x00000002, 0x00000002,
7884 0x00000001, 0x0000004c, 0x00000000, 0x00000001, 0x00000044, 0x00000000, 0x00000002, 0x00000091,
7885 0x00000000, 0x00000008, 0x00000004, 0x0000000e, 0x00000000, 0x00000028, 0x00000024, 0x000000a0,
7886 0x00000000, 0x00000001, 0x00000098, 0x00000000, 0x00000002, 0x00000091, 0x00000000, 0x0000005c,
7887 0x00000058, 0x0000000e, 0x00000000, 0x0000007c, 0x00000078, 0x00000000, 0x00000000,
7890 static void test_effect_find_next_valid_technique(void)
7892 D3DPRESENT_PARAMETERS present_parameters = {0};
7893 IDirect3DDevice9 *device;
7894 D3DXTECHNIQUE_DESC desc;
7895 ID3DXEffect *effect;
7896 IDirect3D9 *d3d;
7897 D3DXHANDLE tech;
7898 ULONG refcount;
7899 HWND window;
7900 HRESULT hr;
7902 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7903 640, 480, NULL, NULL, NULL, NULL)))
7905 skip("Failed to create window.\n");
7906 return;
7908 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7910 skip("Failed to create IDirect3D9 object.\n");
7911 DestroyWindow(window);
7912 return;
7914 present_parameters.Windowed = TRUE;
7915 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7916 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7917 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7918 if (FAILED(hr))
7920 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
7921 IDirect3D9_Release(d3d);
7922 DestroyWindow(window);
7923 return;
7926 hr = D3DXCreateEffectEx(device, test_two_techniques_blob, sizeof(test_two_techniques_blob),
7927 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7928 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7930 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7931 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7932 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7933 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7934 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7936 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7937 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7938 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7939 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7940 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7942 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7943 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7944 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7945 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7946 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7948 effect->lpVtbl->Release(effect);
7950 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7951 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7952 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7954 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7955 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7956 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7957 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7958 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7960 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7961 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7962 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7963 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7964 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7966 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7967 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7969 tech = (D3DXHANDLE)0xdeadbeef;
7970 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
7971 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7972 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7973 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7974 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
7976 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7977 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7979 hr = effect->lpVtbl->SetInt(effect, "i", 0);
7980 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
7982 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7983 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7984 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
7985 ok(hr == D3D_OK, "Got result %#x.\n", hr);
7986 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
7988 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
7989 ok(hr == S_FALSE, "Got result %#x.\n", hr);
7991 hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech);
7992 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
7994 effect->lpVtbl->Release(effect);
7996 refcount = IDirect3DDevice9_Release(device);
7997 ok(!refcount, "Device has %u references left.\n", refcount);
7998 IDirect3D9_Release(d3d);
7999 DestroyWindow(window);
8002 static void test_effect_parameter_block(void)
8004 static const D3DXMATRIX test_mat =
8006 -11.0f, -12.0f, 0.0f, 0.0f,
8007 -21.0f, -22.0f, 0.0f, 0.0f,
8008 -31.0f, -32.0f, 0.0f, 0.0f,
8009 }}};
8010 static const D3DXMATRIX effect_orig_mat =
8012 11.0f, 12.0f, 0.0f, 0.0f,
8013 21.0f, 22.0f, 0.0f, 0.0f,
8014 31.0f, 32.0f, 0.0f, 0.0f,
8015 }}};
8016 D3DPRESENT_PARAMETERS present_parameters = {0};
8017 static const float float_array_zero[4];
8018 IDirect3DTexture9 *texture, *tex_test;
8019 D3DXHANDLE block, block2, handle;
8020 ID3DXEffect *effect, *effect2;
8021 D3DXMATRIX mat, mat_arr[2];
8022 IDirect3DDevice9 *device;
8023 ID3DXEffectPool *pool;
8024 float float_array[4];
8025 float float_value;
8026 IDirect3D9 *d3d;
8027 ULONG refcount;
8028 HWND window;
8029 HRESULT hr;
8031 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
8032 640, 480, NULL, NULL, NULL, NULL)))
8034 skip("Failed to create window.\n");
8035 return;
8037 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
8039 skip("Failed to create IDirect3D9 object.\n");
8040 DestroyWindow(window);
8041 return;
8043 present_parameters.Windowed = TRUE;
8044 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
8045 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
8046 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
8047 if (FAILED(hr))
8049 skip("Failed to create IDirect3DDevice9 object, hr %#x.\n", hr);
8050 IDirect3D9_Release(d3d);
8051 DestroyWindow(window);
8052 return;
8055 hr = D3DXCreateEffectPool(&pool);
8056 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8058 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
8059 NULL, NULL, 0, pool, &effect, NULL);
8060 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8061 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
8062 NULL, NULL, 0, pool, &effect2, NULL);
8063 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8065 hr = effect->lpVtbl->BeginParameterBlock(effect);
8066 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8067 hr = effect->lpVtbl->BeginParameterBlock(effect);
8068 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
8069 block = effect->lpVtbl->EndParameterBlock(effect);
8070 ok(!!block, "Got unexpected block %p.\n", block);
8071 handle = effect->lpVtbl->EndParameterBlock(effect);
8072 ok(!handle, "Got unexpected handle %p.\n", handle);
8074 /* Block doesn't hold effect reference. */
8075 effect->lpVtbl->AddRef(effect);
8076 refcount = effect->lpVtbl->Release(effect);
8077 ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
8079 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8080 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
8081 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8082 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8084 hr = effect->lpVtbl->BeginParameterBlock(effect);
8085 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8086 hr = effect->lpVtbl->SetFloat(effect, "vec3[0]", 1001.0f);
8087 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
8088 hr = effect->lpVtbl->SetFloat(effect, "arr1[0]", 91.0f);
8089 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8090 block = effect->lpVtbl->EndParameterBlock(effect);
8091 ok(!!block, "Got unexpected block %p.\n", block);
8092 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8093 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8095 hr = effect->lpVtbl->DeleteParameterBlock(effect2, block);
8096 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
8097 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8098 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8100 hr = effect->lpVtbl->ApplyParameterBlock(effect, NULL);
8101 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
8102 hr = effect->lpVtbl->ApplyParameterBlock(effect, "parameter_block");
8103 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
8105 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
8106 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
8108 hr = effect->lpVtbl->BeginParameterBlock(effect);
8109 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8111 /* Effect parameters are not updated during recording. */
8112 hr = effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)texture);
8113 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8115 hr = effect->lpVtbl->GetTexture(effect, "tex1", (IDirect3DBaseTexture9 **)&tex_test);
8116 ok(hr == D3D_OK && !tex_test, "Got unexpected hr %#x, tex_test %p.\n", hr, tex_test);
8118 /* Child parameters and array members are recorded separately (the whole
8119 * parameter is not updated when parameter block is applied). */
8120 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 92.0f);
8121 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8122 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 28.0f);
8123 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8124 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8125 ok(hr == D3D_OK && float_value == 12.0, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8127 float_array[0] = -29.0f;
8128 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array, 1);
8129 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8130 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 1);
8131 ok(hr == D3D_OK && float_array[0] == 13.0, "Got unexpected hr %#x, float_array[0] %g.\n",
8132 hr, float_array[0]);
8134 memset(&mat, 0, sizeof(mat));
8135 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &test_mat);
8136 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8137 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8138 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8139 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8141 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &test_mat);
8142 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8143 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8144 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8145 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8147 /* Setting shared parameter through effect2 is not recorded to effect
8148 * parameter block. */
8149 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[1]", -1.0f);
8150 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8151 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8152 ok(float_value == -1.0f, "Unexpected value %g.\n", float_value);
8154 IDirect3DTexture9_AddRef(texture);
8155 refcount = IDirect3DTexture9_Release(texture);
8156 ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
8158 block = effect->lpVtbl->EndParameterBlock(effect);
8159 ok(!!block, "Got unexpected block %p.\n", block);
8161 IDirect3DTexture9_AddRef(texture);
8162 refcount = IDirect3DTexture9_Release(texture);
8163 ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
8165 hr = effect->lpVtbl->DeleteParameterBlock(effect2, block);
8166 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
8168 IDirect3DTexture9_AddRef(texture);
8169 refcount = IDirect3DTexture9_Release(texture);
8170 ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
8172 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 0.0f);
8173 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8174 hr = effect->lpVtbl->SetFloat(effect, "arr2[1]", 0.0f);
8175 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8176 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v1", float_array_zero, 3);
8177 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8178 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 0.0f);
8179 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8180 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array_zero, 4);
8181 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8182 memset(&mat, 0, sizeof(mat));
8183 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &mat);
8184 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8185 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &mat);
8186 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8188 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8189 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8191 IDirect3DTexture9_AddRef(texture);
8192 refcount = IDirect3DTexture9_Release(texture);
8193 ok(refcount == 3, "Got unexpected refcount %u.\n", refcount);
8195 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8196 ok(hr == D3D_OK && float_value == 92.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8197 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8198 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8200 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8201 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8202 "Got unexpected hr %#x, ts1[0].v1 (%g, %g, %g).\n", hr,
8203 float_array[0], float_array[1], float_array[2]);
8205 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8206 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8207 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8208 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8209 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8210 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8212 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8213 ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8215 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8216 ok(hr == D3D_OK && float_array[0] == -29.0f
8217 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8218 "Got unexpected hr %#x, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8219 float_array[0], float_array[1], float_array[2], float_array[3]);
8221 /* Test applying a parameter block while recording a new one. */
8222 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 0.0f);
8223 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8224 hr = effect->lpVtbl->SetFloat(effect, "arr2[1]", 0.0f);
8225 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8226 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v1", float_array_zero, 3);
8227 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8228 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 0.0f);
8229 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8230 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array_zero, 4);
8231 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8232 memset(&mat, 0, sizeof(mat));
8233 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &effect_orig_mat);
8234 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8235 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &effect_orig_mat);
8236 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8238 hr = effect->lpVtbl->BeginParameterBlock(effect);
8239 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8240 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8241 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8243 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8244 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8245 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8246 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8248 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8249 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8250 "Got unexpected hr %#x, ts1[0].v1 (%g, %g, %g).\n", hr,
8251 float_array[0], float_array[1], float_array[2]);
8253 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8254 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8255 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8256 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8257 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8258 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8260 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8261 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8263 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8264 ok(hr == D3D_OK && float_array[0] == 0.0f
8265 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8266 "Got unexpected hr %#x, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8267 float_array[0], float_array[1], float_array[2], float_array[3]);
8269 block2 = effect->lpVtbl->EndParameterBlock(effect);
8270 ok(!!block2, "Got unexpected block %p.\n", block2);
8272 hr = effect->lpVtbl->ApplyParameterBlock(effect, block2);
8273 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8275 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8276 ok(hr == D3D_OK && float_value == 92.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8277 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8278 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8280 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8281 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8282 "Got unexpected hr %#x, ts1[0].v1 (%g, %g, %g).\n", hr,
8283 float_array[0], float_array[1], float_array[2]);
8285 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8286 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8287 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8288 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8289 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8290 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8292 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8293 ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr %#x, float_value %g.\n", hr, float_value);
8295 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8296 ok(hr == D3D_OK && float_array[0] == -29.0f
8297 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8298 "Got unexpected hr %#x, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8299 float_array[0], float_array[1], float_array[2], float_array[3]);
8301 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8302 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8303 hr = effect->lpVtbl->DeleteParameterBlock(effect, block2);
8304 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8306 hr = effect->lpVtbl->SetTexture(effect, "tex1", NULL);
8307 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8308 refcount = IDirect3DTexture9_Release(texture);
8309 ok(!refcount, "Got unexpected refcount %u.\n", refcount);
8311 refcount = effect->lpVtbl->Release(effect);
8312 ok(!refcount, "Got unexpected refcount %u.\n", refcount);
8314 refcount = effect2->lpVtbl->Release(effect2);
8315 ok(!refcount, "Got unexpected refcount %u.\n", refcount);
8317 refcount = pool->lpVtbl->Release(pool);
8318 ok(!refcount, "Got unexpected refcount %u.\n", refcount);
8320 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_float, sizeof(test_effect_parameter_value_blob_float),
8321 NULL, NULL, 0, NULL, &effect, NULL);
8322 hr = effect->lpVtbl->BeginParameterBlock(effect);
8323 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8324 mat_arr[0] = mat_arr[1] = test_mat;
8325 hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
8326 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8327 block = effect->lpVtbl->EndParameterBlock(effect);
8328 ok(!!block, "Got unexpected block %p.\n", block);
8330 memset(mat_arr, 0, sizeof(mat_arr));
8331 hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
8332 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8333 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8334 ok(hr == D3D_OK, "Got result %#x.\n", hr);
8336 hr = effect->lpVtbl->GetMatrixArray(effect, "f33_2", mat_arr, 2);
8337 ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
8338 ok(!memcmp(&mat_arr[0], &test_mat, sizeof(test_mat))
8339 && !memcmp(&mat_arr[1], &test_mat, sizeof(test_mat)), "Got unexpected matrix array.\n");
8341 refcount = effect->lpVtbl->Release(effect);
8342 ok(!refcount, "Got unexpected refcount %u.\n", refcount);
8344 refcount = IDirect3DDevice9_Release(device);
8345 ok(!refcount, "Device has %u references left.\n", refcount);
8346 IDirect3D9_Release(d3d);
8347 DestroyWindow(window);
8350 START_TEST(effect)
8352 IDirect3DDevice9 *device;
8353 ULONG refcount;
8354 HWND wnd;
8356 if (!(device = create_device(&wnd)))
8357 return;
8359 test_create_effect_and_pool(device);
8360 test_create_effect_compiler();
8361 test_effect_parameter_value(device);
8362 test_effect_setvalue_object(device);
8363 test_effect_variable_names(device);
8364 test_effect_compilation_errors(device);
8365 test_effect_states(device);
8366 test_effect_preshader(device);
8367 test_effect_preshader_ops(device);
8368 test_effect_isparameterused(device);
8369 test_effect_out_of_bounds_selector(device);
8370 test_effect_commitchanges(device);
8371 test_effect_preshader_relative_addressing(device);
8372 test_effect_state_manager(device);
8373 test_cross_effect_handle(device);
8374 test_effect_shared_parameters(device);
8375 test_effect_large_address_aware_flag(device);
8376 test_effect_get_pass_desc(device);
8377 test_effect_skip_constants(device);
8379 refcount = IDirect3DDevice9_Release(device);
8380 ok(!refcount, "Device has %u references left.\n", refcount);
8381 DestroyWindow(wnd);
8383 test_effect_unsupported_shader();
8384 test_effect_null_shader();
8385 test_effect_clone();
8386 test_refcount();
8387 test_create_effect_from_file();
8388 test_effect_find_next_valid_technique();
8389 test_effect_parameter_block();