d3dx9/tests: Extend test for boolean matrix constant setting.
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blobbcb526eac9997ecd90857555d15a9126fdc3c6ba
1 /*
2 * Copyright 2010 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
20 #include "initguid.h"
21 #include <limits.h>
22 #include "wine/test.h"
23 #include "d3dx9.h"
25 #ifndef INFINITY
26 static inline float __port_infinity(void)
28 static const unsigned __inf_bytes = 0x7f800000;
29 return *(const float *)&__inf_bytes;
31 #define INFINITY __port_infinity()
32 #endif /* INFINITY */
34 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr))
36 /* helper functions */
37 static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps)
39 INT x = *(INT *)&f;
40 INT y = *(INT *)&g;
42 if (x < 0)
43 x = INT_MIN - x;
44 if (y < 0)
45 y = INT_MIN - y;
47 if (abs(x - y) > ulps)
48 return FALSE;
50 return TRUE;
53 static inline INT get_int(D3DXPARAMETER_TYPE type, const void *data)
55 INT i;
57 switch (type)
59 case D3DXPT_FLOAT:
60 i = *(FLOAT *)data;
61 break;
63 case D3DXPT_INT:
64 i = *(INT *)data;
65 break;
67 case D3DXPT_BOOL:
68 i = *(BOOL *)data;
69 break;
71 default:
72 i = 0;
73 ok(0, "Unhandled type %x.\n", type);
74 break;
77 return i;
80 static inline float get_float(D3DXPARAMETER_TYPE type, const void *data)
82 float f;
84 switch (type)
86 case D3DXPT_FLOAT:
87 f = *(FLOAT *)data;
88 break;
90 case D3DXPT_INT:
91 f = *(INT *)data;
92 break;
94 case D3DXPT_BOOL:
95 f = *(BOOL *)data;
96 break;
98 default:
99 f = 0.0f;
100 ok(0, "Unhandled type %x.\n", type);
101 break;
104 return f;
107 static inline BOOL get_bool(const void *data)
109 return !!*(BOOL *)data;
112 static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
114 switch (outtype)
116 case D3DXPT_FLOAT:
117 *(FLOAT *)outdata = get_float(intype, indata);
118 break;
120 case D3DXPT_BOOL:
121 *(BOOL *)outdata = get_bool(indata);
122 break;
124 case D3DXPT_INT:
125 *(INT *)outdata = get_int(intype, indata);
126 break;
128 case D3DXPT_PIXELSHADER:
129 case D3DXPT_VERTEXSHADER:
130 case D3DXPT_TEXTURE2D:
131 case D3DXPT_STRING:
132 *(INT *)outdata = 0x12345678;
133 break;
135 default:
136 ok(0, "Unhandled type %x.\n", outtype);
137 *(INT *)outdata = 0;
138 break;
142 static const char effect_desc[] =
143 "Technique\n"
144 "{\n"
145 "}\n";
147 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
149 HRESULT hr;
150 ID3DXEffect *effect;
151 ID3DXBaseEffect *base;
152 ULONG count;
153 IDirect3DDevice9 *device2;
154 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
155 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
157 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
158 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
160 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
161 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
163 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
164 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
166 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
167 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
169 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
170 todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
171 if (FAILED(hr))
173 skip("Failed to compile effect, skipping test.\n");
174 return;
177 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
178 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
180 hr = effect->lpVtbl->GetStateManager(effect, NULL);
181 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
183 hr = effect->lpVtbl->GetStateManager(effect, &manager);
184 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
185 ok(!manager, "GetStateManager failed, got %p\n", manager);
187 /* this works, but it is not recommended! */
188 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
189 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
191 hr = effect->lpVtbl->GetStateManager(effect, &manager);
192 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
193 ok(manager != NULL, "GetStateManager failed\n");
195 IDirect3DDevice9_AddRef(device);
196 count = IDirect3DDevice9_Release(device);
197 ok(count == 4, "Release failed, got %u, expected 4\n", count);
199 count = IUnknown_Release(manager);
200 ok(count == 3, "Release failed, got %u, expected 3\n", count);
202 hr = effect->lpVtbl->SetStateManager(effect, NULL);
203 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
205 hr = effect->lpVtbl->GetPool(effect, &pool);
206 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
207 ok(!pool, "GetPool failed, got %p\n", pool);
209 hr = effect->lpVtbl->GetPool(effect, NULL);
210 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
212 hr = effect->lpVtbl->GetDevice(effect, &device2);
213 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
215 hr = effect->lpVtbl->GetDevice(effect, NULL);
216 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
218 count = IDirect3DDevice9_Release(device2);
219 ok(count == 2, "Release failed, got %u, expected 2\n", count);
221 count = effect->lpVtbl->Release(effect);
222 ok(count == 0, "Release failed %u\n", count);
224 hr = D3DXCreateEffectPool(NULL);
225 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
227 hr = D3DXCreateEffectPool(&pool);
228 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
230 count = pool->lpVtbl->Release(pool);
231 ok(count == 0, "Release failed %u\n", count);
233 hr = D3DXCreateEffectPool(&pool);
234 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
236 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
237 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
239 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
240 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
241 ok(pool == pool2, "Release failed, got %p, expected %p\n", pool2, pool);
243 count = pool2->lpVtbl->Release(pool2);
244 ok(count == 1, "Release failed, got %u, expected 1\n", count);
246 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
247 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
249 count = IDirect3DDevice9_Release(device2);
250 ok(count == 1, "Release failed, got %u, expected 1\n", count);
252 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
253 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
255 hr = effect->lpVtbl->GetPool(effect, &pool);
256 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
257 ok(pool == pool2, "GetPool failed, got %p, expected %p\n", pool2, pool);
259 count = pool2->lpVtbl->Release(pool2);
260 ok(count == 2, "Release failed, got %u, expected 2\n", count);
262 count = effect->lpVtbl->Release(effect);
263 ok(count == 0, "Release failed %u\n", count);
265 count = pool->lpVtbl->Release(pool);
266 ok(count == 0, "Release failed %u\n", count);
269 static void test_create_effect_compiler(void)
271 HRESULT hr;
272 ID3DXEffectCompiler *compiler, *compiler2;
273 ID3DXBaseEffect *base;
274 IUnknown *unknown;
275 ULONG count;
277 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
278 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
280 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
281 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
283 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
284 todo_wine ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
285 if (FAILED(hr))
287 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
288 return;
291 count = compiler->lpVtbl->Release(compiler);
292 ok(count == 0, "Release failed %u\n", count);
294 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
295 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
297 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
298 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
300 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
301 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
303 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
304 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
306 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
307 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
309 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
310 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
312 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
313 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
315 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
316 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
318 count = unknown->lpVtbl->Release(unknown);
319 ok(count == 2, "Release failed, got %u, expected %u\n", count, 2);
321 count = compiler2->lpVtbl->Release(compiler2);
322 ok(count == 1, "Release failed, got %u, expected %u\n", count, 1);
324 count = compiler->lpVtbl->Release(compiler);
325 ok(count == 0, "Release failed %u\n", count);
329 * Parameter value test
331 struct test_effect_parameter_value_result
333 const char *full_name;
334 D3DXPARAMETER_DESC desc;
335 UINT value_offset; /* start position for the value in the blob */
339 * fxc.exe /Tfx_2_0
341 #if 0
342 float f = 0.1;
343 float1 f1 = {1.1};
344 float2 f2 = {2.1, 2.2};
345 float3 f3 = {3.1, 3.2, 3.3};
346 float4 f4 = {4.1, 4.2, 4.3, 4.4};
347 float1x1 f11 = {11.1};
348 float1x2 f12 = {12.1, 12.2};
349 float1x3 f13 = {13.1, 13.2, 13.3};
350 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
351 float2x1 f21 = {{21.11, 21.21}};
352 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
353 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
354 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
355 float3x1 f31 = {{31.11, 31.21, 31.31}};
356 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
357 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
358 {33.13, 33.23, 33.33}};
359 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
360 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
361 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
362 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
363 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
364 {43.13, 43.23, 43.33, 43.43}};
365 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
366 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
367 float f_2[2] = {0.101, 0.102};
368 float1 f1_2[2] = {{1.101}, {1.102}};
369 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
370 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
371 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
372 float1x1 f11_2[2] = {{11.101}, {11.102}};
373 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
374 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
375 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
376 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
377 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
378 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
379 {23.1202, 23.2202}, {23.1302, 23.2302}}};
380 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
381 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
382 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
383 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
384 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
385 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
386 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
387 {33.1302, 33.2302, 33.3302}}};
388 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
389 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
390 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
391 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
392 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
393 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
394 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
395 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
396 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
397 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
398 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
399 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
400 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
401 technique t { pass p { } }
402 #endif
403 static const DWORD test_effect_parameter_value_blob_float[] =
405 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
406 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
407 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
408 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
409 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
410 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
411 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
412 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
413 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
414 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
415 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
416 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
417 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
418 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
419 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
420 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
421 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
422 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
423 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
424 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
425 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
426 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
427 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
428 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
429 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
430 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
431 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
432 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
433 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
434 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
435 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
436 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
437 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
438 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
439 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
440 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
441 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
442 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
443 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
444 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
445 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
446 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
447 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
448 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
449 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
450 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
451 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
452 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
453 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
454 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
455 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
456 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
457 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
458 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
459 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
460 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
461 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
462 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
463 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
464 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
465 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
466 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
467 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
468 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
469 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
470 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
471 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
472 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
473 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
474 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
475 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
476 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
477 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
478 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
479 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
480 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
481 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
482 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
483 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
484 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
485 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
486 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
487 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
488 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
489 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
490 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
491 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
492 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
493 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
494 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
495 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
496 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
497 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
498 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
499 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
500 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
501 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
502 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
503 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
504 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
505 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
506 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
507 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
508 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
509 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
510 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
511 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
512 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
513 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
514 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
515 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
516 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
517 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
518 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
519 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
522 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
524 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
525 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
526 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
527 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
528 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
529 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
530 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
531 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
532 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
533 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
534 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
535 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
536 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
537 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
538 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
539 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
540 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
541 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
542 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
543 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
544 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
545 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
546 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
547 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
548 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
549 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
550 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
551 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
552 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
553 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
554 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
555 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
556 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
557 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
558 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
559 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
560 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
561 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
562 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
563 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
564 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
565 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
569 * fxc.exe /Tfx_2_0
571 #if 0
572 int i = 1;
573 int1 i1 = {11};
574 int2 i2 = {21, 22};
575 int3 i3 = {31, 32, 33};
576 int4 i4 = {41, 42, 43, 44};
577 int1x1 i11 = {111};
578 int1x2 i12 = {121, 122};
579 int1x3 i13 = {131, 132, 133};
580 int1x4 i14 = {141, 142, 143, 144};
581 int2x1 i21 = {{2111, 2121}};
582 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
583 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
584 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
585 int3x1 i31 = {{3111, 3121, 3131}};
586 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
587 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
588 {3313, 3323, 3333}};
589 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
590 {3413, 3423, 3433}, {3414, 3424, 3434}};
591 int4x1 i41 = {{4111, 4121, 4131, 4141}};
592 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
593 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
594 {4313, 4323, 4333, 4343}};
595 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
596 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
597 int i_2[2] = {0101, 0102};
598 int1 i1_2[2] = {{1101}, {1102}};
599 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
600 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
601 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
602 int1x1 i11_2[2] = {{11101}, {11102}};
603 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
604 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
605 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
606 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
607 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
608 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
609 {231202, 232202}, {231302, 232302}}};
610 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
611 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
612 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
613 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
614 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
615 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
616 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
617 {331302, 332302, 333302}}};
618 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
619 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
620 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
621 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
622 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
623 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
624 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
625 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
626 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
627 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
628 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
629 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
630 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
631 technique t { pass p { } }
632 #endif
633 static const DWORD test_effect_parameter_value_blob_int[] =
635 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
636 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
637 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
638 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
639 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
640 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
641 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
642 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
643 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
644 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
645 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
646 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
647 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
648 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
649 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
650 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
651 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
652 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
653 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
654 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
655 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
656 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
657 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
658 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
659 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
660 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
661 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
662 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
663 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
664 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
665 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
666 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
667 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
668 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
669 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
670 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
671 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
672 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
673 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
674 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
675 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
676 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
677 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
678 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
679 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
680 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
681 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
682 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
683 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
684 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
685 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
686 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
687 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
688 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
689 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
690 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
691 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
692 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
693 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
694 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
695 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
696 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
697 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
698 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
699 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
700 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
701 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
702 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
703 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
704 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
705 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
706 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
707 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
708 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
709 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
710 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
711 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
712 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
713 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
714 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
715 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
716 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
717 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
718 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
719 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
720 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
721 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
722 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
723 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
724 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
725 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
726 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
727 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
728 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
729 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
730 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
731 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
732 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
733 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
734 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
735 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
736 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
737 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
738 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
739 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
740 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
741 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
742 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
743 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
744 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
745 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
746 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
747 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
748 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
749 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
752 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
754 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
755 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
756 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
757 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
758 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
759 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
760 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
761 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
762 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
763 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
764 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
765 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
766 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
767 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
768 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
769 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
770 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
771 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
772 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
773 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
774 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
775 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
776 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
777 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
778 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
779 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
780 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
781 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
782 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
783 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
784 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
785 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
786 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
787 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
788 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
789 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
790 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
791 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
792 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
793 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
794 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
795 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
799 * fxc.exe /Tfx_2_0
801 #if 0
802 string s = "test";
803 string s_2[2] = {"test1", "test2"};
804 texture2D tex;
805 Vertexshader v;
806 Vertexshader v_2[2];
807 Pixelshader p;
808 Pixelshader p_2[2];
809 technique t { pass p { } }
810 #endif
811 static const DWORD test_effect_parameter_value_blob_object[] =
813 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
814 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
815 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
816 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
817 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
818 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
819 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
820 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
821 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
822 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
823 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
824 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
825 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
826 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
827 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
828 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
829 0x00000001, 0x00000005, 0x74736574, 0x00000000,
832 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
834 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
835 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
836 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
837 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
838 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
839 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
840 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
844 * fxc.exe /Tfx_2_0
846 #if 0
847 float3 f3 = {-3.1, 153.2, 283.3};
848 float3 f3min = {-31.1, -31.2, -31.3};
849 float3 f3max = {320.1, 320.2, 320.3};
850 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
851 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
852 float4 f4max = {420.1, 42.20, 420.3, 420.4};
853 technique t { pass p { } }
854 #endif
855 static const DWORD test_effect_parameter_value_blob_special[] =
857 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
858 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
859 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
860 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
861 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
862 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
863 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
864 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
865 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
866 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
867 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
868 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
869 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
870 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
871 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
872 0x00000000, 0x00000000,
875 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
877 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
878 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
879 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
880 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
881 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
882 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
885 #define ADD_PARAMETER_VALUE(x) {\
886 test_effect_parameter_value_blob_ ## x,\
887 sizeof(test_effect_parameter_value_blob_ ## x),\
888 test_effect_parameter_value_result_ ## x,\
889 sizeof(test_effect_parameter_value_result_ ## x)/sizeof(*test_effect_parameter_value_result_ ## x),\
892 static const struct
894 const DWORD *blob;
895 UINT blob_size;
896 const struct test_effect_parameter_value_result *res;
897 UINT res_count;
899 test_effect_parameter_value_data[] =
901 ADD_PARAMETER_VALUE(float),
902 ADD_PARAMETER_VALUE(int),
903 ADD_PARAMETER_VALUE(object),
904 ADD_PARAMETER_VALUE(special),
907 #undef ADD_PARAMETER_VALUE
909 /* Multiple of 16 to cover complete matrices */
910 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
911 /* Constants for special INT/FLOAT conversation */
912 #define INT_FLOAT_MULTI 255.0f
913 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
915 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
916 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
918 const D3DXPARAMETER_DESC *res_desc = &res->desc;
919 const char *res_full_name = res->full_name;
920 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
921 HRESULT hr;
922 UINT l;
924 memset(value, 0xab, sizeof(value));
925 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
926 if (res_desc->Class == D3DXPC_SCALAR
927 || res_desc->Class == D3DXPC_VECTOR
928 || res_desc->Class == D3DXPC_MATRIX_ROWS)
930 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
932 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
934 ok(value[l] == res_value[l], "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
935 i, res_full_name, l, value[l], res_value[l]);
938 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
940 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
941 i, res_full_name, l, value[l], 0xabababab);
944 else if (res_desc->Class == D3DXPC_OBJECT)
946 switch (res_desc->Type)
948 case D3DXPT_PIXELSHADER:
949 case D3DXPT_VERTEXSHADER:
950 case D3DXPT_TEXTURE2D:
951 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
953 for (l = 0; l < (res_desc->Elements ? res_desc->Elements : 1); ++l)
955 IUnknown *unk = *((IUnknown **)value + l);
956 if (unk) IUnknown_Release(unk);
958 break;
960 case D3DXPT_STRING:
961 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
962 break;
964 default:
965 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
966 break;
969 else
971 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
972 i, res_full_name, hr, D3DERR_INVALIDCALL);
974 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
976 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
977 i, res_full_name, l, value[l], 0xabababab);
982 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
983 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
985 const D3DXPARAMETER_DESC *res_desc = &res->desc;
986 const char *res_full_name = res->full_name;
987 BOOL bvalue = 0xabababab;
988 HRESULT hr;
990 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
991 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
993 ok(hr == D3D_OK, "%u - %s: GetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
994 ok(bvalue == get_bool(res_value), "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
995 i, res_full_name, bvalue, get_bool(res_value));
997 else
999 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1000 i, res_full_name, hr, D3DERR_INVALIDCALL);
1001 ok(bvalue == 0xabababab, "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
1002 i, res_full_name, bvalue, 0xabababab);
1006 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
1007 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1009 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1010 const char *res_full_name = res->full_name;
1011 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1012 HRESULT hr;
1013 UINT l, err = 0;
1015 memset(bavalue, 0xab, sizeof(bavalue));
1016 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1017 if (res_desc->Class == D3DXPC_SCALAR
1018 || res_desc->Class == D3DXPC_VECTOR
1019 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1021 ok(hr == D3D_OK, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1023 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1025 if (bavalue[l] != get_bool(&res_value[l])) ++err;
1028 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1030 if (bavalue[l] != 0xabababab) ++err;
1033 else
1035 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1036 i, res_full_name, hr, D3DERR_INVALIDCALL);
1038 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (bavalue[l] != 0xabababab) ++err;
1040 ok(!err, "%u - %s: GetBoolArray failed with %u errors\n", i, res_full_name, err);
1043 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1044 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1046 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1047 const char *res_full_name = res->full_name;
1048 INT ivalue = 0xabababab;
1049 HRESULT hr;
1051 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1052 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1054 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1055 ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1056 i, res_full_name, ivalue, get_int(res_desc->Type, res_value));
1058 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1059 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1060 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1062 INT tmp;
1064 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1066 tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1067 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1068 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1069 if (res_desc->Columns * res_desc->Rows > 3)
1071 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1074 ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n",
1075 i, res_full_name, ivalue, tmp);
1077 else
1079 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1080 i, res_full_name, hr, D3DERR_INVALIDCALL);
1081 ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1082 i, res_full_name, ivalue, 0xabababab);
1086 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1087 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1089 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1090 const char *res_full_name = res->full_name;
1091 INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1092 HRESULT hr;
1093 UINT l, err = 0;
1095 memset(iavalue, 0xab, sizeof(iavalue));
1096 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1097 if (res_desc->Class == D3DXPC_SCALAR
1098 || res_desc->Class == D3DXPC_VECTOR
1099 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1101 ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1103 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1105 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1108 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1110 if (iavalue[l] != 0xabababab) ++err;
1113 else
1115 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1116 i, res_full_name, hr, D3DERR_INVALIDCALL);
1118 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1120 ok(!err, "%u - %s: GetIntArray failed with %u errors\n", i, res_full_name, err);
1123 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1124 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1126 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1127 const char *res_full_name = res->full_name;
1128 HRESULT hr;
1129 DWORD cmp = 0xabababab;
1130 FLOAT fvalue = *(FLOAT *)&cmp;
1132 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1133 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1135 ok(hr == D3D_OK, "%u - %s: GetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1136 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1137 i, res_full_name, fvalue, get_float(res_desc->Type, res_value));
1139 else
1141 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1142 i, res_full_name, hr, D3DERR_INVALIDCALL);
1143 ok(fvalue == *(FLOAT *)&cmp, "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1144 i, res_full_name, fvalue, *(FLOAT *)&cmp);
1148 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1149 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1151 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1152 const char *res_full_name = res->full_name;
1153 FLOAT favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1154 HRESULT hr;
1155 UINT l, err = 0;
1156 DWORD cmp = 0xabababab;
1158 memset(favalue, 0xab, sizeof(favalue));
1159 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1160 if (res_desc->Class == D3DXPC_SCALAR
1161 || res_desc->Class == D3DXPC_VECTOR
1162 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1164 ok(hr == D3D_OK, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1166 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1168 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1171 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1173 if (favalue[l] != *(FLOAT *)&cmp) ++err;
1176 else
1178 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1179 i, res_full_name, hr, D3DERR_INVALIDCALL);
1181 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1183 ok(!err, "%u - %s: GetFloatArray failed with %u errors\n", i, res_full_name, err);
1186 static void test_effect_parameter_value_GetVector(const struct test_effect_parameter_value_result *res,
1187 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1189 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1190 const char *res_full_name = res->full_name;
1191 HRESULT hr;
1192 DWORD cmp = 0xabababab;
1193 FLOAT fvalue[4];
1194 UINT l, err = 0;
1196 memset(fvalue, 0xab, sizeof(fvalue));
1197 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1198 if (!res_desc->Elements &&
1199 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1200 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1202 DWORD tmp;
1204 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1206 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1207 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1208 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1209 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1211 if (*res_value != tmp) ++err;
1213 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1215 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1217 for (l = 0; l < res_desc->Columns; ++l)
1219 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1222 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l] != 0.0f) ++err;
1224 else
1226 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1227 i, res_full_name, hr, D3DERR_INVALIDCALL);
1229 for (l = 0; l < 4; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1231 ok(!err, "%u - %s: GetVector failed with %u errors\n", i, res_full_name, err);
1234 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1235 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1237 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1238 const char *res_full_name = res->full_name;
1239 HRESULT hr;
1240 DWORD cmp = 0xabababab;
1241 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1242 UINT l, k, element, err = 0;
1244 for (element = 0; element <= res_desc->Elements + 1; ++element)
1246 memset(fvalue, 0xab, sizeof(fvalue));
1247 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1248 if (!element)
1250 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1252 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1254 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1256 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1258 for (k = 0; k < element; ++k)
1260 for (l = 0; l < res_desc->Columns; ++l)
1262 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1263 &res_value[l + k * res_desc->Columns]), 512))
1264 ++err;
1267 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l + k * 4] != 0.0f) ++err;
1270 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1272 else
1274 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n",
1275 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1277 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1279 ok(!err, "%u - %s[%u]: GetVectorArray failed with %u errors\n", i, res_full_name, element, err);
1283 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1284 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1286 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1287 const char *res_full_name = res->full_name;
1288 HRESULT hr;
1289 DWORD cmp = 0xabababab;
1290 FLOAT fvalue[16];
1291 UINT l, k, err = 0;
1293 memset(fvalue, 0xab, sizeof(fvalue));
1294 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1295 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1297 ok(hr == D3D_OK, "%u - %s: GetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1299 for (k = 0; k < 4; ++k)
1301 for (l = 0; l < 4; ++l)
1303 if (k < res_desc->Columns && l < res_desc->Rows)
1305 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1306 &res_value[l * res_desc->Columns + k]), 512))
1307 ++err;
1309 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1313 else
1315 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1316 i, res_full_name, hr, D3DERR_INVALIDCALL);
1318 for (l = 0; l < sizeof(fvalue) / sizeof(*fvalue); ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1320 ok(!err, "%u - %s: GetMatrix failed with %u errors\n", i, res_full_name, err);
1323 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1324 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1326 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1327 const char *res_full_name = res->full_name;
1328 HRESULT hr;
1329 DWORD cmp = 0xabababab;
1330 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1331 UINT l, k, m, element, err = 0;
1333 for (element = 0; element <= res_desc->Elements + 1; ++element)
1335 memset(fvalue, 0xab, sizeof(fvalue));
1336 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1337 if (!element)
1339 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1341 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1343 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1345 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1347 for (m = 0; m < element; ++m)
1349 for (k = 0; k < 4; ++k)
1351 for (l = 0; l < 4; ++l)
1353 if (k < res_desc->Columns && l < res_desc->Rows)
1355 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1356 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1357 ++err;
1359 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1364 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1366 else
1368 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n",
1369 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1371 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1373 ok(!err, "%u - %s[%u]: GetMatrixArray failed with %u errors\n", i, res_full_name, element, err);
1377 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1378 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1380 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1381 const char *res_full_name = res->full_name;
1382 HRESULT hr;
1383 DWORD cmp = 0xabababab;
1384 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1385 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1386 UINT l, k, m, element, err = 0;
1388 for (element = 0; element <= res_desc->Elements + 1; ++element)
1390 memset(fvalue, 0xab, sizeof(fvalue));
1391 for (l = 0; l < element; ++l)
1393 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1395 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
1396 if (!element)
1398 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1399 i, res_full_name, element, hr, D3D_OK);
1401 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1403 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1405 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1406 i, res_full_name, element, hr, D3D_OK);
1408 for (m = 0; m < element; ++m)
1410 for (k = 0; k < 4; ++k)
1412 for (l = 0; l < 4; ++l)
1414 if (k < res_desc->Columns && l < res_desc->Rows)
1416 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1417 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1418 ++err;
1420 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1425 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1427 else
1429 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1431 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1432 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1434 ok(!err, "%u - %s[%u]: GetMatrixPointerArray failed with %u errors\n", i, res_full_name, element, err);
1438 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1439 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1441 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1442 const char *res_full_name = res->full_name;
1443 HRESULT hr;
1444 DWORD cmp = 0xabababab;
1445 FLOAT fvalue[16];
1446 UINT l, k, err = 0;
1448 memset(fvalue, 0xab, sizeof(fvalue));
1449 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1450 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1452 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1454 for (k = 0; k < 4; ++k)
1456 for (l = 0; l < 4; ++l)
1458 if (k < res_desc->Columns && l < res_desc->Rows)
1460 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1461 &res_value[l * res_desc->Columns + k]), 512))
1462 ++err;
1464 else if (fvalue[l + k * 4] != 0.0f) ++err;
1468 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1470 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1472 for (k = 0; k < 4; ++k)
1474 for (l = 0; l < 4; ++l)
1476 if (k < res_desc->Columns && l < res_desc->Rows)
1478 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1479 &res_value[l * res_desc->Columns + k]), 512))
1480 ++err;
1482 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1486 else
1488 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1489 i, res_full_name, hr, D3DERR_INVALIDCALL);
1491 for (l = 0; l < sizeof(fvalue) / sizeof(*fvalue); ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1493 ok(!err, "%u - %s: GetMatrixTranspose failed with %u errors\n", i, res_full_name, err);
1496 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1497 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1499 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1500 const char *res_full_name = res->full_name;
1501 HRESULT hr;
1502 DWORD cmp = 0xabababab;
1503 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1504 UINT l, k, m, element, err = 0;
1506 for (element = 0; element <= res_desc->Elements + 1; ++element)
1508 memset(fvalue, 0xab, sizeof(fvalue));
1509 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1510 if (!element)
1512 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1513 i, res_full_name, element, hr, D3D_OK);
1515 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1517 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1519 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1520 i, res_full_name, element, hr, D3D_OK);
1522 for (m = 0; m < element; ++m)
1524 for (k = 0; k < 4; ++k)
1526 for (l = 0; l < 4; ++l)
1528 if (k < res_desc->Columns && l < res_desc->Rows)
1530 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1531 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1532 ++err;
1534 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1539 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1541 else
1543 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1544 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1546 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1548 ok(!err, "%u - %s[%u]: GetMatrixTransposeArray failed with %u errors\n", i, res_full_name, element, err);
1552 static void test_effect_parameter_value_GetMatrixTransposePointerArray(const struct test_effect_parameter_value_result *res,
1553 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1555 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1556 const char *res_full_name = res->full_name;
1557 HRESULT hr;
1558 DWORD cmp = 0xabababab;
1559 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1560 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1561 UINT l, k, m, element, err = 0;
1563 for (element = 0; element <= res_desc->Elements + 1; ++element)
1565 memset(fvalue, 0xab, sizeof(fvalue));
1566 for (l = 0; l < element; ++l)
1568 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1570 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
1571 if (!element)
1573 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1574 i, res_full_name, element, hr, D3D_OK);
1576 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1578 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1580 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1581 i, res_full_name, element, hr, D3D_OK);
1583 for (m = 0; m < element; ++m)
1585 for (k = 0; k < 4; ++k)
1587 for (l = 0; l < 4; ++l)
1589 if (k < res_desc->Columns && l < res_desc->Rows)
1591 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1592 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1593 ++err;
1595 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1600 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1602 else
1604 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1605 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1607 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1609 ok(!err, "%u - %s[%u]: GetMatrixTransposePointerArray failed with %u errors\n", i, res_full_name, element, err);
1613 static void test_effect_parameter_value_GetTestGroup(const struct test_effect_parameter_value_result *res,
1614 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1616 test_effect_parameter_value_GetValue(res, effect, res_value, parameter, i);
1617 test_effect_parameter_value_GetBool(res, effect, res_value, parameter, i);
1618 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter, i);
1619 test_effect_parameter_value_GetInt(res, effect, res_value, parameter, i);
1620 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter, i);
1621 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter, i);
1622 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter, i);
1623 test_effect_parameter_value_GetVector(res, effect, res_value, parameter, i);
1624 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter, i);
1625 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter, i);
1626 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter, i);
1627 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter, i);
1628 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter, i);
1629 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter, i);
1630 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter, i);
1633 static void test_effect_parameter_value_ResetValue(const struct test_effect_parameter_value_result *res,
1634 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1636 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1637 const char *res_full_name = res->full_name;
1638 HRESULT hr;
1640 if (res_desc->Class == D3DXPC_SCALAR
1641 || res_desc->Class == D3DXPC_VECTOR
1642 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1644 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1645 ok(hr == D3D_OK, "%u - %s: SetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1647 else
1649 /* nothing to do */
1650 switch (res_desc->Type)
1652 case D3DXPT_PIXELSHADER:
1653 case D3DXPT_VERTEXSHADER:
1654 case D3DXPT_TEXTURE2D:
1655 case D3DXPT_STRING:
1656 break;
1658 default:
1659 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1660 break;
1665 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1667 UINT i;
1668 UINT effect_count = sizeof(test_effect_parameter_value_data) / sizeof(*test_effect_parameter_value_data);
1670 for (i = 0; i < effect_count; ++i)
1672 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1673 UINT res_count = test_effect_parameter_value_data[i].res_count;
1674 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1675 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1676 HRESULT hr;
1677 ID3DXEffect *effect;
1678 D3DXEFFECT_DESC edesc;
1679 ULONG count;
1680 UINT k;
1682 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1683 ok(hr == D3D_OK, "%u: D3DXCreateEffect failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1685 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1686 ok(hr == D3D_OK, "%u: GetDesc failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1687 ok(edesc.Parameters == res_count, "%u: Parameters failed, got %u, expected %u\n",
1688 i, edesc.Parameters, res_count);
1690 for (k = 0; k < res_count; ++k)
1692 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1693 const char *res_full_name = res[k].full_name;
1694 UINT res_value_offset = res[k].value_offset;
1695 D3DXHANDLE parameter;
1696 D3DXPARAMETER_DESC pdesc;
1697 BOOL bvalue = TRUE;
1698 INT ivalue = 42;
1699 FLOAT fvalue = 2.71828f;
1700 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1701 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1702 UINT l, n, m, element;
1703 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/sizeof(D3DXMATRIX)];
1705 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1706 ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
1708 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1709 ok(hr == D3D_OK, "%u - %s: GetParameterDesc failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1711 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1712 "%u - %s: GetParameterDesc Name failed, got \"%s\", expected \"%s\"\n",
1713 i, res_full_name, pdesc.Name, res_desc->Name);
1714 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1715 "%u - %s: GetParameterDesc Semantic failed, got \"%s\", expected \"%s\"\n",
1716 i, res_full_name, pdesc.Semantic, res_desc->Semantic);
1717 ok(res_desc->Class == pdesc.Class, "%u - %s: GetParameterDesc Class failed, got %#x, expected %#x\n",
1718 i, res_full_name, pdesc.Class, res_desc->Class);
1719 ok(res_desc->Type == pdesc.Type, "%u - %s: GetParameterDesc Type failed, got %#x, expected %#x\n",
1720 i, res_full_name, pdesc.Type, res_desc->Type);
1721 ok(res_desc->Rows == pdesc.Rows, "%u - %s: GetParameterDesc Rows failed, got %u, expected %u\n",
1722 i, res_full_name, pdesc.Rows, res_desc->Rows);
1723 ok(res_desc->Columns == pdesc.Columns, "%u - %s: GetParameterDesc Columns failed, got %u, expected %u\n",
1724 i, res_full_name, pdesc.Columns, res_desc->Columns);
1725 ok(res_desc->Elements == pdesc.Elements, "%u - %s: GetParameterDesc Elements failed, got %u, expected %u\n",
1726 i, res_full_name, pdesc.Elements, res_desc->Elements);
1727 ok(res_desc->Annotations == pdesc.Annotations, "%u - %s: GetParameterDesc Annotations failed, got %u, expected %u\n",
1728 i, res_full_name, pdesc.Annotations, res_desc->Annotations);
1729 ok(res_desc->StructMembers == pdesc.StructMembers, "%u - %s: GetParameterDesc StructMembers failed, got %u, expected %u\n",
1730 i, res_full_name, pdesc.StructMembers, res_desc->StructMembers);
1731 ok(res_desc->Flags == pdesc.Flags, "%u - %s: GetParameterDesc Flags failed, got %u, expected %u\n",
1732 i, res_full_name, pdesc.Flags, res_desc->Flags);
1733 ok(res_desc->Bytes == pdesc.Bytes, "%u - %s: GetParameterDesc Bytes, got %u, expected %u\n",
1734 i, res_full_name, pdesc.Bytes, res_desc->Bytes);
1736 /* check size */
1737 ok(EFFECT_PARAMETER_VALUE_ARRAY_SIZE >= res_desc->Bytes / 4 +
1738 (res_desc->Elements ? res_desc->Bytes / 4 / res_desc->Elements : 0),
1739 "%u - %s: Warning: Array size too small\n", i, res_full_name);
1741 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1742 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1743 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1746 * check invalid calls
1747 * These will crash:
1748 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1749 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1750 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1751 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1752 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1753 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1754 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1755 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1756 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1757 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1758 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1759 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1760 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1761 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1763 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1764 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1765 i, res_full_name, hr, D3DERR_INVALIDCALL);
1767 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1768 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1769 i, res_full_name, hr, D3DERR_INVALIDCALL);
1771 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1772 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1773 i, res_full_name, hr, D3DERR_INVALIDCALL);
1775 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1776 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1777 i, res_full_name, hr, D3DERR_INVALIDCALL);
1779 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1780 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1781 i, res_full_name, hr, D3DERR_INVALIDCALL);
1783 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1784 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1785 i, res_full_name, hr, D3DERR_INVALIDCALL);
1787 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1788 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
1789 i, res_full_name, hr, D3DERR_INVALIDCALL);
1791 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1792 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1793 i, res_full_name, hr, D3DERR_INVALIDCALL);
1795 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1796 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1797 i, res_full_name, hr, D3DERR_INVALIDCALL);
1799 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1800 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
1801 i, res_full_name, hr, D3DERR_INVALIDCALL);
1803 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1804 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1805 i, res_full_name, hr, D3DERR_INVALIDCALL);
1807 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1808 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1809 i, res_full_name, hr, D3DERR_INVALIDCALL);
1811 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1812 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
1813 i, res_full_name, hr, D3DERR_INVALIDCALL);
1815 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1816 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1817 i, res_full_name, hr, D3DERR_INVALIDCALL);
1819 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1820 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1821 i, res_full_name, hr, D3DERR_INVALIDCALL);
1823 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1824 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
1825 i, res_full_name, hr, D3DERR_INVALIDCALL);
1827 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1828 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1829 i, res_full_name, hr, D3DERR_INVALIDCALL);
1831 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1832 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1833 i, res_full_name, hr, D3DERR_INVALIDCALL);
1835 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1836 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
1837 i, res_full_name, hr, D3DERR_INVALIDCALL);
1839 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1840 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1841 i, res_full_name, hr, D3DERR_INVALIDCALL);
1843 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1844 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1845 i, res_full_name, hr, D3DERR_INVALIDCALL);
1847 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1848 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
1849 i, res_full_name, hr, D3DERR_INVALIDCALL);
1851 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1852 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1853 i, res_full_name, hr, D3DERR_INVALIDCALL);
1855 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1856 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1857 i, res_full_name, hr, D3DERR_INVALIDCALL);
1859 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1860 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
1861 i, res_full_name, hr, D3DERR_INVALIDCALL);
1863 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1864 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1865 i, res_full_name, hr, D3DERR_INVALIDCALL);
1867 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1868 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
1869 i, res_full_name, hr, D3DERR_INVALIDCALL);
1871 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1872 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1873 i, res_full_name, hr, D3DERR_INVALIDCALL);
1875 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1876 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1877 i, res_full_name, hr, D3DERR_INVALIDCALL);
1879 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1880 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1881 i, res_full_name, hr, D3DERR_INVALIDCALL);
1883 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
1884 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1885 i, res_full_name, hr, D3DERR_INVALIDCALL);
1887 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
1888 ok(hr == D3D_OK, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1889 i, res_full_name, hr, D3D_OK);
1891 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1892 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1893 i, res_full_name, hr, D3DERR_INVALIDCALL);
1895 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1896 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1897 i, res_full_name, hr, D3DERR_INVALIDCALL);
1899 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1900 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
1901 i, res_full_name, hr, D3DERR_INVALIDCALL);
1903 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1904 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1905 i, res_full_name, hr, D3DERR_INVALIDCALL);
1907 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
1908 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1909 i, res_full_name, hr, D3DERR_INVALIDCALL);
1911 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1912 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
1913 i, res_full_name, hr, D3DERR_INVALIDCALL);
1915 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1916 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1917 i, res_full_name, hr, D3DERR_INVALIDCALL);
1919 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1920 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1921 i, res_full_name, hr, D3DERR_INVALIDCALL);
1923 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1924 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1925 i, res_full_name, hr, D3DERR_INVALIDCALL);
1927 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
1928 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1929 i, res_full_name, hr, D3DERR_INVALIDCALL);
1931 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
1932 ok(hr == D3D_OK, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1933 i, res_full_name, hr, D3D_OK);
1935 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1936 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1937 i, res_full_name, hr, D3DERR_INVALIDCALL);
1939 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1940 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1941 i, res_full_name, hr, D3DERR_INVALIDCALL);
1943 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
1944 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1945 i, res_full_name, hr, D3DERR_INVALIDCALL);
1947 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1948 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1949 i, res_full_name, hr, D3DERR_INVALIDCALL);
1951 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
1952 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1953 i, res_full_name, hr, D3DERR_INVALIDCALL);
1955 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1956 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1957 i, res_full_name, hr, D3DERR_INVALIDCALL);
1959 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1961 /* SetBool */
1962 bvalue = 5;
1963 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1964 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
1965 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1967 bvalue = TRUE;
1968 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
1969 ok(hr == D3D_OK, "%u - %s: SetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1971 else
1973 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1974 i, res_full_name, hr, D3DERR_INVALIDCALL);
1976 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
1977 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1979 /* SetBoolArray */
1980 *input_value = 1;
1981 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
1983 *(input_value + l) = *(input_value + l - 1) + 1;
1985 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1986 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
1987 if (res_desc->Class == D3DXPC_SCALAR
1988 || res_desc->Class == D3DXPC_VECTOR
1989 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1991 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
1993 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
1995 ok(hr == D3D_OK, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1997 else
1999 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
2000 i, res_full_name, hr, D3DERR_INVALIDCALL);
2002 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2003 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2005 /* SetInt */
2006 ivalue = 0x1fbf02ff;
2007 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2008 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2009 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2011 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2012 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2014 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2015 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2016 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2018 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2019 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2020 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2021 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2022 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2023 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2024 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2025 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2027 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2028 i, res_full_name, hr, D3D_OK);
2030 else
2032 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2033 i, res_full_name, hr, D3DERR_INVALIDCALL);
2035 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2036 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2038 /* SetIntArray */
2039 *input_value = 123456;
2040 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2042 *(input_value + l) = *(input_value + l - 1) + 23;
2044 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2045 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2046 if (res_desc->Class == D3DXPC_SCALAR
2047 || res_desc->Class == D3DXPC_VECTOR
2048 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2050 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2052 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2054 ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2056 else
2058 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
2059 i, res_full_name, hr, D3DERR_INVALIDCALL);
2061 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2062 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2064 /* SetFloat */
2065 fvalue = 1.33;
2066 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2067 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2068 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2070 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2071 ok(hr == D3D_OK, "%u - %s: SetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2073 else
2075 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
2076 i, res_full_name, hr, D3DERR_INVALIDCALL);
2078 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2079 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2081 /* SetFloatArray */
2082 fvalue = 1.33;
2083 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2085 *(input_value + l) = *(DWORD *)&fvalue;
2086 fvalue += 1.12;
2088 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2089 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2090 if (res_desc->Class == D3DXPC_SCALAR
2091 || res_desc->Class == D3DXPC_VECTOR
2092 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2094 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2096 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2098 ok(hr == D3D_OK, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2100 else
2102 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
2103 i, res_full_name, hr, D3DERR_INVALIDCALL);
2105 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2106 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2108 /* SetVector */
2109 fvalue = -1.33;
2110 for (l = 0; l < 4; ++l)
2112 *(input_value + l) = *(DWORD *)&fvalue;
2113 fvalue += 1.12;
2115 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2116 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2117 if (!res_desc->Elements &&
2118 (res_desc->Class == D3DXPC_SCALAR
2119 || res_desc->Class == D3DXPC_VECTOR))
2121 /* only values between 0 and INT_FLOAT_MULTI are valid */
2122 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2124 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2125 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2126 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2127 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2129 else
2131 for (l = 0; l < 4; ++l)
2133 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2136 ok(hr == D3D_OK, "%u - %s: SetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2138 else
2140 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
2141 i, res_full_name, hr, D3DERR_INVALIDCALL);
2143 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2144 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2146 /* SetVectorArray */
2147 for (element = 0; element < res_desc->Elements + 1; ++element)
2149 fvalue = 1.33;
2150 for (l = 0; l < element * 4; ++l)
2152 *(input_value + l) = *(DWORD *)&fvalue;
2153 fvalue += 1.12;
2155 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2156 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
2157 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
2159 for (m = 0; m < element; ++m)
2161 for (l = 0; l < res_desc->Columns; ++l)
2163 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2166 ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2168 else
2170 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
2171 i, res_full_name, hr, D3DERR_INVALIDCALL);
2173 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2174 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2177 /* SetMatrix */
2178 fvalue = 1.33;
2179 for (l = 0; l < 16; ++l)
2181 *(input_value + l) = *(DWORD *)&fvalue;
2182 fvalue += 1.12;
2184 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2185 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2186 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2188 for (l = 0; l < 4; ++l)
2190 for (m = 0; m < 4; ++m)
2192 if (m < res_desc->Rows && l < res_desc->Columns)
2193 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2194 input_value + l + m * 4, D3DXPT_FLOAT);
2198 ok(hr == D3D_OK, "%u - %s: SetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2200 else
2202 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
2203 i, res_full_name, hr, D3DERR_INVALIDCALL);
2205 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2206 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2208 /* SetMatrixArray */
2209 for (element = 0; element < res_desc->Elements + 1; ++element)
2211 fvalue = 1.33;
2212 for (l = 0; l < element * 16; ++l)
2214 *(input_value + l) = *(DWORD *)&fvalue;
2215 fvalue += 1.12;
2217 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2218 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2219 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2221 for (n = 0; n < element; ++n)
2223 for (l = 0; l < 4; ++l)
2225 for (m = 0; m < 4; ++m)
2227 if (m < res_desc->Rows && l < res_desc->Columns)
2228 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2229 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2234 ok(hr == D3D_OK, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2236 else
2238 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
2239 i, res_full_name, hr, D3DERR_INVALIDCALL);
2241 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2242 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2245 /* SetMatrixPointerArray */
2246 for (element = 0; element < res_desc->Elements + 1; ++element)
2248 fvalue = 1.33;
2249 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2251 *(input_value + l) = *(DWORD *)&fvalue;
2252 fvalue += 1.12;
2254 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2255 for (l = 0; l < element; ++l)
2257 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2259 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
2260 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2262 for (n = 0; n < element; ++n)
2264 for (l = 0; l < 4; ++l)
2266 for (m = 0; m < 4; ++m)
2268 if (m < res_desc->Rows && l < res_desc->Columns)
2269 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2270 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2275 ok(hr == D3D_OK, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2276 i, res_full_name, hr, D3D_OK);
2278 else
2280 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2281 i, res_full_name, hr, D3DERR_INVALIDCALL);
2283 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2284 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2287 /* SetMatrixTranspose */
2288 fvalue = 1.33;
2289 for (l = 0; l < 16; ++l)
2291 *(input_value + l) = *(DWORD *)&fvalue;
2292 fvalue += 1.12;
2294 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2295 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2296 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2298 for (l = 0; l < 4; ++l)
2300 for (m = 0; m < 4; ++m)
2302 if (m < res_desc->Rows && l < res_desc->Columns)
2303 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2304 input_value + l * 4 + m, D3DXPT_FLOAT);
2308 ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2310 else
2312 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2313 i, res_full_name, hr, D3DERR_INVALIDCALL);
2315 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2316 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2318 /* SetMatrixTransposeArray */
2319 for (element = 0; element < res_desc->Elements + 1; ++element)
2321 fvalue = 1.33;
2322 for (l = 0; l < element * 16; ++l)
2324 *(input_value + l) = *(DWORD *)&fvalue;
2325 fvalue += 1.12;
2327 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2328 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2329 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2331 for (n = 0; n < element; ++n)
2333 for (l = 0; l < 4; ++l)
2335 for (m = 0; m < 4; ++m)
2337 if (m < res_desc->Rows && l < res_desc->Columns)
2338 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2339 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2344 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2346 else
2348 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2349 i, res_full_name, hr, D3DERR_INVALIDCALL);
2351 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2352 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2355 /* SetMatrixTransposePointerArray */
2356 for (element = 0; element < res_desc->Elements + 1; ++element)
2358 fvalue = 1.33;
2359 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2361 *(input_value + l) = *(DWORD *)&fvalue;
2362 fvalue += 1.12;
2364 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2365 for (l = 0; l < element; ++l)
2367 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2369 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
2370 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2372 for (n = 0; n < element; ++n)
2374 for (l = 0; l < 4; ++l)
2376 for (m = 0; m < 4; ++m)
2378 if (m < res_desc->Rows && l < res_desc->Columns)
2379 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2380 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2385 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2386 i, res_full_name, hr, D3D_OK);
2388 else
2390 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2391 i, res_full_name, hr, D3DERR_INVALIDCALL);
2393 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2394 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2398 count = effect->lpVtbl->Release(effect);
2399 ok(!count, "Release failed %u\n", count);
2403 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2405 static const char expected_string[] = "test_string_1";
2406 static const char expected_string2[] = "test_longer_string_2";
2407 static const char *expected_string_array[] = {expected_string, expected_string2};
2408 const char *string_array[ARRAY_SIZE(expected_string_array)];
2409 const char *string, *string2;
2410 IDirect3DTexture9 *texture_set;
2411 IDirect3DTexture9 *texture;
2412 D3DXHANDLE parameter;
2413 ID3DXEffect *effect;
2414 unsigned int i;
2415 ULONG count;
2416 HRESULT hr;
2418 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2419 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2420 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2422 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2423 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2425 texture = NULL;
2426 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2427 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2428 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2429 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2430 texture_set = NULL;
2431 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2432 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2433 ok(texture == texture_set, "Texture does not match.\n");
2435 count = IDirect3DTexture9_Release(texture_set);
2436 ok(count == 2, "Got reference count %u, expected 2.\n", count);
2437 texture_set = NULL;
2438 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2439 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2440 count = IDirect3DTexture9_Release(texture);
2441 ok(!count, "Got reference count %u, expected 0.\n", count);
2443 hr = effect->lpVtbl->SetString(effect, "s", expected_string);
2444 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2445 string = NULL;
2446 hr = effect->lpVtbl->GetString(effect, "s", &string);
2447 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2448 hr = effect->lpVtbl->GetString(effect, "s", &string2);
2449 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2451 ok(string != expected_string, "String pointers are the same.\n");
2452 ok(string == string2, "String pointers differ.\n");
2453 ok(!strcmp(string, expected_string), "Unexpected string '%s'.\n", string);
2455 string = expected_string2;
2456 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) - 1);
2457 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
2458 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string));
2459 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2460 hr = effect->lpVtbl->SetValue(effect, "s", &string, sizeof(string) * 2);
2461 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2462 string = NULL;
2463 hr = effect->lpVtbl->GetValue(effect, "s", &string, sizeof(string));
2464 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2466 ok(string != expected_string2, "String pointers are the same.\n");
2467 ok(!strcmp(string, expected_string2), "Unexpected string '%s'.\n", string);
2469 hr = effect->lpVtbl->SetValue(effect, "s_2", expected_string_array,
2470 sizeof(expected_string_array));
2471 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2472 hr = effect->lpVtbl->GetValue(effect, "s_2", string_array,
2473 sizeof(string_array));
2474 ok(hr == D3D_OK, "Got result %#x.\n", hr);
2475 for (i = 0; i < ARRAY_SIZE(expected_string_array); ++i)
2477 ok(!strcmp(string_array[i], expected_string_array[i]), "Unexpected string '%s', i %u.\n",
2478 string_array[i], i);
2480 effect->lpVtbl->Release(effect);
2484 * fxc.exe /Tfx_2_0
2486 #if 0
2487 float a = 2.1;
2488 float b[1];
2489 float c <float d = 3;>;
2490 struct {float e;} f;
2491 float g <float h[1] = {3};>;
2492 struct s {float j;};
2493 float i <s k[1] = {4};>;
2494 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2495 #endif
2496 static const DWORD test_effect_variable_names_blob[] =
2498 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2499 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2500 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2501 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2502 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2503 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2504 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2505 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2506 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2507 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2508 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2509 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2510 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2511 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2512 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2513 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2514 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2515 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2516 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2517 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2518 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2519 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2520 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2521 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2522 0x000001f4, 0x00000000, 0x00000000,
2525 static void test_effect_variable_names(IDirect3DDevice9 *device)
2527 ID3DXEffect *effect;
2528 ULONG count;
2529 HRESULT hr;
2530 D3DXHANDLE parameter, p;
2532 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2533 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2534 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2537 * check invalid calls
2538 * This will crash:
2539 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2541 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2542 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2544 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2545 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2547 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2548 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2550 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2551 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2553 /* float a; */
2554 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2555 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2557 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2558 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2560 /* members */
2561 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2562 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2564 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2565 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2567 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2568 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2570 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2571 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2573 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2574 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2576 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2577 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2579 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2580 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2582 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2583 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2585 /* elements */
2586 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2587 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2589 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2590 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2592 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2593 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2595 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2596 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2598 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2599 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2601 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2602 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2604 /* annotations */
2605 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2606 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2608 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2609 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2611 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2612 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2614 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2615 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2617 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2618 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2620 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2621 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2623 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2624 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2626 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2627 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2629 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2630 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2632 /* float b[1]; */
2633 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2634 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2636 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2637 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2639 /* elements */
2640 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2641 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2643 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2644 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2646 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2647 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2649 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2650 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2652 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2653 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2655 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2656 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2658 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2659 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2661 /* float c <float d = 3;>; */
2662 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2663 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2665 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2666 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2668 /* annotations */
2669 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2670 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2672 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2673 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2675 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2676 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2678 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2679 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2681 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2682 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2684 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2685 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2687 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2688 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2690 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2691 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2693 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2694 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2696 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2697 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2699 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2700 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2702 /* struct {float e;} f; */
2703 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2704 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2706 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2707 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2709 /* members */
2710 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2711 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2713 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2714 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2716 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2717 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2719 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2720 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2722 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2723 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2725 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2726 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2728 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2729 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2731 /* float g <float h[1] = {3};>; */
2732 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2733 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2735 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2736 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2738 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2739 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2741 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2742 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2744 /* struct s {float j;}; float i <s k[1] = {4};>; */
2745 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2746 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2748 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2749 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2751 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2752 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2754 /* technique t <s l[1] = {5};> */
2755 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2756 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2758 /* pass p <s m[1] = {6};> */
2759 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2760 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2762 count = effect->lpVtbl->Release(effect);
2763 ok(!count, "Release failed %u\n", count);
2766 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2768 ID3DXEffect *effect;
2769 ID3DXBuffer *compilation_errors;
2770 HRESULT hr;
2772 /* Test binary effect */
2773 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2774 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2775 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
2776 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2778 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2779 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2780 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2781 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2782 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2783 effect->lpVtbl->Release(effect);
2787 * fxc.exe /Tfx_2_0
2789 #if 0
2790 vertexshader vs_arr1[2] =
2794 vs_1_1
2795 def c0, 1, 1, 1, 1
2796 mov oPos, c0
2800 vs_2_0
2801 def c0, 2, 2, 2, 2
2802 mov oPos, c0
2806 sampler sampler1 =
2807 sampler_state
2809 MipFilter = LINEAR;
2812 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};
2813 technique tech0
2815 pass p0
2817 vertexshader = vs_arr1[1];
2818 VertexShaderConstant1[3] = {2,2,2,2};
2819 BlendOp = 2;
2820 AlphaOp[3] = 4;
2821 ZEnable = true;
2822 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};
2823 ViewTransform=(camera);
2824 LightEnable[2] = TRUE;
2825 LightType[2] = POINT;
2826 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2827 Sampler[1] = sampler1;
2830 #endif
2831 static const DWORD test_effect_states_effect_blob[] =
2833 0xfeff0901, 0x000002e8, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2834 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2835 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2836 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2837 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2838 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2839 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2840 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2841 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40000000, 0x40000000,
2842 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2843 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2844 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2845 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2846 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2847 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2848 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2849 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2850 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2851 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2852 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2853 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2854 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2855 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2856 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2857 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2858 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x000002dc, 0x00000000, 0x00000001, 0x000002d4,
2859 0x00000000, 0x0000000b, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000003,
2860 0x00000120, 0x00000110, 0x0000004b, 0x00000000, 0x00000140, 0x0000013c, 0x0000006b, 0x00000003,
2861 0x00000160, 0x0000015c, 0x00000000, 0x00000000, 0x00000180, 0x0000017c, 0x0000007d, 0x00000001,
2862 0x000001dc, 0x0000019c, 0x0000007c, 0x00000000, 0x00000238, 0x000001f8, 0x00000091, 0x00000002,
2863 0x00000258, 0x00000254, 0x00000084, 0x00000002, 0x00000278, 0x00000274, 0x00000088, 0x00000002,
2864 0x000002a0, 0x00000294, 0x000000b2, 0x00000001, 0x000002c0, 0x000002bc, 0x00000002, 0x00000003,
2865 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
2866 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200,
2867 0x05000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x02000001, 0xc00f0000,
2868 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000000a, 0x00000001, 0x00000009,
2869 0x706d6173, 0x3172656c, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000006, 0x00000000,
2870 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443, 0x0000001c, 0x0000008b, 0x46580200, 0x00000001,
2871 0x0000001c, 0x20000100, 0x00000088, 0x00000030, 0x00000002, 0x00000004, 0x00000038, 0x00000048,
2872 0x656d6163, 0xab006172, 0x00030003, 0x00040004, 0x00000001, 0x00000000, 0x40800000, 0x00000000,
2873 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2874 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369,
2875 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2876 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
2877 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
2878 0x00000000, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
2879 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000004,
2880 0x00000008, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000004,
2881 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
2882 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272, 0x00005d31,
2884 #define TEST_EFFECT_STATES_VSHADER_POS 271
2886 static void test_effect_states(IDirect3DDevice9 *device)
2888 D3DMATRIX test_mat =
2890 -1.0f, 0.0f, 0.0f, 0.0f,
2891 0.0f, 0.0f, 0.0f, 0.0f,
2892 0.0f, 0.0f, 0.0f, 0.0f,
2893 0.0f, 0.0f, 0.0f, 0.0f
2894 }}};
2895 D3DMATRIX test_mat_camera =
2897 4.0f, 0.0f, 0.0f, 0.0f,
2898 0.0f, 0.0f, 0.0f, 0.0f,
2899 0.0f, 0.0f, 0.0f, 0.0f,
2900 0.0f, 0.0f, 0.0f, 6.0f
2901 }}};
2902 D3DMATRIX test_mat_world1 =
2904 2.0f, 0.0f, 0.0f, 0.0f,
2905 0.0f, 0.0f, 0.0f, 0.0f,
2906 0.0f, 0.0f, 0.0f, 0.0f,
2907 0.0f, 0.0f, 0.0f, 4.0f
2908 }}};
2909 D3DMATRIX mat;
2910 HRESULT hr;
2911 ID3DXEffect *effect;
2912 UINT npasses;
2913 DWORD value;
2914 IDirect3DVertexShader9 *vshader;
2915 void *byte_code;
2916 UINT byte_code_size;
2917 BOOL bval;
2918 D3DLIGHT9 light;
2919 float float_data[4];
2921 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
2922 NULL, NULL, 0, NULL, &effect, NULL);
2923 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2925 /* State affected in passes saved/restored even if no pass
2926 was performed. States not present in passes are not saved &
2927 restored */
2928 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
2929 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2930 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
2931 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2933 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2934 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2935 ok(npasses == 1, "Expected 1 pass, got %u\n", npasses);
2937 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
2938 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2939 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
2940 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2942 hr = effect->lpVtbl->End(effect);
2943 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2945 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2946 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2947 ok(value == 1, "Got result %u, expected %u.\n", value, 1);
2948 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
2949 ok(value == 2, "Got result %u, expected %u.\n", value, 2);
2951 /* Test states application in BeginPass. No states are restored
2952 on EndPass. */
2953 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
2954 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2955 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
2956 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2958 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
2959 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2960 if (hr == D3D_OK)
2961 ok(!bval, "Got result %u, expected 0.\n", bval);
2963 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
2964 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2965 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2967 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2968 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2969 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
2971 hr = effect->lpVtbl->BeginPass(effect, 0);
2972 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2974 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2975 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2976 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
2978 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
2979 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2980 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
2982 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2983 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2984 ok(value == 2, "Got result %u, expected %u\n", value, 2);
2986 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
2987 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2988 ok(vshader != NULL, "Got NULL vshader.\n");
2989 if (vshader)
2991 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
2992 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2993 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
2994 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
2995 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2996 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
2997 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
2998 "Incorrect shader selected.\n");
2999 HeapFree(GetProcessHeap(), 0, byte_code);
3000 IDirect3DVertexShader9_Release(vshader);
3003 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3004 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3005 if (hr == D3D_OK)
3006 ok(bval, "Got result %u, expected TRUE.\n", bval);
3007 hr = IDirect3DDevice9_GetLight(device, 2, &light);
3008 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3009 if (hr == D3D_OK)
3010 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
3011 "Got unexpected light position (%f, %f, %f).\n", light.Position.x, light.Position.y, light.Position.z);
3012 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, float_data, 1);
3013 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3014 ok(float_data[0] == 2.0f && float_data[1] == 2.0f && float_data[2] == 2.0f && float_data[3] == 2.0f,
3015 "Got unexpected vertex shader floats: (%f %f %f %f).\n",
3016 float_data[0], float_data[1], float_data[2], float_data[3]);
3018 hr = effect->lpVtbl->EndPass(effect);
3019 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3020 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3021 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3022 ok(value == 2, "Got result %u, expected %u\n", value, 2);
3024 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
3025 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3026 ok(value, "Got result %u, expected TRUE.\n", value);
3028 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
3029 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3030 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %u.\n", value);
3032 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
3033 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3034 ok(value == 4, "Unexpected texture stage 3 AlphaOp %u.\n", value);
3036 hr = effect->lpVtbl->End(effect);
3037 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3039 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
3040 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3041 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
3043 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
3044 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3045 if (hr == D3D_OK)
3046 ok(!bval, "Got result %u, expected 0.\n", bval);
3048 /* State is not restored if effect is released without End call */
3049 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
3050 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3052 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3053 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3055 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3056 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3058 effect->lpVtbl->Release(effect);
3060 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3061 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3062 ok(value == 3, "Got result %u, expected %u.\n", value, 1);
3066 * fxc.exe /Tfx_2_0
3068 #if 0
3069 float4 g_Pos1;
3070 float4 g_Pos2;
3071 float4 g_Selector[3] = {{0, 0, 0, 0}, {10, 10, 10, 10}, {5001, 5002, 5003, 5004}};
3073 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3074 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3075 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3077 float4 vect_sampler = {1, 2, 3, 4};
3079 float3 vec3 = {1001, 1002, 1003};
3081 int4 g_iVect = {4, 3, 2, 1};
3083 vertexshader vs_arr[3] =
3087 vs_1_0
3088 def c0, 1, 1, 1, 1
3089 mov oPos, c0
3093 vs_1_1
3094 def c0, 2, 2, 2, 2
3095 mov oPos, c0
3099 vs_2_0
3100 def c0, 3, 3, 3, 3
3101 mov oPos, c0
3105 float4x4 m4x4 = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}, {41, 42, 43, 44}};
3107 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3108 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3109 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3110 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3111 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3112 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3113 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3114 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3115 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3116 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3118 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3119 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3121 struct test_struct
3123 float3 v1;
3124 float fv;
3125 float4 v2;
3128 struct struct_array
3130 test_struct ts[2];
3133 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3134 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3135 struct_array ts3 = {{{1, 2, 3}, 4, {5, 6, 7, 8}}, {{9, 10, 11}, 12, {13, 14, 15, 16}}};
3137 float arr1[1] = {91};
3138 shared float arr2[2] = {92, 93};
3140 Texture2D tex1;
3141 Texture2D tex2;
3142 sampler sampler1 =
3143 sampler_state
3145 Texture = tex1;
3146 MinFilter = g_iVect.y;
3147 MagFilter = vect_sampler.x + vect_sampler.y;
3150 struct VS_OUTPUT
3152 float4 Position : POSITION;
3153 float2 TextureUV : TEXCOORD0;
3154 float4 Diffuse : COLOR0;
3156 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3157 float3 vNormal : NORMAL,
3158 float2 vTexCoord0 : TEXCOORD0,
3159 uniform int nNumLights,
3160 uniform bool bTexture)
3162 VS_OUTPUT Output;
3164 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3165 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3166 else
3167 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3168 Output.TextureUV = float2(0, 0);
3169 Output.Diffuse = 0;
3170 Output.Diffuse.xyz = mul(vPos, m4x3column);
3171 Output.Diffuse += mul(vPos, m3x4column);
3172 Output.Diffuse += mul(vPos, m3x4row);
3173 Output.Diffuse.xyz += mul(vPos, m4x3row);
3174 Output.Diffuse += mul(vPos, ts1[0].fv);
3175 Output.Diffuse += mul(vPos, ts1[0].v2);
3176 Output.Diffuse += mul(vPos, ts2[1].fv);
3177 Output.Diffuse += mul(vPos, ts2[1].v2);
3178 Output.Diffuse += mul(vPos, arr1[0]);
3179 Output.Diffuse += mul(vPos, arr2[1]);
3180 Output.Diffuse += mul(vPos, ts3.ts[1].fv);
3181 Output.Diffuse += mul(vPos, ts3.ts[1].v2);
3182 Output.Diffuse += tex2Dlod(sampler1, g_Pos1);
3183 return Output;
3186 VS_OUTPUT RenderSceneVS2(float4 vPos : POSITION)
3188 VS_OUTPUT Output;
3190 Output.Position = g_Pos1;
3191 Output.TextureUV = float2(0, 0);
3192 Output.Diffuse = 0;
3193 return Output;
3196 struct PS_OUTPUT
3198 float4 RGBColor : COLOR0; /* Pixel color */
3200 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3202 PS_OUTPUT Output;
3203 int i;
3205 Output.RGBColor = In.Diffuse;
3206 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3207 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3208 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3209 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3210 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3211 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3212 for (i = 0; i < g_iVect.x; ++i)
3213 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3214 if (mb[1][1])
3216 Output.RGBColor += sin(Output.RGBColor);
3217 Output.RGBColor += cos(Output.RGBColor);
3218 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3219 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3220 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3221 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3223 if (mb2x3column[0][1])
3225 Output.RGBColor += sin(Output.RGBColor);
3226 Output.RGBColor += cos(Output.RGBColor);
3227 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3228 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3229 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3230 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3232 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3233 return Output;
3236 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3237 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3239 technique tech0
3241 pass p0
3243 VertexShader = vs_arr2[g_iVect.w - 1];
3244 PixelShader = ps_arr[g_iVect.w - 1];
3246 LightEnable[0] = TRUE;
3247 LightEnable[1] = TRUE;
3248 LightEnable[2] = TRUE;
3249 LightEnable[3] = TRUE;
3250 LightEnable[4] = TRUE;
3251 LightEnable[5] = TRUE;
3252 LightEnable[6] = TRUE;
3253 LightEnable[7] = TRUE;
3254 LightType[0] = POINT;
3255 LightType[1] = POINT;
3256 LightType[2] = POINT;
3257 LightType[3] = POINT;
3258 LightType[4] = POINT;
3259 LightType[5] = POINT;
3260 LightType[6] = POINT;
3261 LightType[7] = POINT;
3262 LightDiffuse[0] = 1 / opvect1;
3263 LightDiffuse[1] = rsqrt(opvect1);
3264 LightDiffuse[2] = opvect1 * opvect2;
3265 LightDiffuse[3] = opvect1 + opvect2;
3266 LightDiffuse[4] = float4(opvect1 < opvect2);
3267 LightDiffuse[5] = float4(opvect1 >= opvect2);
3268 LightDiffuse[6] = -opvect1;
3269 LightDiffuse[7] = rcp(opvect1);
3271 LightAmbient[0] = frac(opvect1);
3272 LightAmbient[1] = min(opvect1, opvect2);
3273 LightAmbient[2] = max(opvect1, opvect2);
3274 LightAmbient[3] = sin(opvect1);
3275 LightAmbient[4] = cos(opvect1);
3276 LightAmbient[5] = 1e-2 / opvect1;
3277 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3278 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3280 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3281 dot(opvect1.zzzx, opvect2.xxyy), 0);
3282 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3283 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3284 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3285 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3286 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3288 FogEnable = TRUE;
3289 FogDensity = ts2[0].fv;
3290 FogStart = ts2[1].fv;
3291 PointScale_A = ts3.ts[0].fv;
3292 PointScale_B = ts3.ts[1].fv;
3294 pass p1
3296 VertexShader = vs_arr[g_iVect.z];
3299 #endif
3300 static const DWORD test_effect_preshader_effect_blob[] =
3302 0xfeff0901, 0x00001070, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3303 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3304 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3305 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3306 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3307 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3308 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3309 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3310 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3311 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3312 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3313 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3314 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3315 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3316 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3317 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3318 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3319 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3320 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3321 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3322 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3323 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3324 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3325 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3326 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3327 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3328 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3329 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3330 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3331 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3332 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3333 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3334 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3335 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3336 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3337 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3338 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3339 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3340 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3341 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3342 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3343 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3344 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3345 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3346 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3347 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3348 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3349 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3350 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3351 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3352 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3353 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3354 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3355 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3356 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3357 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3358 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3359 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3360 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3361 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3362 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3363 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3364 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3365 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3366 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3367 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3368 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3369 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3370 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3371 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3372 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3373 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3374 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3375 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3376 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3377 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3378 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3379 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3380 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3381 0x00000000, 0x00000010, 0x00000004, 0x000009f8, 0x00000000, 0x00000002, 0x00000007, 0x00000008,
3382 0x00000008, 0x615f7376, 0x00327272, 0x0000000f, 0x00000004, 0x00000a1c, 0x00000000, 0x00000001,
3383 0x00000009, 0x00000007, 0x615f7370, 0x00007272, 0x0000000a, 0x00000010, 0x00000004, 0x00000000,
3384 0x00000000, 0x00000000, 0x0000000b, 0x0000000f, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3385 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3386 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3387 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3388 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3389 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3390 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3391 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3392 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3393 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3394 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3395 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3396 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3397 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3398 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3399 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3400 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3401 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3402 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3403 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3404 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3405 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3406 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3407 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3408 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3409 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3410 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3411 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3412 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3413 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3414 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3415 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3416 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3417 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3418 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3419 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3420 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3421 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3422 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3423 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3424 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3425 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3426 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3427 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3428 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3429 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3430 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3431 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3432 0x00000001, 0x00000003, 0x00003070, 0x0000000c, 0x00000010, 0x00000004, 0x00000000, 0x00000000,
3433 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574, 0x00000030, 0x00000021, 0x00000001,
3434 0x0000000c, 0x0000000d, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058,
3435 0x00000000, 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x000000d0, 0x000000ec,
3436 0x00000000, 0x00000000, 0x00000108, 0x00000124, 0x00000000, 0x00000000, 0x00000140, 0x0000015c,
3437 0x00000000, 0x00000000, 0x00000178, 0x00000194, 0x00000000, 0x00000000, 0x000001b8, 0x000001d4,
3438 0x00000000, 0x00000000, 0x000001ec, 0x00000208, 0x00000000, 0x00000000, 0x00000224, 0x00000238,
3439 0x00000000, 0x00000000, 0x00000250, 0x0000026c, 0x00000000, 0x00000000, 0x000002b8, 0x000002d4,
3440 0x00000000, 0x00000000, 0x00000310, 0x0000032c, 0x00000000, 0x00000000, 0x00000368, 0x00000384,
3441 0x00000000, 0x00000000, 0x000003c4, 0x000003e0, 0x00000000, 0x00000000, 0x00000420, 0x0000043c,
3442 0x00000000, 0x00000000, 0x00000458, 0x00000474, 0x00000000, 0x00000000, 0x00000494, 0x000004b0,
3443 0x00000000, 0x00000000, 0x000004d4, 0x000004f0, 0x00000000, 0x00000000, 0x00000518, 0x00000534,
3444 0x00000000, 0x00000000, 0x00000558, 0x00000574, 0x00000000, 0x00000000, 0x0000059c, 0x000005b8,
3445 0x00000000, 0x00000000, 0x000005e0, 0x000005fc, 0x00000000, 0x00000000, 0x00000624, 0x00000690,
3446 0x00000000, 0x00000000, 0x000006d0, 0x0000073c, 0x00000001, 0x00000000, 0x0000079c, 0x00000820,
3447 0x00000000, 0x00000000, 0x00000888, 0x000008a4, 0x00000000, 0x00000000, 0x000008b4, 0x000008d0,
3448 0x00000001, 0x00000000, 0x000008e4, 0x000008f8, 0x00000000, 0x00000000, 0x00000908, 0x0000091c,
3449 0x00000000, 0x00000000, 0x0000092c, 0x00000998, 0x00000000, 0x00000000, 0x000009dc, 0x000009f0,
3450 0x00000001, 0x00000000, 0x00000a04, 0x00000a18, 0x00000000, 0x00000000, 0x00001064, 0x00000000,
3451 0x00000002, 0x0000103c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000a2c, 0x00000a28,
3452 0x00000093, 0x00000000, 0x00000a44, 0x00000a40, 0x00000091, 0x00000000, 0x00000a5c, 0x00000a58,
3453 0x00000091, 0x00000001, 0x00000a7c, 0x00000a78, 0x00000091, 0x00000002, 0x00000a9c, 0x00000a98,
3454 0x00000091, 0x00000003, 0x00000abc, 0x00000ab8, 0x00000091, 0x00000004, 0x00000adc, 0x00000ad8,
3455 0x00000091, 0x00000005, 0x00000afc, 0x00000af8, 0x00000091, 0x00000006, 0x00000b1c, 0x00000b18,
3456 0x00000091, 0x00000007, 0x00000b3c, 0x00000b38, 0x00000084, 0x00000000, 0x00000b5c, 0x00000b58,
3457 0x00000084, 0x00000001, 0x00000b7c, 0x00000b78, 0x00000084, 0x00000002, 0x00000b9c, 0x00000b98,
3458 0x00000084, 0x00000003, 0x00000bbc, 0x00000bb8, 0x00000084, 0x00000004, 0x00000bdc, 0x00000bd8,
3459 0x00000084, 0x00000005, 0x00000bfc, 0x00000bf8, 0x00000084, 0x00000006, 0x00000c1c, 0x00000c18,
3460 0x00000084, 0x00000007, 0x00000c3c, 0x00000c38, 0x00000085, 0x00000000, 0x00000c68, 0x00000c58,
3461 0x00000085, 0x00000001, 0x00000c94, 0x00000c84, 0x00000085, 0x00000002, 0x00000cc0, 0x00000cb0,
3462 0x00000085, 0x00000003, 0x00000cec, 0x00000cdc, 0x00000085, 0x00000004, 0x00000d18, 0x00000d08,
3463 0x00000085, 0x00000005, 0x00000d44, 0x00000d34, 0x00000085, 0x00000006, 0x00000d70, 0x00000d60,
3464 0x00000085, 0x00000007, 0x00000d9c, 0x00000d8c, 0x00000087, 0x00000000, 0x00000dc8, 0x00000db8,
3465 0x00000087, 0x00000001, 0x00000df4, 0x00000de4, 0x00000087, 0x00000002, 0x00000e20, 0x00000e10,
3466 0x00000087, 0x00000003, 0x00000e4c, 0x00000e3c, 0x00000087, 0x00000004, 0x00000e78, 0x00000e68,
3467 0x00000087, 0x00000005, 0x00000ea4, 0x00000e94, 0x00000087, 0x00000006, 0x00000ed0, 0x00000ec0,
3468 0x00000087, 0x00000007, 0x00000efc, 0x00000eec, 0x00000086, 0x00000000, 0x00000f28, 0x00000f18,
3469 0x00000086, 0x00000001, 0x00000f54, 0x00000f44, 0x00000086, 0x00000002, 0x00000f80, 0x00000f70,
3470 0x0000000e, 0x00000000, 0x00000fa0, 0x00000f9c, 0x00000014, 0x00000000, 0x00000fc0, 0x00000fbc,
3471 0x00000012, 0x00000000, 0x00000fe0, 0x00000fdc, 0x00000041, 0x00000000, 0x00001000, 0x00000ffc,
3472 0x00000042, 0x00000000, 0x00001020, 0x0000101c, 0x0000105c, 0x00000000, 0x00000001, 0x00000092,
3473 0x00000000, 0x00001048, 0x00001044, 0x00000008, 0x0000001d, 0x00000009, 0x00000a70, 0xffff0300,
3474 0x00ccfffe, 0x42415443, 0x0000001c, 0x000002fb, 0xffff0300, 0x0000000a, 0x0000001c, 0x00000000,
3475 0x000002f4, 0x000000e4, 0x00000001, 0x00000001, 0x000000ec, 0x000000fc, 0x0000010c, 0x00080002,
3476 0x00000002, 0x00000118, 0x00000128, 0x00000148, 0x00060002, 0x00000002, 0x00000150, 0x00000160,
3477 0x00000180, 0x00000002, 0x00000003, 0x0000018c, 0x0000019c, 0x000001cc, 0x000a0002, 0x00000002,
3478 0x000001d4, 0x000001e4, 0x00000204, 0x000c0002, 0x00000002, 0x00000210, 0x00000220, 0x00000240,
3479 0x00030002, 0x00000003, 0x00000248, 0x00000258, 0x00000288, 0x00050000, 0x00000002, 0x00000294,
3480 0x000002a4, 0x000002bc, 0x00000000, 0x00000005, 0x000002c8, 0x000002a4, 0x000002d8, 0x00000003,
3481 0x00000001, 0x000002e4, 0x00000000, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001,
3482 0x00000000, 0x00000004, 0x00000003, 0x00000002, 0x00000001, 0x3278326d, 0x756c6f63, 0xab006e6d,
3483 0x00030003, 0x00020002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000,
3484 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002,
3485 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000,
3486 0x00000000, 0x00000000, 0x3378326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001,
3487 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3488 0x00000000, 0x41500000, 0x41b80000, 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002,
3489 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000,
3490 0x41b00000, 0x41b80000, 0x00000000, 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003,
3491 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000,
3492 0x42000000, 0x00000000, 0x3278336d, 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000,
3493 0x41300000, 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000,
3494 0x41f80000, 0x42000000, 0x00000000, 0x00000000, 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00010003,
3495 0x00030002, 0x00000001, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff,
3496 0xffffffff, 0x7832626d, 0x776f7233, 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000,
3497 0x706d6173, 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000, 0x335f7370,
3498 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3499 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4,
3500 0xbf000000, 0x3f800000, 0xbe22f983, 0x05000051, 0xa00f000f, 0x40c90fdb, 0xc0490fdb, 0xb4878163,
3501 0x37cfb5a1, 0x05000051, 0xa00f0010, 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x0200001f,
3502 0x80000005, 0x90030000, 0x0200001f, 0x8000000a, 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800,
3503 0x03000005, 0x80030000, 0xa0e40007, 0x90550001, 0x04000004, 0x80030000, 0x90000001, 0xa0e40006,
3504 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40001, 0x02000001, 0x80010001, 0xa0000010,
3505 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3506 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000,
3507 0xa0440004, 0x90550001, 0x04000004, 0x800c0000, 0x90000001, 0xa0440003, 0x80e40000, 0x04000004,
3508 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000,
3509 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d,
3510 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, 0x90550001,
3511 0x04000004, 0x800e0001, 0x90000001, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001,
3512 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000,
3513 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002,
3514 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, 0x02000001,
3515 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000, 0x03000002, 0x80070003, 0x80e40002, 0x80e40003,
3516 0x00000027, 0x01000028, 0xe0e40804, 0x02000001, 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000,
3517 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000,
3518 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004,
3519 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002,
3520 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002,
3521 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003,
3522 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e,
3523 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, 0xa000000f,
3524 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002,
3525 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010, 0x04000004,
3526 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004,
3527 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003,
3528 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a,
3529 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002,
3530 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x800e0001, 0x80550000,
3531 0xa090000b, 0x04000004, 0x800e0001, 0x80000000, 0xa090000a, 0x80e40001, 0x03000002, 0x80070003,
3532 0x80e40000, 0x80f90001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000,
3533 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000,
3534 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000, 0x04000004,
3535 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000,
3536 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001, 0x0000002b, 0x01000028, 0xe0e40806, 0x04000004,
3537 0x800f0000, 0x80e40003, 0xa0550010, 0xa0aa0010, 0x02000013, 0x800f0000, 0x80e40000, 0x04000004,
3538 0x800f0000, 0x80e40000, 0xa000000f, 0xa055000f, 0x03000005, 0x800f0000, 0x80e40000, 0x80e40000,
3539 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3540 0x80e40002, 0xa0ff0010, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa000000e, 0x04000004,
3541 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40000, 0x80e40002,
3542 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e, 0x04000004, 0x800f0002, 0x80e40000,
3543 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3544 0xa000000f, 0xa055000f, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0004,
3545 0x80e40002, 0xa0aa000f, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa0ff0010,
3546 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40002,
3547 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002, 0x80e40004, 0x80e40000, 0x03000002,
3548 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000, 0x80e40003, 0xa0e40000, 0x80000001,
3549 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040000, 0x80e40003,
3550 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40003, 0x03000005, 0x80070001,
3551 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000, 0xa0e4000a, 0x80e40001, 0x03000002,
3552 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000, 0x80e40003, 0xa0e4000c, 0x03000008,
3553 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40003, 0x03000005,
3554 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000, 0x80000000, 0xa0440003, 0x80e40000,
3555 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000, 0x03000002, 0x80030003, 0x80ee0000,
3556 0x80e40000, 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0800,
3557 0x80e40000, 0x80e40003, 0x0000ffff, 0x00000007, 0x00000b0c, 0xfffe0300, 0x012ffffe, 0x42415443,
3558 0x0000001c, 0x00000487, 0xfffe0300, 0x0000000b, 0x0000001c, 0x00000000, 0x00000480, 0x000000f8,
3559 0x00200002, 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x001d0002, 0x00000002, 0x00000128,
3560 0x00000138, 0x00000158, 0x001f0002, 0x00000001, 0x00000160, 0x00000170, 0x00000180, 0x00100002,
3561 0x00000004, 0x0000018c, 0x0000019c, 0x000001dc, 0x00140002, 0x00000003, 0x000001e4, 0x000001f4,
3562 0x00000224, 0x00170002, 0x00000003, 0x00000230, 0x00000240, 0x00000270, 0x000c0002, 0x00000004,
3563 0x00000278, 0x00000288, 0x000002c8, 0x00000003, 0x00000001, 0x000002d4, 0x00000000, 0x000002e4,
3564 0x001a0002, 0x00000003, 0x0000033c, 0x0000034c, 0x0000037c, 0x00000002, 0x00000006, 0x00000380,
3565 0x00000390, 0x000003f0, 0x00060002, 0x00000006, 0x00000410, 0x00000420, 0x31727261, 0xababab00,
3566 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000,
3567 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000,
3568 0x00000000, 0x00000000, 0x42ba0000, 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173,
3569 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3570 0x3478336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000,
3571 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000,
3572 0x41b80000, 0x42040000, 0x00000000, 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d,
3573 0x00776f72, 0x00030002, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000,
3574 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3575 0x42080000, 0x3378346d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000,
3576 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000,
3577 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004,
3578 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000,
3579 0x41b80000, 0x00000000, 0x41f80000, 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000,
3580 0x422c0000, 0x00000000, 0x706d6173, 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001,
3581 0x00000000, 0x00317374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3582 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3583 0x00000000, 0x000002e8, 0x000002ec, 0x000002fc, 0x00000300, 0x00000310, 0x00000314, 0x00000005,
3584 0x00080001, 0x00030001, 0x00000324, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000,
3585 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374,
3586 0x00000005, 0x00080001, 0x00030002, 0x00000324, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3587 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3588 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000,
3589 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001,
3590 0x00030002, 0x00000324, 0x000003f4, 0x000003f8, 0x00000005, 0x00100001, 0x00010001, 0x00000408,
3591 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000,
3592 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000,
3593 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000,
3594 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3595 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250,
3596 0x46580201, 0x0047fffe, 0x42415443, 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c,
3597 0x00000100, 0x000000e4, 0x00000058, 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
3598 0x00030002, 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4,
3599 0x000000b4, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3600 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001,
3601 0x00000000, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000,
3602 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000,
3603 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3604 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3605 0x00313131, 0x000cfffe, 0x49535250, 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3606 0x00000000, 0x00000001, 0x00000021, 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43,
3607 0x00000018, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3608 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3609 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3610 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3611 0x00000000, 0x00000000, 0x3fe00000, 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000,
3612 0x00000000, 0x00000000, 0x40100000, 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000,
3613 0x401c0000, 0x0064fffe, 0x434c5846, 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001,
3614 0x00000011, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004,
3615 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000,
3616 0x00000007, 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000,
3617 0x00000002, 0x0000000c, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000,
3618 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008,
3619 0x10100004, 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000,
3620 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
3621 0x00000000, 0x00000007, 0x0000000c, 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010,
3622 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002,
3623 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007,
3624 0x00000004, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007,
3625 0x00000008, 0x00000000, 0x00000004, 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051,
3626 0xa00f0022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000,
3627 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005,
3628 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017,
3629 0x03000009, 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019,
3630 0x03000008, 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011,
3631 0x03000008, 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013,
3632 0x02000001, 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005,
3633 0x800f0001, 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001,
3634 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000,
3635 0x80e40001, 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000,
3636 0xa0e4000c, 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004,
3637 0x80070001, 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001,
3638 0x04000004, 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000,
3639 0xa0e4001c, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000,
3640 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000,
3641 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004,
3642 0x800f0000, 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a,
3643 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000,
3644 0x80000001, 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40800, 0x03000002, 0xe00f0002, 0x80e40000,
3645 0x80e40001, 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff,
3646 0x00000008, 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300,
3647 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73,
3648 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3649 0x332e3235, 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c,
3650 0x0000005b, 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3651 0x00000001, 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001,
3652 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3653 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3654 0x332e3235, 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3655 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe,
3656 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000,
3657 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3658 0x05000051, 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000,
3659 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001,
3660 0xe00f0000, 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001,
3661 0x0000ffff, 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101,
3662 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000,
3663 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000,
3664 0x40000000, 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003,
3665 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000,
3666 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000,
3667 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443,
3668 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
3669 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
3670 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
3671 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3672 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3673 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3674 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029,
3675 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200,
3676 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4,
3677 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3678 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3679 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064,
3680 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001,
3681 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3682 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3683 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3684 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3685 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3686 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3687 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3688 0x00000000, 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe,
3689 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114,
3690 0x00000030, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031,
3691 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3692 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c,
3693 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074,
3694 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000,
3695 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3696 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3697 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369,
3698 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3699 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3700 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3701 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027,
3702 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200,
3703 0x00000001, 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088,
3704 0x00000098, 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3705 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3706 0x00000000, 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005,
3707 0x00080001, 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3708 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3709 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3710 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3711 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3712 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001,
3713 0x00000000, 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3714 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200,
3715 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3716 0x000000f8, 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176,
3717 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001,
3718 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038,
3719 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070,
3720 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3721 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000,
3722 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000,
3723 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3724 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3725 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004,
3726 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3727 0xffffffff, 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c,
3728 0x000001fb, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002,
3729 0x00000001, 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac,
3730 0x000000ec, 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001,
3731 0x000001d8, 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000,
3732 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004,
3733 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000,
3734 0x42000000, 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000,
3735 0x42080000, 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001,
3736 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001,
3737 0x00040001, 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c,
3738 0x00000120, 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005,
3739 0x00100001, 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3740 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000,
3741 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000,
3742 0x41600000, 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001,
3743 0x00000000, 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73,
3744 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3745 0x332e3235, 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000,
3746 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3747 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3748 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3749 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3750 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3751 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3752 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3753 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3754 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3755 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3756 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3757 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3758 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3759 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3760 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3761 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000,
3762 0x3ff00000, 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e,
3763 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e,
3764 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000,
3765 0x00000002, 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000,
3766 0x00000007, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001,
3767 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004,
3768 0x00000002, 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3769 0x0000003c, 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3770 0x0000002f, 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004,
3771 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001,
3772 0x00000030, 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3773 0x0000001c, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007,
3774 0x00000009, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007,
3775 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002,
3776 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3777 0x00000000, 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3778 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002,
3779 0x00000000, 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030,
3780 0x00000000, 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041,
3781 0x00000000, 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002,
3782 0x0000002f, 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031,
3783 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003,
3784 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040,
3785 0x00000000, 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000,
3786 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3787 0x00000000, 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe,
3788 0x42415443, 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130,
3789 0x0000006c, 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001,
3790 0x000000c0, 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108,
3791 0x00090002, 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3792 0x00040001, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3793 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67,
3794 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000,
3795 0x3f800000, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3796 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3797 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3798 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3799 0x332e3235, 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
3800 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3801 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3802 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3803 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3804 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3805 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3806 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3807 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3808 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3809 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3810 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000,
3811 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3812 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3813 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3814 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008,
3815 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a,
3816 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000,
3817 0x00000002, 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000,
3818 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000,
3819 0x00000002, 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000,
3820 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004,
3821 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028,
3822 0x00000001, 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001,
3823 0xa0400001, 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001,
3824 0x00000002, 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001,
3825 0x00000002, 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002,
3826 0x0000002b, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
3827 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200,
3828 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3829 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3830 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3831 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3832 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3833 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3834 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
3835 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3836 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3837 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0061fffe,
3838 0x434c5846, 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3839 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000,
3840 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001,
3841 0xa0400001, 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000,
3842 0x00000000, 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002,
3843 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3844 0x00000004, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000,
3845 0x00000004, 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3846 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3847 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002,
3848 0x00000005, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
3849 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
3850 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248,
3851 0x46580200, 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c,
3852 0x20000100, 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080,
3853 0x00010002, 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0,
3854 0x00000070, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3855 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3856 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001,
3857 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3858 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3859 0x0022fffe, 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3860 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3861 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3862 0x00000000, 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000,
3863 0x00000000, 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002,
3864 0x00000000, 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007,
3865 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002,
3866 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002,
3867 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3868 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3869 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0,
3870 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
3871 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
3872 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3873 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
3874 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
3875 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3876 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c,
3877 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3878 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3879 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3880 0x002afffe, 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3881 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002,
3882 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3883 0x00000002, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
3884 0x00000000, 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004,
3885 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f,
3886 0x00000000, 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3887 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3888 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3889 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3890 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3891 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3892 0x00000000, 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000,
3893 0x00000000, 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001,
3894 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001,
3895 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001,
3896 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001,
3897 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002,
3898 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004,
3899 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e,
3900 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3901 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3902 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3903 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3904 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3905 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001,
3906 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3907 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200,
3908 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3909 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
3910 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3911 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3912 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3913 0x000cfffe, 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
3914 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3915 0xffffffff, 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
3916 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
3917 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
3918 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3919 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3920 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3921 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3922 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004,
3923 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
3924 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3925 0x0000001b, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
3926 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
3927 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
3928 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3929 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
3930 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3931 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3932 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002,
3933 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3934 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a,
3935 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3936 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3937 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3938 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3939 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3940 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001,
3941 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3942 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200,
3943 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
3944 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463,
3945 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3946 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3947 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3948 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000,
3949 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
3950 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002,
3951 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003,
3952 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3953 0xffffffff, 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
3954 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
3955 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3956 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
3957 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3958 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
3959 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
3960 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000,
3961 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
3962 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
3963 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
3964 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
3965 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
3966 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3967 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3968 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002,
3969 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3970 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124,
3971 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
3972 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
3973 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3974 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
3975 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
3976 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3977 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3978 0x000ffffe, 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3979 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3980 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200,
3981 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3982 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3983 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3984 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3985 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3986 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3987 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
3988 0x434c5846, 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3989 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3990 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
3991 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
3992 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
3993 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3994 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
3995 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
3996 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3997 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
3998 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3999 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4000 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4001 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4002 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4003 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
4004 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4005 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4006 0x00000004, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4007 0x00000000, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4008 0x00000001, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4009 0x00000002, 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4010 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012,
4011 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4012 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4013 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
4014 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4015 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4016 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001,
4017 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001,
4018 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001,
4019 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001,
4020 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
4021 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008,
4022 0x615f7370, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
4023 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
4024 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
4025 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
4026 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
4027 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4028 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000,
4029 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002,
4030 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004,
4031 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
4032 0x00000002, 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443,
4033 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030,
4034 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001,
4035 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369,
4036 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4037 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000,
4038 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000,
4039 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846,
4040 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001,
4041 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff,
4042 0x0000001e, 0x00000000, 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443,
4043 0x0000001c, 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030,
4044 0x00000002, 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00,
4045 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000,
4046 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4047 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4048 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001,
4049 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
4050 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200,
4051 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100,
4052 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365,
4053 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000,
4054 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
4055 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4056 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001,
4057 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e,
4058 0x00000000, 0x00000000, 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4060 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2879
4061 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4063 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4064 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4065 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4066 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4068 unsigned int i = 0;
4070 todo_wine_if(todo)
4071 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4073 if (!bytecode)
4074 return;
4076 while (bytecode[i++] != 0x0000ffff)
4079 if (!bytecode_size)
4080 bytecode_size = i * sizeof(*bytecode);
4081 else
4082 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4084 todo_wine_if(todo)
4085 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4086 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4087 "Incorrect shader selected.\n");
4090 #define test_effect_preshader_compare_shader(a, b, c) \
4091 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4092 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4093 int expected_shader_index, BOOL todo)
4095 IDirect3DVertexShader9 *vshader;
4096 void *byte_code;
4097 unsigned int byte_code_size;
4098 HRESULT hr;
4100 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4101 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#x.\n", hr);
4103 todo_wine_if(todo)
4104 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4105 if (!vshader)
4106 return;
4108 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4109 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#x.\n", hr);
4110 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4112 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
4113 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4114 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4116 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4117 byte_code_size, expected_shader_index, todo);
4119 HeapFree(GetProcessHeap(), 0, byte_code);
4120 IDirect3DVertexShader9_Release(vshader);
4123 static const struct
4125 const char *comment;
4126 BOOL todo[4];
4127 unsigned int result[4];
4128 unsigned int ulps;
4130 test_effect_preshader_op_expected[] =
4132 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4133 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4134 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4135 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4136 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4137 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4138 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4139 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4141 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4142 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4143 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4144 #if __x86_64__
4145 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4146 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4147 #else
4148 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4149 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4150 #endif
4151 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4152 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4153 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4155 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4156 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4157 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4160 enum expected_state_update
4162 EXPECTED_STATE_ZERO,
4163 EXPECTED_STATE_UPDATED,
4164 EXPECTED_STATE_ANYTHING
4167 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4168 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4169 const enum expected_state_update *expected_state, const char *updated_param)
4171 static const D3DCOLORVALUE black = {0.0f};
4172 unsigned int i, j;
4173 D3DLIGHT9 light;
4174 const float *v;
4175 HRESULT hr;
4177 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4179 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4180 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4182 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4183 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4185 for (j = 0; j < 4; ++j)
4187 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4188 ok_(__FILE__, line)(compare_float(v[j],
4189 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4190 test_effect_preshader_op_expected[i].ulps),
4191 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4192 test_effect_preshader_op_expected[i].comment, j,
4193 test_effect_preshader_op_expected[i].result[j],
4194 ((const unsigned int *)v)[j], v[j]);
4197 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4199 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4200 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4201 updated_param, i, test_effect_preshader_op_expected[i].comment);
4206 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
4208 static void test_effect_preshader_clear_vconsts(IDirect3DDevice9 *device)
4210 unsigned int i;
4211 HRESULT hr;
4213 for (i = 0; i < 256; ++i)
4215 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
4216 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4220 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4222 {0.0f, 0.0f, 0.0f, 0.0f},
4223 {0.0f, 0.0f, 0.0f, 0.0f},
4224 {0.0f, 0.0f, 0.0f, 0.0f},
4225 {1.0f, 2.0f, 3.0f, 0.0f},
4226 {4.0f, 0.0f, 0.0f, 0.0f},
4227 {5.0f, 6.0f, 7.0f, 8.0f},
4228 {1.0f, 2.0f, 3.0f, 0.0f},
4229 {4.0f, 0.0f, 0.0f, 0.0f},
4230 {5.0f, 6.0f, 7.0f, 8.0f},
4231 {9.0f, 10.0f, 11.0f, 0.0f},
4232 {12.0f, 0.0f, 0.0f, 0.0f},
4233 {13.0f, 14.0f, 15.0f, 16.0f},
4234 {11.0f, 12.0f, 13.0f, 0.0f},
4235 {21.0f, 22.0f, 23.0f, 0.0f},
4236 {31.0f, 32.0f, 33.0f, 0.0f},
4237 {41.0f, 42.0f, 43.0f, 0.0f},
4238 {11.0f, 21.0f, 31.0f, 0.0f},
4239 {12.0f, 22.0f, 32.0f, 0.0f},
4240 {13.0f, 23.0f, 33.0f, 0.0f},
4241 {14.0f, 24.0f, 34.0f, 0.0f},
4242 {11.0f, 12.0f, 13.0f, 14.0f},
4243 {21.0f, 22.0f, 23.0f, 24.0f},
4244 {31.0f, 32.0f, 33.0f, 34.0f},
4245 {11.0f, 21.0f, 31.0f, 41.0f},
4246 {12.0f, 22.0f, 32.0f, 42.0f},
4247 {13.0f, 23.0f, 33.0f, 43.0f},
4248 {9.0f, 10.0f, 11.0f, 0.0f},
4249 {12.0f, 0.0f, 0.0f, 0.0f},
4250 {13.0f, 14.0f, 15.0f, 16.0f},
4251 {92.0f, 0.0f, 0.0f, 0.0f},
4252 {93.0f, 0.0f, 0.0f, 0.0f},
4253 {0.0f, 0.0f, 0.0f, 0.0f},
4254 {91.0f, 0.0f, 0.0f, 0.0f},
4255 {4.0f, 5.0f, 6.0f, 7.0f},
4257 #define TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4259 #define test_effect_preshader_compare_vconsts(a, b, c) \
4260 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4261 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4262 const unsigned int *const_updated_mask, const char *updated_param)
4264 HRESULT hr;
4265 unsigned int i;
4266 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4268 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4269 ARRAY_SIZE(test_effect_preshader_fvect_v));
4270 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4272 if (!const_updated_mask)
4274 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4275 "Vertex shader float constants do not match.\n");
4277 else
4279 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4281 if (const_updated_mask[i / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE]
4282 & (1u << (i % TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE)))
4284 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4285 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), \
4286 got (%g, %g, %g, %g), parameter %s.\n",
4287 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4288 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4289 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4291 else
4293 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4294 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4299 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4301 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4302 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4303 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4304 "Vertex shader float constants do not match.\n");
4308 static void test_effect_preshader(IDirect3DDevice9 *device)
4310 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4312 {11.0f, 21.0f, 0.0f, 0.0f},
4313 {12.0f, 22.0f, 0.0f, 0.0f},
4314 {13.0f, 23.0f, 0.0f, 0.0f},
4315 {11.0f, 12.0f, 0.0f, 0.0f},
4316 {21.0f, 22.0f, 0.0f, 0.0f},
4317 {31.0f, 32.0f, 0.0f, 0.0f},
4318 {11.0f, 12.0f, 0.0f, 0.0f},
4319 {21.0f, 22.0f, 0.0f, 0.0f},
4320 {11.0f, 21.0f, 0.0f, 0.0f},
4321 {12.0f, 22.0f, 0.0f, 0.0f},
4322 {11.0f, 12.0f, 13.0f, 0.0f},
4323 {21.0f, 22.0f, 23.0f, 0.0f},
4324 {11.0f, 21.0f, 31.0f, 0.0f},
4325 {12.0f, 22.0f, 32.0f, 0.0f}
4327 static const BOOL test_effect_preshader_bconsts[] =
4329 TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE
4331 static const int test_effect_preshader_iconsts[][4] =
4333 {4, 3, 2, 1}
4335 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4336 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4337 static const int ivect_empty[4] = {-1, -1, -1, -1};
4338 HRESULT hr;
4339 ID3DXEffect *effect;
4340 D3DXHANDLE par;
4341 unsigned int npasses;
4342 DWORD value;
4343 BOOL bval;
4344 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4345 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4346 BOOL bdata[ARRAY_SIZE(test_effect_preshader_bconsts)];
4347 IDirect3DVertexShader9 *vshader;
4348 unsigned int i;
4349 D3DCAPS9 caps;
4351 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4352 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
4353 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4354 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4356 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4357 return;
4360 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4361 NULL, NULL, 0, NULL, &effect, NULL);
4362 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4364 test_effect_preshader_clear_vconsts(device);
4366 for (i = 0; i < 224; ++i)
4368 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4369 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4371 bval = FALSE;
4372 for (i = 0; i < 16; ++i)
4374 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4375 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4377 for (i = 0; i < 16; ++i)
4379 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4380 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4383 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4384 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4386 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4387 ok(par != NULL, "GetParameterByName failed.\n");
4389 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4390 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4392 hr = effect->lpVtbl->BeginPass(effect, 0);
4393 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4395 hr = effect->lpVtbl->BeginPass(effect, 0);
4396 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4398 hr = effect->lpVtbl->BeginPass(effect, 1);
4399 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4401 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4403 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4404 ARRAY_SIZE(test_effect_preshader_fvect_p));
4405 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4406 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4407 "Pixel shader float constants do not match.\n");
4408 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4410 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4411 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4412 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4413 "Pixel shader float constants do not match.\n");
4415 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4416 ARRAY_SIZE(test_effect_preshader_iconsts));
4417 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4418 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4419 "Pixel shader integer constants do not match.\n");
4420 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4422 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4423 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4424 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4425 "Pixel shader integer constants do not match.\n");
4428 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata,
4429 ARRAY_SIZE(test_effect_preshader_bconsts));
4430 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4431 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4432 ok(!bdata[i] == !test_effect_preshader_bconsts[i],
4433 "Pixel shader boolean constants do not match.\n");
4434 for (; i < 16; ++i)
4436 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, i, &bval, 1);
4437 ok(hr == D3D_OK && !bval, "Got result %#x, boolean register value %u.\n", hr, bval);
4440 test_effect_preshader_op_results(device, NULL, NULL);
4442 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4443 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4444 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4445 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4446 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4447 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4448 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4449 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4450 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4451 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4452 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4453 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4455 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4456 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4457 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4458 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4459 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4460 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4461 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4462 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4463 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4464 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4465 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4466 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4468 hr = effect->lpVtbl->EndPass(effect);
4470 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4471 ok(par != NULL, "GetParameterByName failed.\n");
4472 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4473 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4474 hr = effect->lpVtbl->BeginPass(effect, 1);
4475 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4477 test_effect_preshader_compare_shader(device, 1, FALSE);
4479 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4480 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4482 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4483 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4484 hr = effect->lpVtbl->CommitChanges(effect);
4485 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4486 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4487 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4488 ok(!vshader, "Incorrect shader selected.\n");
4490 hr = effect->lpVtbl->EndPass(effect);
4491 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4493 hr = effect->lpVtbl->End(effect);
4494 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4495 effect->lpVtbl->Release(effect);
4499 * fxc.exe /Tfx_2_0
4501 #if 0
4502 float4 opvect1;
4503 float4 opvect2;
4504 float4 opvect3;
4506 technique tech0
4508 pass p0
4510 LightEnable[0] = TRUE;
4511 LightEnable[1] = TRUE;
4512 LightEnable[2] = TRUE;
4513 LightEnable[3] = TRUE;
4514 LightEnable[4] = TRUE;
4515 LightEnable[5] = TRUE;
4516 LightEnable[6] = TRUE;
4517 LightEnable[7] = TRUE;
4518 LightType[0] = POINT;
4519 LightType[1] = POINT;
4520 LightType[2] = POINT;
4521 LightType[3] = POINT;
4522 LightType[4] = POINT;
4523 LightType[5] = POINT;
4524 LightType[6] = POINT;
4525 LightType[7] = POINT;
4527 LightDiffuse[0] = exp(opvect1);
4528 LightDiffuse[1] = log(opvect1);
4529 LightDiffuse[2] = asin(opvect1);
4530 LightDiffuse[3] = acos(opvect1);
4531 LightDiffuse[4] = atan(opvect1);
4532 LightDiffuse[5] = atan2(opvect1, opvect2);
4533 LightDiffuse[6] = opvect1 * opvect2;
4535 /* Placeholder for 'div' instruction manually edited in binary blob. */
4536 LightDiffuse[7] = opvect1 * opvect2;
4538 /* Placeholder for 'cmp' instruction manually edited in binary blob. */
4539 LightAmbient[0] = opvect1 + opvect2 + opvect3;
4542 #endif
4543 static const DWORD test_effect_preshader_ops_blob[] =
4545 0xfeff0901, 0x0000044c, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
4546 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f,
4547 0x00317463, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4548 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003,
4549 0x00000001, 0x000000a0, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4550 0x00000000, 0x00000000, 0x00000008, 0x6576706f, 0x00337463, 0x00000001, 0x00000002, 0x00000002,
4551 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4552 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4553 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4554 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4555 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4556 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4557 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4558 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4559 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4560 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4561 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4562 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4563 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4564 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4565 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000002,
4566 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4567 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4568 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
4569 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
4570 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
4571 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
4572 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
4573 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4574 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
4575 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
4576 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
4577 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4578 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
4579 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000001,
4580 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, 0x00000000,
4581 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000001,
4582 0x00000438, 0x00000000, 0x00000019, 0x00000091, 0x00000000, 0x000000b0, 0x000000ac, 0x00000091,
4583 0x00000001, 0x000000d0, 0x000000cc, 0x00000091, 0x00000002, 0x000000f0, 0x000000ec, 0x00000091,
4584 0x00000003, 0x00000110, 0x0000010c, 0x00000091, 0x00000004, 0x00000130, 0x0000012c, 0x00000091,
4585 0x00000005, 0x00000150, 0x0000014c, 0x00000091, 0x00000006, 0x00000170, 0x0000016c, 0x00000091,
4586 0x00000007, 0x00000190, 0x0000018c, 0x00000084, 0x00000000, 0x000001b0, 0x000001ac, 0x00000084,
4587 0x00000001, 0x000001d0, 0x000001cc, 0x00000084, 0x00000002, 0x000001f0, 0x000001ec, 0x00000084,
4588 0x00000003, 0x00000210, 0x0000020c, 0x00000084, 0x00000004, 0x00000230, 0x0000022c, 0x00000084,
4589 0x00000005, 0x00000250, 0x0000024c, 0x00000084, 0x00000006, 0x00000270, 0x0000026c, 0x00000084,
4590 0x00000007, 0x00000290, 0x0000028c, 0x00000085, 0x00000000, 0x000002bc, 0x000002ac, 0x00000085,
4591 0x00000001, 0x000002e8, 0x000002d8, 0x00000085, 0x00000002, 0x00000314, 0x00000304, 0x00000085,
4592 0x00000003, 0x00000340, 0x00000330, 0x00000085, 0x00000004, 0x0000036c, 0x0000035c, 0x00000085,
4593 0x00000005, 0x00000398, 0x00000388, 0x00000085, 0x00000006, 0x000003c4, 0x000003b4, 0x00000085,
4594 0x00000007, 0x000003f0, 0x000003e0, 0x00000087, 0x00000000, 0x0000041c, 0x0000040c, 0x00000000,
4595 0x00000009, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, 0x00000000, 0x0000016c, 0x46580200,
4596 0x003afffe, 0x42415443, 0x0000001c, 0x000000b3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
4597 0x000000b0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
4598 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00020002, 0x00000001, 0x000000a0, 0x00000070,
4599 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4600 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4601 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369,
4602 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4603 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4604 /* FXLC for LightAmbient[0] start. */
4605 0x001afffe, 0x434c5846,
4606 0x00000001, /* Instruction count, set to 1. */
4607 0x30000004, /* Operation code (bits 20-30) set to 'cmp' opcode 0x300. */
4608 0x00000003, /* Input arguments count set to 3. */
4609 /* Argument 1. */
4610 0x00000000, /* Relative addressing flag. */
4611 0x00000002, /* Register table ("c", float constants). */
4612 0x00000000, /* Register offset. */
4613 /* Argument 2. */
4614 0x00000000, 0x00000002, 0x00000004,
4615 /* Argument 3. */
4616 0x00000000, 0x00000002, 0x00000008,
4617 /* Output register. */
4618 0x00000000, 0x00000004, 0x00000000,
4619 /* End mark. */
4620 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4621 /* Padding to match placeholder length. */
4622 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4623 /* FXLC for LightAmbient[0] end. */
4624 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000114,
4625 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c,
4626 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
4627 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4628 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463,
4629 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4630 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4631 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
4632 /* FXLC for LightDiffuse[7] start. */
4633 0x000ffffe, 0x434c5846,
4634 0x00000001, /* Instruction count. */
4635 0x20800004, /* Operation code (bits 20-30) set to 'div' opcode 0x208. */
4636 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
4637 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4638 /* FXLC for LightDiffuse[7] end. */
4639 0x00000000, 0x00000000, 0xffffffff,
4640 0x00000016, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe, 0x42415443, 0x0000001c, 0x00000087,
4641 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084, 0x00000044, 0x00000002, 0x00000001,
4642 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x0000005c, 0x6576706f,
4643 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4644 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x4d007874,
4645 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4646 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4647 0x434c5846, 0x00000001, 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4648 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4649 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000114, 0x46580200, 0x002ffffe,
4650 0x42415443, 0x0000001c, 0x00000087, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000084,
4651 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
4652 0x00000074, 0x0000005c, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4653 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
4654 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4655 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4656 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20600004, 0x00000002, 0x00000000,
4657 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4658 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000014, 0x00000000,
4659 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
4660 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
4661 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
4662 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
4663 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
4664 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10c00004, 0x00000001, 0x00000000,
4665 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4666 0x00000000, 0x00000000, 0xffffffff, 0x00000013, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4667 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4668 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
4669 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
4670 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4671 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4672 0x434c5846, 0x00000001, 0x10b00004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
4673 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
4674 0x00000012, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
4675 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
4676 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
4677 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
4678 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
4679 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10a00004,
4680 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
4681 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000011, 0x00000000, 0x0000013c,
4682 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
4683 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
4684 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
4685 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
4686 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
4687 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4688 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4689 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4690 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10600001, 0x00000001, 0x00000000, 0x00000002,
4691 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
4692 0x00000000, 0xffffffff, 0x00000010, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
4693 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
4694 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
4695 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369,
4696 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
4697 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
4698 0x00000004, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
4699 0x00000000, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
4700 0x00000001, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
4701 0x00000002, 0x10500001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
4702 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4705 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
4707 static D3DLIGHT9 light;
4708 static const struct
4710 const char *mnem;
4711 unsigned int expected_result[4];
4712 unsigned int result_index;
4713 float *result;
4714 D3DXVECTOR4 opvect1, opvect2, opvect3;
4715 unsigned int ulps;
4716 BOOL todo[4];
4718 op_tests[] =
4720 {"exp", {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000}, 0, &light.Diffuse.r,
4721 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4722 {"log", {0, 0x40000000, 0x3f9199b7, 0x43000000}, 1, &light.Diffuse.r,
4723 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4724 {"asin", {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000}, 2, &light.Diffuse.r,
4725 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4726 {"acos", {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000}, 3, &light.Diffuse.r,
4727 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4728 {"atan", {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb}, 4, &light.Diffuse.r,
4729 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4730 {"atan2 test #1", {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000}, 5, &light.Diffuse.r,
4731 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
4732 {"atan2 test #2", {0xbfc90fdb, 0, 0xc0490fdb, 0}, 5, &light.Diffuse.r,
4733 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
4734 {"div", {0, 0, 0, 0}, 7, &light.Diffuse.r,
4735 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
4736 {"cmp", {0x40a00000, 0x40000000, 0x40400000, 0x41000000}, 0, &light.Ambient.r,
4737 {-0.3f, 0.0f, 2.2f, NAN}, {1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 6.0f, 7.0f, 8.0f}},
4738 {"0 * INF", {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000}, 6, &light.Diffuse.r,
4739 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
4741 unsigned int i, j, passes_count;
4742 ID3DXEffect *effect;
4743 HRESULT hr;
4745 hr = D3DXCreateEffect(device, test_effect_preshader_ops_blob, sizeof(test_effect_preshader_ops_blob),
4746 NULL, NULL, 0, NULL, &effect, NULL);
4747 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4748 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4749 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4750 hr = effect->lpVtbl->BeginPass(effect, 0);
4751 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4753 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
4755 const float *result = op_tests[i].result;
4756 const float *expected_float = (float *)op_tests[i].expected_result;
4758 hr = effect->lpVtbl->SetVector(effect, "opvect1", &op_tests[i].opvect1);
4759 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4760 hr = effect->lpVtbl->SetVector(effect, "opvect2", &op_tests[i].opvect2);
4761 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4762 hr = effect->lpVtbl->SetVector(effect, "opvect3", &op_tests[i].opvect3);
4763 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4764 hr = effect->lpVtbl->CommitChanges(effect);
4765 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4767 hr = IDirect3DDevice9_GetLight(device, op_tests[i].result_index, &light);
4768 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4769 for (j = 0; j < 4; ++j)
4771 todo_wine_if(op_tests[i].todo[j])
4772 ok(compare_float(result[j], expected_float[j], op_tests[i].ulps),
4773 "Operation %s, component %u, expected %#x (%.8e), got %#x (%.8e).\n", op_tests[i].mnem,
4774 j, op_tests[i].expected_result[j], expected_float[j],
4775 ((unsigned int *)result)[j], result[j]);
4779 hr = effect->lpVtbl->End(effect);
4780 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4781 effect->lpVtbl->Release(effect);
4784 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
4785 D3DXHANDLE tech, D3DXHANDLE param)
4787 D3DXPARAMETER_DESC desc;
4788 D3DXHANDLE param_child;
4789 unsigned int i, child_count;
4790 HRESULT hr;
4792 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
4793 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#x.\n", hr);
4794 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
4795 for (i = 0; i < child_count; ++i)
4797 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
4798 : effect->lpVtbl->GetParameter(effect, param, i);
4799 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
4800 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
4801 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
4802 test_isparameterused_children(line, effect, tech, param_child);
4806 #define test_isparameterused_param_with_children(args...) \
4807 test_isparameterused_param_with_children_(__LINE__, args)
4808 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
4809 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
4811 D3DXHANDLE param;
4813 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
4814 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
4816 if (effect2)
4817 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
4818 else
4819 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
4820 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
4822 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
4823 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
4825 test_isparameterused_children(line, effect, tech, param);
4828 static void test_effect_isparameterused(IDirect3DDevice9 *device)
4830 static const struct
4832 const char *name;
4833 BOOL expected_result;
4835 check_parameters[] =
4837 {"g_Pos1", TRUE},
4838 {"g_Pos2", TRUE},
4839 {"g_Selector", TRUE},
4840 {"opvect1", TRUE},
4841 {"opvect2", TRUE},
4842 {"opvect3", TRUE},
4843 {"arr2", TRUE},
4844 {"vs_arr", TRUE},
4845 {"g_iVect", TRUE},
4846 {"vect_sampler", TRUE},
4847 {"tex1", TRUE},
4848 {"tex2", FALSE},
4849 {"sampler1", TRUE},
4850 {"ts1", TRUE},
4851 {"ts2", TRUE},
4852 {"ts3", TRUE},
4854 ID3DXEffect *effect, *effect2;
4855 HRESULT hr;
4856 D3DXHANDLE tech;
4857 unsigned int i;
4859 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4860 NULL, NULL, 0, NULL, &effect, NULL);
4861 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4863 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
4864 ok(!!tech, "GetTechniqueByName failed.\n");
4866 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
4867 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
4868 check_parameters[i].expected_result);
4870 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4871 NULL, NULL, 0, NULL, &effect2, NULL);
4872 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4874 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
4875 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
4876 check_parameters[i].expected_result);
4878 effect2->lpVtbl->Release(effect2);
4880 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
4881 NULL, NULL, 0, NULL, &effect2, NULL);
4882 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4884 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
4885 effect2->lpVtbl->Release(effect2);
4887 effect->lpVtbl->Release(effect);
4890 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
4892 ID3DXEffect *effect;
4893 HRESULT hr;
4894 D3DXHANDLE param;
4895 int ivect[4];
4896 unsigned int passes_count;
4897 IDirect3DVertexShader9 *vshader;
4899 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4900 NULL, NULL, 0, NULL, &effect, NULL);
4902 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4903 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4905 ivect[0] = ivect[1] = ivect[3] = 1;
4907 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4908 ok(!!param, "GetParameterByName failed.\n");
4909 ivect[2] = 3;
4910 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4911 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4913 hr = effect->lpVtbl->BeginPass(effect, 0);
4914 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4915 hr = effect->lpVtbl->EndPass(effect);
4916 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4918 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4919 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4921 hr = effect->lpVtbl->BeginPass(effect, 1);
4922 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4924 /* Second try reports success and selects array element used previously.
4925 * Probably array index is not recomputed and previous index value is used. */
4926 hr = effect->lpVtbl->BeginPass(effect, 1);
4927 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4928 test_effect_preshader_compare_shader(device, 2, FALSE);
4930 /* Confirm that array element selected is the previous good one and does not depend
4931 * on computed (out of bound) index value. */
4932 ivect[2] = 1;
4933 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4934 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4935 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4936 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4937 hr = effect->lpVtbl->CommitChanges(effect);
4938 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4939 test_effect_preshader_compare_shader(device, 1, FALSE);
4940 hr = effect->lpVtbl->EndPass(effect);
4941 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4942 ivect[2] = 3;
4943 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4944 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4945 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4946 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4947 hr = effect->lpVtbl->BeginPass(effect, 1);
4948 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4949 hr = effect->lpVtbl->BeginPass(effect, 1);
4950 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4951 test_effect_preshader_compare_shader(device, 1, FALSE);
4953 /* End and begin effect again to ensure it will not trigger array
4954 * index recompute and error return from BeginPass. */
4955 hr = effect->lpVtbl->EndPass(effect);
4956 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4957 hr = effect->lpVtbl->End(effect);
4958 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4959 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4960 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4961 hr = effect->lpVtbl->BeginPass(effect, 1);
4962 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4963 test_effect_preshader_compare_shader(device, 1, FALSE);
4964 hr = effect->lpVtbl->EndPass(effect);
4965 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4968 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4969 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4971 ivect[2] = -2;
4972 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4973 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4975 hr = effect->lpVtbl->BeginPass(effect, 1);
4976 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4978 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4979 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4980 ok(!vshader, "Got non NULL vshader.\n");
4982 hr = effect->lpVtbl->BeginPass(effect, 1);
4983 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4985 test_effect_preshader_compare_shader(device, 1, FALSE);
4987 hr = effect->lpVtbl->EndPass(effect);
4988 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4990 ivect[2] = -1;
4991 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4992 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4994 hr = effect->lpVtbl->BeginPass(effect, 1);
4995 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4997 test_effect_preshader_compare_shader(device, 0, FALSE);
4999 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5000 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5002 ivect[2] = 3;
5003 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5004 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5005 hr = effect->lpVtbl->CommitChanges(effect);
5006 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5008 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5009 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5010 ok(!vshader, "Got non NULL vshader.\n");
5012 ivect[2] = -1;
5013 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5014 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5015 hr = effect->lpVtbl->CommitChanges(effect);
5016 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5018 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5019 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5020 ok(!vshader, "Got non NULL vshader.\n");
5022 ivect[2] = 1;
5023 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5024 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5025 hr = effect->lpVtbl->CommitChanges(effect);
5026 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5028 test_effect_preshader_compare_shader(device, 1, FALSE);
5030 hr = effect->lpVtbl->EndPass(effect);
5031 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5033 hr = effect->lpVtbl->End(effect);
5034 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5036 effect->lpVtbl->Release(effect);
5039 static void test_effect_commitchanges(IDirect3DDevice9 *device)
5041 static const struct
5043 const char *param_name;
5044 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
5046 check_op_parameters[] =
5048 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5049 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5050 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5051 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5052 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5053 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5054 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5055 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
5056 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
5057 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
5058 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5059 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
5060 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
5061 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
5062 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
5064 static const struct
5066 const char *param_name;
5067 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5068 + TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE];
5070 check_vconsts_parameters[] =
5072 {"g_Selector", {0x00000000, 0x00000002}},
5073 {"g_Pos1", {0x80000000, 0x00000002}},
5074 {"g_Pos2", {0x00000000, 0x00000002}},
5075 {"m4x3column", {0x03800000, 0x00000000}},
5076 {"m3x4column", {0x000f0000, 0x00000000}},
5077 {"m4x3row", {0x0000f000, 0x00000000}},
5078 {"m3x4row", {0x00700000, 0x00000000}},
5079 {"ts1", {0x1c000000, 0x00000000}},
5080 {"ts2", {0x0000003f, 0x00000000}},
5081 {"arr1", {0x00000000, 0x00000001}},
5082 {"arr2", {0x60000000, 0x00000000}},
5083 {"ts3", {0x00000fc0, 0x00000000}},
5085 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
5086 + TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE];
5087 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
5089 ID3DXEffect *effect;
5090 HRESULT hr;
5091 D3DXHANDLE param;
5092 unsigned int i, passes_count, value;
5093 int ivect[4];
5094 D3DXVECTOR4 fvect;
5095 IDirect3DVertexShader9 *vshader;
5097 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5098 NULL, NULL, 0, NULL, &effect, NULL);
5099 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5101 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5102 ok(!!param, "GetParameterByName failed.\n");
5104 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5105 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5107 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5108 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5110 hr = effect->lpVtbl->BeginPass(effect, 0);
5111 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5113 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
5115 unsigned int j;
5117 for (j = 0; j < 8; ++j)
5119 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
5120 ok(hr == D3D_OK, "Got result %#x, i %u, j %u.\n", hr, i, j);
5122 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
5123 ok(!!param, "GetParameterByName failed.\n");
5124 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
5125 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5126 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
5127 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5128 hr = effect->lpVtbl->CommitChanges(effect);
5129 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5131 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
5132 check_op_parameters[i].param_name);
5135 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
5137 unsigned char buffer[256];
5139 test_effect_preshader_clear_vconsts(device);
5140 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
5141 ok(!!param, "GetParameterByName failed.\n");
5142 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
5143 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5144 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
5145 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5146 hr = effect->lpVtbl->CommitChanges(effect);
5147 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5149 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
5150 check_vconsts_parameters[i].param_name);
5153 test_effect_preshader_clear_vconsts(device);
5154 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
5155 ok(!!param, "GetParameterByName failed.\n");
5156 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5157 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
5158 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5159 hr = effect->lpVtbl->CommitChanges(effect);
5160 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5161 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
5162 check_vconsts_parameters[0].param_name);
5164 test_effect_preshader_clear_vconsts(device);
5165 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5166 ok(!!param, "GetParameterByName failed.\n");
5167 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5168 ok(!!param, "GetParameterElement failed.\n");
5169 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
5170 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5171 hr = effect->lpVtbl->CommitChanges(effect);
5172 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5173 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5174 check_vconsts_parameters[10].param_name);
5176 test_effect_preshader_clear_vconsts(device);
5177 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5178 ok(!!param, "GetParameterByName failed.\n");
5179 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5180 ok(!!param, "GetParameterElement failed.\n");
5181 fvect.x = 93.0f;
5182 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
5183 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5184 hr = effect->lpVtbl->CommitChanges(effect);
5185 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5186 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5187 check_vconsts_parameters[10].param_name);
5189 test_effect_preshader_clear_vconsts(device);
5190 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5191 ok(!!param, "GetParameterByName failed.\n");
5192 fvect.x = 92.0f;
5193 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
5194 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5195 hr = effect->lpVtbl->CommitChanges(effect);
5196 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5197 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
5198 check_vconsts_parameters[10].param_name);
5200 test_effect_preshader_clear_vconsts(device);
5201 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
5202 ok(!!param, "GetParameterByName failed.\n");
5203 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5204 ok(!!param, "GetParameterElement failed.\n");
5205 hr = effect->lpVtbl->SetInt(effect, param, 93);
5206 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5207 hr = effect->lpVtbl->CommitChanges(effect);
5208 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5209 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5210 check_vconsts_parameters[10].param_name);
5212 test_effect_preshader_clear_vconsts(device);
5213 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5214 ok(!!param, "GetParameterByName failed.\n");
5215 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5216 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
5217 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5218 hr = effect->lpVtbl->CommitChanges(effect);
5219 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5220 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5221 check_vconsts_parameters[1].param_name);
5223 test_effect_preshader_clear_vconsts(device);
5224 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
5225 ok(!!param, "GetParameterByName failed.\n");
5226 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5227 ok(!!param, "GetParameterByName failed.\n");
5228 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5229 ok(!!param, "GetParameterByName failed.\n");
5230 fvect.x = 12;
5231 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5232 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5233 hr = effect->lpVtbl->CommitChanges(effect);
5234 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5235 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5236 check_vconsts_parameters[7].param_name);
5238 *(float *)&value = 9999.0f;
5239 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5240 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5241 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5242 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5243 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5244 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5245 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5246 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5247 test_effect_preshader_clear_vconsts(device);
5248 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5249 ok(!!param, "GetParameterByName failed.\n");
5250 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5251 ok(!!param, "GetParameterByName failed.\n");
5252 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5253 ok(!!param, "GetParameterByName failed.\n");
5254 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5255 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5256 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5257 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5258 hr = effect->lpVtbl->CommitChanges(effect);
5259 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5260 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5261 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5262 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
5263 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5264 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5265 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
5266 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5267 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5268 ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5269 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5270 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5271 ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5272 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5273 check_vconsts_parameters[8].param_name);
5275 *(float *)&value = 9999.0f;
5276 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5277 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5278 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5279 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5280 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5281 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5282 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5283 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5284 test_effect_preshader_clear_vconsts(device);
5285 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5286 ok(!!param, "GetParameterByName failed.\n");
5287 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5288 ok(!!param, "GetParameterByName failed.\n");
5289 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5290 ok(!!param, "GetParameterByName failed.\n");
5291 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5292 ok(!!param, "GetParameterByName failed.\n");
5293 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5294 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5295 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5296 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5297 hr = effect->lpVtbl->CommitChanges(effect);
5298 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5299 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5300 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5301 ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
5302 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5303 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5304 ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
5305 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5306 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5307 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5308 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5309 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5310 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5311 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5312 check_vconsts_parameters[11].param_name);
5314 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5315 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5316 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
5318 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5319 ok(!!param, "GetParameterByName failed.\n");
5320 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5321 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5322 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5324 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, 0);
5325 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5326 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, 0);
5327 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5328 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5329 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5330 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5331 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5333 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5334 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5335 test_effect_preshader_clear_vconsts(device);
5337 hr = effect->lpVtbl->CommitChanges(effect);
5338 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5340 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5341 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5342 ok(!vshader, "Got non NULL vshader.\n");
5343 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5344 "selector g_iVect");
5345 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5346 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5347 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5348 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
5349 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5350 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5351 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5352 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5353 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5354 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5355 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5356 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5358 ivect[3] = 2;
5359 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5360 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5361 ivect[3] = 1;
5362 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5363 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5364 hr = effect->lpVtbl->CommitChanges(effect);
5365 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5366 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5367 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5368 ok(!vshader, "Got non NULL vshader.\n");
5369 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5370 "selector g_iVect");
5371 ivect[3] = 2;
5372 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5373 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5374 hr = effect->lpVtbl->CommitChanges(effect);
5375 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5376 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5377 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5378 ok(!!vshader, "Got NULL vshader.\n");
5379 IDirect3DVertexShader9_Release(vshader);
5380 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5381 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5382 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5383 "Vertex shader float constants do not match.\n");
5384 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5385 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5386 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5387 "selector g_iVect");
5388 ivect[3] = 1;
5389 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5390 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5391 hr = effect->lpVtbl->CommitChanges(effect);
5392 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5393 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5395 hr = effect->lpVtbl->EndPass(effect);
5396 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5398 hr = effect->lpVtbl->End(effect);
5399 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5401 effect->lpVtbl->Release(effect);
5404 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5406 static const struct
5408 D3DXVECTOR4 opvect2;
5409 D3DXVECTOR4 g_ivect;
5410 unsigned int expected[4];
5412 test_out_of_bounds_index[] =
5414 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5415 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5416 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5417 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5418 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5419 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5420 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5421 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5422 {0x447ac000, 0x448ae000, 0, 0}},
5423 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5424 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5425 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5426 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5427 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5428 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5429 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5430 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5431 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5432 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5433 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5434 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5435 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5436 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5437 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5438 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5439 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5440 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5441 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5442 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5443 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5444 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5445 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5446 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5447 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5449 static const struct
5451 unsigned int zw[2];
5453 expected_light_specular[] =
5455 {{0, 0x44fa2000}},
5456 {{0x447a8000, 0x453b9000}},
5457 {{0x40000000, 0x459c4800}},
5458 {{0xbf800000, 0}},
5459 {{0x447a4000, 0}},
5460 {{0x3f800000, 0}},
5461 {{0xbf800000, 0}},
5462 {{0, 0}},
5463 {{0, 0x447a4000}},
5464 {{0x44fa4000, 0x3f800000}},
5465 {{0x453ba000, 0xbf800000}},
5466 {{0x459c5000, 0}},
5467 {{0x44fa2000, 0}},
5468 {{0x453b9000, 0}},
5469 {{0x459c4800, 0}},
5470 {{0, 0}},
5472 static const struct
5474 int index_value;
5475 unsigned int expected[4];
5477 test_index_to_immediate_table[] =
5479 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5480 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5481 {-32, {0x448d4000, 0x40800000, 0, 0}},
5482 {-31, {0x45843000, 0x41400000, 0, 0}},
5483 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5484 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5485 {-28, {0, 0, 0x447ac000, 0x40400000}},
5486 {-27, {0, 0x3f800000, 0, 0}},
5487 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5488 {-25, {0, 0x41300000, 0, 0}},
5489 {-24, {0, 0x41600000, 0, 0}},
5490 {-23, {0, 0, 0, 0}},
5491 {-22, {0, 0, 0, 0}},
5492 {-21, {0, 0x40a00000, 0, 0}},
5493 {-20, {0, 0x41500000, 0, 0}},
5494 {-19, {0, 0x41500000, 0, 0}},
5495 {-18, {0, 0xc1900000, 0, 0}},
5496 {-17, {0, 0, 0, 0}},
5497 {-16, {0, 0x40800000, 0, 0}},
5498 {-15, {0, 0x41400000, 0, 0}},
5499 {-14, {0, 0x41400000, 0, 0}},
5500 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5501 {-12, {0, 0, 0, 0}},
5502 {-11, {0, 0x3f800000, 0, 0}},
5503 {-10, {0, 0x41100000, 0, 0}},
5504 {-9, {0, 0x41300000, 0, 0}},
5505 {-8, {0, 0x41600000, 0, 0}},
5506 {-7, {0, 0, 0, 0}},
5507 {-6, {0, 0, 0, 0}},
5508 {-5, {0, 0x40a00000, 0, 0}},
5509 {-4, {0, 0x41500000, 0, 0}},
5510 {-3, {0, 0x41500000, 0, 0}},
5511 {-2, {0, 0xc0000000, 0, 0}},
5512 {-1, {0, 0, 0, 0}},
5513 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5514 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5515 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5516 {3, {0, 0x447a4000, 0, 0}},
5517 {4, {0, 0, 0x45bbd800, 0x41300000}},
5518 {5, {0, 0x3f800000, 0, 0}},
5519 {6, {0, 0x41100000, 0, 0}},
5520 {7, {0, 0x41300000, 0, 0}},
5521 {8, {0, 0x41600000, 0, 0}},
5522 {9, {0, 0, 0, 0}},
5523 {10, {0, 0, 0, 0}},
5524 {11, {0, 0x40a00000, 0, 0}},
5525 {12, {0, 0x41500000, 0, 0}},
5526 {13, {0, 0x41500000, 0, 0}},
5527 {14, {0, 0x41600000, 0, 0}},
5528 {15, {0, 0, 0, 0}},
5529 {16, {0, 0x40800000, 0, 0}},
5530 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5531 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5532 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5533 {20, {0, 0, 0, 0}},
5534 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5535 {22, {0, 0x41100000, 0, 0}},
5536 {23, {0, 0x41300000, 0, 0}},
5537 {24, {0, 0x41600000, 0, 0}},
5538 {25, {0, 0, 0, 0}},
5539 {26, {0, 0, 0, 0}},
5540 {27, {0, 0x40a00000, 0, 0}},
5541 {28, {0, 0x41500000, 0, 0}},
5542 {29, {0, 0x41500000, 0, 0}},
5543 {30, {0, 0x41f00000, 0, 0}},
5544 {31, {0, 0, 0, 0}},
5545 {1001, {0, 0, 0, 0}},
5546 {1000000, {0, 0x40800000, 0, 0}},
5548 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5549 {1.0f, 1.0f, 1.0f, 1.0f}};
5550 unsigned int j, passes_count;
5551 const unsigned int *expected;
5552 const float *expected_float;
5553 ID3DXEffect *effect;
5554 D3DXVECTOR4 fvect;
5555 D3DLIGHT9 light;
5556 const float *v;
5557 HRESULT hr;
5558 int i;
5560 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5561 NULL, NULL, 0, NULL, &effect, NULL);
5562 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5564 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5565 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5566 hr = effect->lpVtbl->BeginPass(effect, 0);
5567 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5569 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5570 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5571 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5573 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5574 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5575 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5577 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5578 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5579 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5581 v = &light.Specular.r;
5582 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5584 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5585 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5586 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5587 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5589 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5590 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5592 hr = effect->lpVtbl->CommitChanges(effect);
5593 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5595 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5596 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5598 expected = test_out_of_bounds_index[i].expected;
5599 expected_float = (const float *)expected;
5601 for (j = 0; j < 4; ++j)
5603 ok(compare_float(v[j], expected_float[j], 0),
5604 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5605 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5609 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5610 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5611 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5612 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5614 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5615 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5617 fvect = test_out_of_bounds_index[7].g_ivect;
5618 v = &light.Specular.b;
5619 for (i = -100; i < 100; ++i)
5621 fvect.w = i;
5622 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5623 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5624 hr = effect->lpVtbl->CommitChanges(effect);
5625 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5627 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5628 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5630 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5631 expected_float = (const float *)expected;
5633 for (j = 0; j < 2; ++j)
5635 ok(compare_float(v[j], expected_float[j], 0),
5636 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
5637 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5641 v = &light.Specular.r;
5642 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
5644 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
5645 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5646 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5647 hr = effect->lpVtbl->CommitChanges(effect);
5648 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5650 hr = IDirect3DDevice9_GetLight(device, 2, &light);
5651 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5653 expected = test_index_to_immediate_table[i].expected;
5654 expected_float = (const float *)expected;
5656 for (j = 0; j < 4; ++j)
5658 ok(compare_float(v[j], expected_float[j], 0),
5659 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5660 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5664 hr = effect->lpVtbl->EndPass(effect);
5665 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5666 hr = effect->lpVtbl->End(effect);
5667 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5669 effect->lpVtbl->Release(effect);
5672 struct test_state_manager_update
5674 unsigned int state_op;
5675 DWORD param1;
5676 DWORD param2;
5679 struct test_manager
5681 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
5682 LONG ref;
5684 IDirect3DDevice9 *device;
5685 struct test_state_manager_update *update_record;
5686 unsigned int update_record_count;
5687 unsigned int update_record_size;
5690 #define INITIAL_UPDATE_RECORD_SIZE 64
5692 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
5694 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
5697 static void free_test_effect_state_manager(struct test_manager *state_manager)
5699 HeapFree(GetProcessHeap(), 0, state_manager->update_record);
5700 state_manager->update_record = NULL;
5702 IDirect3DDevice9_Release(state_manager->device);
5705 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
5707 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5709 return InterlockedIncrement(&state_manager->ref);
5712 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
5714 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5715 ULONG ref = InterlockedDecrement(&state_manager->ref);
5717 if (!ref)
5719 free_test_effect_state_manager(state_manager);
5720 HeapFree(GetProcessHeap(), 0, state_manager);
5722 return ref;
5725 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
5726 unsigned int state_op, DWORD param1, DWORD param2)
5728 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5730 if (state_manager->update_record_count == state_manager->update_record_size)
5732 if (!state_manager->update_record_size)
5734 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
5735 state_manager->update_record = HeapAlloc(GetProcessHeap(), 0,
5736 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5738 else
5740 state_manager->update_record_size *= 2;
5741 state_manager->update_record = HeapReAlloc(GetProcessHeap(), 0, state_manager->update_record,
5742 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5745 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
5746 state_manager->update_record[state_manager->update_record_count].param1 = param1;
5747 state_manager->update_record[state_manager->update_record_count].param2 = param2;
5748 ++state_manager->update_record_count;
5749 return D3D_OK;
5752 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
5753 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
5755 return test_process_set_state(iface, 0, state, 0);
5758 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
5759 const D3DMATERIAL9 *material)
5761 return test_process_set_state(iface, 1, 0, 0);
5764 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
5765 DWORD index, const D3DLIGHT9 *light)
5767 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5769 IDirect3DDevice9_SetLight(state_manager->device, index, light);
5770 return test_process_set_state(iface, 2, index, 0);
5773 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
5774 DWORD index, BOOL enable)
5776 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5778 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
5779 return test_process_set_state(iface, 3, index, 0);
5782 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
5783 D3DRENDERSTATETYPE state, DWORD value)
5785 return test_process_set_state(iface, 4, state, 0);
5788 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
5789 DWORD stage, struct IDirect3DBaseTexture9 *texture)
5791 return test_process_set_state(iface, 5, stage, 0);
5794 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
5795 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
5797 return test_process_set_state(iface, 6, stage, type);
5800 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
5801 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
5803 return test_process_set_state(iface, 7, sampler, type);
5806 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
5807 FLOAT num_segments)
5809 return test_process_set_state(iface, 8, 0, 0);
5812 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
5813 DWORD format)
5815 return test_process_set_state(iface, 9, 0, 0);
5818 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
5819 struct IDirect3DVertexShader9 *shader)
5821 return test_process_set_state(iface, 10, 0, 0);
5824 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
5825 UINT register_index, const FLOAT *constant_data, UINT register_count)
5827 return test_process_set_state(iface, 11, register_index, register_count);
5830 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
5831 UINT register_index, const INT *constant_data, UINT register_count)
5833 return test_process_set_state(iface, 12, register_index, register_count);
5836 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
5837 UINT register_index, const BOOL *constant_data, UINT register_count)
5839 return test_process_set_state(iface, 13, register_index, register_count);
5842 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
5843 struct IDirect3DPixelShader9 *shader)
5845 return test_process_set_state(iface, 14, 0, 0);
5848 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
5849 UINT register_index, const FLOAT *constant_data, UINT register_count)
5851 return test_process_set_state(iface, 15, register_index, register_count);
5854 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
5855 UINT register_index, const INT *constant_data, UINT register_count)
5857 return test_process_set_state(iface, 16, register_index, register_count);
5860 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
5861 UINT register_index, const BOOL *constant_data, UINT register_count)
5863 return test_process_set_state(iface, 17, register_index, register_count);
5866 static void test_effect_state_manager_init(struct test_manager *state_manager,
5867 IDirect3DDevice9 *device)
5869 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
5871 /*** IUnknown methods ***/
5872 NULL,
5873 test_manager_AddRef,
5874 test_manager_Release,
5875 /*** ID3DXEffectStateManager methods ***/
5876 test_manager_SetTransform,
5877 test_manager_SetMaterial,
5878 test_manager_SetLight,
5879 test_manager_LightEnable,
5880 test_manager_SetRenderState,
5881 test_manager_SetTexture,
5882 test_manager_SetTextureStageState,
5883 test_manager_SetSamplerState,
5884 test_manager_SetNPatchMode,
5885 test_manager_SetFVF,
5886 test_manager_SetVertexShader,
5887 test_manager_SetVertexShaderConstantF,
5888 test_manager_SetVertexShaderConstantI,
5889 test_manager_SetVertexShaderConstantB,
5890 test_manager_SetPixelShader,
5891 test_manager_SetPixelShaderConstantF,
5892 test_manager_SetPixelShaderConstantI,
5893 test_manager_SetPixelShaderConstantB,
5896 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
5897 state_manager->ref = 1;
5899 IDirect3DDevice9_AddRef(device);
5900 state_manager->device = device;
5903 static const char *test_effect_state_manager_state_names[] =
5905 "SetTransform",
5906 "SetMaterial",
5907 "SetLight",
5908 "LightEnable",
5909 "SetRenderState",
5910 "SetTexture",
5911 "SetTextureStageState",
5912 "SetSamplerState",
5913 "SetNPatchMode",
5914 "SetFVF",
5915 "SetVertexShader",
5916 "SetVertexShaderConstantF",
5917 "SetVertexShaderConstantI",
5918 "SetVertexShaderConstantB",
5919 "SetPixelShader",
5920 "SetPixelShaderConstantF",
5921 "SetPixelShaderConstantI",
5922 "SetPixelShaderConstantB",
5925 static int compare_update_record(const void *a, const void *b)
5927 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
5928 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
5930 if (r1->state_op != r2->state_op)
5931 return r1->state_op - r2->state_op;
5932 if (r1->param1 != r2->param1)
5933 return r1->param1 - r2->param1;
5934 return r1->param2 - r2->param2;
5937 static void test_effect_state_manager(IDirect3DDevice9 *device)
5939 static const struct test_state_manager_update expected_updates[] =
5941 {2, 0, 0},
5942 {2, 1, 0},
5943 {2, 2, 0},
5944 {2, 3, 0},
5945 {2, 4, 0},
5946 {2, 5, 0},
5947 {2, 6, 0},
5948 {2, 7, 0},
5949 {3, 0, 0},
5950 {3, 1, 0},
5951 {3, 2, 0},
5952 {3, 3, 0},
5953 {3, 4, 0},
5954 {3, 5, 0},
5955 {3, 6, 0},
5956 {3, 7, 0},
5957 {4, 28, 0},
5958 {4, 36, 0},
5959 {4, 38, 0},
5960 {4, 158, 0},
5961 {4, 159, 0},
5962 {5, 0, 0},
5963 {5, 257, 0},
5964 {7, 0, 5},
5965 {7, 0, 6},
5966 {7, 257, 5},
5967 {7, 257, 6},
5968 {10, 0, 0},
5969 {11, 0, 34},
5970 {14, 0, 0},
5971 {15, 0, 14},
5972 {16, 0, 1},
5973 {17, 0, 7},
5975 static D3DLIGHT9 light_filler =
5976 {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}};
5977 struct test_manager *state_manager;
5978 unsigned int passes_count, i, n;
5979 ID3DXEffect *effect;
5980 ULONG refcount;
5981 HRESULT hr;
5983 state_manager = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*state_manager));
5984 test_effect_state_manager_init(state_manager, device);
5986 for (i = 0; i < 8; ++i)
5988 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
5989 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5992 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5993 NULL, NULL, 0, NULL, &effect, NULL);
5994 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5996 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
5997 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5999 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6000 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6002 hr = effect->lpVtbl->BeginPass(effect, 0);
6003 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6005 hr = effect->lpVtbl->EndPass(effect);
6006 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6008 hr = effect->lpVtbl->End(effect);
6009 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6011 effect->lpVtbl->Release(effect);
6013 qsort(state_manager->update_record, state_manager->update_record_count,
6014 sizeof(*state_manager->update_record), compare_update_record);
6016 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
6017 "Got %u update records.\n", state_manager->update_record_count);
6018 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
6019 for (i = 0; i < n; ++i)
6021 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
6022 sizeof(expected_updates[i])),
6023 "Update record mismatch, expected %s, %u, %u, got %s, %u, %u.\n",
6024 test_effect_state_manager_state_names[expected_updates[i].state_op],
6025 expected_updates[i].param1, expected_updates[i].param2,
6026 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
6027 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
6030 for (i = 0; i < 8; ++i)
6032 D3DLIGHT9 light;
6034 hr = IDirect3DDevice9_GetLight(device, i, &light);
6035 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6036 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
6039 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
6040 &state_manager->ID3DXEffectStateManager_iface);
6041 ok(!refcount, "State manager was not properly freed, refcount %u.\n", refcount);
6044 static void test_cross_effect_handle(IDirect3DDevice9 *device)
6046 ID3DXEffect *effect1, *effect2;
6047 D3DXHANDLE param1, param2;
6048 static int expected_ivect[4] = {28, 29, 30, 31};
6049 int ivect[4];
6050 HRESULT hr;
6052 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6053 NULL, NULL, 0, NULL, &effect1, NULL);
6054 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6055 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6056 NULL, NULL, 0, NULL, &effect2, NULL);
6057 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6059 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
6061 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
6062 ok(!!param1, "GetParameterByName failed.\n");
6064 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
6065 ok(!!param2, "GetParameterByName failed.\n");
6067 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
6069 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
6070 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6072 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
6073 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6075 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6077 effect2->lpVtbl->Release(effect2);
6078 effect1->lpVtbl->Release(effect1);
6081 #if 0
6082 struct test_struct
6084 float3 v1_2;
6085 float fv_2;
6086 float4 v2_2;
6089 shared float arr2[1];
6090 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
6092 struct VS_OUTPUT
6094 float4 Position : POSITION;
6097 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
6099 VS_OUTPUT Output;
6101 Output.Position = arr2[0] * vPos;
6102 return Output;
6105 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
6107 technique tech0
6109 pass p0
6111 FogEnable = TRUE;
6112 FogDensity = arr2[0];
6113 PointScale_A = ts2[0].fv_2;
6114 VertexShader = vs_arr2[0];
6117 pass p1
6119 VertexShader = vs_arr2[1];
6122 #endif
6123 static const DWORD test_effect_shared_parameters_blob[] =
6125 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
6126 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
6127 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
6128 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
6129 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
6130 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6131 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
6132 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
6133 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
6134 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
6135 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6136 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
6137 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
6138 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
6139 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
6140 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
6141 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
6142 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
6143 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
6144 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
6145 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
6146 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
6147 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
6148 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
6149 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
6150 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
6151 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
6152 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
6153 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
6154 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
6155 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
6156 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
6157 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
6158 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
6159 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
6160 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
6161 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
6162 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
6163 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
6164 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
6165 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
6166 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
6167 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6168 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
6169 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
6170 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
6171 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
6172 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
6173 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
6174 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
6175 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
6178 #define test_effect_shared_vs_arr_compare_helper(args...) \
6179 test_effect_shared_vs_arr_compare_helper_(__LINE__, args)
6180 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
6181 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
6182 BOOL todo)
6184 struct IDirect3DVertexShader9 *vshader2;
6185 D3DXHANDLE param_child2;
6186 HRESULT hr;
6188 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
6189 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
6190 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6191 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
6192 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6193 todo_wine_if(todo)
6194 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
6195 if (vshader2)
6196 IDirect3DVertexShader9_Release(vshader2);
6199 #define test_effect_shared_parameters_compare_vconst(args...) \
6200 test_effect_shared_parameters_compare_vconst_(__LINE__, args)
6201 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
6202 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6204 D3DXVECTOR4 fvect;
6205 HRESULT hr;
6207 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6208 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6209 todo_wine_if(todo)
6210 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6211 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6214 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6216 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6217 ID3DXEffectPool *pool;
6218 HRESULT hr;
6219 D3DXHANDLE param, param_child, param2, param_child2;
6220 unsigned int i, passes_count;
6221 ULONG refcount;
6222 D3DXVECTOR4 fvect;
6223 float fval[2];
6225 hr = D3DXCreateEffectPool(&pool);
6226 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6228 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6229 NULL, NULL, 0, pool, &effect2, NULL);
6230 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6231 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6232 effect2->lpVtbl->Release(effect2);
6234 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6235 NULL, NULL, 0, pool, &effect2, NULL);
6236 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6237 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6238 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6239 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6241 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6242 NULL, NULL, 0, pool, &effect1, NULL);
6243 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6245 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6246 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6248 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6249 NULL, NULL, 0, pool, &effect3, NULL);
6250 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6251 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6252 NULL, NULL, 0, pool, &effect4, NULL);
6253 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6255 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6256 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6258 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6259 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6260 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6261 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6262 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6263 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6264 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6266 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6267 ok(!!param, "GetParameterByName failed.\n");
6268 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6269 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6271 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6272 ok(!!param, "GetParameterByName failed.\n");
6273 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6274 "Unexpected IsParameterUsed result.\n");
6276 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6277 ok(!!param, "GetParameterByName failed.\n");
6278 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6279 "Unexpected IsParameterUsed result.\n");
6281 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6282 ok(!!param, "GetParameterByName failed.\n");
6283 todo_wine
6284 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6285 "Unexpected IsParameterUsed result.\n");
6287 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6288 "Unexpected IsParameterUsed result.\n");
6289 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6290 "Unexpected IsParameterUsed result.\n");
6291 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6292 "Unexpected IsParameterUsed result.\n");
6294 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6295 "Unexpected IsParameterUsed result.\n");
6297 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6298 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6300 if (0)
6302 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6303 * but initialized with different shaders using different parameters. */
6304 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6305 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6307 hr = effect3->lpVtbl->EndPass(effect3);
6308 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6311 test_effect_preshader_clear_vconsts(device);
6312 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6313 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6314 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6315 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6316 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6318 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6319 todo_wine
6320 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6322 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6323 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6324 todo_wine
6325 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6326 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6328 hr = effect3->lpVtbl->EndPass(effect3);
6329 todo_wine
6330 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6332 hr = effect3->lpVtbl->End(effect3);
6333 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6335 for (i = 0; i < 2; ++i)
6337 struct IDirect3DVertexShader9 *vshader1;
6339 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6340 ok(!!param_child, "GetParameterElement failed.\n");
6341 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6342 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6344 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6345 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6346 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6347 IDirect3DVertexShader9_Release(vshader1);
6350 effect3->lpVtbl->Release(effect3);
6351 effect4->lpVtbl->Release(effect4);
6353 fval[0] = 1.0f;
6354 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6355 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6356 fval[0] = 0.0f;
6357 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6358 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6359 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6361 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6362 ok(!!param, "GetParameterByName failed.\n");
6363 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6364 ok(!!param, "GetParameterByName failed.\n");
6365 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6366 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6367 ok(!!param_child, "GetParameterElement failed.\n");
6368 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6369 ok(!!param_child2, "GetParameterElement failed.\n");
6370 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6372 fval[0] = 33.0f;
6373 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6374 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6375 fval[0] = 0.0f;
6376 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6377 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6378 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6379 fval[0] = 0.0f;
6380 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6381 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6382 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6384 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6385 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6387 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6388 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6390 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6391 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6393 fvect.x = 1.0f;
6394 fvect.y = fvect.z = fvect.w = 0.0f;
6395 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6397 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6398 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6400 fvect.x = 91.0f;
6401 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6402 fvect.x = 33.0f;
6403 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6405 fval[0] = 28.0f;
6406 fval[1] = -1.0f;
6407 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6408 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6410 test_effect_preshader_clear_vconsts(device);
6412 hr = effect1->lpVtbl->CommitChanges(effect1);
6413 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6415 fvect.x = 28.0f;
6416 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6417 fvect.x = -1.0f;
6418 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6420 test_effect_preshader_clear_vconsts(device);
6422 hr = effect1->lpVtbl->CommitChanges(effect1);
6423 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6425 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6426 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6428 hr = effect2->lpVtbl->CommitChanges(effect2);
6429 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6431 fvect.x = 28.0f;
6432 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6433 fvect.x = -1.0f;
6434 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6436 fval[0] = -2.0f;
6437 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6438 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6439 hr = effect1->lpVtbl->CommitChanges(effect1);
6440 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6442 fvect.x = -2.0f;
6443 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6444 fvect.x = -1.0f;
6445 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6447 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6448 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6449 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6451 hr = effect1->lpVtbl->CommitChanges(effect1);
6452 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6453 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6455 hr = effect1->lpVtbl->CommitChanges(effect2);
6456 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6457 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6459 hr = effect1->lpVtbl->End(effect1);
6460 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6462 hr = effect2->lpVtbl->End(effect2);
6463 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6465 if (0)
6467 refcount = pool->lpVtbl->Release(pool);
6468 ok(refcount == 2, "Unexpected refcount %u.\n", refcount);
6470 refcount = pool->lpVtbl->Release(pool);
6471 ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
6473 refcount = pool->lpVtbl->Release(pool);
6474 ok(!refcount, "Unexpected refcount %u.\n", refcount);
6476 /* Native d3dx crashes in GetFloat(). */
6477 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6480 effect1->lpVtbl->Release(effect1);
6481 effect2->lpVtbl->Release(effect2);
6483 refcount = pool->lpVtbl->Release(pool);
6484 ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount);
6487 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6489 ID3DXEffect *effect;
6490 D3DXHANDLE param;
6491 static int expected_ivect[4] = {28, 29, 30, 31};
6492 int ivect[4];
6493 HRESULT hr;
6495 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6496 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6497 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6499 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6500 ok(!!param, "GetParameterByName failed.\n");
6502 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6503 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6505 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6506 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6508 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6510 if (0)
6512 /* Native d3dx crashes in GetValue(). */
6513 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6514 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6517 effect->lpVtbl->Release(effect);
6520 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6522 unsigned int passes_count;
6523 ID3DXEffect *effect;
6524 D3DXPASS_DESC desc;
6525 D3DXVECTOR4 fvect;
6526 D3DXHANDLE pass;
6527 HRESULT hr;
6529 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6530 NULL, NULL, 0, NULL, &effect, NULL);
6531 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6533 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6534 ok(!!pass, "GetPass() failed.\n");
6536 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6537 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6538 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6540 fvect.x = fvect.y = fvect.w = 0.0f;
6541 fvect.z = 0.0f;
6542 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6543 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6545 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6546 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6547 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6549 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6551 fvect.z = 3.0f;
6552 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6553 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6555 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6556 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6557 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6559 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6560 * as it is not the case sometimes for BeginPass() with out of bound access. */
6561 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6562 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6563 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6565 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6566 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6568 hr = effect->lpVtbl->BeginPass(effect, 1);
6569 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6571 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6572 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6574 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6576 fvect.z = 2.0f;
6577 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6578 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6579 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6580 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6582 effect->lpVtbl->Release(effect);
6584 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6585 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6586 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6588 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6589 ok(!!pass, "GetPass() failed.\n");
6591 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6592 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6594 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6595 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6597 effect->lpVtbl->Release(effect);
6600 START_TEST(effect)
6602 HWND wnd;
6603 IDirect3D9 *d3d;
6604 IDirect3DDevice9 *device;
6605 D3DPRESENT_PARAMETERS d3dpp;
6606 HRESULT hr;
6607 ULONG count;
6609 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
6610 640, 480, NULL, NULL, NULL, NULL)))
6612 skip("Couldn't create application window\n");
6613 return;
6615 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
6617 skip("Couldn't create IDirect3D9 object\n");
6618 DestroyWindow(wnd);
6619 return;
6622 ZeroMemory(&d3dpp, sizeof(d3dpp));
6623 d3dpp.Windowed = TRUE;
6624 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
6625 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
6626 if (FAILED(hr)) {
6627 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
6628 IDirect3D9_Release(d3d);
6629 DestroyWindow(wnd);
6630 return;
6633 test_create_effect_and_pool(device);
6634 test_create_effect_compiler();
6635 test_effect_parameter_value(device);
6636 test_effect_setvalue_object(device);
6637 test_effect_variable_names(device);
6638 test_effect_compilation_errors(device);
6639 test_effect_states(device);
6640 test_effect_preshader(device);
6641 test_effect_preshader_ops(device);
6642 test_effect_isparameterused(device);
6643 test_effect_out_of_bounds_selector(device);
6644 test_effect_commitchanges(device);
6645 test_effect_preshader_relative_addressing(device);
6646 test_effect_state_manager(device);
6647 test_cross_effect_handle(device);
6648 test_effect_shared_parameters(device);
6649 test_effect_large_address_aware_flag(device);
6650 test_effect_get_pass_desc(device);
6652 count = IDirect3DDevice9_Release(device);
6653 ok(count == 0, "The device was not properly freed: refcount %u\n", count);
6655 count = IDirect3D9_Release(d3d);
6656 ok(count == 0, "Release failed %u\n", count);
6658 DestroyWindow(wnd);