include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blob0e7028f38b6051f75f9743fb7f2744ac4f74f7cd
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_uint(unsigned int x, unsigned int y, unsigned int max_diff)
28 unsigned int diff = x > y ? x - y : y - x;
30 return diff <= max_diff;
33 static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps)
35 INT x = *(INT *)&f;
36 INT y = *(INT *)&g;
38 if (x < 0)
39 x = INT_MIN - x;
40 if (y < 0)
41 y = INT_MIN - y;
43 return compare_uint(x, y, ulps);
46 static inline INT get_int(D3DXPARAMETER_TYPE type, const void *data)
48 INT i;
50 switch (type)
52 case D3DXPT_FLOAT:
53 i = *(FLOAT *)data;
54 break;
56 case D3DXPT_INT:
57 i = *(INT *)data;
58 break;
60 case D3DXPT_BOOL:
61 i = *(BOOL *)data;
62 break;
64 default:
65 i = 0;
66 ok(0, "Unhandled type %x.\n", type);
67 break;
70 return i;
73 static inline float get_float(D3DXPARAMETER_TYPE type, const void *data)
75 float f;
77 switch (type)
79 case D3DXPT_FLOAT:
80 f = *(FLOAT *)data;
81 break;
83 case D3DXPT_INT:
84 f = *(INT *)data;
85 break;
87 case D3DXPT_BOOL:
88 f = *(BOOL *)data;
89 break;
91 default:
92 f = 0.0f;
93 ok(0, "Unhandled type %x.\n", type);
94 break;
97 return f;
100 static inline BOOL get_bool(const void *data)
102 return !!*(BOOL *)data;
105 static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
107 switch (outtype)
109 case D3DXPT_FLOAT:
110 *(FLOAT *)outdata = get_float(intype, indata);
111 break;
113 case D3DXPT_BOOL:
114 *(BOOL *)outdata = get_bool(indata);
115 break;
117 case D3DXPT_INT:
118 *(INT *)outdata = get_int(intype, indata);
119 break;
121 case D3DXPT_PIXELSHADER:
122 case D3DXPT_VERTEXSHADER:
123 case D3DXPT_TEXTURE2D:
124 case D3DXPT_STRING:
125 *(INT *)outdata = 0x12345678;
126 break;
128 default:
129 ok(0, "Unhandled type %x.\n", outtype);
130 *(INT *)outdata = 0;
131 break;
135 static IDirect3DDevice9 *create_device(HWND *window)
137 D3DPRESENT_PARAMETERS present_parameters = { 0 };
138 IDirect3DDevice9 *device;
139 IDirect3D9 *d3d;
140 HRESULT hr;
141 HWND wnd;
143 *window = NULL;
145 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
146 640, 480, NULL, NULL, NULL, NULL)))
148 skip("Couldn't create application window.\n");
149 return NULL;
152 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
154 skip("Couldn't create IDirect3D9 object.\n");
155 DestroyWindow(wnd);
156 return NULL;
159 present_parameters.Windowed = TRUE;
160 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
161 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING,
162 &present_parameters, &device);
163 IDirect3D9_Release(d3d);
164 if (FAILED(hr))
166 skip("Failed to create IDirect3DDevice9 object %#lx.\n", hr);
167 DestroyWindow(wnd);
168 return NULL;
171 *window = wnd;
172 return device;
175 static char temp_path[MAX_PATH];
177 static BOOL create_file(const char *filename, const char *data, const unsigned int size, char *out_path)
179 DWORD written;
180 HANDLE hfile;
181 char path[MAX_PATH];
183 if (!*temp_path)
184 GetTempPathA(sizeof(temp_path), temp_path);
186 strcpy(path, temp_path);
187 strcat(path, filename);
188 hfile = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
189 if (hfile == INVALID_HANDLE_VALUE)
190 return FALSE;
192 if (WriteFile(hfile, data, size, &written, NULL))
194 CloseHandle(hfile);
196 if (out_path)
197 strcpy(out_path, path);
198 return TRUE;
201 CloseHandle(hfile);
202 return FALSE;
205 static void delete_file(const char *filename)
207 char path[MAX_PATH];
209 strcpy(path, temp_path);
210 strcat(path, filename);
211 DeleteFileA(path);
214 static BOOL create_directory(const char *name)
216 char path[MAX_PATH];
218 strcpy(path, temp_path);
219 strcat(path, name);
220 return CreateDirectoryA(path, NULL);
223 static void delete_directory(const char *name)
225 char path[MAX_PATH];
227 strcpy(path, temp_path);
228 strcat(path, name);
229 RemoveDirectoryA(path);
232 static const char effect_desc[] =
233 "Technique\n"
234 "{\n"
235 "}\n";
237 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
239 HRESULT hr;
240 ID3DXEffect *effect;
241 ID3DXBaseEffect *base;
242 ULONG count;
243 IDirect3DDevice9 *device2;
244 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
245 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
247 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
248 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
250 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
251 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
253 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
254 ok(hr == E_FAIL, "Got result %lx, expected %lx (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
256 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
257 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
259 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
260 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
262 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
263 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %lx, expected %lx (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
265 hr = effect->lpVtbl->GetStateManager(effect, NULL);
266 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %lx, expected %lx (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
268 hr = effect->lpVtbl->GetStateManager(effect, &manager);
269 ok(hr == D3D_OK, "GetStateManager failed, got %lx, expected 0 (D3D_OK)\n", hr);
270 ok(!manager, "GetStateManager failed, got %p\n", manager);
272 /* this works, but it is not recommended! */
273 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
274 ok(hr == D3D_OK, "SetStateManager failed, got %lx, expected 0 (D3D_OK)\n", hr);
276 hr = effect->lpVtbl->GetStateManager(effect, &manager);
277 ok(hr == D3D_OK, "GetStateManager failed, got %lx, expected 0 (D3D_OK)\n", hr);
278 ok(manager != NULL, "GetStateManager failed\n");
280 IDirect3DDevice9_AddRef(device);
281 count = IDirect3DDevice9_Release(device);
282 ok(count == 4, "Release failed, got %lu, expected 4\n", count);
284 count = IUnknown_Release(manager);
285 ok(count == 3, "Release failed, got %lu, expected 3\n", count);
287 hr = effect->lpVtbl->SetStateManager(effect, NULL);
288 ok(hr == D3D_OK, "SetStateManager failed, got %lx, expected 0 (D3D_OK)\n", hr);
290 hr = effect->lpVtbl->GetPool(effect, &pool);
291 ok(hr == D3D_OK, "GetPool failed, got %lx, expected 0 (D3D_OK)\n", hr);
292 ok(!pool, "GetPool failed, got %p\n", pool);
294 hr = effect->lpVtbl->GetPool(effect, NULL);
295 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %lx, expected %lx (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
297 hr = effect->lpVtbl->GetDevice(effect, &device2);
298 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
300 hr = effect->lpVtbl->GetDevice(effect, NULL);
301 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %lx, expected %lx (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
303 count = IDirect3DDevice9_Release(device2);
304 ok(count == 2, "Release failed, got %lu, expected 2\n", count);
306 count = effect->lpVtbl->Release(effect);
307 ok(count == 0, "Release failed %lu\n", count);
309 hr = D3DXCreateEffectPool(NULL);
310 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
312 hr = D3DXCreateEffectPool(&pool);
313 ok(hr == S_OK, "Got result %lx, expected 0 (S_OK)\n", hr);
315 count = pool->lpVtbl->Release(pool);
316 ok(count == 0, "Release failed %lu\n", count);
318 hr = D3DXCreateEffectPool(&pool);
319 ok(hr == S_OK, "Got result %lx, expected 0 (S_OK)\n", hr);
321 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
322 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
324 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
325 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
326 ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
328 count = pool2->lpVtbl->Release(pool2);
329 ok(count == 1, "Release failed, got %lu, expected 1\n", count);
331 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
332 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
334 count = IDirect3DDevice9_Release(device2);
335 ok(count == 1, "Release failed, got %lu, expected 1\n", count);
337 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
338 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK)\n", hr);
340 hr = effect->lpVtbl->GetPool(effect, &pool);
341 ok(hr == D3D_OK, "GetPool failed, got %lx, expected 0 (D3D_OK)\n", hr);
342 ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
344 count = pool2->lpVtbl->Release(pool2);
345 ok(count == 2, "Release failed, got %lu, expected 2\n", count);
347 count = effect->lpVtbl->Release(effect);
348 ok(count == 0, "Release failed %lu\n", count);
350 count = pool->lpVtbl->Release(pool);
351 ok(count == 0, "Release failed %lu\n", count);
354 static void test_create_effect_compiler(void)
356 HRESULT hr;
357 ID3DXEffectCompiler *compiler, *compiler2;
358 ID3DXBaseEffect *base;
359 IUnknown *unknown;
360 ULONG count;
362 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
363 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
365 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
366 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
368 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
369 ok(hr == D3D_OK, "Got result %lx, expected %lx (D3D_OK)\n", hr, D3D_OK);
370 if (FAILED(hr))
372 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
373 return;
376 count = compiler->lpVtbl->Release(compiler);
377 ok(count == 0, "Release failed %lu\n", count);
379 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
380 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
382 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
383 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
385 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
386 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
388 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
389 ok(hr == D3DERR_INVALIDCALL, "Got result %lx, expected %lx (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
391 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
392 ok(hr == D3D_OK, "Got result %lx, expected %lx (D3D_OK)\n", hr, D3D_OK);
394 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
395 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %lx, expected %lx (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
397 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
398 ok(hr == D3D_OK, "QueryInterface failed, got %lx, expected %lx (D3D_OK)\n", hr, D3D_OK);
400 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
401 ok(hr == D3D_OK, "QueryInterface failed, got %lx, expected %lx (D3D_OK)\n", hr, D3D_OK);
403 count = unknown->lpVtbl->Release(unknown);
404 ok(count == 2, "Release failed, got %lu, expected %u\n", count, 2);
406 count = compiler2->lpVtbl->Release(compiler2);
407 ok(count == 1, "Release failed, got %lu, expected %u\n", count, 1);
409 count = compiler->lpVtbl->Release(compiler);
410 ok(count == 0, "Release failed %lu\n", count);
414 * Parameter value test
416 struct test_effect_parameter_value_result
418 const char *full_name;
419 D3DXPARAMETER_DESC desc;
420 UINT value_offset; /* start position for the value in the blob */
424 * fxc.exe /Tfx_2_0
426 #if 0
427 float f = 0.1;
428 float1 f1 = {1.1};
429 float2 f2 = {2.1, 2.2};
430 float3 f3 = {3.1, 3.2, 3.3};
431 float4 f4 = {4.1, 4.2, 4.3, 4.4};
432 float1x1 f11 = {11.1};
433 float1x2 f12 = {12.1, 12.2};
434 float1x3 f13 = {13.1, 13.2, 13.3};
435 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
436 float2x1 f21 = {{21.11, 21.21}};
437 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
438 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
439 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
440 float3x1 f31 = {{31.11, 31.21, 31.31}};
441 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
442 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
443 {33.13, 33.23, 33.33}};
444 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
445 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
446 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
447 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
448 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
449 {43.13, 43.23, 43.33, 43.43}};
450 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
451 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
452 float f_2[2] = {0.101, 0.102};
453 float1 f1_2[2] = {{1.101}, {1.102}};
454 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
455 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
456 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
457 float1x1 f11_2[2] = {{11.101}, {11.102}};
458 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
459 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
460 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
461 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
462 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
463 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
464 {23.1202, 23.2202}, {23.1302, 23.2302}}};
465 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
466 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
467 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
468 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
469 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
470 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
471 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
472 {33.1302, 33.2302, 33.3302}}};
473 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
474 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
475 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
476 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
477 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
478 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
479 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
480 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
481 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
482 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
483 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
484 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
485 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
486 technique t { pass p { } }
487 #endif
488 static const DWORD test_effect_parameter_value_blob_float[] =
490 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
491 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
492 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
493 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
494 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
495 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
496 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
497 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
498 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
499 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
500 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
501 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
502 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
503 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
504 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
505 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
506 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
507 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
508 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
509 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
510 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
511 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
512 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
513 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
514 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
515 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
516 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
517 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
518 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
519 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
520 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
521 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
522 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
523 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
524 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
525 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
526 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
527 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
528 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
529 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
530 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
531 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
532 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
533 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
534 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
535 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
536 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
537 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
538 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
539 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
540 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
541 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
542 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
543 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
544 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
545 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
546 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
547 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
548 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
549 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
550 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
551 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
552 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
553 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
554 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
555 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
556 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
557 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
558 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
559 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
560 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
561 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
562 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
563 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
564 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
565 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
566 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
567 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
568 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
569 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
570 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
571 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
572 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
573 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
574 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
575 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
576 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
577 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
578 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
579 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
580 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
581 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
582 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
583 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
584 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
585 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
586 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
587 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
588 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
589 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
590 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
591 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
592 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
593 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
594 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
595 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
596 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
597 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
598 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
599 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
600 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
601 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
602 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
603 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
604 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
607 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
609 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
610 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
611 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
612 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
613 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
614 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
615 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
616 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
617 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
618 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
619 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
620 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
621 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
622 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
623 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
624 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
625 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
626 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
627 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
628 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
629 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
630 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
631 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
632 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
633 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
634 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
635 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
636 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
637 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
638 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
639 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
640 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
641 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
642 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
643 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
644 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
645 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
646 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
647 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
648 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
649 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
650 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
654 * fxc.exe /Tfx_2_0
656 #if 0
657 int i = 1;
658 int1 i1 = {11};
659 int2 i2 = {21, 22};
660 int3 i3 = {31, 32, 33};
661 int4 i4 = {41, 42, 43, 44};
662 int1x1 i11 = {111};
663 int1x2 i12 = {121, 122};
664 int1x3 i13 = {131, 132, 133};
665 int1x4 i14 = {141, 142, 143, 144};
666 int2x1 i21 = {{2111, 2121}};
667 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
668 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
669 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
670 int3x1 i31 = {{3111, 3121, 3131}};
671 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
672 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
673 {3313, 3323, 3333}};
674 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
675 {3413, 3423, 3433}, {3414, 3424, 3434}};
676 int4x1 i41 = {{4111, 4121, 4131, 4141}};
677 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
678 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
679 {4313, 4323, 4333, 4343}};
680 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
681 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
682 int i_2[2] = {0101, 0102};
683 int1 i1_2[2] = {{1101}, {1102}};
684 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
685 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
686 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
687 int1x1 i11_2[2] = {{11101}, {11102}};
688 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
689 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
690 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
691 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
692 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
693 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
694 {231202, 232202}, {231302, 232302}}};
695 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
696 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
697 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
698 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
699 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
700 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
701 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
702 {331302, 332302, 333302}}};
703 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
704 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
705 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
706 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
707 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
708 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
709 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
710 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
711 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
712 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
713 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
714 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
715 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
716 technique t { pass p { } }
717 #endif
718 static const DWORD test_effect_parameter_value_blob_int[] =
720 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
721 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
722 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
723 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
724 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
725 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
726 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
727 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
728 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
729 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
730 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
731 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
732 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
733 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
734 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
735 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
736 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
737 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
738 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
739 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
740 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
741 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
742 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
743 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
744 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
745 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
746 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
747 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
748 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
749 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
750 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
751 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
752 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
753 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
754 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
755 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
756 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
757 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
758 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
759 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
760 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
761 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
762 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
763 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
764 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
765 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
766 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
767 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
768 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
769 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
770 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
771 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
772 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
773 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
774 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
775 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
776 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
777 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
778 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
779 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
780 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
781 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
782 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
783 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
784 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
785 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
786 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
787 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
788 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
789 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
790 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
791 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
792 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
793 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
794 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
795 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
796 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
797 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
798 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
799 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
800 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
801 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
802 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
803 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
804 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
805 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
806 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
807 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
808 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
809 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
810 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
811 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
812 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
813 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
814 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
815 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
816 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
817 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
818 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
819 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
820 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
821 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
822 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
823 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
824 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
825 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
826 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
827 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
828 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
829 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
830 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
831 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
832 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
833 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
834 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
837 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
839 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
840 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
841 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
842 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
843 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
844 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
845 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
846 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
847 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
848 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
849 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
850 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
851 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
852 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
853 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
854 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
855 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
856 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
857 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
858 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
859 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
860 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
861 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
862 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
863 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
864 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
865 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
866 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
867 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
868 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
869 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
870 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
871 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
872 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
873 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
874 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
875 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
876 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
877 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
878 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
879 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
880 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
884 * fxc.exe /Tfx_2_0
886 #if 0
887 string s = "test";
888 string s_2[2] = {"test1", "test2"};
889 texture2D tex;
890 Vertexshader v;
891 Vertexshader v_2[2];
892 Pixelshader p;
893 Pixelshader p_2[2];
894 technique t { pass p { } }
895 #endif
896 static const DWORD test_effect_parameter_value_blob_object[] =
898 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
899 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
900 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
901 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
902 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
903 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
904 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
905 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
906 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
907 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
908 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
909 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
910 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
911 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
912 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
913 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
914 0x00000001, 0x00000005, 0x74736574, 0x00000000,
917 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
919 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
920 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
921 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
922 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
923 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
924 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
925 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
929 * fxc.exe /Tfx_2_0
931 #if 0
932 float3 f3 = {-3.1, 153.2, 283.3};
933 float3 f3min = {-31.1, -31.2, -31.3};
934 float3 f3max = {320.1, 320.2, 320.3};
935 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
936 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
937 float4 f4max = {420.1, 42.20, 420.3, 420.4};
938 technique t { pass p { } }
939 #endif
940 static const DWORD test_effect_parameter_value_blob_special[] =
942 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
943 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
944 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
945 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
946 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
947 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
948 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
949 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
950 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
951 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
952 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
953 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
954 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
955 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
956 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
957 0x00000000, 0x00000000,
960 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
962 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
963 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
964 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
965 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
966 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
967 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
970 #define ADD_PARAMETER_VALUE(x) {\
971 test_effect_parameter_value_blob_ ## x,\
972 sizeof(test_effect_parameter_value_blob_ ## x),\
973 test_effect_parameter_value_result_ ## x,\
974 ARRAY_SIZE(test_effect_parameter_value_result_ ## x),\
977 static const struct
979 const DWORD *blob;
980 UINT blob_size;
981 const struct test_effect_parameter_value_result *res;
982 UINT res_count;
984 test_effect_parameter_value_data[] =
986 ADD_PARAMETER_VALUE(float),
987 ADD_PARAMETER_VALUE(int),
988 ADD_PARAMETER_VALUE(object),
989 ADD_PARAMETER_VALUE(special),
992 #undef ADD_PARAMETER_VALUE
994 /* Multiple of 16 to cover complete matrices */
995 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
996 /* Constants for special INT/FLOAT conversation */
997 #define INT_FLOAT_MULTI 255.0f
998 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
1000 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
1001 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1003 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1004 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1005 unsigned int l;
1006 HRESULT hr;
1008 memset(value, 0xab, sizeof(value));
1009 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
1010 if (res_desc->Class == D3DXPC_SCALAR
1011 || res_desc->Class == D3DXPC_VECTOR
1012 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1014 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1016 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
1018 ok(value[l] == res_value[l], "Unexpected value[%u] %#lx, expected %#lx.\n",
1019 l, value[l], res_value[l]);
1022 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1024 ok(value[l] == 0xabababab, "Unexpected value[%u] %#lx.\n", l, value[l]);
1027 else if (res_desc->Class == D3DXPC_OBJECT)
1029 switch (res_desc->Type)
1031 case D3DXPT_PIXELSHADER:
1032 case D3DXPT_VERTEXSHADER:
1033 case D3DXPT_TEXTURE2D:
1034 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1036 for (l = 0; l < (res_desc->Elements ? res_desc->Elements : 1); ++l)
1038 IUnknown *unk = *((IUnknown **)value + l);
1039 if (unk) IUnknown_Release(unk);
1041 break;
1043 case D3DXPT_STRING:
1044 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1045 break;
1047 default:
1048 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1049 break;
1052 else
1054 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1056 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1058 ok(value[l] == 0xabababab, "Unexpected value[%u] %#lx.\n", l, value[l]);
1063 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
1064 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1066 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1067 BOOL bvalue = 0xabababab;
1068 HRESULT hr;
1070 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
1071 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1073 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1074 ok(bvalue == get_bool(res_value), "Unexpected value %#x, expected %#x.\n",
1075 bvalue, get_bool(res_value));
1077 else
1079 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1080 ok(bvalue == 0xabababab, "Unexpected value %#x.\n", bvalue);
1084 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
1085 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1087 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1088 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1089 unsigned int l, err = 0;
1090 HRESULT hr;
1092 memset(bavalue, 0xab, sizeof(bavalue));
1093 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1094 if (res_desc->Class == D3DXPC_SCALAR
1095 || res_desc->Class == D3DXPC_VECTOR
1096 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1098 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1100 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1102 if (bavalue[l] != get_bool(&res_value[l]))
1103 ++err;
1106 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1108 if (bavalue[l] != 0xabababab)
1109 ++err;
1112 else
1114 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1116 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1117 if (bavalue[l] != 0xabababab)
1118 ++err;
1120 ok(!err, "Unexpected value in %u elements.\n", err);
1123 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1124 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1126 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1127 int ivalue = 0xabababab;
1128 HRESULT hr;
1130 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1131 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1133 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1134 ok(ivalue == get_int(res_desc->Type, res_value), "Unexpected value %d, expected %d.\n",
1135 ivalue, get_int(res_desc->Type, res_value));
1137 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1138 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1139 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1141 int tmp;
1143 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1145 tmp = (int)(min(max(0.0f, *((float *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1146 tmp |= ((int)(min(max(0.0f, *((float *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1147 tmp |= ((int)(min(max(0.0f, *((float *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1148 if (res_desc->Columns * res_desc->Rows > 3)
1150 tmp |= ((int)(min(max(0.0f, *((float *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1153 ok(ivalue == tmp, "Unexpected value %x, expected %x.\n", ivalue, tmp);
1155 else
1157 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1158 ok(ivalue == 0xabababab, "Unexpected value %d.\n", ivalue);
1162 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1163 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1165 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1166 int iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1167 unsigned int l, err = 0;
1168 HRESULT hr;
1170 memset(iavalue, 0xab, sizeof(iavalue));
1171 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1172 if (res_desc->Class == D3DXPC_SCALAR
1173 || res_desc->Class == D3DXPC_VECTOR
1174 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1176 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1178 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1180 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1183 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1185 if (iavalue[l] != 0xabababab) ++err;
1188 else
1190 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1192 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1194 ok(!err, "Unexpected value in %u elements.\n", err);
1197 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1198 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1200 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1201 DWORD cmp = 0xabababab;
1202 float fvalue;
1203 HRESULT hr;
1205 fvalue = *(float *)&cmp;
1206 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1207 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1209 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1210 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "Unexpected value %.8e, expected %.8e.\n",
1211 fvalue, get_float(res_desc->Type, res_value));
1213 else
1215 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1216 ok(fvalue == *(float *)&cmp, "Unexpected value %.8e, expected %.8e.\n", fvalue, *(float *)&cmp);
1220 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1221 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1223 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1224 float favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1225 unsigned int l, err = 0;
1226 DWORD cmp = 0xabababab;
1227 HRESULT hr;
1229 memset(favalue, 0xab, sizeof(favalue));
1230 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1231 if (res_desc->Class == D3DXPC_SCALAR
1232 || res_desc->Class == D3DXPC_VECTOR
1233 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1235 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1237 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1239 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512))
1240 ++err;
1243 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1245 if (favalue[l] != *(float *)&cmp)
1246 ++err;
1249 else
1251 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1253 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1255 ok(!err, "Unexpected value in %u elements.\n", err);
1258 static void test_effect_parameter_value_GetVector(const struct test_effect_parameter_value_result *res,
1259 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1261 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1262 unsigned int l, err = 0;
1263 DWORD cmp = 0xabababab;
1264 float fvalue[4];
1265 HRESULT hr;
1267 memset(fvalue, 0xab, sizeof(fvalue));
1268 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1269 if (!res_desc->Elements &&
1270 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1271 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1273 DWORD tmp;
1275 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1277 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1278 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1279 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1280 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1282 if (*res_value != tmp)
1283 ++err;
1285 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1287 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1289 for (l = 0; l < res_desc->Columns; ++l)
1290 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512))
1291 ++err;
1293 for (l = res_desc->Columns; l < 4; ++l)
1294 if (fvalue[l] != 0.0f)
1295 ++err;
1297 else
1299 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1301 for (l = 0; l < 4; ++l)
1302 if (fvalue[l] != *(float *)&cmp)
1303 ++err;
1305 ok(!err, "Unexpected value in %u elements.\n", err);
1308 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1309 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1311 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1312 float fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1313 unsigned int l, k, element, err = 0;
1314 DWORD cmp = 0xabababab;
1315 HRESULT hr;
1317 for (element = 0; element <= res_desc->Elements + 1; ++element)
1319 winetest_push_context("Element %u", element);
1320 memset(fvalue, 0xab, sizeof(fvalue));
1321 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1322 if (!element)
1324 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1326 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1327 if (fvalue[l] != *(float *)&cmp)
1328 ++err;
1330 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1332 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1334 for (k = 0; k < element; ++k)
1336 for (l = 0; l < res_desc->Columns; ++l)
1338 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1339 &res_value[l + k * res_desc->Columns]), 512))
1340 ++err;
1343 for (l = res_desc->Columns; l < 4; ++l)
1344 if (fvalue[l + k * 4] != 0.0f)
1345 ++err;
1348 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1349 if (fvalue[l] != *(float *)&cmp)
1350 ++err;
1352 else
1354 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1356 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1357 if (fvalue[l] != *(float *)&cmp)
1358 ++err;
1360 ok(!err, "Unexpected value in %u elements.\n", err);
1361 winetest_pop_context();
1365 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1366 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1368 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1369 unsigned int l, k, err = 0;
1370 float fvalue[16];
1371 union
1373 DWORD d;
1374 float f;
1375 } cmp;
1376 HRESULT hr;
1378 cmp.d = 0xabababab;
1379 memset(fvalue, 0xab, sizeof(fvalue));
1380 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1381 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1383 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1385 for (k = 0; k < 4; ++k)
1387 for (l = 0; l < 4; ++l)
1389 if (k < res_desc->Columns && l < res_desc->Rows)
1391 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1392 &res_value[l * res_desc->Columns + k]), 512))
1393 ++err;
1395 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1399 else
1401 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1403 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1404 if (fvalue[l] != cmp.f)
1405 ++err;
1407 ok(!err, "Unexpected value in %u elements.\n", err);
1410 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1411 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1413 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1414 float fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1415 unsigned int l, k, m, count, err = 0;
1416 DWORD cmp = 0xabababab;
1417 HRESULT hr;
1419 for (count = 0; count <= res_desc->Elements + 1; ++count)
1421 winetest_push_context("Count %u", count);
1422 memset(fvalue, 0xab, sizeof(fvalue));
1423 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, count);
1424 if (!count)
1426 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1428 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1429 if (fvalue[l] != *(float *)&cmp)
1430 ++err;
1432 else if (count <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1434 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1436 for (m = 0; m < count; ++m)
1438 for (k = 0; k < 4; ++k)
1440 for (l = 0; l < 4; ++l)
1442 if (k < res_desc->Columns && l < res_desc->Rows)
1444 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1445 &res_value[m * res_desc->Columns * res_desc->Rows
1446 + l * res_desc->Columns + k]), 512))
1447 ++err;
1449 else if (fvalue[m * 16 + l * 4 + k] != 0.0f)
1450 ++err;
1455 for (l = count * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1456 if (fvalue[l] != *(float *)&cmp)
1457 ++err;
1459 else
1461 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1463 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1464 if (fvalue[l] != *(float *)&cmp)
1465 ++err;
1467 ok(!err, "Unexpected value in %u elements.\n", err);
1468 winetest_pop_context();
1472 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1473 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1475 union
1477 float f[sizeof(D3DXMATRIX) / sizeof(float)];
1478 D3DXMATRIX m;
1479 } fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE * sizeof(float) / sizeof(D3DXMATRIX)];
1480 D3DXMATRIX *matrix_pointer_array[ARRAY_SIZE(fvalue)];
1481 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1482 unsigned int l, k, m, count, err = 0;
1483 union
1485 DWORD d;
1486 float f;
1487 } cmp = {0xabababab};
1488 HRESULT hr;
1490 for (count = 0; count <= res_desc->Elements + 1; ++count)
1492 winetest_push_context("Count %u", count);
1493 memset(fvalue, 0xab, sizeof(fvalue));
1494 for (l = 0; l < count; ++l)
1496 matrix_pointer_array[l] = &fvalue[l].m;
1498 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, count);
1499 if (!count)
1501 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1503 for (m = 0; m < ARRAY_SIZE(fvalue); ++m)
1504 for (l = 0; l < ARRAY_SIZE(fvalue[l].f); ++l)
1505 if (fvalue[m].f[l] != cmp.f)
1506 ++err;
1508 else if (count <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1510 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1512 for (m = 0; m < count; ++m)
1514 for (k = 0; k < 4; ++k)
1516 for (l = 0; l < 4; ++l)
1518 if (k < res_desc->Columns && l < res_desc->Rows)
1520 if (!compare_float(fvalue[m].m.m[l][k], get_float(res_desc->Type,
1521 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1522 ++err;
1524 else if (fvalue[m].m.m[l][k] != 0.0f)
1525 ++err;
1530 for (m = count; m < ARRAY_SIZE(fvalue); ++m)
1531 for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l)
1532 if (fvalue[m].f[l] != cmp.f)
1533 ++err;
1535 else
1537 for (m = 0; m < ARRAY_SIZE(fvalue); ++m)
1538 for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l)
1539 if (fvalue[m].f[l] != cmp.f)
1540 ++err;
1542 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1544 ok(!err, "Unexpected value in %u elements.\n", err);
1545 winetest_pop_context();
1549 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1550 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1552 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1553 unsigned int l, k, err = 0;
1554 HRESULT hr;
1555 union
1557 DWORD d;
1558 float f;
1559 } cmp;
1560 float fvalue[16];
1562 cmp.d = 0xabababab;
1563 memset(fvalue, 0xab, sizeof(fvalue));
1564 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1565 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1567 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1569 for (k = 0; k < 4; ++k)
1571 for (l = 0; l < 4; ++l)
1573 if (k < res_desc->Columns && l < res_desc->Rows)
1575 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1576 &res_value[l * res_desc->Columns + k]), 512))
1577 ++err;
1579 else if (fvalue[l + k * 4] != 0.0f) ++err;
1583 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1585 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1587 for (k = 0; k < 4; ++k)
1589 for (l = 0; l < 4; ++l)
1591 if (k < res_desc->Columns && l < res_desc->Rows)
1593 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1594 &res_value[l * res_desc->Columns + k]), 512))
1595 ++err;
1597 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1601 else
1603 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1605 for (l = 0; l < ARRAY_SIZE(fvalue); ++l)
1606 if (fvalue[l] != cmp.f)
1607 ++err;
1609 ok(!err, "Unexpected value in %u elements.\n", err);
1612 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1613 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1615 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1616 float fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1617 unsigned int l, k, m, count, err = 0;
1618 DWORD cmp = 0xabababab;
1619 HRESULT hr;
1621 for (count = 0; count <= res_desc->Elements + 1; ++count)
1623 winetest_push_context("Count %u", count);
1624 memset(fvalue, 0xab, sizeof(fvalue));
1625 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, count);
1626 if (!count)
1628 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1630 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1632 else if (count <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1634 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1636 for (m = 0; m < count; ++m)
1638 for (k = 0; k < 4; ++k)
1640 for (l = 0; l < 4; ++l)
1642 if (k < res_desc->Columns && l < res_desc->Rows)
1644 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1645 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1646 ++err;
1648 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1653 for (l = count * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1655 else
1657 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1659 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1661 ok(!err, "Unexpected value in %u elements.\n", err);
1662 winetest_pop_context();
1666 static void test_effect_parameter_value_GetMatrixTransposePointerArray(
1667 const struct test_effect_parameter_value_result *res, ID3DXEffect *effect,
1668 const DWORD *res_value, D3DXHANDLE parameter)
1670 union
1672 float f[sizeof(D3DXMATRIX) / sizeof(float)];
1673 D3DXMATRIX m;
1674 } fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE * sizeof(float) / sizeof(D3DXMATRIX)];
1675 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)];
1676 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1677 unsigned int l, k, m, count, err = 0;
1678 union
1680 DWORD d;
1681 float f;
1682 } cmp = {0xabababab};
1683 HRESULT hr;
1685 for (count = 0; count <= res_desc->Elements + 1; ++count)
1687 winetest_push_context("Count %u", count);
1688 memset(fvalue, 0xab, sizeof(fvalue));
1689 for (l = 0; l < count; ++l)
1691 matrix_pointer_array[l] = &fvalue[l].m;
1693 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, count);
1694 if (!count)
1696 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1698 for (m = 0; m < ARRAY_SIZE(fvalue); ++m)
1699 for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l)
1700 if (fvalue[m].f[l] != cmp.f)
1701 ++err;
1703 else if (count <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1705 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1707 for (m = 0; m < count; ++m)
1709 for (k = 0; k < 4; ++k)
1711 for (l = 0; l < 4; ++l)
1713 if (k < res_desc->Columns && l < res_desc->Rows)
1715 if (!compare_float(fvalue[m].m.m[k][l], get_float(res_desc->Type,
1716 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1717 ++err;
1719 else if (fvalue[m].m.m[k][l] != 0.0f)
1720 ++err;
1725 for (m = count; m < ARRAY_SIZE(fvalue); ++m)
1726 for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l)
1727 if (fvalue[m].f[l] != cmp.f)
1728 ++err;
1730 else
1732 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1734 for (m = 0; m < ARRAY_SIZE(fvalue); ++m)
1735 for (l = 0; l < ARRAY_SIZE(fvalue[m].f); ++l)
1736 if (fvalue[m].f[l] != cmp.f)
1737 ++err;
1739 ok(!err, "Unexpected value in %u elements.\n", err);
1740 winetest_pop_context();
1744 static void test_effect_parameter_values(const struct test_effect_parameter_value_result *res,
1745 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1747 test_effect_parameter_value_GetValue(res, effect, res_value, parameter);
1748 test_effect_parameter_value_GetBool(res, effect, res_value, parameter);
1749 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter);
1750 test_effect_parameter_value_GetInt(res, effect, res_value, parameter);
1751 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter);
1752 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter);
1753 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter);
1754 test_effect_parameter_value_GetVector(res, effect, res_value, parameter);
1755 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter);
1756 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter);
1757 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter);
1758 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter);
1759 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter);
1760 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter);
1761 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter);
1764 static void test_effect_parameter_value_reset(const struct test_effect_parameter_value_result *res,
1765 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter)
1767 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1768 HRESULT hr;
1770 if (res_desc->Class == D3DXPC_SCALAR
1771 || res_desc->Class == D3DXPC_VECTOR
1772 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1774 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1775 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1777 else
1779 /* nothing to do */
1780 switch (res_desc->Type)
1782 case D3DXPT_PIXELSHADER:
1783 case D3DXPT_VERTEXSHADER:
1784 case D3DXPT_TEXTURE2D:
1785 case D3DXPT_STRING:
1786 break;
1788 default:
1789 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1790 break;
1795 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1797 unsigned int effect_count = ARRAY_SIZE(test_effect_parameter_value_data), i;
1799 for (i = 0; i < effect_count; ++i)
1801 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1802 UINT res_count = test_effect_parameter_value_data[i].res_count;
1803 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1804 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1805 D3DXEFFECT_DESC edesc;
1806 ID3DXEffect *effect;
1807 unsigned int k;
1808 ULONG refcount;
1809 HRESULT hr;
1811 winetest_push_context("Test %u", i);
1812 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1813 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1815 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1816 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1817 ok(edesc.Parameters == res_count, "Unexpected Parameters %u, expected %u.\n",
1818 edesc.Parameters, res_count);
1820 for (k = 0; k < res_count; ++k)
1822 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1823 const char *res_full_name = res[k].full_name;
1824 UINT res_value_offset = res[k].value_offset;
1825 D3DXHANDLE parameter;
1826 D3DXPARAMETER_DESC pdesc;
1827 BOOL bvalue = TRUE;
1828 INT ivalue = 42;
1829 FLOAT fvalue = 2.71828f;
1830 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1831 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1832 UINT l, n, m, count;
1833 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/(sizeof(D3DXMATRIX))];
1835 winetest_push_context("Parameter %s", res_full_name);
1836 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1837 ok(!!parameter, "Unexpected parameter %p.\n", parameter);
1839 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1840 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1842 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1843 "Unexpected Name %s, expected %s.\n",
1844 debugstr_a(pdesc.Name), debugstr_a(res_desc->Name));
1845 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1846 "Unexpected Semantic %s, expected %s.\n",
1847 debugstr_a(pdesc.Semantic), debugstr_a(res_desc->Semantic));
1848 ok(res_desc->Class == pdesc.Class, "Unexpected Class %#x, expected %#x.\n",
1849 pdesc.Class, res_desc->Class);
1850 ok(res_desc->Type == pdesc.Type, "Unexpected Type %#x, expected %#x.\n",
1851 pdesc.Type, res_desc->Type);
1852 ok(res_desc->Rows == pdesc.Rows, "Unexpected Rows %u, expected %u.\n",
1853 pdesc.Rows, res_desc->Rows);
1854 ok(res_desc->Columns == pdesc.Columns, "Unexpected Columns %u, expected %u.\n",
1855 pdesc.Columns, res_desc->Columns);
1856 ok(res_desc->Elements == pdesc.Elements, "Unexpected Elements %u, expected %u.\n",
1857 pdesc.Elements, res_desc->Elements);
1858 ok(res_desc->Annotations == pdesc.Annotations, "Unexpected Annotations %u, expected %u.\n",
1859 pdesc.Annotations, res_desc->Annotations);
1860 ok(res_desc->StructMembers == pdesc.StructMembers, "Unexpected StructMembers %u, expected %u.\n",
1861 pdesc.StructMembers, res_desc->StructMembers);
1862 ok(res_desc->Flags == pdesc.Flags, "Unexpected Flags %lu, expected %lu.\n",
1863 pdesc.Flags, res_desc->Flags);
1864 ok(res_desc->Bytes == pdesc.Bytes, "Unexpected Bytes %u, expected %u.\n",
1865 pdesc.Bytes, res_desc->Bytes);
1867 test_effect_parameter_values(&res[k], effect, &blob[res_value_offset], parameter);
1868 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
1869 test_effect_parameter_values(&res[k], effect, &blob[res_value_offset], parameter);
1872 * check invalid calls
1873 * These will crash:
1874 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1875 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1876 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1877 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1878 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1879 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1880 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1881 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1882 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1883 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1884 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1885 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1886 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1887 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1889 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1890 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1892 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1893 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1895 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1896 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1898 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1899 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1901 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1902 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1904 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1905 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1907 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1908 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1910 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1911 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1913 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1914 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1916 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1917 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1919 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1920 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1922 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1923 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1925 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1926 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1928 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1929 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1931 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1932 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1934 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1935 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1937 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1938 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1940 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1941 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1943 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1944 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1946 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1947 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1949 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1950 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1952 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1953 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1955 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1956 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1958 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1959 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1961 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1962 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1964 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1965 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1967 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1968 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1970 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1971 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1973 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1974 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1976 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1977 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1979 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
1980 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1982 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
1983 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
1985 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1986 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1988 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1989 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1991 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1992 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1994 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1995 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
1997 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
1998 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2000 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2001 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2003 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
2004 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2006 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2007 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2009 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
2010 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2012 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
2013 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2015 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
2016 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2018 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
2019 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2021 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
2022 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2024 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
2025 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2027 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2028 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2030 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
2031 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2033 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
2034 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2036 test_effect_parameter_values(&res[k], effect, &blob[res_value_offset], parameter);
2038 /* SetBool */
2039 bvalue = 5;
2040 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2041 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
2042 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2044 bvalue = TRUE;
2045 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
2046 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2048 else
2050 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2052 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2053 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2055 /* SetBoolArray */
2056 *input_value = 1;
2057 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
2059 *(input_value + l) = *(input_value + l - 1) + 1;
2061 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2062 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
2063 if (res_desc->Class == D3DXPC_SCALAR
2064 || res_desc->Class == D3DXPC_VECTOR
2065 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2067 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2069 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
2071 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2073 else
2075 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2077 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2078 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2080 /* SetInt */
2081 ivalue = 0x1fbf02ff;
2082 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2083 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2084 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2086 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2087 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2089 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2090 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2091 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2093 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2094 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2095 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2096 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2097 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2098 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2099 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2100 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2102 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2104 else
2106 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2108 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2109 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2111 /* SetIntArray */
2112 *input_value = 123456;
2113 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2115 *(input_value + l) = *(input_value + l - 1) + 23;
2117 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2118 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2119 if (res_desc->Class == D3DXPC_SCALAR
2120 || res_desc->Class == D3DXPC_VECTOR
2121 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2123 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2125 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2127 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2129 else
2131 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2133 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2134 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2136 /* SetFloat */
2137 fvalue = 1.33;
2138 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2139 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2140 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2142 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2143 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2145 else
2147 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2149 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2150 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2152 /* SetFloatArray */
2153 fvalue = 1.33;
2154 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2156 *(input_value + l) = *(DWORD *)&fvalue;
2157 fvalue += 1.12;
2159 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2160 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2161 if (res_desc->Class == D3DXPC_SCALAR
2162 || res_desc->Class == D3DXPC_VECTOR
2163 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2165 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2167 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2169 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2171 else
2173 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2175 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2176 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2178 /* SetVector */
2179 fvalue = -1.33;
2180 for (l = 0; l < 4; ++l)
2182 *(input_value + l) = *(DWORD *)&fvalue;
2183 fvalue += 1.12;
2185 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2186 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2187 if (!res_desc->Elements &&
2188 (res_desc->Class == D3DXPC_SCALAR
2189 || res_desc->Class == D3DXPC_VECTOR))
2191 /* only values between 0 and INT_FLOAT_MULTI are valid */
2192 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2194 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2195 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2196 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2197 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2199 else
2201 for (l = 0; l < 4; ++l)
2203 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2206 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2208 else
2210 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2212 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2213 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2215 /* SetVectorArray */
2216 for (count = 0; count < res_desc->Elements + 1; ++count)
2218 fvalue = 1.33;
2219 for (l = 0; l < count * 4; ++l)
2221 *(input_value + l) = *(DWORD *)&fvalue;
2222 fvalue += 1.12;
2224 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2225 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, count);
2226 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && count <= res_desc->Elements)
2228 for (m = 0; m < count; ++m)
2230 for (l = 0; l < res_desc->Columns; ++l)
2232 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2235 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2237 else
2239 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2241 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2242 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2245 /* SetMatrix */
2246 fvalue = 1.33;
2247 for (l = 0; l < 16; ++l)
2249 *(input_value + l) = *(DWORD *)&fvalue;
2250 fvalue += 1.12;
2252 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2253 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2254 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2256 for (l = 0; l < 4; ++l)
2258 for (m = 0; m < 4; ++m)
2260 if (m < res_desc->Rows && l < res_desc->Columns)
2261 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2262 input_value + l + m * 4, D3DXPT_FLOAT);
2266 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2268 else
2270 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2272 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2273 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2275 /* SetMatrixArray */
2276 for (count = 0; count < res_desc->Elements + 1; ++count)
2278 fvalue = 1.33;
2279 for (l = 0; l < count * 16; ++l)
2281 *(input_value + l) = *(DWORD *)&fvalue;
2282 fvalue += 1.12;
2284 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2285 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, count);
2286 if (res_desc->Class == D3DXPC_MATRIX_ROWS && count <= res_desc->Elements)
2288 for (n = 0; n < count; ++n)
2290 for (l = 0; l < 4; ++l)
2292 for (m = 0; m < 4; ++m)
2294 if (m < res_desc->Rows && l < res_desc->Columns)
2295 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2296 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2301 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2303 else
2305 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2307 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2308 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2311 /* SetMatrixPointerArray */
2312 for (count = 0; count < res_desc->Elements + 1; ++count)
2314 fvalue = 1.33;
2315 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2317 *(input_value + l) = *(DWORD *)&fvalue;
2318 fvalue += 1.12;
2320 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2321 for (l = 0; l < count; ++l)
2323 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2325 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, count);
2326 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= count)
2328 for (n = 0; n < count; ++n)
2330 for (l = 0; l < 4; ++l)
2332 for (m = 0; m < 4; ++m)
2334 if (m < res_desc->Rows && l < res_desc->Columns)
2335 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2336 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2341 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2343 else
2345 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2347 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2348 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2351 /* SetMatrixTranspose */
2352 fvalue = 1.33;
2353 for (l = 0; l < 16; ++l)
2355 *(input_value + l) = *(DWORD *)&fvalue;
2356 fvalue += 1.12;
2358 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2359 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2360 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2362 for (l = 0; l < 4; ++l)
2364 for (m = 0; m < 4; ++m)
2366 if (m < res_desc->Rows && l < res_desc->Columns)
2367 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2368 input_value + l * 4 + m, D3DXPT_FLOAT);
2372 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2374 else
2376 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2378 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2379 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2381 /* SetMatrixTransposeArray */
2382 for (count = 0; count < res_desc->Elements + 1; ++count)
2384 fvalue = 1.33;
2385 for (l = 0; l < count * 16; ++l)
2387 *(input_value + l) = *(DWORD *)&fvalue;
2388 fvalue += 1.12;
2390 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2391 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, count);
2392 if (res_desc->Class == D3DXPC_MATRIX_ROWS && count <= res_desc->Elements)
2394 for (n = 0; n < count; ++n)
2396 for (l = 0; l < 4; ++l)
2398 for (m = 0; m < 4; ++m)
2400 if (m < res_desc->Rows && l < res_desc->Columns)
2401 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2402 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2407 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2409 else
2411 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2413 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2414 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2417 /* SetMatrixTransposePointerArray */
2418 for (count = 0; count < res_desc->Elements + 1; ++count)
2420 fvalue = 1.33;
2421 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2423 *(input_value + l) = *(DWORD *)&fvalue;
2424 fvalue += 1.12;
2426 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2427 for (l = 0; l < count; ++l)
2429 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2431 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, count);
2432 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= count)
2434 for (n = 0; n < count; ++n)
2436 for (l = 0; l < 4; ++l)
2438 for (m = 0; m < 4; ++m)
2440 if (m < res_desc->Rows && l < res_desc->Columns)
2441 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2442 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2447 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
2449 else
2451 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
2453 test_effect_parameter_values(&res[k], effect, expected_value, parameter);
2454 test_effect_parameter_value_reset(&res[k], effect, &blob[res_value_offset], parameter);
2456 winetest_pop_context();
2459 refcount = effect->lpVtbl->Release(effect);
2460 ok(!refcount, "Unexpected refcount %lu.\n", refcount);
2461 winetest_pop_context();
2465 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2467 static const char expected_string[] = "test_string_1";
2468 static const char expected_string2[] = "test_longer_string_2";
2469 static const char *expected_string_array[] = {expected_string, expected_string2};
2470 const char *string_array[ARRAY_SIZE(expected_string_array)];
2471 const char *string, *string2;
2472 IDirect3DTexture9 *texture_set;
2473 IDirect3DTexture9 *texture;
2474 D3DXHANDLE parameter;
2475 ID3DXEffect *effect;
2476 unsigned int i;
2477 ULONG count;
2478 HRESULT hr;
2480 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2481 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2482 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
2484 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2485 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2487 texture = NULL;
2488 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2489 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
2490 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2491 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
2492 texture_set = NULL;
2493 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2494 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
2495 ok(texture == texture_set, "Texture does not match.\n");
2497 count = IDirect3DTexture9_Release(texture_set);
2498 ok(count == 2, "Got reference count %lu, expected 2.\n", count);
2499 texture_set = NULL;
2500 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2501 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
2502 count = IDirect3DTexture9_Release(texture);
2503 ok(!count, "Got reference count %lu, expected 0.\n", count);
2505 hr = effect->lpVtbl->SetString(effect, "s", expected_string);
2506 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2507 string = NULL;
2508 hr = effect->lpVtbl->GetString(effect, "s", &string);
2509 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2510 hr = effect->lpVtbl->GetString(effect, "s", &string2);
2511 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2513 ok(string != expected_string, "String pointers are the same.\n");
2514 ok(string == string2, "String pointers differ.\n");
2515 ok(!strcmp(string, expected_string), "Unexpected string '%s'.\n", string);
2517 string = expected_string2;
2518 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) - 1);
2519 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
2520 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string));
2521 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2522 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) * 2);
2523 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2524 string = NULL;
2525 hr = effect->lpVtbl->GetValue(effect, "s", &string, sizeof(string));
2526 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2528 ok(string != expected_string2, "String pointers are the same.\n");
2529 ok(!strcmp(string, expected_string2), "Unexpected string '%s'.\n", string);
2531 hr = effect->lpVtbl->SetValue(effect, "s_2", expected_string_array,
2532 sizeof(expected_string_array));
2533 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2534 hr = effect->lpVtbl->GetValue(effect, "s_2", string_array,
2535 sizeof(string_array));
2536 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2537 for (i = 0; i < ARRAY_SIZE(expected_string_array); ++i)
2539 ok(!strcmp(string_array[i], expected_string_array[i]), "Unexpected string '%s', i %u.\n",
2540 string_array[i], i);
2542 effect->lpVtbl->Release(effect);
2546 * fxc.exe /Tfx_2_0
2548 #if 0
2549 float a = 2.1;
2550 float b[1];
2551 float c <float d = 3;>;
2552 struct {float e;} f;
2553 float g <float h[1] = {3};>;
2554 struct s {float j;};
2555 float i <s k[1] = {4};>;
2556 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2557 #endif
2558 static const DWORD test_effect_variable_names_blob[] =
2560 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2561 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2562 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2563 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2564 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2565 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2566 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2567 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2568 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2569 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2570 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2571 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2572 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2573 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2574 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2575 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2576 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2577 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2578 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2579 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2580 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2581 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2582 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2583 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2584 0x000001f4, 0x00000000, 0x00000000,
2587 static void test_effect_variable_names(IDirect3DDevice9 *device)
2589 ID3DXEffect *effect;
2590 ULONG count;
2591 HRESULT hr;
2592 D3DXHANDLE parameter, p;
2594 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2595 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2596 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#lx, expected %#lx\n", hr, D3D_OK);
2599 * check invalid calls
2600 * This will crash:
2601 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2603 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2604 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2606 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2607 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2609 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2610 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2612 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2613 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2615 /* float a; */
2616 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2617 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2619 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2620 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2622 /* members */
2623 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2624 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2626 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2627 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2629 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2630 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2632 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2633 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2635 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2636 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2638 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2639 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2641 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2642 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2644 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2645 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2647 /* elements */
2648 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2649 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2651 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2652 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2654 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2655 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2657 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2658 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2660 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2661 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2663 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2664 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2666 /* annotations */
2667 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2668 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2670 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2671 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2673 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2674 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2676 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2677 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2679 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2680 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2682 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2683 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2685 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2686 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2688 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2689 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2691 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2692 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2694 /* float b[1]; */
2695 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2696 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2698 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2699 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2701 /* elements */
2702 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2703 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2705 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2706 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2708 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2709 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2711 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2712 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2714 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2715 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2717 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2718 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2720 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2721 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2723 /* float c <float d = 3;>; */
2724 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2725 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2727 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2728 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2730 /* annotations */
2731 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2732 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2734 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2735 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2737 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2738 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2740 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2741 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2743 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2744 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2746 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2747 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2749 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2750 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2752 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2753 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2755 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2756 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2758 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2759 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2761 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2762 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2764 /* struct {float e;} f; */
2765 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2766 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2768 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2769 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2771 /* members */
2772 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2773 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2775 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2776 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2778 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2779 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2781 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2782 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2784 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2785 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2787 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2788 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2790 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2791 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2793 /* float g <float h[1] = {3};>; */
2794 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2795 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2797 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2798 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2800 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2801 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2803 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2804 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2806 /* struct s {float j;}; float i <s k[1] = {4};>; */
2807 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2808 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2810 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2811 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2813 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2814 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2816 /* technique t <s l[1] = {5};> */
2817 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2818 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2820 /* pass p <s m[1] = {6};> */
2821 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2822 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2824 count = effect->lpVtbl->Release(effect);
2825 ok(!count, "Release failed %lu\n", count);
2828 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2830 ID3DXEffect *effect;
2831 ID3DXBuffer *compilation_errors;
2832 HRESULT hr;
2834 /* Test binary effect */
2835 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2836 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2837 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#lx, expected %#lx\n", hr, D3DERR_INVALIDCALL);
2838 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2840 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2841 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2842 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2843 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#lx, expected %#lx\n", hr, D3D_OK);
2844 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2845 effect->lpVtbl->Release(effect);
2849 * fxc.exe /Tfx_2_0
2851 #if 0
2852 vertexshader vs_arr1[2] =
2856 vs_1_1
2857 def c0, 1, 1, 1, 1
2858 mov oPos, c0
2862 vs_2_0
2863 def c0, 2, 2, 2, 2
2864 mov oPos, c0
2868 sampler sampler1 =
2869 sampler_state
2871 MipFilter = LINEAR;
2874 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};
2875 technique tech0
2877 pass p0
2879 vertexshader = vs_arr1[1];
2880 VertexShaderConstant1[1] = 3.0f;
2881 VertexShaderConstant4[2] = 1;
2882 VertexShaderConstant1[3] = {2, 2, 2, 2};
2883 VertexShaderConstant4[4] = {4, 4, 4, 4, 5, 5, 5, 5, 6};
2884 BlendOp = 2;
2885 AlphaOp[3] = 4;
2886 ZEnable = true;
2887 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};
2888 ViewTransform=(camera);
2889 LightEnable[2] = TRUE;
2890 LightType[2] = POINT;
2891 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2892 Sampler[1] = sampler1;
2895 #endif
2896 static const DWORD test_effect_states_effect_blob[] =
2898 0xfeff0901, 0x00000368, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2899 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2900 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2901 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2902 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2903 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2904 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2905 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2906 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40400000, 0x00000003,
2907 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f800000, 0x00000003,
2908 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40000000, 0x40000000,
2909 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2910 0x00000001, 0x40800000, 0x40800000, 0x40800000, 0x40800000, 0x40a00000, 0x40a00000, 0x40a00000,
2911 0x40a00000, 0x40c00000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000009,
2912 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2913 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2914 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2915 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2916 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2917 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2918 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2919 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2920 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2921 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2922 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2923 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2924 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2925 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2926 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2927 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x0000035c, 0x00000000, 0x00000001, 0x00000354,
2928 0x00000000, 0x0000000e, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000001,
2929 0x00000114, 0x00000110, 0x0000009b, 0x00000002, 0x00000134, 0x00000130, 0x00000098, 0x00000003,
2930 0x00000160, 0x00000150, 0x0000009b, 0x00000004, 0x000001a0, 0x0000017c, 0x0000004b, 0x00000000,
2931 0x000001c0, 0x000001bc, 0x0000006b, 0x00000003, 0x000001e0, 0x000001dc, 0x00000000, 0x00000000,
2932 0x00000200, 0x000001fc, 0x0000007d, 0x00000001, 0x0000025c, 0x0000021c, 0x0000007c, 0x00000000,
2933 0x000002b8, 0x00000278, 0x00000091, 0x00000002, 0x000002d8, 0x000002d4, 0x00000084, 0x00000002,
2934 0x000002f8, 0x000002f4, 0x00000088, 0x00000002, 0x00000320, 0x00000314, 0x000000b2, 0x00000001,
2935 0x00000340, 0x0000033c, 0x00000002, 0x00000003, 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051,
2936 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000,
2937 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40000000, 0x40000000,
2938 0x40000000, 0x40000000, 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000,
2939 0xffffffff, 0x0000000d, 0x00000001, 0x00000009, 0x706d6173, 0x3172656c, 0x00000000, 0x00000000,
2940 0x00000000, 0xffffffff, 0x00000009, 0x00000000, 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443,
2941 0x0000001c, 0x0000008b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000088, 0x00000030,
2942 0x00000002, 0x00000004, 0x00000038, 0x00000048, 0x656d6163, 0xab006172, 0x00030003, 0x00040004,
2943 0x00000001, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2944 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2945 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
2946 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
2947 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10000004, 0x00000001, 0x00000000,
2948 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10000004, 0x00000001, 0x00000000,
2949 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000004, 0x10000004, 0x00000001, 0x00000000,
2950 0x00000002, 0x00000008, 0x00000000, 0x00000004, 0x00000008, 0x10000004, 0x00000001, 0x00000000,
2951 0x00000002, 0x0000000c, 0x00000000, 0x00000004, 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
2952 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272,
2953 0x00005d31,
2955 #define TEST_EFFECT_STATES_VSHADER_POS 315
2957 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
2959 static void test_effect_clear_vconsts(IDirect3DDevice9 *device)
2961 unsigned int i;
2962 HRESULT hr;
2964 for (i = 0; i < 256; ++i)
2966 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
2967 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
2971 static void test_effect_states(IDirect3DDevice9 *device)
2973 static const D3DMATRIX test_mat =
2975 -1.0f, 0.0f, 0.0f, 0.0f,
2976 0.0f, 0.0f, 0.0f, 0.0f,
2977 0.0f, 0.0f, 0.0f, 0.0f,
2978 0.0f, 0.0f, 0.0f, 0.0f
2979 }}};
2980 static const D3DMATRIX test_mat_camera =
2982 4.0f, 0.0f, 0.0f, 0.0f,
2983 0.0f, 0.0f, 0.0f, 0.0f,
2984 0.0f, 0.0f, 0.0f, 0.0f,
2985 0.0f, 0.0f, 0.0f, 6.0f
2986 }}};
2987 static const D3DMATRIX test_mat_world1 =
2989 2.0f, 0.0f, 0.0f, 0.0f,
2990 0.0f, 0.0f, 0.0f, 0.0f,
2991 0.0f, 0.0f, 0.0f, 0.0f,
2992 0.0f, 0.0f, 0.0f, 4.0f
2993 }}};
2995 IDirect3DVertexShader9 *vshader;
2996 ID3DXEffect *effect;
2997 UINT byte_code_size;
2998 D3DXVECTOR4 fvect;
2999 void *byte_code;
3000 D3DLIGHT9 light;
3001 D3DMATRIX mat;
3002 UINT npasses;
3003 DWORD value;
3004 HRESULT hr;
3005 BOOL bval;
3007 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
3008 NULL, NULL, 0, NULL, &effect, NULL);
3009 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3011 hr = effect->lpVtbl->End(effect);
3012 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3014 hr = effect->lpVtbl->BeginPass(effect, 0);
3015 ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#lx.\n", hr);
3017 /* State affected in passes saved/restored even if no pass
3018 was performed. States not present in passes are not saved &
3019 restored */
3020 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3021 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3022 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
3023 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3025 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3026 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3027 ok(npasses == 1, "Unexpected npasses %u.\n", npasses);
3029 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3030 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3031 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
3032 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3034 hr = effect->lpVtbl->End(effect);
3035 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3037 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3038 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3039 ok(value == 1, "Unexpected value %lu.\n", value);
3040 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
3041 ok(value == 2, "Unexpected value %lu.\n", value);
3043 /* Test states application in BeginPass. No states are restored
3044 on EndPass. */
3045 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
3046 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3047 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
3048 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3050 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3051 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3052 if (hr == D3D_OK)
3053 ok(!bval, "Unexpected bval %#x.\n", bval);
3055 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
3056 hr = effect->lpVtbl->Begin(effect, NULL, 0);
3057 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3059 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3060 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3061 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
3063 test_effect_clear_vconsts(device);
3065 hr = effect->lpVtbl->BeginPass(effect, 0);
3066 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3068 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3069 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3070 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
3072 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
3073 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3074 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
3076 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3077 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3078 ok(value == 2, "Unexpected value %lu.\n", value);
3080 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3081 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3082 ok(vshader != NULL, "Unexpected vshader %p.\n", vshader);
3083 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
3084 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3085 byte_code = calloc(1, byte_code_size);
3086 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
3087 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3088 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
3089 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
3090 "Incorrect shader selected.\n");
3091 free(byte_code);
3092 IDirect3DVertexShader9_Release(vshader);
3094 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3095 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3096 ok(bval, "Unexpected bval %#x.\n", bval);
3097 hr = IDirect3DDevice9_GetLight(device, 2, &light);
3098 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3099 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
3100 "Unexpected light position (%.8e, %.8e, %.8e).\n", light.Position.x, light.Position.y, light.Position.z);
3102 /* Testing first value only for constants 1, 2 as the rest of the vector seem to
3103 * contain garbage data on native. */
3104 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, &fvect.x, 1);
3105 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3106 ok(fvect.x == 3.0f, "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3107 fvect.x, fvect.y, fvect.z, fvect.w);
3108 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 2, &fvect.x, 1);
3109 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3110 ok(fvect.x == 1.0f, "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3111 fvect.x, fvect.y, fvect.z, fvect.w);
3113 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, &fvect.x, 1);
3114 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3115 ok(fvect.x == 2.0f && fvect.y == 2.0f && fvect.z == 2.0f && fvect.w == 2.0f,
3116 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3117 fvect.x, fvect.y, fvect.z, fvect.w);
3119 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 4, &fvect.x, 1);
3120 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3121 ok(fvect.x == 4.0f && fvect.y == 4.0f && fvect.z == 4.0f && fvect.w == 4.0f,
3122 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3123 fvect.x, fvect.y, fvect.z, fvect.w);
3124 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 5, &fvect.x, 1);
3125 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3126 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
3127 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3128 fvect.x, fvect.y, fvect.z, fvect.w);
3129 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 6, &fvect.x, 1);
3130 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3131 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
3132 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3133 fvect.x, fvect.y, fvect.z, fvect.w);
3134 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 7, &fvect.x, 1);
3135 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3136 ok(!memcmp(&fvect, &fvect_filler, sizeof(fvect_filler)),
3137 "Got unexpected vertex shader constant (%.8e, %.8e, %.8e, %.8e).\n",
3138 fvect.x, fvect.y, fvect.z, fvect.w);
3140 hr = effect->lpVtbl->EndPass(effect);
3141 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3142 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3143 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3144 ok(value == 2, "Unexpected value %lu.\n", value);
3146 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
3147 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3148 ok(value, "Unexpected value %lu.\n", value);
3150 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
3151 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3152 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %lu.\n", value);
3154 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
3155 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3156 ok(value == 4, "Unexpected texture stage 3 AlphaOp %lu.\n", value);
3158 hr = effect->lpVtbl->End(effect);
3159 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3161 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3162 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3163 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
3165 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3166 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3167 ok(!bval, "Unexpected bval %u.\n", bval);
3169 /* State is not restored if effect is released without End call */
3170 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3171 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3173 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3174 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3176 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3177 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3179 effect->lpVtbl->Release(effect);
3181 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3182 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
3183 ok(value == 3, "Unexpected value %lu.\n", value);
3187 * fxc.exe /Tfx_2_0
3189 #if 0
3190 float4 g_Pos1;
3191 float4 g_Pos2;
3192 float4 g_Selector[3] = {{0, 0, 0, 0}, {10, 10, 10, 10}, {5001, 5002, 5003, 5004}};
3194 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3195 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3196 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3198 float4 vect_sampler = {1, 2, 3, 4};
3200 float3 vec3 = {1001, 1002, 1003};
3202 int4 g_iVect = {4, 3, 2, 1};
3204 vertexshader vs_arr[3] =
3208 vs_1_0
3209 def c0, 1, 1, 1, 1
3210 mov oPos, c0
3214 vs_1_1
3215 def c0, 2, 2, 2, 2
3216 mov oPos, c0
3220 vs_2_0
3221 def c0, 3, 3, 3, 3
3222 mov oPos, c0
3226 float4x4 m4x4 = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}, {41, 42, 43, 44}};
3228 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3229 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3230 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3231 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3232 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3233 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3234 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3235 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3236 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3237 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3239 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3240 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3242 struct test_struct
3244 float3 v1;
3245 float fv;
3246 float4 v2;
3249 struct struct_array
3251 test_struct ts[2];
3254 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3255 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3256 struct_array ts3 = {{{1, 2, 3}, 4, {5, 6, 7, 8}}, {{9, 10, 11}, 12, {13, 14, 15, 16}}};
3258 float arr1[1] = {91};
3259 shared float arr2[2] = {92, 93};
3261 Texture2D tex1;
3262 Texture2D tex2;
3263 sampler sampler1 =
3264 sampler_state
3266 Texture = tex1;
3267 MinFilter = g_iVect.y;
3268 MagFilter = vect_sampler.x + vect_sampler.y;
3271 sampler samplers_array[2] =
3273 sampler_state
3275 MinFilter = 1;
3276 MagFilter = vect_sampler.x;
3278 sampler_state
3280 MinFilter = 2;
3281 MagFilter = vect_sampler.y;
3285 struct VS_OUTPUT
3287 float4 Position : POSITION;
3288 float2 TextureUV : TEXCOORD0;
3289 float4 Diffuse : COLOR0;
3291 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3292 float3 vNormal : NORMAL,
3293 float2 vTexCoord0 : TEXCOORD0,
3294 uniform int nNumLights,
3295 uniform bool bTexture)
3297 VS_OUTPUT Output;
3299 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3300 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3301 else
3302 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3303 Output.TextureUV = float2(0, 0);
3304 Output.Diffuse = 0;
3305 Output.Diffuse.xyz = mul(vPos, m4x3column);
3306 Output.Diffuse += mul(vPos, m3x4column);
3307 Output.Diffuse += mul(vPos, m3x4row);
3308 Output.Diffuse.xyz += mul(vPos, m4x3row);
3309 Output.Diffuse += mul(vPos, ts1[0].fv);
3310 Output.Diffuse += mul(vPos, ts1[0].v2);
3311 Output.Diffuse += mul(vPos, ts2[1].fv);
3312 Output.Diffuse += mul(vPos, ts2[1].v2);
3313 Output.Diffuse += mul(vPos, arr1[0]);
3314 Output.Diffuse += mul(vPos, arr2[1]);
3315 Output.Diffuse += mul(vPos, ts3.ts[1].fv);
3316 Output.Diffuse += mul(vPos, ts3.ts[1].v2);
3317 Output.Diffuse += tex2Dlod(sampler1, g_Pos1);
3318 Output.Diffuse += tex2Dlod(samplers_array[1], g_Pos1);
3319 return Output;
3322 VS_OUTPUT RenderSceneVS2(float4 vPos : POSITION)
3324 VS_OUTPUT Output;
3326 Output.Position = g_Pos1;
3327 Output.TextureUV = float2(0, 0);
3328 Output.Diffuse = 0;
3329 return Output;
3332 struct PS_OUTPUT
3334 float4 RGBColor : COLOR0; /* Pixel color */
3336 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3338 PS_OUTPUT Output;
3339 int i;
3341 Output.RGBColor = In.Diffuse;
3342 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3343 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3344 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3345 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3346 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3347 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3348 for (i = 0; i < g_iVect.x; ++i)
3349 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3350 if (mb[1][1])
3352 Output.RGBColor += sin(Output.RGBColor);
3353 Output.RGBColor += cos(Output.RGBColor);
3354 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3355 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3356 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3357 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3359 if (mb2x3column[0][0])
3361 Output.RGBColor += sin(Output.RGBColor);
3362 Output.RGBColor += cos(Output.RGBColor);
3363 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3364 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3365 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3366 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3368 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3369 Output.RGBColor += tex2D(samplers_array[0], In.TextureUV);
3370 return Output;
3373 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3374 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3376 technique tech0
3378 pass p0
3380 VertexShader = vs_arr2[g_iVect.w - 1];
3381 PixelShader = ps_arr[g_iVect.w - 1];
3383 LightEnable[0] = TRUE;
3384 LightEnable[1] = TRUE;
3385 LightEnable[2] = TRUE;
3386 LightEnable[3] = TRUE;
3387 LightEnable[4] = TRUE;
3388 LightEnable[5] = TRUE;
3389 LightEnable[6] = TRUE;
3390 LightEnable[7] = TRUE;
3391 LightType[0] = POINT;
3392 LightType[1] = POINT;
3393 LightType[2] = POINT;
3394 LightType[3] = POINT;
3395 LightType[4] = POINT;
3396 LightType[5] = POINT;
3397 LightType[6] = POINT;
3398 LightType[7] = POINT;
3399 LightDiffuse[0] = 1 / opvect1;
3400 LightDiffuse[1] = rsqrt(opvect1);
3401 LightDiffuse[2] = opvect1 * opvect2;
3402 LightDiffuse[3] = opvect1 + opvect2;
3403 LightDiffuse[4] = float4(opvect1 < opvect2);
3404 LightDiffuse[5] = float4(opvect1 >= opvect2);
3405 LightDiffuse[6] = -opvect1;
3406 LightDiffuse[7] = rcp(opvect1);
3408 LightAmbient[0] = frac(opvect1);
3409 LightAmbient[1] = min(opvect1, opvect2);
3410 LightAmbient[2] = max(opvect1, opvect2);
3411 LightAmbient[3] = sin(opvect1);
3412 LightAmbient[4] = cos(opvect1);
3413 LightAmbient[5] = 1e-2 / opvect1;
3414 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3415 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3417 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3418 dot(opvect1.zzzx, opvect2.xxyy), 0);
3419 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3420 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3421 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3422 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3423 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3425 FogEnable = TRUE;
3426 FogDensity = ts2[0].fv;
3427 FogStart = ts2[1].fv;
3428 PointScale_A = ts3.ts[0].fv;
3429 PointScale_B = ts3.ts[1].fv;
3431 pass p1
3433 VertexShader = vs_arr[g_iVect.z];
3436 #endif
3437 static const DWORD test_effect_preshader_effect_blob[] =
3439 0xfeff0901, 0x00001160, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3440 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3441 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3442 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3443 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3444 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3445 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3446 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3447 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3448 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3449 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3450 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3451 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3452 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3453 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3454 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3455 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3456 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3457 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3458 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3459 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3460 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3461 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3462 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3463 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3464 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3465 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3466 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3467 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3468 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3469 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3470 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3471 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3472 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3473 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3474 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3475 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3476 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3477 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3478 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3479 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3480 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3481 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3482 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3483 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3484 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3485 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3486 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3487 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3488 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3489 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3490 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3491 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3492 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3493 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3494 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3495 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3496 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3497 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3498 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3499 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3500 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3501 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3502 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3503 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3504 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3505 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3506 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3507 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3508 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3509 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3510 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3511 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3512 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3513 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3514 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3515 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3516 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3517 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3518 0x00000000, 0x0000000a, 0x00000004, 0x00000ab8, 0x00000000, 0x00000002, 0x00000001, 0x00000002,
3519 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3520 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3521 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
3522 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x000000aa,
3523 0x00000100, 0x000009f4, 0x000009f0, 0x000000a9, 0x00000100, 0x00000a14, 0x00000a10, 0x00000002,
3524 0x000000aa, 0x00000100, 0x00000a34, 0x00000a30, 0x000000a9, 0x00000100, 0x00000a54, 0x00000a50,
3525 0x0000000f, 0x706d6173, 0x7372656c, 0x7272615f, 0x00007961, 0x00000010, 0x00000004, 0x00000ae8,
3526 0x00000000, 0x00000002, 0x00000007, 0x00000008, 0x00000008, 0x615f7376, 0x00327272, 0x0000000f,
3527 0x00000004, 0x00000b0c, 0x00000000, 0x00000001, 0x00000009, 0x00000007, 0x615f7370, 0x00007272,
3528 0x0000000a, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x0000000b, 0x0000000f,
3529 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3530 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3531 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3532 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3533 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3534 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3535 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3536 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3537 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3538 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3539 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3540 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3541 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3542 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3543 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3544 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000,
3545 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3546 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3547 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3548 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3549 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3550 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3551 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3552 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3553 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3554 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3555 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3556 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3557 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3558 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3559 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3560 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3561 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3562 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3563 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3564 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3565 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3566 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3567 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3568 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3569 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3570 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3571 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
3572 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3573 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3574 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3575 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
3576 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x0000000c,
3577 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006,
3578 0x68636574, 0x00000030, 0x00000022, 0x00000001, 0x0000000e, 0x0000000d, 0x00000004, 0x00000020,
3579 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000, 0x00000000, 0x00000074, 0x00000090,
3580 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
3581 0x00000000, 0x00000000, 0x00000140, 0x0000015c, 0x00000000, 0x00000000, 0x00000178, 0x00000194,
3582 0x00000000, 0x00000000, 0x000001b8, 0x000001d4, 0x00000000, 0x00000000, 0x000001ec, 0x00000208,
3583 0x00000000, 0x00000000, 0x00000224, 0x00000238, 0x00000000, 0x00000000, 0x00000250, 0x0000026c,
3584 0x00000000, 0x00000000, 0x000002b8, 0x000002d4, 0x00000000, 0x00000000, 0x00000310, 0x0000032c,
3585 0x00000000, 0x00000000, 0x00000368, 0x00000384, 0x00000000, 0x00000000, 0x000003c4, 0x000003e0,
3586 0x00000000, 0x00000000, 0x00000420, 0x0000043c, 0x00000000, 0x00000000, 0x00000458, 0x00000474,
3587 0x00000000, 0x00000000, 0x00000494, 0x000004b0, 0x00000000, 0x00000000, 0x000004d4, 0x000004f0,
3588 0x00000000, 0x00000000, 0x00000518, 0x00000534, 0x00000000, 0x00000000, 0x00000558, 0x00000574,
3589 0x00000000, 0x00000000, 0x0000059c, 0x000005b8, 0x00000000, 0x00000000, 0x000005e0, 0x000005fc,
3590 0x00000000, 0x00000000, 0x00000624, 0x00000690, 0x00000000, 0x00000000, 0x000006d0, 0x0000073c,
3591 0x00000001, 0x00000000, 0x0000079c, 0x00000820, 0x00000000, 0x00000000, 0x00000888, 0x000008a4,
3592 0x00000000, 0x00000000, 0x000008b4, 0x000008d0, 0x00000001, 0x00000000, 0x000008e4, 0x000008f8,
3593 0x00000000, 0x00000000, 0x00000908, 0x0000091c, 0x00000000, 0x00000000, 0x0000092c, 0x00000998,
3594 0x00000000, 0x00000000, 0x000009dc, 0x00000a70, 0x00000000, 0x00000000, 0x00000acc, 0x00000ae0,
3595 0x00000001, 0x00000000, 0x00000af4, 0x00000b08, 0x00000000, 0x00000000, 0x00001154, 0x00000000,
3596 0x00000002, 0x0000112c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000b1c, 0x00000b18,
3597 0x00000093, 0x00000000, 0x00000b34, 0x00000b30, 0x00000091, 0x00000000, 0x00000b4c, 0x00000b48,
3598 0x00000091, 0x00000001, 0x00000b6c, 0x00000b68, 0x00000091, 0x00000002, 0x00000b8c, 0x00000b88,
3599 0x00000091, 0x00000003, 0x00000bac, 0x00000ba8, 0x00000091, 0x00000004, 0x00000bcc, 0x00000bc8,
3600 0x00000091, 0x00000005, 0x00000bec, 0x00000be8, 0x00000091, 0x00000006, 0x00000c0c, 0x00000c08,
3601 0x00000091, 0x00000007, 0x00000c2c, 0x00000c28, 0x00000084, 0x00000000, 0x00000c4c, 0x00000c48,
3602 0x00000084, 0x00000001, 0x00000c6c, 0x00000c68, 0x00000084, 0x00000002, 0x00000c8c, 0x00000c88,
3603 0x00000084, 0x00000003, 0x00000cac, 0x00000ca8, 0x00000084, 0x00000004, 0x00000ccc, 0x00000cc8,
3604 0x00000084, 0x00000005, 0x00000cec, 0x00000ce8, 0x00000084, 0x00000006, 0x00000d0c, 0x00000d08,
3605 0x00000084, 0x00000007, 0x00000d2c, 0x00000d28, 0x00000085, 0x00000000, 0x00000d58, 0x00000d48,
3606 0x00000085, 0x00000001, 0x00000d84, 0x00000d74, 0x00000085, 0x00000002, 0x00000db0, 0x00000da0,
3607 0x00000085, 0x00000003, 0x00000ddc, 0x00000dcc, 0x00000085, 0x00000004, 0x00000e08, 0x00000df8,
3608 0x00000085, 0x00000005, 0x00000e34, 0x00000e24, 0x00000085, 0x00000006, 0x00000e60, 0x00000e50,
3609 0x00000085, 0x00000007, 0x00000e8c, 0x00000e7c, 0x00000087, 0x00000000, 0x00000eb8, 0x00000ea8,
3610 0x00000087, 0x00000001, 0x00000ee4, 0x00000ed4, 0x00000087, 0x00000002, 0x00000f10, 0x00000f00,
3611 0x00000087, 0x00000003, 0x00000f3c, 0x00000f2c, 0x00000087, 0x00000004, 0x00000f68, 0x00000f58,
3612 0x00000087, 0x00000005, 0x00000f94, 0x00000f84, 0x00000087, 0x00000006, 0x00000fc0, 0x00000fb0,
3613 0x00000087, 0x00000007, 0x00000fec, 0x00000fdc, 0x00000086, 0x00000000, 0x00001018, 0x00001008,
3614 0x00000086, 0x00000001, 0x00001044, 0x00001034, 0x00000086, 0x00000002, 0x00001070, 0x00001060,
3615 0x0000000e, 0x00000000, 0x00001090, 0x0000108c, 0x00000014, 0x00000000, 0x000010b0, 0x000010ac,
3616 0x00000012, 0x00000000, 0x000010d0, 0x000010cc, 0x00000041, 0x00000000, 0x000010f0, 0x000010ec,
3617 0x00000042, 0x00000000, 0x00001110, 0x0000110c, 0x0000114c, 0x00000000, 0x00000001, 0x00000092,
3618 0x00000000, 0x00001138, 0x00001134, 0x00000008, 0x0000001f, 0x00000009, 0x00000ad0, 0xffff0300,
3619 0x00d9fffe, 0x42415443, 0x0000001c, 0x0000032f, 0xffff0300, 0x0000000b, 0x0000001c, 0x00000000,
3620 0x00000328, 0x000000f8, 0x00000001, 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x00080002,
3621 0x00000002, 0x0000012c, 0x0000013c, 0x0000015c, 0x00060002, 0x00000002, 0x00000164, 0x00000174,
3622 0x00000194, 0x00000002, 0x00000003, 0x000001a0, 0x000001b0, 0x000001e0, 0x000a0002, 0x00000002,
3623 0x000001e8, 0x000001f8, 0x00000218, 0x000c0002, 0x00000002, 0x00000224, 0x00000234, 0x00000254,
3624 0x00030002, 0x00000003, 0x0000025c, 0x0000026c, 0x0000029c, 0x00050000, 0x00000001, 0x000002a8,
3625 0x000002b8, 0x000002d0, 0x00000000, 0x00000005, 0x000002dc, 0x000002b8, 0x000002ec, 0x00000003,
3626 0x00000001, 0x000002f8, 0x00000000, 0x00000308, 0x00010003, 0x00000001, 0x00000318, 0x00000000,
3627 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x00000004, 0x00000003,
3628 0x00000002, 0x00000001, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001,
3629 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3630 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3631 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d,
3632 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3633 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000,
3634 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000,
3635 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3636 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000,
3637 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d,
3638 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3639 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000,
3640 0x00000000, 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00010003, 0x00030002, 0x00000001, 0x00000000,
3641 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x7832626d, 0x776f7233,
3642 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, 0x706d6173, 0x3172656c, 0xababab00,
3643 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c, 0x7272615f, 0xab007961,
3644 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x335f7370, 0x4d00305f, 0x6f726369, 0x74666f73,
3645 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3646 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, 0x3f800000, 0xbe22f983,
3647 0x05000051, 0xa00f000f, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x05000051, 0xa00f0010,
3648 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x0200001f, 0x80000005, 0x90030000, 0x0200001f,
3649 0x8000000a, 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, 0xa00f0801,
3650 0x03000005, 0x80030000, 0xa0e40007, 0x90550001, 0x04000004, 0x80030000, 0x90000001, 0xa0e40006,
3651 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40001, 0x02000001, 0x80010001, 0xa0000010,
3652 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3653 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000,
3654 0xa0440004, 0x90550001, 0x04000004, 0x800c0000, 0x90000001, 0xa0440003, 0x80e40000, 0x04000004,
3655 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000,
3656 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d,
3657 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, 0x90550001,
3658 0x04000004, 0x800e0001, 0x90000001, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001,
3659 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000,
3660 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002,
3661 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, 0x02000001,
3662 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000, 0x03000002, 0x80070003, 0x80e40002, 0x80e40003,
3663 0x00000027, 0x01000028, 0xe0e40804, 0x02000001, 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000,
3664 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000,
3665 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004,
3666 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002,
3667 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002,
3668 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003,
3669 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e,
3670 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, 0xa000000f,
3671 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002,
3672 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010, 0x04000004,
3673 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004,
3674 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003,
3675 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a,
3676 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002,
3677 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x800e0001, 0x80550000,
3678 0xa090000b, 0x04000004, 0x800e0001, 0x80000000, 0xa090000a, 0x80e40001, 0x03000002, 0x80070003,
3679 0x80e40000, 0x80f90001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000,
3680 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000,
3681 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000, 0x04000004,
3682 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000,
3683 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001, 0x0000002b, 0x01000028, 0xe0e40805, 0x04000004,
3684 0x800f0000, 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004,
3685 0x800f0000, 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000,
3686 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3687 0x80e40002, 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004,
3688 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002,
3689 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000,
3690 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3691 0xa000000f, 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004,
3692 0x80e40002, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010,
3693 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002,
3694 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002,
3695 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001,
3696 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003,
3697 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x80070001,
3698 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000, 0xa0e4000a, 0x80e40001, 0x03000002,
3699 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008,
3700 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005,
3701 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000,
3702 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000,
3703 0x80e40000, 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0000,
3704 0x80e40000, 0x80e40003, 0x03000042, 0x800f0001, 0x90e40000, 0xa0e40801, 0x03000002, 0x800f0800,
3705 0x80e40000, 0x80e40001, 0x0000ffff, 0x00000007, 0x00000b6c, 0xfffe0300, 0x013cfffe, 0x42415443,
3706 0x0000001c, 0x000004bb, 0xfffe0300, 0x0000000c, 0x0000001c, 0x00000000, 0x000004b4, 0x0000010c,
3707 0x00200002, 0x00000001, 0x00000114, 0x00000124, 0x00000134, 0x001d0002, 0x00000002, 0x0000013c,
3708 0x0000014c, 0x0000016c, 0x001f0002, 0x00000001, 0x00000174, 0x00000184, 0x00000194, 0x00100002,
3709 0x00000004, 0x000001a0, 0x000001b0, 0x000001f0, 0x00140002, 0x00000003, 0x000001f8, 0x00000208,
3710 0x00000238, 0x00170002, 0x00000003, 0x00000244, 0x00000254, 0x00000284, 0x000c0002, 0x00000004,
3711 0x0000028c, 0x0000029c, 0x000002dc, 0x00020003, 0x00000001, 0x000002e8, 0x00000000, 0x000002f8,
3712 0x00000003, 0x00000002, 0x00000308, 0x00000000, 0x00000318, 0x001a0002, 0x00000003, 0x00000370,
3713 0x00000380, 0x000003b0, 0x00000002, 0x00000006, 0x000003b4, 0x000003c4, 0x00000424, 0x00060002,
3714 0x00000006, 0x00000444, 0x00000454, 0x31727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001,
3715 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, 0x32727261, 0xababab00, 0x00030000,
3716 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, 0x00000000, 0x00000000, 0x42ba0000,
3717 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3718 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63, 0xab006e6d,
3719 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x00000000,
3720 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000, 0x00000000,
3721 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002, 0x00040003,
3722 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3723 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d, 0x756c6f63,
3724 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3725 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000,
3726 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000, 0x41300000,
3727 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, 0x41f80000,
3728 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000, 0x706d6173,
3729 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x706d6173, 0x7372656c,
3730 0x7272615f, 0xab007961, 0x000c0004, 0x00010001, 0x00000002, 0x00000000, 0x00317374, 0xab003176,
3731 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3732 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0000031c, 0x00000320,
3733 0x00000330, 0x00000334, 0x00000344, 0x00000348, 0x00000005, 0x00080001, 0x00030001, 0x00000358,
3734 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000,
3735 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005, 0x00080001, 0x00030002,
3736 0x00000358, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3737 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000,
3738 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3739 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001, 0x00030002, 0x00000358, 0x00000428,
3740 0x0000042c, 0x00000005, 0x00100001, 0x00010001, 0x0000043c, 0x3f800000, 0x40000000, 0x40400000,
3741 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3742 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000,
3743 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x335f7376, 0x4d00305f, 0x6f726369,
3744 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3745 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250, 0x46580201, 0x0047fffe, 0x42415443,
3746 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c, 0x00000100, 0x000000e4, 0x00000058,
3747 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088,
3748 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173,
3749 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3750 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c,
3751 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3752 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800,
3753 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3754 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250,
3755 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001, 0x00000021,
3756 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018, 0x00000000, 0x00000000,
3757 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3758 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3759 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3760 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3fe00000,
3761 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000, 0x00000000, 0x40100000,
3762 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000, 0x0064fffe, 0x434c5846,
3763 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011, 0x00000000, 0x00000002,
3764 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3765 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000004, 0xa0500004,
3766 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002, 0x0000000c, 0x00000000,
3767 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3768 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004, 0x00000001, 0x00000000,
3769 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000,
3770 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x0000000c,
3771 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000, 0x00000002, 0x00000005,
3772 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3773 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004, 0x20400004, 0x00000002,
3774 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004,
3775 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f0022, 0x00000000, 0x00000000,
3776 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0801,
3777 0x0200001f, 0x90000000, 0xa00f0802, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005,
3778 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017,
3779 0x03000009, 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019,
3780 0x03000008, 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011,
3781 0x03000008, 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013,
3782 0x02000001, 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005,
3783 0x800f0001, 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001,
3784 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000,
3785 0x80e40001, 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000,
3786 0xa0e4000c, 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004,
3787 0x80070001, 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001,
3788 0x04000004, 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000,
3789 0xa0e4001c, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000,
3790 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000,
3791 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004,
3792 0x800f0000, 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a,
3793 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000,
3794 0x80000001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40802, 0x03000002, 0x800f0000, 0x80e40000,
3795 0x80e40001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40801, 0x03000002, 0xe00f0002, 0x80e40000,
3796 0x80e40001, 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff,
3797 0x00000008, 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300,
3798 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73,
3799 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3800 0x332e3235, 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c,
3801 0x0000005b, 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3802 0x00000001, 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3803 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3804 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3805 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3806 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe,
3807 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000,
3808 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3809 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000,
3810 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001,
3811 0xe00f0000, 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001,
3812 0x0000ffff, 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101,
3813 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000,
3814 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000,
3815 0x40000000, 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003,
3816 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000,
3817 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
3818 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443,
3819 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
3820 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
3821 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
3822 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3823 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3824 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3825 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029,
3826 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200,
3827 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4,
3828 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3829 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3830 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064,
3831 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001,
3832 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3833 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3834 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3835 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3836 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3837 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3838 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3839 0x00000000, 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe,
3840 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114,
3841 0x00000030, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031,
3842 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3843 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c,
3844 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074,
3845 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000,
3846 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3847 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3848 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369,
3849 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3850 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3851 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3852 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027,
3853 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200,
3854 0x00000001, 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088,
3855 0x00000098, 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3856 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3857 0x00000000, 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005,
3858 0x00080001, 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3859 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3860 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3861 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3862 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3863 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001,
3864 0x00000000, 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3865 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200,
3866 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3867 0x000000f8, 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176,
3868 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3869 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038,
3870 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070,
3871 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3872 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000,
3873 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000,
3874 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3875 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3876 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004,
3877 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3878 0xffffffff, 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c,
3879 0x000001fb, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002,
3880 0x00000001, 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac,
3881 0x000000ec, 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001,
3882 0x000001d8, 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
3883 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004,
3884 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000,
3885 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000,
3886 0x42080000, 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001,
3887 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001,
3888 0x00040001, 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c,
3889 0x00000120, 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005,
3890 0x00100001, 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3891 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000,
3892 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000,
3893 0x41600000, 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001,
3894 0x00000000, 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3895 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3896 0x332e3235, 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000,
3897 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3898 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3899 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3900 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3901 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3902 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3903 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3904 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3905 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3906 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3907 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3908 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3909 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3910 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3911 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3912 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000,
3913 0x3ff00000, 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e,
3914 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e,
3915 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000,
3916 0x00000002, 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000,
3917 0x00000007, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001,
3918 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004,
3919 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3920 0x0000003c, 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3921 0x0000002f, 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004,
3922 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001,
3923 0x00000030, 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3924 0x0000001c, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007,
3925 0x00000009, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007,
3926 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002,
3927 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3928 0x00000000, 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3929 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002,
3930 0x00000000, 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030,
3931 0x00000000, 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041,
3932 0x00000000, 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002,
3933 0x0000002f, 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031,
3934 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003,
3935 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040,
3936 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000,
3937 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3938 0x00000000, 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe,
3939 0x42415443, 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130,
3940 0x0000006c, 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001,
3941 0x000000c0, 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108,
3942 0x00090002, 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3943 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3944 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67,
3945 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000,
3946 0x3f800000, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3947 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3948 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3949 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3950 0x332e3235, 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
3951 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3952 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3953 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3954 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3955 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3956 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3957 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3958 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3959 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3960 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3961 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3962 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3963 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3964 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3965 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008,
3966 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a,
3967 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000,
3968 0x00000002, 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000,
3969 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000,
3970 0x00000002, 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000,
3971 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
3972 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028,
3973 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001,
3974 0xa0400001, 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001,
3975 0x00000002, 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001,
3976 0x00000002, 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002,
3977 0x0000002b, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
3978 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200,
3979 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3980 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3981 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3982 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3983 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3984 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3985 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
3986 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3987 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3988 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0061fffe,
3989 0x434c5846, 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3990 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000,
3991 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001,
3992 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
3993 0x00000000, 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002,
3994 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3995 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
3996 0x00000004, 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3997 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3998 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002,
3999 0x00000005, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
4000 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
4001 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248,
4002 0x46580200, 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c,
4003 0x20000100, 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
4004 0x00010002, 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0,
4005 0x00000070, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4006 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
4007 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001,
4008 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4009 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4010 0x0022fffe, 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4011 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4012 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4013 0x00000000, 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000,
4014 0x00000000, 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002,
4015 0x00000000, 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
4016 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002,
4017 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002,
4018 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
4019 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4020 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0,
4021 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4022 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4023 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4024 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4025 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4026 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4027 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c,
4028 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4029 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4030 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4031 0x002afffe, 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4032 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002,
4033 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4034 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4035 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
4036 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f,
4037 0x00000000, 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4038 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4039 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4040 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4041 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4042 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4043 0x00000000, 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000,
4044 0x00000000, 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001,
4045 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001,
4046 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001,
4047 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001,
4048 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002,
4049 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
4050 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e,
4051 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4052 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4053 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4054 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4055 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4056 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001,
4057 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4058 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200,
4059 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4060 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4061 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4062 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4063 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4064 0x000cfffe, 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4065 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4066 0xffffffff, 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
4067 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
4068 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
4069 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
4070 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4071 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4072 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4073 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004,
4074 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4075 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4076 0x0000001b, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
4077 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
4078 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
4079 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
4080 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
4081 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4082 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4083 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002,
4084 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
4085 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a,
4086 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4087 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4088 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4089 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4090 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4091 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001,
4092 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4093 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200,
4094 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4095 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
4096 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
4097 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4098 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4099 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
4100 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4101 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002,
4102 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003,
4103 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
4104 0xffffffff, 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
4105 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
4106 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4107 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
4108 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
4109 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
4110 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
4111 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000,
4112 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
4113 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
4114 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
4115 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
4116 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
4117 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4118 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4119 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002,
4120 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4121 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124,
4122 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
4123 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4124 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4125 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
4126 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
4127 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4128 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4129 0x000ffffe, 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
4130 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4131 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200,
4132 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
4133 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
4134 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
4135 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
4136 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
4137 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4138 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4139 0x434c5846, 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4140 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4141 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
4142 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
4143 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4144 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4145 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4146 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
4147 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4148 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4149 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
4150 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4151 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4152 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4153 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4154 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
4155 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4156 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4157 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4158 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4159 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4160 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4161 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012,
4162 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4163 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4164 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4165 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4166 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4167 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001,
4168 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001,
4169 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001,
4170 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001,
4171 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4172 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008,
4173 0x615f7370, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4174 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4175 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
4176 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4177 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4178 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4179 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000,
4180 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002,
4181 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004,
4182 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
4183 0x00000002, 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443,
4184 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
4185 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4186 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4187 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4188 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000,
4189 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000,
4190 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846,
4191 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001,
4192 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4193 0x0000001f, 0x00000001, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443,
4194 0x0000001c, 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030,
4195 0x00000002, 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00,
4196 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000,
4197 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4198 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4199 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4200 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001f,
4201 0x00000000, 0x00000001, 0x00000000, 0x000000e4, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c,
4202 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002,
4203 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001,
4204 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874,
4205 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4206 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4207 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4208 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000,
4209 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c, 0x00000063,
4210 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002, 0x00000001,
4211 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001, 0x00040001,
4212 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874, 0x6f726369,
4213 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4214 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
4215 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000002,
4216 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4217 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443,
4218 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4219 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4220 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4221 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4222 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
4223 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4224 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000, 0x00000000,
4225 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4227 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2991
4228 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4230 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4231 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4232 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4233 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4235 unsigned int i = 0;
4237 todo_wine_if(todo)
4238 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4240 if (!bytecode)
4241 return;
4243 while (bytecode[i++] != 0x0000ffff)
4246 if (!bytecode_size)
4247 bytecode_size = i * sizeof(*bytecode);
4248 else
4249 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4251 todo_wine_if(todo)
4252 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4253 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4254 "Incorrect shader selected.\n");
4257 #define test_effect_preshader_compare_shader(a, b, c) \
4258 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4259 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4260 int expected_shader_index, BOOL todo)
4262 IDirect3DVertexShader9 *vshader;
4263 void *byte_code;
4264 unsigned int byte_code_size;
4265 HRESULT hr;
4267 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4268 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#lx.\n", hr);
4270 todo_wine_if(todo)
4271 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4272 if (!vshader)
4273 return;
4275 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4276 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#lx.\n", hr);
4277 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4279 byte_code = calloc(1, byte_code_size);
4280 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4281 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
4283 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4284 byte_code_size, expected_shader_index, todo);
4286 free(byte_code);
4287 IDirect3DVertexShader9_Release(vshader);
4290 static const struct
4292 const char *comment;
4293 BOOL todo[4];
4294 unsigned int result[4];
4295 unsigned int ulps;
4297 test_effect_preshader_op_expected[] =
4299 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4300 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4301 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4302 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4303 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4304 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4305 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4306 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4308 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4309 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4310 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4311 #if __x86_64__
4312 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4313 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4314 #else
4315 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4316 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4317 #endif
4318 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4319 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4320 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4322 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4323 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4324 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4327 enum expected_state_update
4329 EXPECTED_STATE_ZERO,
4330 EXPECTED_STATE_UPDATED,
4331 EXPECTED_STATE_ANYTHING
4334 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4335 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4336 const enum expected_state_update *expected_state, const char *updated_param)
4338 static const D3DCOLORVALUE black = {0.0f};
4339 unsigned int i, j;
4340 D3DLIGHT9 light;
4341 const float *v;
4342 HRESULT hr;
4344 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4346 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4347 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
4349 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4350 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4352 for (j = 0; j < 4; ++j)
4354 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4355 ok_(__FILE__, line)(compare_float(v[j],
4356 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4357 test_effect_preshader_op_expected[i].ulps),
4358 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4359 test_effect_preshader_op_expected[i].comment, j,
4360 test_effect_preshader_op_expected[i].result[j],
4361 ((const unsigned int *)v)[j], v[j]);
4364 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4366 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4367 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4368 updated_param, i, test_effect_preshader_op_expected[i].comment);
4373 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4375 {0.0f, 0.0f, 0.0f, 0.0f},
4376 {0.0f, 0.0f, 0.0f, 0.0f},
4377 {0.0f, 0.0f, 0.0f, 0.0f},
4378 {1.0f, 2.0f, 3.0f, 0.0f},
4379 {4.0f, 0.0f, 0.0f, 0.0f},
4380 {5.0f, 6.0f, 7.0f, 8.0f},
4381 {1.0f, 2.0f, 3.0f, 0.0f},
4382 {4.0f, 0.0f, 0.0f, 0.0f},
4383 {5.0f, 6.0f, 7.0f, 8.0f},
4384 {9.0f, 10.0f, 11.0f, 0.0f},
4385 {12.0f, 0.0f, 0.0f, 0.0f},
4386 {13.0f, 14.0f, 15.0f, 16.0f},
4387 {11.0f, 12.0f, 13.0f, 0.0f},
4388 {21.0f, 22.0f, 23.0f, 0.0f},
4389 {31.0f, 32.0f, 33.0f, 0.0f},
4390 {41.0f, 42.0f, 43.0f, 0.0f},
4391 {11.0f, 21.0f, 31.0f, 0.0f},
4392 {12.0f, 22.0f, 32.0f, 0.0f},
4393 {13.0f, 23.0f, 33.0f, 0.0f},
4394 {14.0f, 24.0f, 34.0f, 0.0f},
4395 {11.0f, 12.0f, 13.0f, 14.0f},
4396 {21.0f, 22.0f, 23.0f, 24.0f},
4397 {31.0f, 32.0f, 33.0f, 34.0f},
4398 {11.0f, 21.0f, 31.0f, 41.0f},
4399 {12.0f, 22.0f, 32.0f, 42.0f},
4400 {13.0f, 23.0f, 33.0f, 43.0f},
4401 {9.0f, 10.0f, 11.0f, 0.0f},
4402 {12.0f, 0.0f, 0.0f, 0.0f},
4403 {13.0f, 14.0f, 15.0f, 16.0f},
4404 {92.0f, 0.0f, 0.0f, 0.0f},
4405 {93.0f, 0.0f, 0.0f, 0.0f},
4406 {0.0f, 0.0f, 0.0f, 0.0f},
4407 {91.0f, 0.0f, 0.0f, 0.0f},
4408 {4.0f, 5.0f, 6.0f, 7.0f},
4410 #define TEST_EFFECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4412 #define test_effect_preshader_compare_vconsts(a, b, c) \
4413 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4414 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4415 const unsigned int *const_updated_mask, const char *updated_param)
4417 HRESULT hr;
4418 unsigned int i;
4419 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4421 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4422 ARRAY_SIZE(test_effect_preshader_fvect_v));
4423 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
4425 if (!const_updated_mask)
4427 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4428 "Vertex shader float constants do not match.\n");
4430 else
4432 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4434 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4435 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4437 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4438 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), "
4439 "got (%g, %g, %g, %g), parameter %s.\n",
4440 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4441 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4442 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4444 else
4446 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4447 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4452 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4454 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4455 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
4456 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4457 "Vertex shader float constants do not match.\n");
4461 static const BOOL test_effect_preshader_bconsts[] =
4463 TRUE, FALSE, TRUE, FALSE, TRUE, TRUE
4466 static void test_effect_preshader_clear_pbool_consts(IDirect3DDevice9 *device)
4468 BOOL bval;
4469 unsigned int i;
4470 HRESULT hr;
4472 for (i = 0; i < 16; ++i)
4474 bval = i < ARRAY_SIZE(test_effect_preshader_bconsts) ? !test_effect_preshader_bconsts[i] : FALSE;
4475 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4476 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4480 #define test_effect_preshader_compare_pbool_consts(a, b, c) \
4481 test_effect_preshader_compare_pbool_consts_(__LINE__, a, b, c)
4482 static void test_effect_preshader_compare_pbool_consts_(unsigned int line, IDirect3DDevice9 *device,
4483 const unsigned int *const_updated_mask, const char *updated_param)
4485 unsigned int i;
4486 BOOL bdata[16];
4487 HRESULT hr;
4489 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, ARRAY_SIZE(bdata));
4490 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
4492 if (!const_updated_mask)
4494 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4496 /* The negation on both sides is actually needed, sometimes you
4497 * get 0xffffffff instead of 1 on native. */
4498 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4499 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u.\n",
4500 test_effect_preshader_bconsts[i], bdata[i], i);
4503 else
4505 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4507 if (const_updated_mask[i / TEST_EFFECT_BITMASK_BLOCK_SIZE]
4508 & (1u << (i % TEST_EFFECT_BITMASK_BLOCK_SIZE)))
4510 /* The negation on both sides is actually needed, sometimes
4511 * you get 0xffffffff instead of 1 on native. */
4512 ok_(__FILE__, line)(!bdata[i] == !test_effect_preshader_bconsts[i],
4513 "Pixel shader boolean constants do not match, expected %#x, got %#x, i %u, parameter %s.\n",
4514 test_effect_preshader_bconsts[i], bdata[i], i, updated_param);
4516 else
4518 ok_(__FILE__, line)(bdata[i] == !test_effect_preshader_bconsts[i],
4519 "Pixel shader boolean constants updated unexpectedly, parameter %s.\n", updated_param);
4524 for (; i < 16; ++i)
4526 ok_(__FILE__, line)(!bdata[i], "Got result %#lx, boolean register value %u.\n", hr, bdata[i]);
4530 static void test_effect_preshader(IDirect3DDevice9 *device)
4532 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4534 {11.0f, 21.0f, 0.0f, 0.0f},
4535 {12.0f, 22.0f, 0.0f, 0.0f},
4536 {13.0f, 23.0f, 0.0f, 0.0f},
4537 {11.0f, 12.0f, 0.0f, 0.0f},
4538 {21.0f, 22.0f, 0.0f, 0.0f},
4539 {31.0f, 32.0f, 0.0f, 0.0f},
4540 {11.0f, 12.0f, 0.0f, 0.0f},
4541 {21.0f, 22.0f, 0.0f, 0.0f},
4542 {11.0f, 21.0f, 0.0f, 0.0f},
4543 {12.0f, 22.0f, 0.0f, 0.0f},
4544 {11.0f, 12.0f, 13.0f, 0.0f},
4545 {21.0f, 22.0f, 23.0f, 0.0f},
4546 {11.0f, 21.0f, 31.0f, 0.0f},
4547 {12.0f, 22.0f, 32.0f, 0.0f}
4549 static const int test_effect_preshader_iconsts[][4] =
4551 {4, 3, 2, 1}
4553 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4554 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4555 static const int ivect_empty[4] = {-1, -1, -1, -1};
4556 HRESULT hr;
4557 ID3DXEffect *effect;
4558 D3DXHANDLE par;
4559 unsigned int npasses;
4560 DWORD value;
4561 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4562 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4563 IDirect3DVertexShader9 *vshader;
4564 unsigned int i;
4565 D3DCAPS9 caps;
4567 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4568 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#lx.\n", hr);
4569 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4570 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4572 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4573 return;
4576 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4577 NULL, NULL, 0, NULL, &effect, NULL);
4578 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4580 test_effect_clear_vconsts(device);
4582 for (i = 0; i < 224; ++i)
4584 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4585 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4588 test_effect_preshader_clear_pbool_consts(device);
4590 for (i = 0; i < 16; ++i)
4592 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4593 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4596 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4597 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4599 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4600 ok(par != NULL, "GetParameterByName failed.\n");
4602 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4603 ok(hr == D3D_OK, "SetVector failed, hr %#lx.\n", hr);
4605 hr = effect->lpVtbl->BeginPass(effect, 0);
4606 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4608 hr = effect->lpVtbl->BeginPass(effect, 0);
4609 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
4611 hr = effect->lpVtbl->BeginPass(effect, 1);
4612 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
4614 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4616 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4617 ARRAY_SIZE(test_effect_preshader_fvect_p));
4618 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4619 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4620 "Pixel shader float constants do not match.\n");
4621 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4623 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4624 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4625 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4626 "Pixel shader float constants do not match.\n");
4628 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4629 ARRAY_SIZE(test_effect_preshader_iconsts));
4630 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4631 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4632 "Pixel shader integer constants do not match.\n");
4633 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4635 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4636 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4637 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4638 "Pixel shader integer constants do not match.\n");
4641 test_effect_preshader_compare_pbool_consts(device, NULL, NULL);
4643 test_effect_preshader_op_results(device, NULL, NULL);
4645 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4646 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4647 ok(value == 3, "Unexpected sampler 0 minfilter %lu.\n", value);
4648 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4649 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4650 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %lu.\n", value);
4652 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4653 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4654 ok(value == 1, "Unexpected sampler 1 minfilter %lu.\n", value);
4655 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4656 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4657 todo_wine
4658 ok(value == 1, "Unexpected sampler 1 magfilter %lu.\n", value);
4660 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4661 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4662 ok(value == 1, "Unexpected vertex sampler 0 minfilter %lu.\n", value);
4663 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4664 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4665 todo_wine
4666 ok(value == 1, "Unexpected vertex sampler 0 magfilter %lu.\n", value);
4668 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4669 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4670 todo_wine
4671 ok(value == 0, "Unexpected vertex sampler 1 minfilter %lu.\n", value);
4672 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4673 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4674 todo_wine
4675 ok(value == 0, "Unexpected vertex sampler 1 magfilter %lu.\n", value);
4677 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4678 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4679 ok(value == 3, "Unexpected vertex sampler 2 minfilter %lu.\n", value);
4680 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4681 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4682 todo_wine ok(value == 3, "Unexpected vertex sampler 2 magfilter %lu.\n", value);
4684 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4685 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4686 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4687 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4688 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4689 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4690 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4691 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4692 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4693 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4694 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4695 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4697 hr = effect->lpVtbl->EndPass(effect);
4699 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4700 ok(par != NULL, "GetParameterByName failed.\n");
4701 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4702 ok(hr == D3D_OK, "SetVector failed, hr %#lx.\n", hr);
4703 hr = effect->lpVtbl->BeginPass(effect, 1);
4704 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4706 test_effect_preshader_compare_shader(device, 1, FALSE);
4708 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4709 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4711 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4712 ok(hr == D3D_OK, "SetVector failed, hr %#lx.\n", hr);
4713 hr = effect->lpVtbl->CommitChanges(effect);
4714 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4715 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4716 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4717 ok(!vshader, "Incorrect shader selected.\n");
4719 hr = effect->lpVtbl->EndPass(effect);
4720 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4722 hr = effect->lpVtbl->End(effect);
4723 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4725 effect->lpVtbl->Release(effect);
4727 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4728 NULL, NULL, 0, NULL, &effect, NULL);
4729 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4731 hr = effect->lpVtbl->Begin(effect, &npasses, D3DXFX_DONOTSAVESTATE);
4732 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4734 hr = effect->lpVtbl->BeginPass(effect, 0);
4735 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4737 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4738 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4739 ok(value == 3, "Unexpected sampler 0 minfilter %lu.\n", value);
4740 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4741 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4742 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %lu.\n", value);
4744 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MINFILTER, &value);
4745 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4746 ok(value == 1, "Unexpected sampler 1 minfilter %lu.\n", value);
4747 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MAGFILTER, &value);
4748 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4749 todo_wine
4750 ok(value == 1, "Unexpected sampler 1 magfilter %lu.\n", value);
4752 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4753 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4754 ok(value == 1, "Unexpected vertex sampler 0 minfilter %lu.\n", value);
4755 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4756 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4757 todo_wine
4758 ok(value == 1, "Unexpected vertex sampler 0 magfilter %lu.\n", value);
4760 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
4761 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4762 ok(value == 2, "Unexpected vertex sampler 1 minfilter %lu.\n", value);
4763 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MAGFILTER, &value);
4764 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4765 todo_wine
4766 ok(value == 2, "Unexpected vertex sampler 1 magfilter %lu.\n", value);
4768 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
4769 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4770 ok(value == 3, "Unexpected vertex sampler 2 minfilter %lu.\n", value);
4771 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
4772 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4773 todo_wine
4774 ok(value == 3, "Unexpected vertex sampler 2 magfilter %lu.\n", value);
4776 hr = effect->lpVtbl->EndPass(effect);
4777 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4778 hr = effect->lpVtbl->End(effect);
4779 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
4780 effect->lpVtbl->Release(effect);
4784 * fxc.exe /Tfx_2_0
4786 #if 0
4787 float4 opvect1;
4788 float4 opvect2;
4789 float4 opvect3;
4791 technique tech0
4793 pass p0
4795 LightEnable[0] = TRUE;
4796 LightEnable[1] = TRUE;
4797 LightEnable[2] = TRUE;
4798 LightEnable[3] = TRUE;
4799 LightEnable[4] = TRUE;
4800 LightEnable[5] = TRUE;
4801 LightEnable[6] = TRUE;
4802 LightEnable[7] = TRUE;
4803 LightType[0] = POINT;
4804 LightType[1] = POINT;
4805 LightType[2] = POINT;
4806 LightType[3] = POINT;
4807 LightType[4] = POINT;
4808 LightType[5] = POINT;
4809 LightType[6] = POINT;
4810 LightType[7] = POINT;
4812 LightDiffuse[0] = exp(opvect1);
4813 LightDiffuse[1] = log(opvect1);
4814 LightDiffuse[2] = asin(opvect1);
4815 LightDiffuse[3] = acos(opvect1);
4816 LightDiffuse[4] = atan(opvect1);
4817 LightDiffuse[5] = atan2(opvect1, opvect2);
4818 LightDiffuse[6] = opvect1 * opvect2;
4820 /* Placeholder for 'div' instruction manually edited in binary blob. */
4821 LightDiffuse[7] = opvect1 * opvect2;
4823 /* Placeholder for 'cmp' instruction manually edited in binary blob. */
4824 LightAmbient[0] = opvect1 + opvect2 + opvect3;
4827 #endif
4828 static const DWORD test_effect_preshader_ops_blob[] =
4830 0xfeff0901, 0x0000044c, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
4831 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f,
4832 0x00317463, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4833 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003,
4834 0x00000001, 0x000000a0, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4835 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00337463, 0x00000001, 0x00000002, 0x00000002,
4836 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4837 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4838 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4839 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4840 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4841 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4842 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4843 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4844 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4845 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4846 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4847 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4848 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4849 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4850 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4851 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4852 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4853 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
4854 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
4855 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4856 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
4857 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
4858 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4859 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
4860 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4861 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
4862 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4863 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4864 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000001,
4865 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000,
4866 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000001,
4867 0x00000438, 0x00000000, 0x00000019, 0x00000091, 0x00000000, 0x000000b0, 0x000000ac, 0x00000091,
4868 0x00000001, 0x000000d0, 0x000000cc, 0x00000091, 0x00000002, 0x000000f0, 0x000000ec, 0x00000091,
4869 0x00000003, 0x00000110, 0x0000010c, 0x00000091, 0x00000004, 0x00000130, 0x0000012c, 0x00000091,
4870 0x00000005, 0x00000150, 0x0000014c, 0x00000091, 0x00000006, 0x00000170, 0x0000016c, 0x00000091,
4871 0x00000007, 0x00000190, 0x0000018c, 0x00000084, 0x00000000, 0x000001b0, 0x000001ac, 0x00000084,
4872 0x00000001, 0x000001d0, 0x000001cc, 0x00000084, 0x00000002, 0x000001f0, 0x000001ec, 0x00000084,
4873 0x00000003, 0x00000210, 0x0000020c, 0x00000084, 0x00000004, 0x00000230, 0x0000022c, 0x00000084,
4874 0x00000005, 0x00000250, 0x0000024c, 0x00000084, 0x00000006, 0x00000270, 0x0000026c, 0x00000084,
4875 0x00000007, 0x00000290, 0x0000028c, 0x00000085, 0x00000000, 0x000002bc, 0x000002ac, 0x00000085,
4876 0x00000001, 0x000002e8, 0x000002d8, 0x00000085, 0x00000002, 0x00000314, 0x00000304, 0x00000085,
4877 0x00000003, 0x00000340, 0x00000330, 0x00000085, 0x00000004, 0x0000036c, 0x0000035c, 0x00000085,
4878 0x00000005, 0x00000398, 0x00000388, 0x00000085, 0x00000006, 0x000003c4, 0x000003b4, 0x00000085,
4879 0x00000007, 0x000003f0, 0x000003e0, 0x00000087, 0x00000000, 0x0000041c, 0x0000040c, 0x00000000,
4880 0x00000009, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, 0x00000000, 0x0000016c, 0x46580200,
4881 0x003afffe, 0x42415443, 0x0000001c, 0x000000b3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
4882 0x000000b0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
4883 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00020002, 0x00000001, 0x000000a0, 0x00000070,
4884 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4885 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4886 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
4887 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4888 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4889 /* FXLC for LightAmbient[0] start. */
4890 0x001afffe, 0x434c5846,
4891 0x00000001, /* Instruction count, set to 1. */
4892 0x30000004, /* Operation code (bits 20-30) set to 'cmp' opcode 0x300. */
4893 0x00000003, /* Input arguments count set to 3. */
4894 /* Argument 1. */
4895 0x00000000, /* Relative addressing flag. */
4896 0x00000002, /* Register table ("c", float constants). */
4897 0x00000000, /* Register offset. */
4898 /* Argument 2. */
4899 0x00000000, 0x00000002, 0x00000004,
4900 /* Argument 3. */
4901 0x00000000, 0x00000002, 0x00000008,
4902 /* Output register. */
4903 0x00000000, 0x00000004, 0x00000000,
4904 /* End mark. */
4905 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4906 /* Padding to match placeholder length. */
4907 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4908 /* FXLC for LightAmbient[0] end. */
4909 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000114,
4910 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c,
4911 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4912 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4913 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463,
4914 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4915 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4916 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4917 /* FXLC for LightDiffuse[7] start. */
4918 0x000ffffe, 0x434c5846,
4919 0x00000001, /* Instruction count. */
4920 0x20800004, /* Operation code (bits 20-30) set to 'div' opcode 0x208. */
4921 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4922 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4923 /* FXLC for LightDiffuse[7] end. */
4924 0x00000000, 0x00000000, 0xffffffff,
4925 0x00000016, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087,
4926 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001,
4927 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f,
4928 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4929 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
4930 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4931 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4932 0x434c5846, 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4933 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4934 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe,
4935 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084,
4936 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4937 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4938 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4939 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4940 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4941 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20600004, 0x00000002, 0x00000000,
4942 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4943 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000,
4944 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
4945 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
4946 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4947 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4948 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4949 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10c00004, 0x00000001, 0x00000000,
4950 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4951 0x00000000, 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4952 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4953 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
4954 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
4955 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4956 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4957 0x434c5846, 0x00000001, 0x10b00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4958 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4959 0x00000012, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
4960 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
4961 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4962 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4963 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4964 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10a00004,
4965 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4966 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000011, 0x00000000, 0x0000013c,
4967 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
4968 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
4969 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4970 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4971 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4972 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4973 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4974 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4975 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4976 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4977 0x00000000, 0xffffffff, 0x00000010, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4978 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4979 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4980 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
4981 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4982 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4983 0x00000004, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4984 0x00000000, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4985 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4986 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4987 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4990 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
4992 static D3DLIGHT9 light;
4993 const struct
4995 const char *mnem;
4996 unsigned int expected_result[4];
4997 unsigned int result_index;
4998 float *result;
4999 D3DXVECTOR4 opvect1, opvect2, opvect3;
5000 unsigned int ulps;
5001 BOOL todo[4];
5003 op_tests[] =
5005 {"exp", {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000}, 0, &light.Diffuse.r,
5006 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5007 {"log", {0, 0x40000000, 0x3f9199b7, 0x43000000}, 1, &light.Diffuse.r,
5008 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5009 {"asin", {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000}, 2, &light.Diffuse.r,
5010 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5011 {"acos", {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000}, 3, &light.Diffuse.r,
5012 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5013 {"atan", {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb}, 4, &light.Diffuse.r,
5014 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
5015 {"atan2 test #1", {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000}, 5, &light.Diffuse.r,
5016 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
5017 {"atan2 test #2", {0xbfc90fdb, 0, 0xc0490fdb, 0}, 5, &light.Diffuse.r,
5018 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
5019 {"div", {0, 0, 0, 0}, 7, &light.Diffuse.r,
5020 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
5021 {"cmp", {0x40a00000, 0x40000000, 0x40400000, 0x41000000}, 0, &light.Ambient.r,
5022 {-0.3f, 0.0f, 2.2f, NAN}, {1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 6.0f, 7.0f, 8.0f}},
5023 {"0 * INF", {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000}, 6, &light.Diffuse.r,
5024 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
5026 unsigned int i, j, passes_count;
5027 ID3DXEffect *effect;
5028 HRESULT hr;
5030 hr = D3DXCreateEffect(device, test_effect_preshader_ops_blob, sizeof(test_effect_preshader_ops_blob),
5031 NULL, NULL, 0, NULL, &effect, NULL);
5032 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5033 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5034 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5035 hr = effect->lpVtbl->BeginPass(effect, 0);
5036 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5038 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
5040 const float *result = op_tests[i].result;
5041 const float *expected_float = (float *)op_tests[i].expected_result;
5043 winetest_push_context("Test %u", i);
5044 hr = effect->lpVtbl->SetVector(effect, "opvect1", &op_tests[i].opvect1);
5045 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5046 hr = effect->lpVtbl->SetVector(effect, "opvect2", &op_tests[i].opvect2);
5047 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5048 hr = effect->lpVtbl->SetVector(effect, "opvect3", &op_tests[i].opvect3);
5049 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5050 hr = effect->lpVtbl->CommitChanges(effect);
5051 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5053 hr = IDirect3DDevice9_GetLight(device, op_tests[i].result_index, &light);
5054 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5055 for (j = 0; j < 4; ++j)
5057 winetest_push_context("Light %u", j);
5058 todo_wine_if(op_tests[i].todo[j])
5059 ok(compare_float(result[j], expected_float[j], op_tests[i].ulps),
5060 "Operation %s, component %u, expected %#x (%.8e), got %#x (%.8e).\n", op_tests[i].mnem,
5061 j, op_tests[i].expected_result[j], expected_float[j],
5062 ((unsigned int *)result)[j], result[j]);
5063 winetest_pop_context();
5065 winetest_pop_context();
5068 hr = effect->lpVtbl->End(effect);
5069 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5070 effect->lpVtbl->Release(effect);
5073 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
5074 D3DXHANDLE tech, D3DXHANDLE param)
5076 D3DXPARAMETER_DESC desc;
5077 D3DXHANDLE param_child;
5078 unsigned int i, child_count;
5079 HRESULT hr;
5081 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
5082 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#lx.\n", hr);
5083 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
5084 for (i = 0; i < child_count; ++i)
5086 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
5087 : effect->lpVtbl->GetParameter(effect, param, i);
5088 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
5089 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
5090 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
5091 test_isparameterused_children(line, effect, tech, param_child);
5095 #define test_isparameterused_param_with_children(...) \
5096 test_isparameterused_param_with_children_(__LINE__, __VA_ARGS__)
5097 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
5098 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
5100 D3DXHANDLE param;
5102 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
5103 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
5105 if (effect2)
5106 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
5107 else
5108 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
5109 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
5111 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
5112 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
5114 test_isparameterused_children(line, effect, tech, param);
5117 static void test_effect_isparameterused(IDirect3DDevice9 *device)
5119 static const struct
5121 const char *name;
5122 BOOL expected_result;
5124 check_parameters[] =
5126 {"g_Pos1", TRUE},
5127 {"g_Pos2", TRUE},
5128 {"g_Selector", TRUE},
5129 {"opvect1", TRUE},
5130 {"opvect2", TRUE},
5131 {"opvect3", TRUE},
5132 {"arr2", TRUE},
5133 {"vs_arr", TRUE},
5134 {"g_iVect", TRUE},
5135 {"vect_sampler", TRUE},
5136 {"tex1", TRUE},
5137 {"tex2", FALSE},
5138 {"sampler1", TRUE},
5139 {"ts1", TRUE},
5140 {"ts2", TRUE},
5141 {"ts3", TRUE},
5143 ID3DXEffect *effect, *effect2;
5144 HRESULT hr;
5145 D3DXHANDLE tech;
5146 unsigned int i;
5148 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5149 NULL, NULL, 0, NULL, &effect, NULL);
5150 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5152 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
5153 ok(!!tech, "GetTechniqueByName failed.\n");
5155 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5156 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
5157 check_parameters[i].expected_result);
5159 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5160 NULL, NULL, 0, NULL, &effect2, NULL);
5161 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5163 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
5164 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
5165 check_parameters[i].expected_result);
5167 effect2->lpVtbl->Release(effect2);
5169 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
5170 NULL, NULL, 0, NULL, &effect2, NULL);
5171 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5173 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
5174 effect2->lpVtbl->Release(effect2);
5176 effect->lpVtbl->Release(effect);
5179 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
5181 ID3DXEffect *effect;
5182 HRESULT hr;
5183 D3DXHANDLE param;
5184 int ivect[4];
5185 unsigned int passes_count;
5186 IDirect3DVertexShader9 *vshader;
5188 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5189 NULL, NULL, 0, NULL, &effect, NULL);
5191 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5192 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5194 ivect[0] = ivect[1] = ivect[3] = 1;
5196 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5197 ok(!!param, "GetParameterByName failed.\n");
5198 ivect[2] = 3;
5199 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5200 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5202 hr = effect->lpVtbl->BeginPass(effect, 0);
5203 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5204 hr = effect->lpVtbl->EndPass(effect);
5205 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5207 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5208 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5210 hr = effect->lpVtbl->BeginPass(effect, 1);
5211 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
5213 /* Second try reports success and selects array element used previously.
5214 * Probably array index is not recomputed and previous index value is used. */
5215 hr = effect->lpVtbl->BeginPass(effect, 1);
5216 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5217 test_effect_preshader_compare_shader(device, 2, FALSE);
5219 /* Confirm that array element selected is the previous good one and does not depend
5220 * on computed (out of bound) index value. */
5221 ivect[2] = 1;
5222 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5223 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5224 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5225 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5226 hr = effect->lpVtbl->CommitChanges(effect);
5227 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5228 test_effect_preshader_compare_shader(device, 1, FALSE);
5229 hr = effect->lpVtbl->EndPass(effect);
5230 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5231 ivect[2] = 3;
5232 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5233 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5234 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5235 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5236 hr = effect->lpVtbl->BeginPass(effect, 1);
5237 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
5238 hr = effect->lpVtbl->BeginPass(effect, 1);
5239 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5240 test_effect_preshader_compare_shader(device, 1, FALSE);
5242 /* End and begin effect again to ensure it will not trigger array
5243 * index recompute and error return from BeginPass. */
5244 hr = effect->lpVtbl->EndPass(effect);
5245 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5246 hr = effect->lpVtbl->End(effect);
5247 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5248 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5249 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5250 hr = effect->lpVtbl->BeginPass(effect, 1);
5251 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5252 test_effect_preshader_compare_shader(device, 1, FALSE);
5253 hr = effect->lpVtbl->EndPass(effect);
5254 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5257 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5258 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5260 ivect[2] = -2;
5261 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5262 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5264 hr = effect->lpVtbl->BeginPass(effect, 1);
5265 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
5267 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5268 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5269 ok(!vshader, "Got non NULL vshader.\n");
5271 hr = effect->lpVtbl->BeginPass(effect, 1);
5272 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5274 test_effect_preshader_compare_shader(device, 1, FALSE);
5276 hr = effect->lpVtbl->EndPass(effect);
5277 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5279 ivect[2] = -1;
5280 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5281 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5283 hr = effect->lpVtbl->BeginPass(effect, 1);
5284 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5286 test_effect_preshader_compare_shader(device, 0, FALSE);
5288 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5289 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5291 ivect[2] = 3;
5292 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5293 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5294 hr = effect->lpVtbl->CommitChanges(effect);
5295 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5297 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5298 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5299 ok(!vshader, "Got non NULL vshader.\n");
5301 ivect[2] = -1;
5302 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5303 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5304 hr = effect->lpVtbl->CommitChanges(effect);
5305 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5307 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5308 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5309 ok(!vshader, "Got non NULL vshader.\n");
5311 ivect[2] = 1;
5312 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5313 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5314 hr = effect->lpVtbl->CommitChanges(effect);
5315 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5317 test_effect_preshader_compare_shader(device, 1, FALSE);
5319 hr = effect->lpVtbl->EndPass(effect);
5320 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5322 hr = effect->lpVtbl->End(effect);
5323 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5325 effect->lpVtbl->Release(effect);
5328 static void test_effect_commitchanges(IDirect3DDevice9 *device)
5330 static const struct
5332 const char *param_name;
5333 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
5335 check_op_parameters[] =
5337 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5338 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5339 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5340 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5341 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5342 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5343 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5344 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5345 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5346 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5347 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5348 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
5349 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5350 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
5351 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
5353 static const struct
5355 const char *param_name;
5356 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5357 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5359 check_vconsts_parameters[] =
5361 {"g_Selector", {0x00000000, 0x00000002}},
5362 {"g_Pos1", {0x80000000, 0x00000002}},
5363 {"g_Pos2", {0x00000000, 0x00000002}},
5364 {"m4x3column", {0x03800000, 0x00000000}},
5365 {"m3x4column", {0x000f0000, 0x00000000}},
5366 {"m4x3row", {0x0000f000, 0x00000000}},
5367 {"m3x4row", {0x00700000, 0x00000000}},
5368 {"ts1", {0x1c000000, 0x00000000}},
5369 {"ts2", {0x0000003f, 0x00000000}},
5370 {"arr1", {0x00000000, 0x00000001}},
5371 {"arr2", {0x60000000, 0x00000000}},
5372 {"ts3", {0x00000fc0, 0x00000000}},
5374 static const struct
5376 const char *param_name;
5377 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_bconsts)
5378 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5380 check_bconsts_parameters[] =
5382 {"mb2x3row", {0x0000001f}},
5383 {"mb2x3column", {0x00000060}},
5385 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5386 + TEST_EFFECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_BITMASK_BLOCK_SIZE];
5387 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
5389 ID3DXEffect *effect;
5390 HRESULT hr;
5391 D3DXHANDLE param;
5392 unsigned int i, passes_count;
5393 union
5395 DWORD dw;
5396 float f;
5397 } float_value;
5398 DWORD value;
5399 int ivect[4];
5400 D3DXVECTOR4 fvect;
5401 IDirect3DVertexShader9 *vshader;
5402 unsigned char buffer[256];
5405 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5406 NULL, NULL, 0, NULL, &effect, NULL);
5407 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5409 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5410 ok(!!param, "GetParameterByName failed.\n");
5412 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5413 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5415 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5416 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5418 hr = effect->lpVtbl->BeginPass(effect, 0);
5419 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5421 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
5423 unsigned int j;
5425 winetest_push_context("Parameter %s", check_op_parameters[i].param_name);
5426 for (j = 0; j < 8; ++j)
5428 winetest_push_context("Light %u", j);
5429 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
5430 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5431 winetest_pop_context();
5433 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
5434 ok(!!param, "Unexpected parameter %p.\n", param);
5435 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
5436 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5437 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
5438 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5439 hr = effect->lpVtbl->CommitChanges(effect);
5440 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5442 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
5443 check_op_parameters[i].param_name);
5444 winetest_pop_context();
5447 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
5449 winetest_push_context("Float constants, parameter %s", check_vconsts_parameters[i].param_name);
5450 test_effect_clear_vconsts(device);
5451 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
5452 ok(!!param, "Unexpected parameter %p.\n", param);
5453 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5454 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5455 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5456 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5457 hr = effect->lpVtbl->CommitChanges(effect);
5458 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5460 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
5461 check_vconsts_parameters[i].param_name);
5462 winetest_pop_context();
5465 for (i = 0; i < ARRAY_SIZE(check_bconsts_parameters); ++i)
5467 winetest_push_context("Bool constants, parameter %s", check_bconsts_parameters[i].param_name);
5468 test_effect_preshader_clear_pbool_consts(device);
5469 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_bconsts_parameters[i].param_name);
5470 ok(!!param, "GetParameterByName failed.\n");
5471 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5472 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5473 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5474 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5475 hr = effect->lpVtbl->CommitChanges(effect);
5476 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5478 test_effect_preshader_compare_pbool_consts(device, check_bconsts_parameters[i].const_updated_mask,
5479 check_bconsts_parameters[i].param_name);
5480 winetest_pop_context();
5483 test_effect_clear_vconsts(device);
5484 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
5485 ok(!!param, "Unexpected parameter %p.\n", param);
5486 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5487 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
5488 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5489 hr = effect->lpVtbl->CommitChanges(effect);
5490 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5491 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
5492 check_vconsts_parameters[0].param_name);
5494 test_effect_clear_vconsts(device);
5495 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5496 ok(!!param, "GetParameterByName failed.\n");
5497 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5498 ok(!!param, "GetParameterElement failed.\n");
5499 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
5500 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5501 hr = effect->lpVtbl->CommitChanges(effect);
5502 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5503 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5504 check_vconsts_parameters[10].param_name);
5506 test_effect_clear_vconsts(device);
5507 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5508 ok(!!param, "GetParameterByName failed.\n");
5509 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5510 ok(!!param, "GetParameterElement failed.\n");
5511 fvect.x = 93.0f;
5512 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
5513 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5514 hr = effect->lpVtbl->CommitChanges(effect);
5515 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5516 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5517 check_vconsts_parameters[10].param_name);
5519 test_effect_clear_vconsts(device);
5520 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5521 ok(!!param, "GetParameterByName failed.\n");
5522 fvect.x = 92.0f;
5523 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
5524 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5525 hr = effect->lpVtbl->CommitChanges(effect);
5526 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5527 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5528 check_vconsts_parameters[10].param_name);
5530 test_effect_clear_vconsts(device);
5531 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5532 ok(!!param, "GetParameterByName failed.\n");
5533 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5534 ok(!!param, "GetParameterElement failed.\n");
5535 hr = effect->lpVtbl->SetInt(effect, param, 93);
5536 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5537 hr = effect->lpVtbl->CommitChanges(effect);
5538 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5539 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5540 check_vconsts_parameters[10].param_name);
5542 test_effect_clear_vconsts(device);
5543 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5544 ok(!!param, "GetParameterByName failed.\n");
5545 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5546 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
5547 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5548 hr = effect->lpVtbl->CommitChanges(effect);
5549 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5550 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5551 check_vconsts_parameters[1].param_name);
5553 test_effect_clear_vconsts(device);
5554 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
5555 ok(!!param, "GetParameterByName failed.\n");
5556 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5557 ok(!!param, "GetParameterByName failed.\n");
5558 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5559 ok(!!param, "GetParameterByName failed.\n");
5560 fvect.x = 12;
5561 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5562 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5563 hr = effect->lpVtbl->CommitChanges(effect);
5564 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5565 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5566 check_vconsts_parameters[7].param_name);
5568 float_value.f = 9999.0f;
5569 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, float_value.dw);
5570 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5571 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, float_value.dw);
5572 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5573 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, float_value.dw);
5574 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5575 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, float_value.dw);
5576 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5577 test_effect_clear_vconsts(device);
5578 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5579 ok(!!param, "GetParameterByName failed.\n");
5580 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5581 ok(!!param, "GetParameterByName failed.\n");
5582 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5583 ok(!!param, "GetParameterByName failed.\n");
5584 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5585 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5586 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5587 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5588 hr = effect->lpVtbl->CommitChanges(effect);
5589 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5590 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &float_value.dw);
5591 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5592 ok(float_value.f == 0, "Unexpected fog density %.8e.\n", float_value.f);
5593 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &float_value.dw);
5594 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5595 ok(float_value.f == 4.0f, "Unexpected fog start %.8e.\n", float_value.f);
5596 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &float_value.dw);
5597 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5598 ok(float_value.f == 9999.0f, "Unexpected point scale A %.8e.\n", float_value.f);
5599 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &float_value.dw);
5600 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5601 ok(float_value.f == 9999.0f, "Unexpected point scale B %.8e.\n", float_value.f);
5602 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5603 check_vconsts_parameters[8].param_name);
5605 float_value.f = 9999.0f;
5606 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, float_value.dw);
5607 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5608 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, float_value.dw);
5609 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5610 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, float_value.dw);
5611 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5612 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, float_value.dw);
5613 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5614 test_effect_clear_vconsts(device);
5615 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5616 ok(!!param, "GetParameterByName failed.\n");
5617 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5618 ok(!!param, "GetParameterByName failed.\n");
5619 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5620 ok(!!param, "GetParameterByName failed.\n");
5621 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5622 ok(!!param, "GetParameterByName failed.\n");
5623 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5624 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5625 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5626 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5627 hr = effect->lpVtbl->CommitChanges(effect);
5628 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5629 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &float_value.dw);
5630 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5631 ok(float_value.f == 9999.0f, "Unexpected fog density %.8e.\n", float_value.f);
5632 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &float_value.dw);
5633 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5634 ok(float_value.f == 9999.0f, "Unexpected fog start %.8e.\n", float_value.f);
5635 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &float_value.dw);
5636 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5637 ok(float_value.f == 4.0f, "Unexpected point scale A %.8e.\n", float_value.f);
5638 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &float_value.dw);
5639 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5640 ok(float_value.f == 12.0f, "Unexpected point scale B %.8e.\n", float_value.f);
5641 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5642 check_vconsts_parameters[11].param_name);
5644 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5645 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5646 ok(value == 1, "Unexpected sampler 0 minfilter %lu.\n", value);
5647 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5648 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5649 todo_wine
5650 ok(value == 0, "Unexpected sampler 1 minfilter %lu.\n", value);
5651 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5652 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5653 ok(value == 3, "Unexpected sampler 2 minfilter %lu.\n", value);
5655 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5656 ok(!!param, "GetParameterByName failed.\n");
5657 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5658 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5659 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5661 for (i = 0; i < 3; ++i)
5663 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MINFILTER, 0);
5664 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5665 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0 + i, D3DSAMP_MAGFILTER, 0);
5666 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5669 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5670 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5671 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5672 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5674 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5675 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5676 test_effect_clear_vconsts(device);
5678 hr = effect->lpVtbl->CommitChanges(effect);
5679 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5681 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5682 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5683 ok(!vshader, "Unexpected vshader %p.\n", vshader);
5684 test_effect_preshader_compare_vconsts(device, const_no_update_mask, "selector g_iVect");
5686 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5687 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5688 ok(value == 0, "Unexpected sampler 0 minfilter %lu.\n", value);
5689 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER1, D3DSAMP_MINFILTER, &value);
5690 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5691 ok(value == 0, "Unexpected sampler 1 minfilter %lu.\n", value);
5693 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MINFILTER, &value);
5694 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5695 ok(value == 1, "Unexpected sampler 2 minfilter %lu.\n", value);
5696 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER2, D3DSAMP_MAGFILTER, &value);
5697 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5698 ok(value == 0, "Unexpected sampler 2 minfilter %lu.\n", value);
5699 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5700 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5701 ok(value == 1, "Unexpected sampler 0 minfilter %lu.\n", value);
5702 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5703 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5704 ok(value == 0, "Unexpected sampler 0 minfilter %lu.\n", value);
5706 ivect[3] = 2;
5707 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5708 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5709 ivect[3] = 1;
5710 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5711 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5712 hr = effect->lpVtbl->CommitChanges(effect);
5713 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5714 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5715 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5716 ok(!vshader, "Unexpected vshader %p.\n", vshader);
5717 test_effect_preshader_compare_vconsts(device, const_no_update_mask, "selector g_iVect");
5718 ivect[3] = 2;
5719 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5720 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5721 hr = effect->lpVtbl->CommitChanges(effect);
5722 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5723 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5724 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5725 ok(!!vshader, "Unexpected vshader %p.\n", vshader);
5726 IDirect3DVertexShader9_Release(vshader);
5727 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5728 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5729 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5730 "Vertex shader float constants do not match.\n");
5731 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5732 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5733 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5734 "selector g_iVect");
5735 ivect[3] = 1;
5736 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5737 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5738 hr = effect->lpVtbl->CommitChanges(effect);
5739 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5740 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5742 hr = effect->lpVtbl->EndPass(effect);
5743 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5745 hr = effect->lpVtbl->End(effect);
5746 ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
5748 effect->lpVtbl->Release(effect);
5751 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5753 static const struct
5755 D3DXVECTOR4 opvect2;
5756 D3DXVECTOR4 g_ivect;
5757 unsigned int expected[4];
5759 test_out_of_bounds_index[] =
5761 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5762 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5763 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5764 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5765 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5766 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5767 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5768 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5769 {0x447ac000, 0x448ae000, 0, 0}},
5770 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5771 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5772 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5773 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5774 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5775 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5776 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5777 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5778 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5779 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5780 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5781 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5782 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5783 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5784 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5785 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5786 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5787 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5788 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5789 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5790 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5791 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5792 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5793 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5794 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5796 static const struct
5798 unsigned int zw[2];
5800 expected_light_specular[] =
5802 {{0, 0x44fa2000}},
5803 {{0x447a8000, 0x453b9000}},
5804 {{0x40000000, 0x459c4800}},
5805 {{0xbf800000, 0}},
5806 {{0x447a4000, 0}},
5807 {{0x3f800000, 0}},
5808 {{0xbf800000, 0}},
5809 {{0, 0}},
5810 {{0, 0x447a4000}},
5811 {{0x44fa4000, 0x3f800000}},
5812 {{0x453ba000, 0xbf800000}},
5813 {{0x459c5000, 0}},
5814 {{0x44fa2000, 0}},
5815 {{0x453b9000, 0}},
5816 {{0x459c4800, 0}},
5817 {{0, 0}},
5819 static const struct
5821 int index_value;
5822 unsigned int expected[4];
5824 test_index_to_immediate_table[] =
5826 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5827 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5828 {-32, {0x448d4000, 0x40800000, 0, 0}},
5829 {-31, {0x45843000, 0x41400000, 0, 0}},
5830 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5831 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5832 {-28, {0, 0, 0x447ac000, 0x40400000}},
5833 {-27, {0, 0x3f800000, 0, 0}},
5834 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5835 {-25, {0, 0x41300000, 0, 0}},
5836 {-24, {0, 0x41600000, 0, 0}},
5837 {-23, {0, 0, 0, 0}},
5838 {-22, {0, 0, 0, 0}},
5839 {-21, {0, 0x40a00000, 0, 0}},
5840 {-20, {0, 0x41500000, 0, 0}},
5841 {-19, {0, 0x41500000, 0, 0}},
5842 {-18, {0, 0xc1900000, 0, 0}},
5843 {-17, {0, 0, 0, 0}},
5844 {-16, {0, 0x40800000, 0, 0}},
5845 {-15, {0, 0x41400000, 0, 0}},
5846 {-14, {0, 0x41400000, 0, 0}},
5847 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5848 {-12, {0, 0, 0, 0}},
5849 {-11, {0, 0x3f800000, 0, 0}},
5850 {-10, {0, 0x41100000, 0, 0}},
5851 {-9, {0, 0x41300000, 0, 0}},
5852 {-8, {0, 0x41600000, 0, 0}},
5853 {-7, {0, 0, 0, 0}},
5854 {-6, {0, 0, 0, 0}},
5855 {-5, {0, 0x40a00000, 0, 0}},
5856 {-4, {0, 0x41500000, 0, 0}},
5857 {-3, {0, 0x41500000, 0, 0}},
5858 {-2, {0, 0xc0000000, 0, 0}},
5859 {-1, {0, 0, 0, 0}},
5860 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5861 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5862 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5863 {3, {0, 0x447a4000, 0, 0}},
5864 {4, {0, 0, 0x45bbd800, 0x41300000}},
5865 {5, {0, 0x3f800000, 0, 0}},
5866 {6, {0, 0x41100000, 0, 0}},
5867 {7, {0, 0x41300000, 0, 0}},
5868 {8, {0, 0x41600000, 0, 0}},
5869 {9, {0, 0, 0, 0}},
5870 {10, {0, 0, 0, 0}},
5871 {11, {0, 0x40a00000, 0, 0}},
5872 {12, {0, 0x41500000, 0, 0}},
5873 {13, {0, 0x41500000, 0, 0}},
5874 {14, {0, 0x41600000, 0, 0}},
5875 {15, {0, 0, 0, 0}},
5876 {16, {0, 0x40800000, 0, 0}},
5877 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5878 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5879 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5880 {20, {0, 0, 0, 0}},
5881 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5882 {22, {0, 0x41100000, 0, 0}},
5883 {23, {0, 0x41300000, 0, 0}},
5884 {24, {0, 0x41600000, 0, 0}},
5885 {25, {0, 0, 0, 0}},
5886 {26, {0, 0, 0, 0}},
5887 {27, {0, 0x40a00000, 0, 0}},
5888 {28, {0, 0x41500000, 0, 0}},
5889 {29, {0, 0x41500000, 0, 0}},
5890 {30, {0, 0x41f00000, 0, 0}},
5891 {31, {0, 0, 0, 0}},
5892 {1001, {0, 0, 0, 0}},
5893 {1000000, {0, 0x40800000, 0, 0}},
5895 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5896 {1.0f, 1.0f, 1.0f, 1.0f}};
5897 unsigned int j, passes_count;
5898 const unsigned int *expected;
5899 const float *expected_float;
5900 ID3DXEffect *effect;
5901 D3DXVECTOR4 fvect;
5902 D3DLIGHT9 light;
5903 const float *v;
5904 HRESULT hr;
5905 int i;
5907 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5908 NULL, NULL, 0, NULL, &effect, NULL);
5909 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5911 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5912 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5913 hr = effect->lpVtbl->BeginPass(effect, 0);
5914 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5916 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5917 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5918 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5920 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5921 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5922 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5924 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5925 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5926 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5928 v = &light.Specular.r;
5929 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5931 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5932 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5933 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5934 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5936 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5937 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5939 hr = effect->lpVtbl->CommitChanges(effect);
5940 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5942 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5943 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5945 expected = test_out_of_bounds_index[i].expected;
5946 expected_float = (const float *)expected;
5948 for (j = 0; j < 4; ++j)
5950 ok(compare_float(v[j], expected_float[j], 0),
5951 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5952 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5956 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5957 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5958 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5959 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5961 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5962 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5964 fvect = test_out_of_bounds_index[7].g_ivect;
5965 v = &light.Specular.b;
5966 for (i = -100; i < 100; ++i)
5968 fvect.w = i;
5969 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5970 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5971 hr = effect->lpVtbl->CommitChanges(effect);
5972 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5974 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5975 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5977 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5978 expected_float = (const float *)expected;
5980 for (j = 0; j < 2; ++j)
5982 ok(compare_float(v[j], expected_float[j], 0),
5983 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
5984 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5988 v = &light.Specular.r;
5989 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
5991 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
5992 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5993 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5994 hr = effect->lpVtbl->CommitChanges(effect);
5995 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
5997 hr = IDirect3DDevice9_GetLight(device, 2, &light);
5998 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6000 expected = test_index_to_immediate_table[i].expected;
6001 expected_float = (const float *)expected;
6003 for (j = 0; j < 4; ++j)
6005 ok(compare_float(v[j], expected_float[j], 0),
6006 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
6007 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
6011 hr = effect->lpVtbl->EndPass(effect);
6012 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6013 hr = effect->lpVtbl->End(effect);
6014 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6016 effect->lpVtbl->Release(effect);
6019 struct test_state_manager_update
6021 unsigned int state_op;
6022 DWORD param1;
6023 DWORD param2;
6026 struct test_manager
6028 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
6029 LONG ref;
6031 IDirect3DDevice9 *device;
6032 struct test_state_manager_update *update_record;
6033 unsigned int update_record_count;
6034 unsigned int update_record_size;
6037 #define INITIAL_UPDATE_RECORD_SIZE 64
6039 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
6041 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
6044 static void free_test_effect_state_manager(struct test_manager *state_manager)
6046 free(state_manager->update_record);
6047 state_manager->update_record = NULL;
6049 IDirect3DDevice9_Release(state_manager->device);
6052 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
6054 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6056 return InterlockedIncrement(&state_manager->ref);
6059 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
6061 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6062 ULONG ref = InterlockedDecrement(&state_manager->ref);
6064 if (!ref)
6066 free_test_effect_state_manager(state_manager);
6067 free(state_manager);
6069 return ref;
6072 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
6073 unsigned int state_op, DWORD param1, DWORD param2)
6075 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6077 if (state_manager->update_record_count == state_manager->update_record_size)
6079 if (!state_manager->update_record_size)
6080 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
6081 else
6082 state_manager->update_record_size *= 2;
6083 state_manager->update_record = realloc(state_manager->update_record,
6084 sizeof(*state_manager->update_record) * state_manager->update_record_size);
6086 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
6087 state_manager->update_record[state_manager->update_record_count].param1 = param1;
6088 state_manager->update_record[state_manager->update_record_count].param2 = param2;
6089 ++state_manager->update_record_count;
6090 return D3D_OK;
6093 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
6094 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
6096 return test_process_set_state(iface, 0, state, 0);
6099 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
6100 const D3DMATERIAL9 *material)
6102 return test_process_set_state(iface, 1, 0, 0);
6105 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
6106 DWORD index, const D3DLIGHT9 *light)
6108 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6110 IDirect3DDevice9_SetLight(state_manager->device, index, light);
6111 return test_process_set_state(iface, 2, index, 0);
6114 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
6115 DWORD index, BOOL enable)
6117 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
6119 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
6120 return test_process_set_state(iface, 3, index, 0);
6123 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
6124 D3DRENDERSTATETYPE state, DWORD value)
6126 return test_process_set_state(iface, 4, state, 0);
6129 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
6130 DWORD stage, struct IDirect3DBaseTexture9 *texture)
6132 return test_process_set_state(iface, 5, stage, 0);
6135 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
6136 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
6138 return test_process_set_state(iface, 6, stage, type);
6141 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
6142 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
6144 return test_process_set_state(iface, 7, sampler, type);
6147 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
6148 FLOAT num_segments)
6150 return test_process_set_state(iface, 8, 0, 0);
6153 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
6154 DWORD format)
6156 return test_process_set_state(iface, 9, 0, 0);
6159 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
6160 struct IDirect3DVertexShader9 *shader)
6162 return test_process_set_state(iface, 10, 0, 0);
6165 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
6166 UINT register_index, const FLOAT *constant_data, UINT register_count)
6168 return test_process_set_state(iface, 11, register_index, register_count);
6171 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
6172 UINT register_index, const INT *constant_data, UINT register_count)
6174 return test_process_set_state(iface, 12, register_index, register_count);
6177 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
6178 UINT register_index, const BOOL *constant_data, UINT register_count)
6180 return test_process_set_state(iface, 13, register_index, register_count);
6183 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
6184 struct IDirect3DPixelShader9 *shader)
6186 return test_process_set_state(iface, 14, 0, 0);
6189 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
6190 UINT register_index, const FLOAT *constant_data, UINT register_count)
6192 return test_process_set_state(iface, 15, register_index, register_count);
6195 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
6196 UINT register_index, const INT *constant_data, UINT register_count)
6198 return test_process_set_state(iface, 16, register_index, register_count);
6201 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
6202 UINT register_index, const BOOL *constant_data, UINT register_count)
6204 return test_process_set_state(iface, 17, register_index, register_count);
6207 static void test_effect_state_manager_init(struct test_manager *state_manager,
6208 IDirect3DDevice9 *device)
6210 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
6212 /*** IUnknown methods ***/
6213 NULL,
6214 test_manager_AddRef,
6215 test_manager_Release,
6216 /*** ID3DXEffectStateManager methods ***/
6217 test_manager_SetTransform,
6218 test_manager_SetMaterial,
6219 test_manager_SetLight,
6220 test_manager_LightEnable,
6221 test_manager_SetRenderState,
6222 test_manager_SetTexture,
6223 test_manager_SetTextureStageState,
6224 test_manager_SetSamplerState,
6225 test_manager_SetNPatchMode,
6226 test_manager_SetFVF,
6227 test_manager_SetVertexShader,
6228 test_manager_SetVertexShaderConstantF,
6229 test_manager_SetVertexShaderConstantI,
6230 test_manager_SetVertexShaderConstantB,
6231 test_manager_SetPixelShader,
6232 test_manager_SetPixelShaderConstantF,
6233 test_manager_SetPixelShaderConstantI,
6234 test_manager_SetPixelShaderConstantB,
6237 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
6238 state_manager->ref = 1;
6240 IDirect3DDevice9_AddRef(device);
6241 state_manager->device = device;
6244 static const char *test_effect_state_manager_state_names[] =
6246 "SetTransform",
6247 "SetMaterial",
6248 "SetLight",
6249 "LightEnable",
6250 "SetRenderState",
6251 "SetTexture",
6252 "SetTextureStageState",
6253 "SetSamplerState",
6254 "SetNPatchMode",
6255 "SetFVF",
6256 "SetVertexShader",
6257 "SetVertexShaderConstantF",
6258 "SetVertexShaderConstantI",
6259 "SetVertexShaderConstantB",
6260 "SetPixelShader",
6261 "SetPixelShaderConstantF",
6262 "SetPixelShaderConstantI",
6263 "SetPixelShaderConstantB",
6266 static int compare_update_record(const void *a, const void *b)
6268 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
6269 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
6271 if (r1->state_op != r2->state_op)
6272 return r1->state_op - r2->state_op;
6273 if (r1->param1 != r2->param1)
6274 return r1->param1 - r2->param1;
6275 return r1->param2 - r2->param2;
6278 static void test_effect_state_manager(IDirect3DDevice9 *device)
6280 static const struct test_state_manager_update expected_updates[] =
6282 {2, 0, 0},
6283 {2, 1, 0},
6284 {2, 2, 0},
6285 {2, 3, 0},
6286 {2, 4, 0},
6287 {2, 5, 0},
6288 {2, 6, 0},
6289 {2, 7, 0},
6290 {3, 0, 0},
6291 {3, 1, 0},
6292 {3, 2, 0},
6293 {3, 3, 0},
6294 {3, 4, 0},
6295 {3, 5, 0},
6296 {3, 6, 0},
6297 {3, 7, 0},
6298 {4, 28, 0},
6299 {4, 36, 0},
6300 {4, 38, 0},
6301 {4, 158, 0},
6302 {4, 159, 0},
6303 {5, 0, 0},
6304 {5, 259, 0},
6305 {7, 0, 5},
6306 {7, 0, 6},
6307 {7, 1, 5},
6308 {7, 1, 6},
6309 {7, 257, 5},
6310 {7, 257, 6},
6311 {7, 258, 5},
6312 {7, 258, 6},
6313 {7, 259, 5},
6314 {7, 259, 6},
6315 {10, 0, 0},
6316 {11, 0, 34},
6317 {14, 0, 0},
6318 {15, 0, 14},
6319 {16, 0, 1},
6320 {17, 0, 6},
6322 static D3DLIGHT9 light_filler =
6323 {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}};
6324 struct test_manager *state_manager;
6325 unsigned int passes_count, i, n;
6326 ID3DXEffect *effect;
6327 ULONG refcount;
6328 HRESULT hr;
6330 state_manager = calloc(1, sizeof(*state_manager));
6331 test_effect_state_manager_init(state_manager, device);
6333 for (i = 0; i < 8; ++i)
6335 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
6336 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6339 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6340 NULL, NULL, 0, NULL, &effect, NULL);
6341 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6343 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
6344 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6346 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6347 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6349 hr = effect->lpVtbl->BeginPass(effect, 0);
6350 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6352 hr = effect->lpVtbl->EndPass(effect);
6353 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6355 hr = effect->lpVtbl->End(effect);
6356 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6358 effect->lpVtbl->Release(effect);
6360 qsort(state_manager->update_record, state_manager->update_record_count,
6361 sizeof(*state_manager->update_record), compare_update_record);
6363 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
6364 "Got %u update records.\n", state_manager->update_record_count);
6365 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
6366 for (i = 0; i < n; ++i)
6368 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
6369 sizeof(expected_updates[i])),
6370 "Update record mismatch, expected %s, %lu, %lu, got %s, %lu, %lu.\n",
6371 test_effect_state_manager_state_names[expected_updates[i].state_op],
6372 expected_updates[i].param1, expected_updates[i].param2,
6373 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
6374 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
6377 for (i = 0; i < 8; ++i)
6379 D3DLIGHT9 light;
6381 hr = IDirect3DDevice9_GetLight(device, i, &light);
6382 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6383 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
6386 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
6387 &state_manager->ID3DXEffectStateManager_iface);
6388 ok(!refcount, "State manager was not properly freed, refcount %lu.\n", refcount);
6391 static void test_cross_effect_handle(IDirect3DDevice9 *device)
6393 ID3DXEffect *effect1, *effect2;
6394 D3DXHANDLE param1, param2;
6395 static int expected_ivect[4] = {28, 29, 30, 31};
6396 int ivect[4];
6397 HRESULT hr;
6399 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6400 NULL, NULL, 0, NULL, &effect1, NULL);
6401 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6402 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6403 NULL, NULL, 0, NULL, &effect2, NULL);
6404 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6406 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
6408 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
6409 ok(!!param1, "GetParameterByName failed.\n");
6411 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
6412 ok(!!param2, "GetParameterByName failed.\n");
6414 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
6416 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
6417 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6419 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
6420 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6422 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6424 effect2->lpVtbl->Release(effect2);
6425 effect1->lpVtbl->Release(effect1);
6428 #if 0
6429 struct test_struct
6431 float3 v1_2;
6432 float fv_2;
6433 float4 v2_2;
6436 shared float arr2[1];
6437 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
6439 struct VS_OUTPUT
6441 float4 Position : POSITION;
6444 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6446 VS_OUTPUT Output;
6448 Output.Position = arr2[0] * vPos;
6449 return Output;
6452 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
6454 technique tech0
6456 pass p0
6458 FogEnable = TRUE;
6459 FogDensity = arr2[0];
6460 PointScale_A = ts2[0].fv_2;
6461 VertexShader = vs_arr2[0];
6464 pass p1
6466 VertexShader = vs_arr2[1];
6469 #endif
6470 static const DWORD test_effect_shared_parameters_blob[] =
6472 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
6473 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
6474 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
6475 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
6476 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
6477 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6478 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
6479 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
6480 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
6481 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
6482 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6483 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6484 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
6485 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
6486 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
6487 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
6488 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
6489 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
6490 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
6491 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
6492 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
6493 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
6494 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
6495 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
6496 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
6497 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
6498 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
6499 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
6500 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
6501 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
6502 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
6503 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
6504 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
6505 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
6506 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
6507 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
6508 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6509 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
6510 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
6511 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6512 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6513 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6514 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6515 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
6516 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
6517 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
6518 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
6519 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
6520 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
6521 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6522 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6525 #define test_effect_shared_vs_arr_compare_helper(...) \
6526 test_effect_shared_vs_arr_compare_helper_(__LINE__, __VA_ARGS__)
6527 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
6528 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
6529 BOOL todo)
6531 struct IDirect3DVertexShader9 *vshader2;
6532 D3DXHANDLE param_child2;
6533 HRESULT hr;
6535 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
6536 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
6537 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6538 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
6539 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
6540 todo_wine_if(todo)
6541 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
6542 if (vshader2)
6543 IDirect3DVertexShader9_Release(vshader2);
6546 #define test_effect_shared_parameters_compare_vconst(...) \
6547 test_effect_shared_parameters_compare_vconst_(__LINE__, __VA_ARGS__)
6548 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
6549 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6551 D3DXVECTOR4 fvect;
6552 HRESULT hr;
6554 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6555 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#lx.\n", hr);
6556 todo_wine_if(todo)
6557 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6558 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6561 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6563 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6564 ID3DXEffectPool *pool;
6565 HRESULT hr;
6566 D3DXHANDLE param, param_child, param2, param_child2;
6567 unsigned int i, passes_count;
6568 ULONG refcount;
6569 D3DXVECTOR4 fvect;
6570 float fval[2];
6572 hr = D3DXCreateEffectPool(&pool);
6573 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6575 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6576 NULL, NULL, 0, pool, &effect2, NULL);
6577 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6578 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6579 effect2->lpVtbl->Release(effect2);
6581 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6582 NULL, NULL, 0, pool, &effect2, NULL);
6583 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6584 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6585 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6586 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6588 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6589 NULL, NULL, 0, pool, &effect1, NULL);
6590 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6592 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6593 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6595 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6596 NULL, NULL, 0, pool, &effect3, NULL);
6597 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6598 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6599 NULL, NULL, 0, pool, &effect4, NULL);
6600 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6602 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6603 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6605 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6606 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6607 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6608 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6609 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6610 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6611 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6613 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6614 ok(!!param, "GetParameterByName failed.\n");
6615 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6616 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6618 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6619 ok(!!param, "GetParameterByName failed.\n");
6620 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6621 "Unexpected IsParameterUsed result.\n");
6623 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6624 ok(!!param, "GetParameterByName failed.\n");
6625 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6626 "Unexpected IsParameterUsed result.\n");
6628 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6629 ok(!!param, "GetParameterByName failed.\n");
6630 todo_wine
6631 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6632 "Unexpected IsParameterUsed result.\n");
6634 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6635 "Unexpected IsParameterUsed result.\n");
6636 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6637 "Unexpected IsParameterUsed result.\n");
6638 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6639 "Unexpected IsParameterUsed result.\n");
6641 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6642 "Unexpected IsParameterUsed result.\n");
6644 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6645 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6647 if (0)
6649 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6650 * but initialized with different shaders using different parameters. */
6651 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6652 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6654 hr = effect3->lpVtbl->EndPass(effect3);
6655 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6658 test_effect_clear_vconsts(device);
6659 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6660 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6661 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6662 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6663 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6665 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6666 todo_wine
6667 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6669 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6670 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6671 todo_wine
6672 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6673 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6675 hr = effect3->lpVtbl->EndPass(effect3);
6676 todo_wine
6677 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6679 hr = effect3->lpVtbl->End(effect3);
6680 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6682 for (i = 0; i < 2; ++i)
6684 struct IDirect3DVertexShader9 *vshader1;
6686 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6687 ok(!!param_child, "GetParameterElement failed.\n");
6688 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6689 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6691 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6692 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6693 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6694 IDirect3DVertexShader9_Release(vshader1);
6697 effect3->lpVtbl->Release(effect3);
6698 effect4->lpVtbl->Release(effect4);
6700 fval[0] = 1.0f;
6701 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6702 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6703 fval[0] = 0.0f;
6704 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6705 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6706 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6708 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6709 ok(!!param, "GetParameterByName failed.\n");
6710 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6711 ok(!!param, "GetParameterByName failed.\n");
6712 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6713 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6714 ok(!!param_child, "GetParameterElement failed.\n");
6715 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6716 ok(!!param_child2, "GetParameterElement failed.\n");
6717 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6719 fval[0] = 33.0f;
6720 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6721 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6722 fval[0] = 0.0f;
6723 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6724 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6725 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6726 fval[0] = 0.0f;
6727 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6728 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6729 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6731 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6732 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6734 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6735 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6737 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6738 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6740 fvect.x = 1.0f;
6741 fvect.y = fvect.z = fvect.w = 0.0f;
6742 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6744 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6745 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6747 fvect.x = 91.0f;
6748 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6749 fvect.x = 33.0f;
6750 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6752 fval[0] = 28.0f;
6753 fval[1] = -1.0f;
6754 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6755 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6757 test_effect_clear_vconsts(device);
6759 hr = effect1->lpVtbl->CommitChanges(effect1);
6760 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6762 fvect.x = 28.0f;
6763 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6764 fvect.x = -1.0f;
6765 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6767 test_effect_clear_vconsts(device);
6769 hr = effect1->lpVtbl->CommitChanges(effect1);
6770 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6772 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6773 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6775 hr = effect2->lpVtbl->CommitChanges(effect2);
6776 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6778 fvect.x = 28.0f;
6779 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6780 fvect.x = -1.0f;
6781 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6783 fval[0] = -2.0f;
6784 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6785 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6786 hr = effect1->lpVtbl->CommitChanges(effect1);
6787 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6789 fvect.x = -2.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 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6795 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6796 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6798 hr = effect1->lpVtbl->CommitChanges(effect1);
6799 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6800 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6802 hr = effect1->lpVtbl->CommitChanges(effect2);
6803 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6804 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6806 hr = effect1->lpVtbl->End(effect1);
6807 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6809 hr = effect2->lpVtbl->End(effect2);
6810 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6812 if (0)
6814 refcount = pool->lpVtbl->Release(pool);
6815 ok(refcount == 2, "Unexpected refcount %lu.\n", refcount);
6817 refcount = pool->lpVtbl->Release(pool);
6818 ok(refcount == 1, "Unexpected refcount %lu.\n", refcount);
6820 refcount = pool->lpVtbl->Release(pool);
6821 ok(!refcount, "Unexpected refcount %lu.\n", refcount);
6823 /* Native d3dx crashes in GetFloat(). */
6824 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6827 effect1->lpVtbl->Release(effect1);
6828 effect2->lpVtbl->Release(effect2);
6830 refcount = pool->lpVtbl->Release(pool);
6831 ok(!refcount, "Effect pool was not properly freed, refcount %lu.\n", refcount);
6834 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6836 ID3DXEffect *effect;
6837 D3DXHANDLE param;
6838 static int expected_ivect[4] = {28, 29, 30, 31};
6839 int ivect[4];
6840 HRESULT hr;
6842 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6843 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6844 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6846 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6847 ok(!!param, "GetParameterByName failed.\n");
6849 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6850 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6852 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6853 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6855 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6857 if (0)
6859 /* Native d3dx crashes in GetValue(). */
6860 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6861 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
6864 effect->lpVtbl->Release(effect);
6867 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6869 unsigned int passes_count;
6870 ID3DXEffect *effect;
6871 D3DXPASS_DESC desc;
6872 D3DXVECTOR4 fvect;
6873 D3DXHANDLE pass;
6874 HRESULT hr;
6876 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6877 NULL, NULL, 0, NULL, &effect, NULL);
6878 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6880 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6881 ok(!!pass, "GetPass() failed.\n");
6883 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6884 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6885 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6887 fvect.x = fvect.y = fvect.w = 0.0f;
6888 fvect.z = 0.0f;
6889 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6890 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6892 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6893 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6894 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6896 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6898 fvect.z = 3.0f;
6899 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6900 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6902 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6903 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
6904 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6906 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6907 * as it is not the case sometimes for BeginPass() with out of bound access. */
6908 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6909 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
6910 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6912 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6913 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6915 hr = effect->lpVtbl->BeginPass(effect, 1);
6916 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6918 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6919 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6921 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6923 fvect.z = 2.0f;
6924 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6925 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6926 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6927 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6929 effect->lpVtbl->Release(effect);
6931 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6932 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6933 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6935 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6936 ok(!!pass, "GetPass() failed.\n");
6938 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6939 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
6941 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6942 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6944 effect->lpVtbl->Release(effect);
6947 #if 0
6948 float v1 : register(c2);
6949 float v2 : register(c3);
6950 float v3;
6951 float v4 : register(c4);
6952 float v5;
6953 float v6[2] : register(c5) = {11, 22};
6955 struct VS_OUTPUT
6957 float4 Position : POSITION;
6960 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6962 VS_OUTPUT Output;
6964 Output.Position = v1 * v2 * vPos + v2 + v3 + v4;
6965 Output.Position += v6[0] + v6[1];
6966 return Output;
6969 technique tech0
6971 pass p0
6973 PointScale_A = v4;
6974 VertexShader = compile vs_3_0 RenderSceneVS();
6977 #endif
6978 static const DWORD test_effect_skip_constants_blob[] =
6980 0xfeff0901, 0x00000144, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
6981 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003176, 0x00000003, 0x00000000, 0x0000004c,
6982 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003276, 0x00000003,
6983 0x00000000, 0x00000074, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6984 0x00003376, 0x00000003, 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6985 0x00000000, 0x00000003, 0x00003476, 0x00000003, 0x00000000, 0x000000c4, 0x00000000, 0x00000000,
6986 0x00000001, 0x00000001, 0x00000000, 0x00000003, 0x00003576, 0x00000003, 0x00000000, 0x000000f0,
6987 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41300000, 0x41b00000, 0x00000003, 0x00003676,
6988 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
6989 0x00000001, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070,
6990 0x00000006, 0x68636574, 0x00000030, 0x00000006, 0x00000001, 0x00000002, 0x00000002, 0x00000004,
6991 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054,
6992 0x00000070, 0x00000000, 0x00000000, 0x0000007c, 0x00000098, 0x00000000, 0x00000000, 0x000000a4,
6993 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e8, 0x00000000, 0x00000000, 0x00000138,
6994 0x00000000, 0x00000001, 0x00000130, 0x00000000, 0x00000002, 0x00000041, 0x00000000, 0x000000fc,
6995 0x000000f8, 0x00000092, 0x00000000, 0x0000011c, 0x00000118, 0x00000000, 0x00000002, 0x00000000,
6996 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000001bc, 0xfffe0300, 0x0047fffe, 0x42415443,
6997 0x0000001c, 0x000000e7, 0xfffe0300, 0x00000005, 0x0000001c, 0x20000000, 0x000000e0, 0x00000080,
6998 0x00020002, 0x000a0001, 0x00000084, 0x00000094, 0x000000a4, 0x00030002, 0x000e0001, 0x00000084,
6999 0x00000094, 0x000000a7, 0x00000002, 0x00000001, 0x00000084, 0x00000094, 0x000000aa, 0x00040002,
7000 0x00120001, 0x00000084, 0x00000094, 0x000000ad, 0x00050002, 0x00160002, 0x000000b0, 0x000000c0,
7001 0xab003176, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7002 0x00000000, 0x76003276, 0x34760033, 0x00367600, 0x00030000, 0x00010001, 0x00000002, 0x00000000,
7003 0x41300000, 0x00000000, 0x00000000, 0x00000000, 0x41b00000, 0x00000000, 0x00000000, 0x00000000,
7004 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7005 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000,
7006 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0x80010000, 0xa0000003, 0x03000005,
7007 0x80010000, 0x80000000, 0xa0000002, 0x04000004, 0x800f0000, 0x80000000, 0x90e40000, 0xa0000003,
7008 0x03000002, 0x800f0000, 0x80e40000, 0xa0000000, 0x03000002, 0x800f0000, 0x80e40000, 0xa0000004,
7009 0x02000001, 0x80010001, 0xa0000005, 0x03000002, 0x80010001, 0x80000001, 0xa0000006, 0x03000002,
7010 0xe00f0000, 0x80e40000, 0x80000001, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
7011 0x00000000, 0x000000d8, 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200,
7012 0x00000001, 0x0000001c, 0x20000100, 0x00000054, 0x00000030, 0x00040002, 0x00120001, 0x00000034,
7013 0x00000044, 0xab003476, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
7014 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
7015 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
7016 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
7017 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7020 static void test_effect_skip_constants(IDirect3DDevice9 *device)
7022 HRESULT hr;
7023 ID3DXEffect *effect;
7024 unsigned int passes_count;
7025 D3DXVECTOR4 fvect;
7026 unsigned int i;
7028 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7029 NULL, NULL, "v3", 0, NULL, &effect, NULL);
7030 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7031 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7032 NULL, NULL, "v4", 0, NULL, &effect, NULL);
7033 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7034 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7035 NULL, NULL, "v1;v5;v4", 0, NULL, &effect, NULL);
7036 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7038 hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob),
7039 NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL);
7040 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7042 ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"),
7043 "Unexpected IsParameterUsed result.\n");
7044 ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"),
7045 "Unexpected IsParameterUsed result.\n");
7046 ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"),
7047 "Unexpected IsParameterUsed result.\n");
7048 ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"),
7049 "Unexpected IsParameterUsed result.\n");
7050 ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"),
7051 "Unexpected IsParameterUsed result.\n");
7052 ok(!effect->lpVtbl->IsParameterUsed(effect, "v6", "tech0"),
7053 "Unexpected IsParameterUsed result.\n");
7055 hr = effect->lpVtbl->SetFloat(effect, "v1", 28.0f);
7056 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7057 hr = effect->lpVtbl->SetFloat(effect, "v2", 29.0f);
7058 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7059 hr = effect->lpVtbl->SetFloat(effect, "v3", 30.0f);
7060 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7061 hr = effect->lpVtbl->SetFloat(effect, "v4", 31.0f);
7062 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7063 hr = effect->lpVtbl->SetFloat(effect, "v5", 32.0f);
7064 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7066 test_effect_clear_vconsts(device);
7068 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7069 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7070 hr = effect->lpVtbl->BeginPass(effect, 0);
7071 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7073 fvect.y = fvect.z = fvect.w = 0.0f;
7074 fvect.x = 30.0f;
7075 test_effect_shared_parameters_compare_vconst(device, 0, &fvect, FALSE);
7076 for (i = 1; i < 4; ++i)
7077 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7078 fvect.x = 31.0f;
7079 test_effect_shared_parameters_compare_vconst(device, 4, &fvect, FALSE);
7080 for (i = 5; i < 256; ++i)
7081 test_effect_shared_parameters_compare_vconst(device, i, &fvect_filler, FALSE);
7083 hr = effect->lpVtbl->EndPass(effect);
7084 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7085 hr = effect->lpVtbl->End(effect);
7086 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7088 effect->lpVtbl->Release(effect);
7091 #if 0
7092 vertexshader vs_arr[2] =
7096 vs_3_0
7097 def c0, 1, 1, 1, 1
7098 dcl_position o0
7099 mov o0, c0
7104 vs_3_sw
7105 def c256, 1, 1, 1, 1
7106 dcl_position o0
7107 mov o0, c256
7111 int i;
7113 technique tech0
7115 pass p0
7117 VertexShader = vs_arr[1];
7120 technique tech1
7122 pass p0
7124 VertexShader = vs_arr[i];
7127 #endif
7128 static const DWORD test_effect_unsupported_shader_blob[] =
7130 0xfeff0901, 0x000000ac, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7131 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7132 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000003,
7133 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006,
7134 0x68636574, 0x00000030, 0x00000004, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
7135 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002, 0x00000002, 0x00000006,
7136 0x00000005, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
7137 0x00000000, 0x00000074, 0x00000000, 0x00000001, 0x0000006c, 0x00000000, 0x00000001, 0x00000092,
7138 0x00000000, 0x00000058, 0x00000054, 0x000000a0, 0x00000000, 0x00000001, 0x00000098, 0x00000000,
7139 0x00000001, 0x00000092, 0x00000000, 0x00000084, 0x00000080, 0x00000002, 0x00000002, 0x00000001,
7140 0x00000038, 0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7141 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40000, 0x0000ffff, 0x00000002,
7142 0x00000038, 0xfffe03ff, 0x05000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
7143 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40100, 0x0000ffff, 0x00000001,
7144 0x00000000, 0xffffffff, 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272,
7145 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c,
7146 0x00000100, 0x00000054, 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069,
7147 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
7148 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
7149 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
7150 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
7151 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
7152 0xffffffff, 0x00000000, 0x00000001, 0x0000000a, 0x615f7376, 0x315b7272, 0x0000005d,
7155 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS 81
7156 #define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN 14
7158 static void test_effect_unsupported_shader(void)
7160 IDirect3DVertexShader9 *vshader;
7161 unsigned int passes_count;
7162 IDirect3DDevice9 *device;
7163 UINT byte_code_size;
7164 ID3DXEffect *effect;
7165 void *byte_code;
7166 ULONG refcount;
7167 HWND window;
7168 HRESULT hr;
7170 if (!(device = create_device(&window)))
7171 return;
7173 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
7174 NULL, NULL, NULL, 0, NULL, &effect, NULL);
7175 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7177 hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique");
7178 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7179 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7180 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
7182 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7183 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7184 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7185 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7186 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7187 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
7188 hr = effect->lpVtbl->SetInt(effect, "i", 0);
7189 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7190 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7191 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7193 hr = effect->lpVtbl->SetTechnique(effect, "tech0");
7194 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7195 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7196 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7197 hr = effect->lpVtbl->BeginPass(effect, 0);
7198 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7200 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7201 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK).\n", hr);
7202 ok(!vshader, "Got non NULL vshader.\n");
7204 hr = effect->lpVtbl->EndPass(effect);
7205 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7206 hr = effect->lpVtbl->End(effect);
7207 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7209 hr = effect->lpVtbl->SetTechnique(effect, "tech1");
7210 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7211 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7212 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7213 hr = effect->lpVtbl->BeginPass(effect, 0);
7214 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7216 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7217 ok(hr == D3D_OK, "Got result %lx, expected 0 (D3D_OK).\n", hr);
7218 ok(!!vshader, "Got NULL vshader.\n");
7219 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
7220 ok(hr == D3D_OK, "Got result %lx.\n", hr);
7221 byte_code = calloc(1, byte_code_size);
7222 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
7223 ok(hr == D3D_OK, "Got result %lx.\n", hr);
7224 ok(byte_code_size == TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN * sizeof(DWORD),
7225 "Got unexpected byte code size %u.\n", byte_code_size);
7226 ok(!memcmp(byte_code,
7227 &test_effect_unsupported_shader_blob[TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS],
7228 byte_code_size), "Incorrect shader selected.\n");
7229 free(byte_code);
7230 IDirect3DVertexShader9_Release(vshader);
7232 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7233 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7234 hr = effect->lpVtbl->CommitChanges(effect);
7235 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7236 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
7237 ok(hr == D3D_OK, "Got result %lx.\n", hr);
7238 ok(!vshader, "Got non NULL vshader.\n");
7240 effect->lpVtbl->Release(effect);
7242 refcount = IDirect3DDevice9_Release(device);
7243 ok(!refcount, "Device has %lu references left.\n", refcount);
7244 DestroyWindow(window);
7247 #if 0
7248 vertexshader vs_arr[2];
7250 int i;
7252 technique tech0
7254 pass p0
7256 VertexShader = null;
7259 technique tech1
7261 pass p0
7263 VertexShader = vs_arr[i];
7266 #endif
7267 static const DWORD test_effect_null_shader_blob[] =
7269 0xfeff0901, 0x000000b4, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
7270 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c,
7271 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000000,
7272 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
7273 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000010, 0x00000004, 0x00000000,
7274 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002,
7275 0x00000002, 0x00000005, 0x00000004, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c,
7276 0x00000048, 0x00000000, 0x00000000, 0x0000007c, 0x00000000, 0x00000001, 0x00000074, 0x00000000,
7277 0x00000001, 0x00000092, 0x00000000, 0x00000058, 0x00000054, 0x000000a8, 0x00000000, 0x00000001,
7278 0x000000a0, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x0000008c, 0x00000088, 0x00000002,
7279 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0xffffffff,
7280 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0023fffe,
7281 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000054,
7282 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069, 0x00020000, 0x00010001,
7283 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
7284 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
7285 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
7286 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
7287 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
7290 static void test_effect_null_shader(void)
7292 IDirect3DDevice9 *device;
7293 ID3DXEffect *effect;
7294 D3DXPASS_DESC desc;
7295 D3DXHANDLE pass;
7296 ULONG refcount;
7297 HWND window;
7298 HRESULT hr;
7300 /* Creating a fresh device because the existing device can have invalid
7301 * render states from previous tests. If IDirect3DDevice9_ValidateDevice()
7302 * returns certain error codes, native ValidateTechnique() fails. */
7303 if (!(device = create_device(&window)))
7304 return;
7306 hr = D3DXCreateEffectEx(device, test_effect_null_shader_blob,
7307 sizeof(test_effect_null_shader_blob), NULL, NULL, NULL, 0, NULL, &effect, NULL);
7308 ok(hr == D3D_OK, "Failed to create effect, hr %#lx.\n", hr);
7310 pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
7311 ok(!!pass, "GetPass() failed.\n");
7312 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7313 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7314 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7316 pass = effect->lpVtbl->GetPass(effect, "tech1", 0);
7317 ok(!!pass, "GetPass() failed.\n");
7318 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
7319 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7320 ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
7322 hr = effect->lpVtbl->ValidateTechnique(effect, "tech0");
7323 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7324 hr = effect->lpVtbl->SetInt(effect, "i", 0);
7325 ok(hr == D3D_OK, "Failed to set parameter, hr %#lx.\n", hr);
7326 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7327 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7328 hr = effect->lpVtbl->SetInt(effect, "i", 1);
7329 ok(hr == D3D_OK, "Failed to set parameter, hr %#lx.\n", hr);
7330 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7331 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7333 hr = effect->lpVtbl->SetInt(effect, "i", 2);
7334 ok(hr == D3D_OK, "Failed to set parameter, hr %#lx.\n", hr);
7335 hr = effect->lpVtbl->ValidateTechnique(effect, "tech1");
7336 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
7338 effect->lpVtbl->Release(effect);
7340 refcount = IDirect3DDevice9_Release(device);
7341 ok(!refcount, "Device has %lu references left.\n", refcount);
7342 DestroyWindow(window);
7345 static void test_effect_clone(void)
7347 D3DXHANDLE parameter, parameter2, technique, technique2, block, annotation;
7348 IDirect3DDevice9 *device, *device2, *device3;
7349 IDirect3DBaseTexture9 *texture, *texture2;
7350 ID3DXEffectStateManager *ret_manager;
7351 struct test_manager *state_manager;
7352 IDirect3DVertexShader9 *vs, *vs2;
7353 ID3DXEffect *effect, *cloned;
7354 unsigned int passes_count;
7355 HWND window, window2;
7356 const char *string;
7357 ULONG refcount;
7358 HRESULT hr;
7359 float f;
7361 static const DWORD effect_code[] =
7363 #if 0
7364 Texture2D tex;
7365 float f <float a = 1.0;>;
7366 string s;
7367 float skipped : register(c4);
7369 float4 vs0_main(float4 pos : POSITION) : POSITION
7371 return pos;
7374 vertexshader vs = compile vs_2_0 vs0_main();
7376 technique tech0 <float a = 1.0;>
7378 pass p
7380 VertexShader = vs;
7384 float4 vs1_main(float4 pos : POSITION) : POSITION
7386 return skipped;
7389 technique tech1
7391 pass p
7393 VertexShader = compile vs_2_0 vs1_main();
7396 #endif
7397 0xfeff0901, 0x00000160, 0x00000000, 0x00000007, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
7398 0x00000001, 0x00000004, 0x00786574, 0x00000003, 0x00000000, 0x0000006c, 0x00000000, 0x00000000,
7399 0x00000001, 0x00000001, 0x00000000, 0x3f800000, 0x00000003, 0x00000000, 0x00000064, 0x00000000,
7400 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000061, 0x00000002, 0x00000066, 0x00000004,
7401 0x00000004, 0x0000008c, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000073, 0x00000003,
7402 0x00000000, 0x000000b4, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000008,
7403 0x70696b73, 0x00646570, 0x00000010, 0x00000004, 0x000000d8, 0x00000000, 0x00000000, 0x00000003,
7404 0x00000003, 0x00007376, 0x3f800000, 0x00000003, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
7405 0x00000001, 0x00000001, 0x00000002, 0x00000061, 0x00000004, 0x00000010, 0x00000004, 0x00000000,
7406 0x00000000, 0x00000000, 0x00000002, 0x00000070, 0x00000006, 0x68636574, 0x00000030, 0x00000005,
7407 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000070, 0x00000006,
7408 0x68636574, 0x00000031, 0x00000005, 0x00000002, 0x00000005, 0x00000006, 0x00000004, 0x00000018,
7409 0x00000000, 0x00000000, 0x00000024, 0x00000040, 0x00000000, 0x00000001, 0x00000048, 0x00000044,
7410 0x00000074, 0x00000088, 0x00000000, 0x00000000, 0x00000094, 0x000000b0, 0x00000000, 0x00000000,
7411 0x000000c0, 0x000000d4, 0x00000000, 0x00000000, 0x00000128, 0x00000001, 0x00000001, 0x000000e4,
7412 0x000000e0, 0x00000120, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x0000010c, 0x00000108,
7413 0x00000154, 0x00000000, 0x00000001, 0x0000014c, 0x00000000, 0x00000001, 0x00000092, 0x00000000,
7414 0x00000138, 0x00000134, 0x00000003, 0x00000002, 0x00000003, 0x00000074, 0xfffe0200, 0x0014fffe,
7415 0x42415443, 0x0000001c, 0x00000023, 0xfffe0200, 0x00000000, 0x00000000, 0x00000400, 0x0000001c,
7416 0x325f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
7417 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x0200001f, 0x80000000, 0x900f0000, 0x02000001,
7418 0xc00f0000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000001, 0x00000000, 0x00000001,
7419 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x000000a4, 0xfffe0200, 0x0023fffe, 0x42415443,
7420 0x0000001c, 0x0000005f, 0xfffe0200, 0x00000001, 0x0000001c, 0x20000400, 0x00000058, 0x00000030,
7421 0x00040002, 0x00120001, 0x00000038, 0x00000048, 0x70696b73, 0x00646570, 0x00030000, 0x00010001,
7422 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x325f7376, 0x4d00305f,
7423 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
7424 0x30312072, 0xab00312e, 0x02000001, 0xc00f0000, 0xa0000004, 0x0000ffff, 0x00000000, 0x00000000,
7425 0xffffffff, 0x00000000, 0x00000001, 0x00000003, 0x00007376,
7428 if (!(device = create_device(&window)))
7429 return;
7431 state_manager = calloc(1, sizeof(*state_manager));
7432 test_effect_state_manager_init(state_manager, device);
7434 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8,
7435 D3DPOOL_DEFAULT, (IDirect3DTexture9 **)&texture, NULL);
7436 ok(hr == D3D_OK, "Failed to create texture, hr %#lx.\n", hr);
7438 /* D3DXFX_NOT_CLONEABLE */
7439 hr = D3DXCreateEffect(device, effect_code, sizeof(effect_code),
7440 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
7441 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7443 technique = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
7444 ok(!!technique, "Expected a technique.\n");
7446 technique2 = effect->lpVtbl->GetCurrentTechnique(effect);
7447 ok(technique2 == technique, "Got unexpected technique %p.\n", technique2);
7449 hr = effect->lpVtbl->SetTechnique(effect, "tech1");
7450 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7452 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7453 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7455 cloned = (void *)0xdeadbeef;
7456 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7457 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
7458 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7460 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7461 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7463 cloned = (void *)0xdeadbeef;
7464 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7465 ok(hr == E_FAIL, "Got result %#lx.\n", hr);
7466 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7468 effect->lpVtbl->Release(effect);
7470 hr = D3DXCreateEffectEx(device, effect_code, sizeof(effect_code),
7471 NULL, NULL, "skipped", 0, NULL, &effect, NULL);
7472 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7474 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
7475 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7477 hr = effect->lpVtbl->SetTexture(effect, "tex", texture);
7478 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7480 hr = effect->lpVtbl->SetFloat(effect, "f", 123.0f);
7481 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7483 hr = effect->lpVtbl->SetString(effect, "s", "tiny silver hammers");
7484 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7486 hr = effect->lpVtbl->SetFloat(effect, "f@a", 4.0f);
7487 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7489 annotation = effect->lpVtbl->GetAnnotationByName(effect, "tech0", "a");
7490 ok(!!annotation, "Failed to get annotation.\n");
7491 hr = effect->lpVtbl->SetFloat(effect, annotation, 4.0f);
7492 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7494 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
7495 ok(!!parameter, "Failed to get parameter.\n");
7497 hr = effect->lpVtbl->GetVertexShader(effect, "vs", &vs);
7498 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7500 ok(!effect->lpVtbl->IsParameterUsed(effect, "skipped", "tech1"),
7501 "Unexpected IsParameterUsed result.\n");
7503 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
7504 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7506 hr = effect->lpVtbl->CloneEffect(effect, NULL, NULL);
7507 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7509 cloned = (void *)0xdeadbeef;
7510 hr = effect->lpVtbl->CloneEffect(effect, NULL, &cloned);
7511 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7512 ok(cloned == (void *)0xdeadbeef, "Unexpected effect pointer.\n");
7514 hr = effect->lpVtbl->CloneEffect(effect, device, NULL);
7515 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7517 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7518 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7519 ok(cloned != effect, "Expected new effect instance.\n");
7521 hr = cloned->lpVtbl->GetStateManager(cloned, &ret_manager);
7522 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7523 ok(!ret_manager, "Unexpected state manager %p.\n", ret_manager);
7525 hr = cloned->lpVtbl->GetTexture(cloned, "tex", &texture2);
7526 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7527 ok(texture2 == texture, "Expected the same texture.\n");
7528 IDirect3DBaseTexture9_Release(texture2);
7530 hr = cloned->lpVtbl->GetVertexShader(cloned, "vs", &vs2);
7531 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7532 ok(vs2 == vs, "Expected the same vertex shader.\n");
7533 IDirect3DVertexShader9_Release(vs2);
7535 ok(!effect->lpVtbl->IsParameterUsed(effect, "skipped", "tech1"),
7536 "Unexpected IsParameterUsed result.\n");
7538 f = 0.0f;
7539 hr = cloned->lpVtbl->GetFloat(cloned, "f", &f);
7540 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7541 ok(f == 123.0f, "Got float %.8e.\n", f);
7543 hr = cloned->lpVtbl->GetString(cloned, "s", &string);
7544 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7545 ok(!strcmp(string, "tiny silver hammers"), "Got string %s.\n", debugstr_a(string));
7547 f = 0.0f;
7548 hr = cloned->lpVtbl->GetFloat(cloned, "f@a", &f);
7549 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7550 ok(f == 4.0f, "Got float %.8e.\n", f);
7552 annotation = cloned->lpVtbl->GetAnnotationByName(cloned, "tech0", "a");
7553 ok(!!annotation, "Failed to get annotation.\n");
7554 f = 0.0f;
7555 hr = cloned->lpVtbl->GetFloat(cloned, annotation, &f);
7556 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7557 ok(f == 4.0f, "Got float %.8e.\n", f);
7559 parameter2 = cloned->lpVtbl->GetParameterByName(cloned, NULL, "tex");
7560 ok(!!parameter2, "Failed to get parameter.\n");
7561 ok(parameter2 != parameter, "Parameters should not match.\n");
7563 hr = cloned->lpVtbl->BeginPass(cloned, 0);
7564 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7566 technique = cloned->lpVtbl->GetTechniqueByName(cloned, "tech0");
7567 ok(!!technique, "Expected a technique.\n");
7569 technique2 = cloned->lpVtbl->GetCurrentTechnique(cloned);
7570 ok(technique2 == technique, "Got unexpected technique %p.\n", technique2);
7572 cloned->lpVtbl->Release(cloned);
7574 /* Try with different device. */
7575 device2 = create_device(&window2);
7577 hr = effect->lpVtbl->CloneEffect(effect, device2, &cloned);
7578 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7579 ok(cloned != effect, "Expected new effect instance.\n");
7581 hr = cloned->lpVtbl->GetDevice(cloned, &device3);
7582 ok(hr == S_OK, "Failed to get effect device.\n");
7583 ok(device3 == device2, "Unexpected device instance.\n");
7584 IDirect3DDevice9_Release(device3);
7586 hr = cloned->lpVtbl->GetTexture(cloned, "tex", &texture2);
7587 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7588 ok(!texture2, "Expected a NULL texture.\n");
7590 hr = cloned->lpVtbl->GetVertexShader(cloned, "vs", &vs2);
7591 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7592 ok(vs2 != vs, "Expected a different vertex shader.\n");
7593 IDirect3DVertexShader9_Release(vs2);
7595 f = 0.0f;
7596 hr = cloned->lpVtbl->GetFloat(cloned, "f", &f);
7597 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7598 ok(f == 123.0f, "Got float %.8e.\n", f);
7600 hr = cloned->lpVtbl->GetString(cloned, "s", &string);
7601 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7602 ok(!strcmp(string, "tiny silver hammers"), "Got string %s.\n", debugstr_a(string));
7604 f = 0.0f;
7605 hr = cloned->lpVtbl->GetFloat(cloned, "f@a", &f);
7606 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7607 ok(f == 4.0f, "Got float %.8e.\n", f);
7609 annotation = cloned->lpVtbl->GetAnnotationByName(cloned, "tech0", "a");
7610 ok(!!annotation, "Failed to get annotation.\n");
7611 f = 0.0f;
7612 hr = cloned->lpVtbl->GetFloat(cloned, annotation, &f);
7613 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7614 ok(f == 4.0f, "Got float %.8e.\n", f);
7616 parameter2 = cloned->lpVtbl->GetParameterByName(cloned, NULL, "tex");
7617 ok(!!parameter2, "Failed to get parameter.\n");
7618 ok(parameter2 != parameter, "Parameters should not match.\n");
7620 hr = cloned->lpVtbl->BeginPass(cloned, 0);
7621 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
7623 technique = cloned->lpVtbl->GetTechniqueByName(cloned, "tech0");
7624 ok(!!technique, "Expected a technique.\n");
7626 technique2 = cloned->lpVtbl->GetCurrentTechnique(cloned);
7627 ok(technique2 == technique, "Got unexpected technique %p.\n", technique2);
7629 cloned->lpVtbl->Release(cloned);
7631 hr = effect->lpVtbl->BeginPass(effect, 0);
7632 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7634 hr = effect->lpVtbl->EndPass(effect);
7635 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7637 hr = effect->lpVtbl->End(effect);
7638 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7640 /* Test parameter blocks (we can't do this above since we can't record a
7641 * parameter block while started). */
7643 hr = effect->lpVtbl->BeginParameterBlock(effect);
7644 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7646 hr = effect->lpVtbl->SetFloat(effect, "f", 456.0f);
7647 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7649 hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
7650 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
7651 block = cloned->lpVtbl->EndParameterBlock(cloned);
7652 ok(!block, "Expected no active parameter block.\n");
7654 cloned->lpVtbl->Release(cloned);
7656 block = effect->lpVtbl->EndParameterBlock(effect);
7657 ok(!!block, "Expected an active parameter block.\n");
7659 IDirect3DVertexShader9_Release(vs);
7660 IDirect3DDevice9_Release(device2);
7661 DestroyWindow(window2);
7662 effect->lpVtbl->Release(effect);
7663 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
7664 &state_manager->ID3DXEffectStateManager_iface);
7665 ok(!refcount, "State manager was not properly freed, refcount %lu.\n", refcount);
7666 IDirect3DBaseTexture9_Release(texture);
7667 refcount = IDirect3DDevice9_Release(device);
7668 ok(!refcount, "Device has %lu references left.\n", refcount);
7669 DestroyWindow(window);
7672 static unsigned int get_texture_refcount(IDirect3DTexture9 *iface)
7674 IDirect3DTexture9_AddRef(iface);
7675 return IDirect3DTexture9_Release(iface);
7678 static void test_refcount(void)
7680 IDirect3DTexture9 *texture, *cur_texture, *managed_texture, *sysmem_texture;
7681 unsigned int passes_count;
7682 IDirect3DDevice9 *device;
7683 ID3DXEffect *effect;
7684 ULONG refcount;
7685 HWND window;
7686 HRESULT hr;
7688 if (!(device = create_device(&window)))
7689 return;
7691 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL);
7692 ok(hr == D3D_OK, "Failed to create texture, hr %#lx.\n", hr);
7694 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob,
7695 sizeof(test_effect_preshader_effect_blob), NULL, NULL,
7696 D3DXFX_DONOTSAVESTATE, NULL, &effect, NULL);
7697 ok(hr == D3D_OK, "Failed to create effect, hr %#lx.\n", hr);
7699 hr = effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)texture);
7700 ok(hr == D3D_OK, "Failed to set texture parameter, hr %#lx.\n", hr);
7702 hr = effect->lpVtbl->Begin(effect, &passes_count, D3DXFX_DONOTSAVESTATE);
7703 ok(hr == D3D_OK, "Begin() failed, hr %#lx.\n", hr);
7705 hr = effect->lpVtbl->BeginPass(effect, 0);
7706 ok(hr == D3D_OK, "BeginPass() failed, hr %#lx.\n", hr);
7708 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7709 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7710 IDirect3DTexture9_Release(cur_texture);
7712 IDirect3DDevice9_SetTexture(device, 0, NULL);
7713 effect->lpVtbl->CommitChanges(effect);
7715 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7716 ok(cur_texture == NULL, "Unexpected current texture %p.\n", cur_texture);
7718 hr = effect->lpVtbl->EndPass(effect);
7719 ok(hr == D3D_OK, "EndPass() failed, hr %#lx.\n", hr);
7721 hr = effect->lpVtbl->BeginPass(effect, 0);
7722 ok(hr == D3D_OK, "BeginPass() failed, hr %#lx.\n", hr);
7724 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7725 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7726 IDirect3DTexture9_Release(cur_texture);
7728 hr = effect->lpVtbl->EndPass(effect);
7729 ok(hr == D3D_OK, "EndPass() failed, hr %#lx.\n", hr);
7730 hr = effect->lpVtbl->End(effect);
7731 ok(hr == D3D_OK, "End() failed, hr %#lx.\n", hr);
7733 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7734 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7735 IDirect3DTexture9_Release(cur_texture);
7736 refcount = get_texture_refcount(texture);
7737 ok(refcount == 2, "Unexpected texture refcount %lu.\n", refcount);
7739 hr = effect->lpVtbl->OnLostDevice(effect);
7740 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#lx.\n", hr);
7741 refcount = get_texture_refcount(texture);
7742 ok(refcount == 1, "Unexpected texture refcount %lu.\n", refcount);
7744 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED,
7745 &managed_texture, NULL);
7746 ok(hr == D3D_OK, "Failed to create texture, hr %#lx.\n", hr);
7747 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)managed_texture);
7749 refcount = get_texture_refcount(managed_texture);
7750 ok(refcount == 2, "Unexpected texture refcount %lu.\n", refcount);
7751 hr = effect->lpVtbl->OnLostDevice(effect);
7752 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#lx.\n", hr);
7753 refcount = get_texture_refcount(managed_texture);
7754 ok(refcount == 2, "Unexpected texture refcount %lu.\n", refcount);
7756 hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM,
7757 &sysmem_texture, NULL);
7758 ok(hr == D3D_OK, "Failed to create texture, hr %#lx.\n", hr);
7759 effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)sysmem_texture);
7761 refcount = get_texture_refcount(managed_texture);
7762 ok(refcount == 1, "Unexpected texture refcount %lu.\n", refcount);
7763 IDirect3DTexture9_Release(managed_texture);
7764 refcount = get_texture_refcount(sysmem_texture);
7765 ok(refcount == 2, "Unexpected texture refcount %lu.\n", refcount);
7766 hr = effect->lpVtbl->OnLostDevice(effect);
7767 ok(hr == D3D_OK, "OnLostDevice() failed, hr %#lx.\n", hr);
7768 refcount = get_texture_refcount(sysmem_texture);
7769 ok(refcount == 2, "Unexpected texture refcount %lu.\n", refcount);
7771 effect->lpVtbl->Release(effect);
7773 refcount = get_texture_refcount(sysmem_texture);
7774 ok(refcount == 1, "Unexpected texture refcount %lu.\n", refcount);
7775 IDirect3DTexture9_Release(sysmem_texture);
7777 IDirect3DDevice9_GetTexture(device, 0, (IDirect3DBaseTexture9 **)&cur_texture);
7778 ok(cur_texture == texture, "Unexpected current texture %p.\n", cur_texture);
7779 IDirect3DTexture9_Release(cur_texture);
7780 refcount = get_texture_refcount(texture);
7781 ok(refcount == 1, "Unexpected texture refcount %lu.\n", refcount);
7782 IDirect3DTexture9_Release(texture);
7784 refcount = IDirect3DDevice9_Release(device);
7785 ok(!refcount, "Device has %lu references left.\n", refcount);
7786 DestroyWindow(window);
7789 static HRESULT WINAPI d3dxinclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type,
7790 const char *filename, const void *parent_data, const void **data, UINT *bytes)
7792 static const char include1[] =
7793 "float4 light;\n"
7794 "float4x4 mat;\n"
7795 "float4 color;\n"
7796 "\n"
7797 "struct vs_input\n"
7798 "{\n"
7799 " float4 position : POSITION;\n"
7800 " float3 normal : NORMAL;\n"
7801 "};\n"
7802 "\n"
7803 "struct vs_output\n"
7804 "{\n"
7805 " float4 position : POSITION;\n"
7806 " float4 diffuse : COLOR;\n"
7807 "};\n";
7808 static const char include2[] =
7809 "#include \"include1.h\"\n"
7810 "\n"
7811 "vs_output vs_main(const vs_input v)\n"
7812 "{\n"
7813 " vs_output o;\n"
7814 " const float4 scaled_color = 0.5 * color;\n"
7815 "\n"
7816 " o.position = mul(v.position, mat);\n"
7817 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7818 "\n"
7819 " return o;\n"
7820 "}\n";
7821 static const char effect2[] =
7822 "#include \"include\\include2.h\"\n"
7823 "\n"
7824 "technique t\n"
7825 "{\n"
7826 " pass p\n"
7827 " {\n"
7828 " VertexShader = compile vs_2_0 vs_main();\n"
7829 " }\n"
7830 "}\n";
7831 char *buffer;
7833 trace("filename %s.\n", filename);
7834 trace("parent_data %p: %s.\n", parent_data, parent_data ? (char *)parent_data : "(null)");
7836 if (!strcmp(filename, "effect2.fx"))
7838 buffer = malloc(sizeof(effect2));
7839 memcpy(buffer, effect2, sizeof(effect2));
7840 *bytes = sizeof(effect2);
7841 ok(!parent_data, "Unexpected parent_data value.\n");
7843 else if (!strcmp(filename, "include1.h"))
7845 buffer = malloc(sizeof(include1));
7846 memcpy(buffer, include1, sizeof(include1));
7847 *bytes = sizeof(include1);
7848 ok(!strncmp(parent_data, include2, strlen(include2)), "Unexpected parent_data value.\n");
7850 else if (!strcmp(filename, "include\\include2.h"))
7852 buffer = malloc(sizeof(include2));
7853 memcpy(buffer, include2, sizeof(include2));
7854 *bytes = sizeof(include2);
7855 todo_wine ok(parent_data && !strncmp(parent_data, effect2, strlen(effect2)),
7856 "unexpected parent_data value.\n");
7858 else
7860 ok(0, "Unexpected #include for file %s.\n", filename);
7861 return D3DERR_INVALIDCALL;
7863 *data = buffer;
7864 return S_OK;
7867 static HRESULT WINAPI d3dxinclude_close(ID3DXInclude *iface, const void *data)
7869 free((void *)data);
7870 return S_OK;
7873 static const struct ID3DXIncludeVtbl d3dxinclude_vtbl =
7875 d3dxinclude_open,
7876 d3dxinclude_close
7879 struct d3dxinclude
7881 ID3DXInclude ID3DXInclude_iface;
7884 static void test_create_effect_from_file(void)
7886 static const char effect1[] =
7887 "float4 light;\n"
7888 "float4x4 mat;\n"
7889 "float4 color;\n"
7890 "\n"
7891 "struct vs_input\n"
7892 "{\n"
7893 " float4 position : POSITION;\n"
7894 " float3 normal : NORMAL;\n"
7895 "};\n"
7896 "\n"
7897 "struct vs_output\n"
7898 "{\n"
7899 " float4 position : POSITION;\n"
7900 " float4 diffuse : COLOR;\n"
7901 "};\n"
7902 "\n"
7903 "vs_output vs_main(const vs_input v)\n"
7904 "{\n"
7905 " vs_output o;\n"
7906 " const float4 scaled_color = 0.5 * color;\n"
7907 "\n"
7908 " o.position = mul(v.position, mat);\n"
7909 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7910 "\n"
7911 " return o;\n"
7912 "}\n"
7913 "\n"
7914 "technique t\n"
7915 "{\n"
7916 " pass p\n"
7917 " {\n"
7918 " VertexShader = compile vs_2_0 vs_main();\n"
7919 " }\n"
7920 "}\n";
7921 static const char include1[] =
7922 "float4 light;\n"
7923 "float4x4 mat;\n"
7924 "float4 color;\n"
7925 "\n"
7926 "struct vs_input\n"
7927 "{\n"
7928 " float4 position : POSITION;\n"
7929 " float3 normal : NORMAL;\n"
7930 "};\n"
7931 "\n"
7932 "struct vs_output\n"
7933 "{\n"
7934 " float4 position : POSITION;\n"
7935 " float4 diffuse : COLOR;\n"
7936 "};\n";
7937 static const char include1_wrong[] =
7938 "#error \"wrong include\"\n";
7939 static const char include2[] =
7940 "#include \"include1.h\"\n"
7941 "\n"
7942 "vs_output vs_main(const vs_input v)\n"
7943 "{\n"
7944 " vs_output o;\n"
7945 " const float4 scaled_color = 0.5 * color;\n"
7946 "\n"
7947 " o.position = mul(v.position, mat);\n"
7948 " o.diffuse = dot((float3)light, v.normal) * scaled_color;\n"
7949 "\n"
7950 " return o;\n"
7951 "}\n";
7952 static const char effect2[] =
7953 "#include \"include\\include2.h\"\n"
7954 "\n"
7955 "technique t\n"
7956 "{\n"
7957 " pass p\n"
7958 " {\n"
7959 " VertexShader = compile vs_2_0 vs_main();\n"
7960 " }\n"
7961 "}\n";
7962 WCHAR effect_path_w[MAX_PATH], filename_w[MAX_PATH];
7963 char effect_path[MAX_PATH], filename[MAX_PATH];
7964 D3DPRESENT_PARAMETERS present_parameters = {0};
7965 unsigned int filename_size;
7966 struct d3dxinclude include;
7967 IDirect3DDevice9 *device;
7968 ID3DXBuffer *messages;
7969 ID3DXEffect *effect;
7970 IDirect3D9 *d3d;
7971 ULONG refcount;
7972 HWND window;
7973 HRESULT hr;
7975 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
7976 640, 480, NULL, NULL, NULL, NULL)))
7978 skip("Failed to create window.\n");
7979 return;
7981 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
7983 skip("Failed to create IDirect3D9 object.\n");
7984 DestroyWindow(window);
7985 return;
7987 present_parameters.Windowed = TRUE;
7988 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
7989 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
7990 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
7991 if (FAILED(hr))
7993 skip("Failed to create IDirect3DDevice9 object, hr %#lx.\n", hr);
7994 IDirect3D9_Release(d3d);
7995 DestroyWindow(window);
7996 return;
7999 if (!create_file("effect1.fx", effect1, sizeof(effect1) - 1, filename))
8001 skip("Couldn't create temporary file, skipping test.\n");
8002 return;
8005 filename_size = strlen(filename);
8006 filename_size -= sizeof("effect1.fx") - 1;
8007 memcpy(effect_path, filename, filename_size);
8008 effect_path[filename_size] = 0;
8009 MultiByteToWideChar(CP_ACP, 0, effect_path, -1, effect_path_w, ARRAY_SIZE(effect_path_w));
8011 create_directory("include");
8012 create_file("effect2.fx", effect2, sizeof(effect2) - 1, NULL);
8013 create_file("include\\include1.h", include1, sizeof(include1) - 1, NULL);
8014 create_file("include\\include2.h", include2, sizeof(include2) - 1, NULL);
8015 create_file("include1.h", include1_wrong, sizeof(include1_wrong) - 1, NULL);
8017 lstrcpyW(filename_w, effect_path_w);
8018 lstrcatW(filename_w, L"effect1.fx");
8019 effect = NULL;
8020 messages = NULL;
8021 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
8022 0, NULL, &effect, &messages);
8023 todo_wine ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
8024 if (messages)
8026 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
8027 ID3DXBuffer_Release(messages);
8029 if (effect)
8030 effect->lpVtbl->Release(effect);
8032 lstrcpyW(filename_w, effect_path_w);
8033 lstrcatW(filename_w, L"effect2.fx");
8034 effect = NULL;
8035 messages = NULL;
8036 /* This is apparently broken on native, it ends up using the wrong include. */
8037 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
8038 0, NULL, &effect, &messages);
8039 ok(hr == E_FAIL, "Unexpected error, hr %#lx.\n", hr);
8040 if (messages)
8042 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
8043 ID3DXBuffer_Release(messages);
8046 delete_file("effect1.fx");
8047 delete_file("effect2.fx");
8048 delete_file("include\\include1.h");
8049 delete_file("include\\include2.h");
8050 delete_file("include2.h");
8051 delete_directory("include");
8053 lstrcpyW(filename_w, L"effect2.fx");
8054 effect = NULL;
8055 messages = NULL;
8056 include.ID3DXInclude_iface.lpVtbl = &d3dxinclude_vtbl;
8057 /* This is actually broken in native d3dx9 (manually tried multiple
8058 * versions, all are affected). For reference, the message printed below
8059 * is "ID3DXEffectCompiler: There were no techniques" */
8060 hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, &include.ID3DXInclude_iface, NULL,
8061 0, NULL, &effect, &messages);
8062 ok(hr == E_FAIL, "D3DXInclude test failed with error %#lx.\n", hr);
8063 if (messages)
8065 trace("D3DXCreateEffectFromFileExW messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
8066 ID3DXBuffer_Release(messages);
8069 refcount = IDirect3DDevice9_Release(device);
8070 ok(!refcount, "Device has %lu references left.\n", refcount);
8071 IDirect3D9_Release(d3d);
8072 DestroyWindow(window);
8075 #if 0
8076 technique tech0
8078 pass p0
8080 LightEnable[0] = FALSE;
8081 FogEnable = FALSE;
8084 technique tech1
8086 pass p0
8088 LightEnable[0] = TRUE;
8089 FogEnable = TRUE;
8092 #endif
8093 static const DWORD test_two_techniques_blob[] =
8095 0xfeff0901, 0x000000ac, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
8096 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000,
8097 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030,
8098 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
8099 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
8100 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000000, 0x00000002, 0x00000002,
8101 0x00000001, 0x0000004c, 0x00000000, 0x00000001, 0x00000044, 0x00000000, 0x00000002, 0x00000091,
8102 0x00000000, 0x00000008, 0x00000004, 0x0000000e, 0x00000000, 0x00000028, 0x00000024, 0x000000a0,
8103 0x00000000, 0x00000001, 0x00000098, 0x00000000, 0x00000002, 0x00000091, 0x00000000, 0x0000005c,
8104 0x00000058, 0x0000000e, 0x00000000, 0x0000007c, 0x00000078, 0x00000000, 0x00000000,
8107 static void test_effect_find_next_valid_technique(void)
8109 D3DPRESENT_PARAMETERS present_parameters = {0};
8110 IDirect3DDevice9 *device;
8111 D3DXTECHNIQUE_DESC desc;
8112 D3DXHANDLE tech, tech2;
8113 ID3DXEffect *effect;
8114 IDirect3D9 *d3d;
8115 ULONG refcount;
8116 HWND window;
8117 HRESULT hr;
8119 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
8120 640, 480, NULL, NULL, NULL, NULL)))
8122 skip("Failed to create window.\n");
8123 return;
8125 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
8127 skip("Failed to create IDirect3D9 object.\n");
8128 DestroyWindow(window);
8129 return;
8131 present_parameters.Windowed = TRUE;
8132 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
8133 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
8134 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
8135 if (FAILED(hr))
8137 skip("Failed to create IDirect3DDevice9 object, hr %#lx.\n", hr);
8138 IDirect3D9_Release(d3d);
8139 DestroyWindow(window);
8140 return;
8143 hr = D3DXCreateEffectEx(device, test_two_techniques_blob, sizeof(test_two_techniques_blob),
8144 NULL, NULL, NULL, 0, NULL, &effect, NULL);
8145 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8147 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
8148 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8149 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
8150 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8151 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
8153 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
8154 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8155 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
8156 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8157 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
8159 tech2 = tech;
8160 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
8161 ok(hr == S_FALSE, "Got result %#lx.\n", hr);
8162 ok(!tech2, "Unexpected technique handle %p.\n", tech2);
8163 /* Test GetTechniqueDesc() with a NULL handle. */
8164 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc);
8165 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8166 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
8168 effect->lpVtbl->Release(effect);
8170 hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob),
8171 NULL, NULL, NULL, 0, NULL, &effect, NULL);
8172 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8174 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
8175 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8176 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
8177 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8178 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
8180 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
8181 ok(hr == S_FALSE, "Got result %#lx.\n", hr);
8182 ok(!tech2, "Unexpected technique handle %p.\n", tech2);
8183 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc);
8184 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8185 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
8187 hr = effect->lpVtbl->SetInt(effect, "i", 1);
8188 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8190 tech = (D3DXHANDLE)0xdeadbeef;
8191 hr = effect->lpVtbl->FindNextValidTechnique(effect, NULL, &tech);
8192 ok(hr == S_FALSE, "Got result %#lx.\n", hr);
8193 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
8194 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8195 ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
8197 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
8198 ok(hr == S_FALSE, "Got result %#lx.\n", hr);
8200 hr = effect->lpVtbl->SetInt(effect, "i", 0);
8201 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8203 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech);
8204 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8205 hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc);
8206 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8207 ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
8209 hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2);
8210 ok(hr == S_FALSE, "Got result %#lx.\n", hr);
8211 ok(!tech2, "Unexpected technique handle %p.\n", tech2);
8213 hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech);
8214 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
8216 effect->lpVtbl->Release(effect);
8218 refcount = IDirect3DDevice9_Release(device);
8219 ok(!refcount, "Device has %lu references left.\n", refcount);
8220 IDirect3D9_Release(d3d);
8221 DestroyWindow(window);
8224 static void test_effect_parameter_block(void)
8226 static const D3DXMATRIX test_mat =
8228 -11.0f, -12.0f, 0.0f, 0.0f,
8229 -21.0f, -22.0f, 0.0f, 0.0f,
8230 -31.0f, -32.0f, 0.0f, 0.0f,
8231 }}};
8232 static const D3DXMATRIX effect_orig_mat =
8234 11.0f, 12.0f, 0.0f, 0.0f,
8235 21.0f, 22.0f, 0.0f, 0.0f,
8236 31.0f, 32.0f, 0.0f, 0.0f,
8237 }}};
8238 D3DPRESENT_PARAMETERS present_parameters = {0};
8239 static const float float_array_zero[4];
8240 IDirect3DTexture9 *texture, *tex_test;
8241 D3DXHANDLE block, block2, handle;
8242 ID3DXEffect *effect, *effect2;
8243 D3DXMATRIX mat, mat_arr[2];
8244 IDirect3DDevice9 *device;
8245 ID3DXEffectPool *pool;
8246 float float_array[4];
8247 float float_value;
8248 IDirect3D9 *d3d;
8249 ULONG refcount;
8250 HWND window;
8251 HRESULT hr;
8253 static const DWORD annotation_code[] =
8255 #if 0
8256 float f <float a = 1.0;>;
8258 float4 vs_main(float4 pos : POSITION) : POSITION
8260 return pos;
8263 technique tech0
8265 pass p
8267 VertexShader = compile vs_2_0 vs_main();
8270 #endif
8271 0xfeff0901, 0x00000080, 0x00000000, 0x00000003, 0x00000000, 0x0000004c, 0x00000000, 0x00000000,
8272 0x00000001, 0x00000001, 0x00000000, 0x3f800000, 0x00000003, 0x00000000, 0x00000044, 0x00000000,
8273 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x00000061, 0x00000002, 0x00000066, 0x00000001,
8274 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000070, 0x00000006,
8275 0x68636574, 0x00000030, 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000004, 0x00000020,
8276 0x00000000, 0x00000001, 0x00000028, 0x00000024, 0x00000074, 0x00000000, 0x00000001, 0x0000006c,
8277 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x00000058, 0x00000054, 0x00000000, 0x00000001,
8278 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000074, 0xfffe0200, 0x0014fffe,
8279 0x42415443, 0x0000001c, 0x00000023, 0xfffe0200, 0x00000000, 0x00000000, 0x20000400, 0x0000001c,
8280 0x325f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
8281 0x6d6f4320, 0x656c6970, 0x30312072, 0xab00312e, 0x0200001f, 0x80000000, 0x900f0000, 0x02000001,
8282 0xc00f0000, 0x90e40000, 0x0000ffff,
8285 if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
8286 640, 480, NULL, NULL, NULL, NULL)))
8288 skip("Failed to create window.\n");
8289 return;
8291 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
8293 skip("Failed to create IDirect3D9 object.\n");
8294 DestroyWindow(window);
8295 return;
8297 present_parameters.Windowed = TRUE;
8298 present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
8299 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window,
8300 D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device);
8301 if (FAILED(hr))
8303 skip("Failed to create IDirect3DDevice9 object, hr %#lx.\n", hr);
8304 IDirect3D9_Release(d3d);
8305 DestroyWindow(window);
8306 return;
8309 hr = D3DXCreateEffectPool(&pool);
8310 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8312 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
8313 NULL, NULL, 0, pool, &effect, NULL);
8314 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8315 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
8316 NULL, NULL, 0, pool, &effect2, NULL);
8317 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8319 hr = effect->lpVtbl->BeginParameterBlock(effect);
8320 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8321 hr = effect->lpVtbl->BeginParameterBlock(effect);
8322 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
8323 block = effect->lpVtbl->EndParameterBlock(effect);
8324 ok(!!block, "Got unexpected block %p.\n", block);
8325 handle = effect->lpVtbl->EndParameterBlock(effect);
8326 ok(!handle, "Got unexpected handle %p.\n", handle);
8328 /* Block doesn't hold effect reference. */
8329 effect->lpVtbl->AddRef(effect);
8330 refcount = effect->lpVtbl->Release(effect);
8331 ok(refcount == 1, "Got unexpected refcount %lu.\n", refcount);
8333 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8334 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
8335 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8336 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8338 hr = effect->lpVtbl->BeginParameterBlock(effect);
8339 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8340 hr = effect->lpVtbl->SetFloat(effect, "vec3[0]", 1001.0f);
8341 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
8342 hr = effect->lpVtbl->SetFloat(effect, "arr1[0]", 91.0f);
8343 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8344 block = effect->lpVtbl->EndParameterBlock(effect);
8345 ok(!!block, "Got unexpected block %p.\n", block);
8346 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8347 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8349 hr = effect->lpVtbl->DeleteParameterBlock(effect2, block);
8350 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
8351 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8352 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8354 hr = effect->lpVtbl->ApplyParameterBlock(effect, NULL);
8355 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
8356 hr = effect->lpVtbl->ApplyParameterBlock(effect, "parameter_block");
8357 ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#lx.\n", hr);
8359 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
8360 ok(hr == D3D_OK, "Got result %#lx, expected 0 (D3D_OK).\n", hr);
8362 hr = effect->lpVtbl->BeginParameterBlock(effect);
8363 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8365 /* Effect parameters are not updated during recording. */
8366 hr = effect->lpVtbl->SetTexture(effect, "tex1", (IDirect3DBaseTexture9 *)texture);
8367 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8369 hr = effect->lpVtbl->GetTexture(effect, "tex1", (IDirect3DBaseTexture9 **)&tex_test);
8370 ok(hr == D3D_OK && !tex_test, "Got unexpected hr %#lx, tex_test %p.\n", hr, tex_test);
8372 /* Child parameters and array members are recorded separately (the whole
8373 * parameter is not updated when parameter block is applied). */
8374 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 92.0f);
8375 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8376 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 28.0f);
8377 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8378 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8379 ok(hr == D3D_OK && float_value == 12.0, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8381 float_array[0] = -29.0f;
8382 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array, 1);
8383 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8384 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 1);
8385 ok(hr == D3D_OK && float_array[0] == 13.0, "Got unexpected hr %#lx, float_array[0] %g.\n",
8386 hr, float_array[0]);
8388 memset(&mat, 0, sizeof(mat));
8389 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &test_mat);
8390 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8391 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8392 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8393 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8395 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &test_mat);
8396 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8397 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8398 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8399 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8401 /* Setting shared parameter through effect2 is not recorded to effect
8402 * parameter block. */
8403 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[1]", -1.0f);
8404 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8405 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8406 ok(float_value == -1.0f, "Unexpected value %g.\n", float_value);
8408 IDirect3DTexture9_AddRef(texture);
8409 refcount = IDirect3DTexture9_Release(texture);
8410 ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount);
8412 block = effect->lpVtbl->EndParameterBlock(effect);
8413 ok(!!block, "Got unexpected block %p.\n", block);
8415 IDirect3DTexture9_AddRef(texture);
8416 refcount = IDirect3DTexture9_Release(texture);
8417 ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount);
8419 hr = effect->lpVtbl->DeleteParameterBlock(effect2, block);
8420 ok(hr == D3DERR_INVALIDCALL, "Got result %#lx.\n", hr);
8422 IDirect3DTexture9_AddRef(texture);
8423 refcount = IDirect3DTexture9_Release(texture);
8424 ok(refcount == 2, "Got unexpected refcount %lu.\n", refcount);
8426 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 0.0f);
8427 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8428 hr = effect->lpVtbl->SetFloat(effect, "arr2[1]", 0.0f);
8429 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8430 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v1", float_array_zero, 3);
8431 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8432 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 0.0f);
8433 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8434 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array_zero, 4);
8435 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8436 memset(&mat, 0, sizeof(mat));
8437 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &mat);
8438 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8439 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &mat);
8440 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8442 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8443 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8445 IDirect3DTexture9_AddRef(texture);
8446 refcount = IDirect3DTexture9_Release(texture);
8447 ok(refcount == 3, "Got unexpected refcount %lu.\n", refcount);
8449 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8450 ok(hr == D3D_OK && float_value == 92.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8451 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8452 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8454 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8455 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8456 "Got unexpected hr %#lx, ts1[0].v1 (%g, %g, %g).\n", hr,
8457 float_array[0], float_array[1], float_array[2]);
8459 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8460 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8461 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8462 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8463 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8464 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8466 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8467 ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8469 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8470 ok(hr == D3D_OK && float_array[0] == -29.0f
8471 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8472 "Got unexpected hr %#lx, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8473 float_array[0], float_array[1], float_array[2], float_array[3]);
8475 /* Test applying a parameter block while recording a new one. */
8476 hr = effect->lpVtbl->SetFloat(effect, "arr2[0]", 0.0f);
8477 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8478 hr = effect->lpVtbl->SetFloat(effect, "arr2[1]", 0.0f);
8479 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8480 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v1", float_array_zero, 3);
8481 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8482 hr = effect->lpVtbl->SetFloat(effect, "ts1[0].fv", 0.0f);
8483 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8484 hr = effect->lpVtbl->SetFloatArray(effect, "ts1[0].v2", float_array_zero, 4);
8485 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8486 memset(&mat, 0, sizeof(mat));
8487 hr = effect->lpVtbl->SetMatrix(effect, "m3x2row", &effect_orig_mat);
8488 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8489 hr = effect->lpVtbl->SetMatrix(effect, "m3x2column", &effect_orig_mat);
8490 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8492 hr = effect->lpVtbl->BeginParameterBlock(effect);
8493 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8494 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8495 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8497 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8498 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8499 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8500 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8502 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8503 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8504 "Got unexpected hr %#lx, ts1[0].v1 (%g, %g, %g).\n", hr,
8505 float_array[0], float_array[1], float_array[2]);
8507 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8508 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8509 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8510 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8511 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8512 ok(!memcmp(&mat, &effect_orig_mat, sizeof(mat)), "Got unexpected matrix.\n");
8514 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8515 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8517 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8518 ok(hr == D3D_OK && float_array[0] == 0.0f
8519 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8520 "Got unexpected hr %#lx, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8521 float_array[0], float_array[1], float_array[2], float_array[3]);
8523 block2 = effect->lpVtbl->EndParameterBlock(effect);
8524 ok(!!block2, "Got unexpected block %p.\n", block2);
8526 hr = effect->lpVtbl->ApplyParameterBlock(effect, block2);
8527 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8529 hr = effect->lpVtbl->GetFloat(effect, "arr2[0]", &float_value);
8530 ok(hr == D3D_OK && float_value == 92.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8531 hr = effect->lpVtbl->GetFloat(effect, "arr2[1]", &float_value);
8532 ok(hr == D3D_OK && float_value == 0.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8534 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v1", float_array, 3);
8535 ok(hr == D3D_OK && !memcmp(float_array, float_array_zero, 3 * sizeof(*float_array)),
8536 "Got unexpected hr %#lx, ts1[0].v1 (%g, %g, %g).\n", hr,
8537 float_array[0], float_array[1], float_array[2]);
8539 hr = effect->lpVtbl->GetMatrix(effect, "m3x2row", &mat);
8540 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8541 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8542 hr = effect->lpVtbl->GetMatrix(effect, "m3x2column", &mat);
8543 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8544 ok(!memcmp(&mat, &test_mat, sizeof(mat)), "Got unexpected matrix.\n");
8546 hr = effect->lpVtbl->GetFloat(effect, "ts1[0].fv", &float_value);
8547 ok(hr == D3D_OK && float_value == 28.0f, "Got unexpected hr %#lx, float_value %g.\n", hr, float_value);
8549 hr = effect->lpVtbl->GetFloatArray(effect, "ts1[0].v2", float_array, 4);
8550 ok(hr == D3D_OK && float_array[0] == -29.0f
8551 && !memcmp(float_array + 1, float_array_zero, 3 * sizeof(*float_array)),
8552 "Got unexpected hr %#lx, ts1[0].v2 (%g, %g, %g, %g).\n", hr,
8553 float_array[0], float_array[1], float_array[2], float_array[3]);
8555 hr = effect->lpVtbl->DeleteParameterBlock(effect, block);
8556 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8557 hr = effect->lpVtbl->DeleteParameterBlock(effect, block2);
8558 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8560 hr = effect->lpVtbl->SetTexture(effect, "tex1", NULL);
8561 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8562 refcount = IDirect3DTexture9_Release(texture);
8563 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8565 refcount = effect->lpVtbl->Release(effect);
8566 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8568 refcount = effect2->lpVtbl->Release(effect2);
8569 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8571 refcount = pool->lpVtbl->Release(pool);
8572 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8574 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_float, sizeof(test_effect_parameter_value_blob_float),
8575 NULL, NULL, 0, NULL, &effect, NULL);
8576 hr = effect->lpVtbl->BeginParameterBlock(effect);
8577 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8578 mat_arr[0] = mat_arr[1] = test_mat;
8579 hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
8580 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8581 block = effect->lpVtbl->EndParameterBlock(effect);
8582 ok(!!block, "Got unexpected block %p.\n", block);
8584 memset(mat_arr, 0, sizeof(mat_arr));
8585 hr = effect->lpVtbl->SetMatrixArray(effect, "f33_2", mat_arr, 2);
8586 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8587 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8588 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8590 hr = effect->lpVtbl->GetMatrixArray(effect, "f33_2", mat_arr, 2);
8591 ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
8592 ok(!memcmp(&mat_arr[0], &test_mat, sizeof(test_mat))
8593 && !memcmp(&mat_arr[1], &test_mat, sizeof(test_mat)), "Got unexpected matrix array.\n");
8595 refcount = effect->lpVtbl->Release(effect);
8596 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8598 hr = D3DXCreateEffect(device, annotation_code, sizeof(annotation_code),
8599 NULL, NULL, 0, NULL, &effect, NULL);
8600 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8602 hr = effect->lpVtbl->GetFloat(effect, "f@a", &float_value);
8603 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8604 ok(float_value == 1.0f, "Got float %.8e.\n", float_value);
8605 hr = effect->lpVtbl->SetFloat(effect, "f@a", 2.0f);
8606 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8607 hr = effect->lpVtbl->GetFloat(effect, "f@a", &float_value);
8608 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8609 ok(float_value == 2.0f, "Got float %.8e.\n", float_value);
8611 hr = effect->lpVtbl->BeginParameterBlock(effect);
8612 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8613 hr = effect->lpVtbl->SetFloat(effect, "f@a", 3.0f);
8614 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8615 hr = effect->lpVtbl->GetFloat(effect, "f@a", &float_value);
8616 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8617 ok(float_value == 2.0f, "Got float %.8e.\n", float_value);
8618 block = effect->lpVtbl->EndParameterBlock(effect);
8619 ok(!!block, "Got unexpected block %p.\n", block);
8620 hr = effect->lpVtbl->ApplyParameterBlock(effect, block);
8621 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8622 hr = effect->lpVtbl->GetFloat(effect, "f@a", &float_value);
8623 ok(hr == D3D_OK, "Got result %#lx.\n", hr);
8624 ok(float_value == 3.0f, "Got float %.8e.\n", float_value);
8626 refcount = effect->lpVtbl->Release(effect);
8627 ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
8629 refcount = IDirect3DDevice9_Release(device);
8630 ok(!refcount, "Device has %lu references left.\n", refcount);
8631 IDirect3D9_Release(d3d);
8632 DestroyWindow(window);
8635 START_TEST(effect)
8637 IDirect3DDevice9 *device;
8638 ULONG refcount;
8639 HWND wnd;
8641 if (!(device = create_device(&wnd)))
8642 return;
8644 test_create_effect_and_pool(device);
8645 test_create_effect_compiler();
8646 test_effect_parameter_value(device);
8647 test_effect_setvalue_object(device);
8648 test_effect_variable_names(device);
8649 test_effect_compilation_errors(device);
8650 test_effect_states(device);
8651 test_effect_preshader(device);
8652 test_effect_preshader_ops(device);
8653 test_effect_isparameterused(device);
8654 test_effect_out_of_bounds_selector(device);
8655 test_effect_commitchanges(device);
8656 test_effect_preshader_relative_addressing(device);
8657 test_effect_state_manager(device);
8658 test_cross_effect_handle(device);
8659 test_effect_shared_parameters(device);
8660 test_effect_large_address_aware_flag(device);
8661 test_effect_get_pass_desc(device);
8662 test_effect_skip_constants(device);
8664 refcount = IDirect3DDevice9_Release(device);
8665 ok(!refcount, "Device has %lu references left.\n", refcount);
8666 DestroyWindow(wnd);
8668 test_effect_unsupported_shader();
8669 test_effect_null_shader();
8670 test_effect_clone();
8671 test_refcount();
8672 test_create_effect_from_file();
8673 test_effect_find_next_valid_technique();
8674 test_effect_parameter_block();