d3dx9/tests: Check pixel shader sampler states in test_effect_commitchanges().
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blob1bd471a2554e13b05f4973bd253f4db5ca542067
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 Output.RGBColor += tex2D(sampler1, In.TextureUV);
3224 return Output;
3227 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(1, true), compile vs_3_0 RenderSceneVS2()};
3228 pixelshader ps_arr[1] = {compile ps_3_0 RenderScenePS(mb2x3row)};
3230 technique tech0
3232 pass p0
3234 VertexShader = vs_arr2[g_iVect.w - 1];
3235 PixelShader = ps_arr[g_iVect.w - 1];
3237 LightEnable[0] = TRUE;
3238 LightEnable[1] = TRUE;
3239 LightEnable[2] = TRUE;
3240 LightEnable[3] = TRUE;
3241 LightEnable[4] = TRUE;
3242 LightEnable[5] = TRUE;
3243 LightEnable[6] = TRUE;
3244 LightEnable[7] = TRUE;
3245 LightType[0] = POINT;
3246 LightType[1] = POINT;
3247 LightType[2] = POINT;
3248 LightType[3] = POINT;
3249 LightType[4] = POINT;
3250 LightType[5] = POINT;
3251 LightType[6] = POINT;
3252 LightType[7] = POINT;
3253 LightDiffuse[0] = 1 / opvect1;
3254 LightDiffuse[1] = rsqrt(opvect1);
3255 LightDiffuse[2] = opvect1 * opvect2;
3256 LightDiffuse[3] = opvect1 + opvect2;
3257 LightDiffuse[4] = float4(opvect1 < opvect2);
3258 LightDiffuse[5] = float4(opvect1 >= opvect2);
3259 LightDiffuse[6] = -opvect1;
3260 LightDiffuse[7] = rcp(opvect1);
3262 LightAmbient[0] = frac(opvect1);
3263 LightAmbient[1] = min(opvect1, opvect2);
3264 LightAmbient[2] = max(opvect1, opvect2);
3265 LightAmbient[3] = sin(opvect1);
3266 LightAmbient[4] = cos(opvect1);
3267 LightAmbient[5] = 1e-2 / opvect1;
3268 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3269 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3271 LightSpecular[0] = float4(dot(opvect1.zx, opvect2.xy), dot(opvect1.zzx, opvect2.xyz),
3272 dot(opvect1.zzzx, opvect2.xxyy), 0);
3273 LightSpecular[1] = float4(opvect1[g_iVect.z], g_iVect[opvect2.y + 1],
3274 g_Selector[4 + g_iVect.w].x + g_Selector[7 + g_iVect.w].y,
3275 g_Selector[g_iVect.w].x + g_Selector[g_iVect.x].y);
3276 LightSpecular[2] = float4(dot(m4x4[3 + g_iVect.z], m4x4[g_iVect.w * 2]), ts3.ts[g_iVect.x].fv,
3277 vec3[g_iVect.z], float3(1, 2, 3)[g_iVect.w]);
3279 FogEnable = TRUE;
3280 FogDensity = ts2[0].fv;
3281 FogStart = ts2[1].fv;
3282 PointScale_A = ts3.ts[0].fv;
3283 PointScale_B = ts3.ts[1].fv;
3285 pass p1
3287 VertexShader = vs_arr[g_iVect.z];
3290 #endif
3291 static const DWORD test_effect_preshader_effect_blob[] =
3293 0xfeff0901, 0x00001070, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3294 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3295 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3296 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3297 0x00000001, 0x000000c0, 0x00000000, 0x00000003, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3298 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800, 0x459c5000,
3299 0x459c5800, 0x459c6000, 0x0000000b, 0x65535f67, 0x7463656c, 0x0000726f, 0x00000003, 0x00000001,
3300 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3301 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
3302 0x00000000, 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x00000008,
3303 0x6576706f, 0x00327463, 0x00000003, 0x00000001, 0x0000016c, 0x00000000, 0x00000000, 0x00000004,
3304 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463,
3305 0x00000003, 0x00000001, 0x000001a4, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3306 0x40000000, 0x40400000, 0x40800000, 0x0000000d, 0x74636576, 0x6d61735f, 0x72656c70, 0x00000000,
3307 0x00000003, 0x00000001, 0x000001e0, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x447a4000,
3308 0x447a8000, 0x447ac000, 0x00000005, 0x33636576, 0x00000000, 0x00000002, 0x00000001, 0x00000218,
3309 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3310 0x00000008, 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x00000244, 0x00000000, 0x00000003,
3311 0x00000001, 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002,
3312 0x000002ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3313 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3314 0x42080000, 0x42240000, 0x42280000, 0x422c0000, 0x42300000, 0x00000005, 0x3478346d, 0x00000000,
3315 0x00000003, 0x00000002, 0x00000304, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000,
3316 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000,
3317 0x42240000, 0x42280000, 0x422c0000, 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002,
3318 0x0000035c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000,
3319 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000,
3320 0x42080000, 0x00000008, 0x3478336d, 0x00776f72, 0x00000003, 0x00000002, 0x000003b4, 0x00000000,
3321 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3322 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b,
3323 0x3378346d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000410, 0x00000000, 0x00000000,
3324 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3325 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d,
3326 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x0000044c, 0x00000000, 0x00000000, 0x00000002,
3327 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72,
3328 0x00000003, 0x00000002, 0x00000484, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000,
3329 0x41400000, 0x41a80000, 0x41b00000, 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003,
3330 0x00000002, 0x000004c8, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3331 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003,
3332 0x00000002, 0x00000508, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000,
3333 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d,
3334 0x00000003, 0x00000002, 0x0000054c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3335 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72,
3336 0x00000003, 0x00000002, 0x0000058c, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000,
3337 0x41400000, 0x41a80000, 0x41b00000, 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63,
3338 0x00006e6d, 0x00000001, 0x00000002, 0x000005d0, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
3339 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d,
3340 0x776f7233, 0x00000000, 0x00000001, 0x00000002, 0x00000614, 0x00000000, 0x00000000, 0x00000002,
3341 0x00000003, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c,
3342 0x7832626d, 0x6c6f6333, 0x006e6d75, 0x00000000, 0x00000005, 0x000006b0, 0x00000000, 0x00000001,
3343 0x00000003, 0x00000003, 0x00000001, 0x000006b8, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3344 0x00000003, 0x00000000, 0x000006c0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3345 0x00000001, 0x000006c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000,
3346 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374,
3347 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005,
3348 0x0000077c, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000784, 0x00000000,
3349 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x0000078c, 0x00000000, 0x00000000,
3350 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000794, 0x00000000, 0x00000000, 0x00000004,
3351 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3352 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
3353 0x41000000, 0x00000004, 0x00327374, 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003,
3354 0x00003276, 0x00000000, 0x00000005, 0x00000860, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3355 0x00000005, 0x00000868, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x00000870,
3356 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x00000878, 0x00000000,
3357 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x00000880, 0x00000000, 0x00000000,
3358 0x00000004, 0x00000001, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000,
3359 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3360 0x41700000, 0x41800000, 0x00000004, 0x00337374, 0x00000003, 0x00007374, 0x00000003, 0x00003176,
3361 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, 0x000008a8, 0x00000000,
3362 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, 0x00000000, 0x00000003,
3363 0x00000000, 0x000008d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x42b80000, 0x42ba0000,
3364 0x00000005, 0x32727261, 0x00000000, 0x00000007, 0x00000004, 0x000008fc, 0x00000000, 0x00000000,
3365 0x00000004, 0x00000005, 0x31786574, 0x00000000, 0x00000007, 0x00000004, 0x00000920, 0x00000000,
3366 0x00000000, 0x00000005, 0x00000005, 0x32786574, 0x00000000, 0x0000000a, 0x00000004, 0x000009cc,
3367 0x00000000, 0x00000000, 0x00000006, 0x00000007, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3368 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3369 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3370 0x00000003, 0x000000a4, 0x00000100, 0x00000944, 0x00000940, 0x000000aa, 0x00000100, 0x0000095c,
3371 0x00000958, 0x000000a9, 0x00000100, 0x0000097c, 0x00000978, 0x00000009, 0x706d6173, 0x3172656c,
3372 0x00000000, 0x00000010, 0x00000004, 0x000009f8, 0x00000000, 0x00000002, 0x00000007, 0x00000008,
3373 0x00000008, 0x615f7376, 0x00327272, 0x0000000f, 0x00000004, 0x00000a1c, 0x00000000, 0x00000001,
3374 0x00000009, 0x00000007, 0x615f7370, 0x00007272, 0x0000000a, 0x00000010, 0x00000004, 0x00000000,
3375 0x00000000, 0x00000000, 0x0000000b, 0x0000000f, 0x00000004, 0x00000000, 0x00000000, 0x00000000,
3376 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3377 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3378 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3379 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3380 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3381 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3382 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3383 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
3384 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
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 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3393 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3394 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3395 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3396 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3397 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3398 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3399 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3400 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3401 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3402 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3403 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3404 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3405 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3406 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3407 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3408 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3409 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3410 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3411 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3412 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3413 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3414 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3415 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3416 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3417 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3418 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3419 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3420 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3421 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3422 0x00000001, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3423 0x00000001, 0x00000003, 0x00003070, 0x0000000c, 0x00000010, 0x00000004, 0x00000000, 0x00000000,
3424 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574, 0x00000030, 0x00000021, 0x00000001,
3425 0x0000000c, 0x0000000d, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058,
3426 0x00000000, 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x000000d0, 0x000000ec,
3427 0x00000000, 0x00000000, 0x00000108, 0x00000124, 0x00000000, 0x00000000, 0x00000140, 0x0000015c,
3428 0x00000000, 0x00000000, 0x00000178, 0x00000194, 0x00000000, 0x00000000, 0x000001b8, 0x000001d4,
3429 0x00000000, 0x00000000, 0x000001ec, 0x00000208, 0x00000000, 0x00000000, 0x00000224, 0x00000238,
3430 0x00000000, 0x00000000, 0x00000250, 0x0000026c, 0x00000000, 0x00000000, 0x000002b8, 0x000002d4,
3431 0x00000000, 0x00000000, 0x00000310, 0x0000032c, 0x00000000, 0x00000000, 0x00000368, 0x00000384,
3432 0x00000000, 0x00000000, 0x000003c4, 0x000003e0, 0x00000000, 0x00000000, 0x00000420, 0x0000043c,
3433 0x00000000, 0x00000000, 0x00000458, 0x00000474, 0x00000000, 0x00000000, 0x00000494, 0x000004b0,
3434 0x00000000, 0x00000000, 0x000004d4, 0x000004f0, 0x00000000, 0x00000000, 0x00000518, 0x00000534,
3435 0x00000000, 0x00000000, 0x00000558, 0x00000574, 0x00000000, 0x00000000, 0x0000059c, 0x000005b8,
3436 0x00000000, 0x00000000, 0x000005e0, 0x000005fc, 0x00000000, 0x00000000, 0x00000624, 0x00000690,
3437 0x00000000, 0x00000000, 0x000006d0, 0x0000073c, 0x00000001, 0x00000000, 0x0000079c, 0x00000820,
3438 0x00000000, 0x00000000, 0x00000888, 0x000008a4, 0x00000000, 0x00000000, 0x000008b4, 0x000008d0,
3439 0x00000001, 0x00000000, 0x000008e4, 0x000008f8, 0x00000000, 0x00000000, 0x00000908, 0x0000091c,
3440 0x00000000, 0x00000000, 0x0000092c, 0x00000998, 0x00000000, 0x00000000, 0x000009dc, 0x000009f0,
3441 0x00000001, 0x00000000, 0x00000a04, 0x00000a18, 0x00000000, 0x00000000, 0x00001064, 0x00000000,
3442 0x00000002, 0x0000103c, 0x00000000, 0x0000002a, 0x00000092, 0x00000000, 0x00000a2c, 0x00000a28,
3443 0x00000093, 0x00000000, 0x00000a44, 0x00000a40, 0x00000091, 0x00000000, 0x00000a5c, 0x00000a58,
3444 0x00000091, 0x00000001, 0x00000a7c, 0x00000a78, 0x00000091, 0x00000002, 0x00000a9c, 0x00000a98,
3445 0x00000091, 0x00000003, 0x00000abc, 0x00000ab8, 0x00000091, 0x00000004, 0x00000adc, 0x00000ad8,
3446 0x00000091, 0x00000005, 0x00000afc, 0x00000af8, 0x00000091, 0x00000006, 0x00000b1c, 0x00000b18,
3447 0x00000091, 0x00000007, 0x00000b3c, 0x00000b38, 0x00000084, 0x00000000, 0x00000b5c, 0x00000b58,
3448 0x00000084, 0x00000001, 0x00000b7c, 0x00000b78, 0x00000084, 0x00000002, 0x00000b9c, 0x00000b98,
3449 0x00000084, 0x00000003, 0x00000bbc, 0x00000bb8, 0x00000084, 0x00000004, 0x00000bdc, 0x00000bd8,
3450 0x00000084, 0x00000005, 0x00000bfc, 0x00000bf8, 0x00000084, 0x00000006, 0x00000c1c, 0x00000c18,
3451 0x00000084, 0x00000007, 0x00000c3c, 0x00000c38, 0x00000085, 0x00000000, 0x00000c68, 0x00000c58,
3452 0x00000085, 0x00000001, 0x00000c94, 0x00000c84, 0x00000085, 0x00000002, 0x00000cc0, 0x00000cb0,
3453 0x00000085, 0x00000003, 0x00000cec, 0x00000cdc, 0x00000085, 0x00000004, 0x00000d18, 0x00000d08,
3454 0x00000085, 0x00000005, 0x00000d44, 0x00000d34, 0x00000085, 0x00000006, 0x00000d70, 0x00000d60,
3455 0x00000085, 0x00000007, 0x00000d9c, 0x00000d8c, 0x00000087, 0x00000000, 0x00000dc8, 0x00000db8,
3456 0x00000087, 0x00000001, 0x00000df4, 0x00000de4, 0x00000087, 0x00000002, 0x00000e20, 0x00000e10,
3457 0x00000087, 0x00000003, 0x00000e4c, 0x00000e3c, 0x00000087, 0x00000004, 0x00000e78, 0x00000e68,
3458 0x00000087, 0x00000005, 0x00000ea4, 0x00000e94, 0x00000087, 0x00000006, 0x00000ed0, 0x00000ec0,
3459 0x00000087, 0x00000007, 0x00000efc, 0x00000eec, 0x00000086, 0x00000000, 0x00000f28, 0x00000f18,
3460 0x00000086, 0x00000001, 0x00000f54, 0x00000f44, 0x00000086, 0x00000002, 0x00000f80, 0x00000f70,
3461 0x0000000e, 0x00000000, 0x00000fa0, 0x00000f9c, 0x00000014, 0x00000000, 0x00000fc0, 0x00000fbc,
3462 0x00000012, 0x00000000, 0x00000fe0, 0x00000fdc, 0x00000041, 0x00000000, 0x00001000, 0x00000ffc,
3463 0x00000042, 0x00000000, 0x00001020, 0x0000101c, 0x0000105c, 0x00000000, 0x00000001, 0x00000092,
3464 0x00000000, 0x00001048, 0x00001044, 0x00000008, 0x0000001d, 0x00000009, 0x000007cc, 0xffff0300,
3465 0x00c0fffe, 0x42415443, 0x0000001c, 0x000002cb, 0xffff0300, 0x00000009, 0x0000001c, 0x00000000,
3466 0x000002c4, 0x000000d0, 0x00000001, 0x00000001, 0x000000d8, 0x000000e8, 0x000000f8, 0x00080002,
3467 0x00000002, 0x00000104, 0x00000114, 0x00000134, 0x00060002, 0x00000002, 0x0000013c, 0x0000014c,
3468 0x0000016c, 0x00000002, 0x00000003, 0x00000178, 0x00000188, 0x000001b8, 0x000a0002, 0x00000002,
3469 0x000001c0, 0x000001d0, 0x000001f0, 0x000c0002, 0x00000002, 0x000001fc, 0x0000020c, 0x0000022c,
3470 0x00030002, 0x00000003, 0x00000234, 0x00000244, 0x00000274, 0x00000000, 0x00000005, 0x00000280,
3471 0x00000290, 0x000002a8, 0x00000003, 0x00000001, 0x000002b4, 0x00000000, 0x56695f67, 0x00746365,
3472 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x00000004, 0x00000003, 0x00000002, 0x00000001,
3473 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3474 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x3278326d,
3475 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3476 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d, 0x756c6f63, 0xab006e6d,
3477 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000,
3478 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000, 0x00000000, 0x00000000,
3479 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41400000,
3480 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, 0x3278336d, 0x756c6f63,
3481 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3482 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d, 0x00776f72, 0x00030002,
3483 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000, 0x00000000, 0x41a80000,
3484 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000, 0x00000000, 0x7832626d,
3485 0x776f7233, 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, 0xffffffff, 0x00000000,
3486 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x706d6173, 0x3172656c, 0xababab00, 0x000c0004,
3487 0x00010001, 0x00000001, 0x00000000, 0x335f7370, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
3488 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3489 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, 0x3f800000, 0xbe22f983, 0x05000051,
3490 0xa00f000f, 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, 0x05000051, 0xa00f0010, 0x40c90fdb,
3491 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x0200001f, 0x80000005, 0x90030000, 0x0200001f, 0x8000000a,
3492 0x900f0001, 0x0200001f, 0x90000000, 0xa00f0800, 0x03000005, 0x80030000, 0xa0e40007, 0x90550001,
3493 0x04000004, 0x80030000, 0x90000001, 0xa0e40006, 0x80e40000, 0x03000002, 0x80030000, 0x80e40000,
3494 0x90e40001, 0x02000001, 0x80010001, 0xa000000f, 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40008,
3495 0x80000001, 0x0400005a, 0x80020002, 0x90e40001, 0xa0e40009, 0x80000001, 0x03000002, 0x80030000,
3496 0x80e40000, 0x80e40002, 0x03000005, 0x800c0000, 0xa0440004, 0x90550001, 0x04000004, 0x800c0000,
3497 0x90000001, 0xa0440003, 0x80e40000, 0x04000004, 0x800c0000, 0x90aa0001, 0xa0440005, 0x80e40000,
3498 0x03000002, 0x80030000, 0x80ee0000, 0x80e40000, 0x03000008, 0x80010002, 0x90e40001, 0xa0e4000c,
3499 0x03000008, 0x80020002, 0x90e40001, 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002,
3500 0x03000005, 0x800e0001, 0xa090000b, 0x90550001, 0x04000004, 0x800e0001, 0x90000001, 0xa090000a,
3501 0x80e40001, 0x02000001, 0x80040000, 0x90aa0001, 0x03000002, 0x80070000, 0x80e40000, 0x80f90001,
3502 0x0400005a, 0x80010002, 0x90e40001, 0xa0e40000, 0x80000001, 0x0400005a, 0x80020002, 0x90e40001,
3503 0xa0e40001, 0x80000001, 0x0400005a, 0x80040002, 0x90e40001, 0xa0e40002, 0x80000001, 0x03000002,
3504 0x80070000, 0x80e40000, 0x80e40002, 0x02000001, 0x80070003, 0x80e40000, 0x01000026, 0xf0e40000,
3505 0x03000002, 0x80070003, 0x80e40002, 0x80e40003, 0x00000027, 0x01000028, 0xe0e40804, 0x02000001,
3506 0x80080003, 0x90ff0001, 0x04000004, 0x800f0000, 0x80e40003, 0xa055000f, 0xa0aa000f, 0x02000013,
3507 0x800f0000, 0x80e40000, 0x04000004, 0x800f0000, 0x80e40000, 0xa0000010, 0xa0550010, 0x03000005,
3508 0x800f0000, 0x80e40000, 0x80e40000, 0x04000004, 0x800f0002, 0x80e40000, 0xa0aa0010, 0xa0ff0010,
3509 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa0ff000f, 0x04000004, 0x800f0002, 0x80e40000,
3510 0x80e40002, 0xa000000e, 0x04000004, 0x800f0002, 0x80e40000, 0x80e40002, 0xa055000e, 0x04000004,
3511 0x800f0000, 0x80e40000, 0x80e40002, 0x80e40003, 0x03000002, 0x800f0000, 0x80e40000, 0xa0aa000e,
3512 0x04000004, 0x800f0002, 0x80e40000, 0xa1ff000e, 0xa155000e, 0x02000013, 0x800f0002, 0x80e40002,
3513 0x04000004, 0x800f0002, 0x80e40002, 0xa0000010, 0xa0550010, 0x03000005, 0x800f0002, 0x80e40002,
3514 0x80e40002, 0x04000004, 0x800f0004, 0x80e40002, 0xa0aa0010, 0xa0ff0010, 0x04000004, 0x800f0004,
3515 0x80e40002, 0x80e40004, 0xa0ff000f, 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa000000e,
3516 0x04000004, 0x800f0004, 0x80e40002, 0x80e40004, 0xa055000e, 0x04000004, 0x800f0000, 0x80e40002,
3517 0x80e40004, 0x80e40000, 0x03000002, 0x800f0003, 0x80e40000, 0xa0aa000e, 0x0400005a, 0x80010000,
3518 0x80e40003, 0xa0e40000, 0x80000001, 0x0400005a, 0x80020000, 0x80e40003, 0xa0e40001, 0x80000001,
3519 0x0400005a, 0x80040000, 0x80e40003, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000,
3520 0x80e40003, 0x03000005, 0x80070001, 0x80550000, 0xa0e4000b, 0x04000004, 0x80070001, 0x80000000,
3521 0xa0e4000a, 0x80e40001, 0x03000002, 0x80070003, 0x80e40000, 0x80e40001, 0x03000008, 0x80010000,
3522 0x80e40003, 0xa0e4000c, 0x03000008, 0x80020000, 0x80e40003, 0xa0e4000d, 0x03000002, 0x80030000,
3523 0x80e40000, 0x80e40003, 0x03000005, 0x800c0000, 0x80550000, 0xa0440004, 0x04000004, 0x800c0000,
3524 0x80000000, 0xa0440003, 0x80e40000, 0x04000004, 0x800c0000, 0x80aa0003, 0xa0440005, 0x80e40000,
3525 0x03000002, 0x80030003, 0x80ee0000, 0x80e40000, 0x0000002a, 0x02000001, 0x80080003, 0x90ff0001,
3526 0x0000002b, 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, 0x03000002, 0x800f0800, 0x80e40000,
3527 0x80e40003, 0x0000ffff, 0x00000007, 0x00000b0c, 0xfffe0300, 0x012ffffe, 0x42415443, 0x0000001c,
3528 0x00000487, 0xfffe0300, 0x0000000b, 0x0000001c, 0x00000000, 0x00000480, 0x000000f8, 0x00200002,
3529 0x00000001, 0x00000100, 0x00000110, 0x00000120, 0x001d0002, 0x00000002, 0x00000128, 0x00000138,
3530 0x00000158, 0x001f0002, 0x00000001, 0x00000160, 0x00000170, 0x00000180, 0x00100002, 0x00000004,
3531 0x0000018c, 0x0000019c, 0x000001dc, 0x00140002, 0x00000003, 0x000001e4, 0x000001f4, 0x00000224,
3532 0x00170002, 0x00000003, 0x00000230, 0x00000240, 0x00000270, 0x000c0002, 0x00000004, 0x00000278,
3533 0x00000288, 0x000002c8, 0x00000003, 0x00000001, 0x000002d4, 0x00000000, 0x000002e4, 0x001a0002,
3534 0x00000003, 0x0000033c, 0x0000034c, 0x0000037c, 0x00000002, 0x00000006, 0x00000380, 0x00000390,
3535 0x000003f0, 0x00060002, 0x00000006, 0x00000410, 0x00000420, 0x31727261, 0xababab00, 0x00030000,
3536 0x00010001, 0x00000001, 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, 0x32727261,
3537 0xababab00, 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, 0x00000000,
3538 0x00000000, 0x42ba0000, 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003173, 0x00030001,
3539 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d,
3540 0x756c6f63, 0xab006e6d, 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3541 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000,
3542 0x42040000, 0x00000000, 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72,
3543 0x00030002, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000,
3544 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000,
3545 0x3378346d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000,
3546 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000,
3547 0x41b80000, 0x42040000, 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001,
3548 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000,
3549 0x00000000, 0x41f80000, 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000,
3550 0x00000000, 0x706d6173, 0x3172656c, 0xababab00, 0x000c0004, 0x00010001, 0x00000001, 0x00000000,
3551 0x00317374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000,
3552 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3553 0x000002e8, 0x000002ec, 0x000002fc, 0x00000300, 0x00000310, 0x00000314, 0x00000005, 0x00080001,
3554 0x00030001, 0x00000324, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3555 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005,
3556 0x00080001, 0x00030002, 0x00000324, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3557 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3558 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3559 0x40c00000, 0x40e00000, 0x41000000, 0x00337374, 0xab007374, 0x00000005, 0x00080001, 0x00030002,
3560 0x00000324, 0x000003f4, 0x000003f8, 0x00000005, 0x00100001, 0x00010001, 0x00000408, 0x3f800000,
3561 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3562 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000,
3563 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x335f7376,
3564 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3565 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x00f0fffe, 0x53455250, 0x46580201,
3566 0x0047fffe, 0x42415443, 0x0000001c, 0x000000e7, 0x46580201, 0x00000003, 0x0000001c, 0x00000100,
3567 0x000000e4, 0x00000058, 0x00020002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00030002,
3568 0x00000001, 0x00000088, 0x00000070, 0x00000098, 0x00000002, 0x00000002, 0x000000a4, 0x000000b4,
3569 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3570 0x00000000, 0x00000000, 0x6f505f67, 0xab003273, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3571 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001, 0x00040001, 0x00000003, 0x00000000, 0x00000000,
3572 0x00000000, 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x459c4800,
3573 0x459c5000, 0x459c5800, 0x459c6000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3574 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3575 0x000cfffe, 0x49535250, 0x00000021, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
3576 0x00000001, 0x00000021, 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018,
3577 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3578 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3579 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3580 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3581 0x00000000, 0x3fe00000, 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000,
3582 0x00000000, 0x40100000, 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000,
3583 0x0064fffe, 0x434c5846, 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011,
3584 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002,
3585 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007,
3586 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002,
3587 0x0000000c, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3588 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004,
3589 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004,
3590 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000,
3591 0x00000007, 0x0000000c, 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000,
3592 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000,
3593 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004,
3594 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008,
3595 0x00000000, 0x00000004, 0x00000084, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f0022,
3596 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f,
3597 0x90000000, 0xa00f0800, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001,
3598 0x0200001f, 0x8000000a, 0xe00f0002, 0x03000009, 0x80010000, 0x90e40000, 0xa0e40017, 0x03000009,
3599 0x80020000, 0x90e40000, 0xa0e40018, 0x03000009, 0x80040000, 0x90e40000, 0xa0e40019, 0x03000008,
3600 0x80010001, 0x90e40000, 0xa0e40010, 0x03000008, 0x80020001, 0x90e40000, 0xa0e40011, 0x03000008,
3601 0x80040001, 0x90e40000, 0xa0e40012, 0x03000008, 0x80080001, 0x90e40000, 0xa0e40013, 0x02000001,
3602 0x80080000, 0xa0000022, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005, 0x800f0001,
3603 0xa0e40015, 0x90550000, 0x04000004, 0x800f0001, 0x90000000, 0xa0e40014, 0x80e40001, 0x04000004,
3604 0x800f0001, 0x90aa0000, 0xa0e40016, 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001,
3605 0x03000005, 0x80070001, 0xa0e4000d, 0x90550000, 0x04000004, 0x80070001, 0x90000000, 0xa0e4000c,
3606 0x80e40001, 0x04000004, 0x80070001, 0x90aa0000, 0xa0e4000e, 0x80e40001, 0x04000004, 0x80070001,
3607 0x90ff0000, 0xa0e4000f, 0x80e40001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40001, 0x04000004,
3608 0x800f0000, 0x90e40000, 0xa000001b, 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e4001c,
3609 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000004,
3610 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000, 0x80e40000,
3611 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000020, 0x80e40000, 0x04000004, 0x800f0000,
3612 0x90e40000, 0xa000001e, 0x80e40000, 0x04000004, 0x800f0000, 0x90e40000, 0xa000000a, 0x80e40000,
3613 0x03000009, 0x80010001, 0x90e40000, 0xa0e4000b, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001,
3614 0x0300005f, 0x800f0001, 0xa0e4001f, 0xa0e40800, 0x03000002, 0xe00f0002, 0x80e40000, 0x80e40001,
3615 0x02000001, 0xe00f0000, 0xa0e40021, 0x02000001, 0xe0030001, 0xa0000022, 0x0000ffff, 0x00000008,
3616 0x000001dc, 0xfffe0300, 0x0016fffe, 0x42415443, 0x0000001c, 0x00000023, 0xfffe0300, 0x00000000,
3617 0x00000000, 0x00000000, 0x0000001c, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
3618 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3619 0x00313131, 0x0045fffe, 0x53455250, 0x46580201, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
3620 0x46580201, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
3621 0x00000038, 0x00000048, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3622 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3623 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3624 0x00313131, 0x000cfffe, 0x49535250, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
3625 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x0002fffe, 0x54494c43,
3626 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000004, 0x00000001, 0x00000000, 0x00000002,
3627 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051,
3628 0xa00f0001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0xe00f0000,
3629 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, 0x02000001, 0xe00f0000,
3630 0xa0e40000, 0x02000001, 0xe0030001, 0xa0000001, 0x02000001, 0xe00f0002, 0xa0000001, 0x0000ffff,
3631 0x00000005, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051,
3632 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000,
3633 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000, 0x40000000,
3634 0x40000000, 0x40000000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003, 0x0000002c,
3635 0xfffe0200, 0x05000051, 0xa00f0000, 0x40400000, 0x40400000, 0x40400000, 0x40400000, 0x02000001,
3636 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000002,
3637 0x000000e8, 0x00000008, 0x615f7376, 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
3638 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
3639 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001,
3640 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73,
3641 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3642 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
3643 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000000,
3644 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000029, 0x00000000,
3645 0x00000198, 0x46580200, 0x0053fffe, 0x42415443, 0x0000001c, 0x00000117, 0x46580200, 0x00000001,
3646 0x0000001c, 0x20000100, 0x00000114, 0x00000030, 0x00000002, 0x00000005, 0x000000a4, 0x000000b4,
3647 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666,
3648 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001,
3649 0x00000000, 0x00000037, 0x0000003c, 0x0000004c, 0x00000050, 0x00000060, 0x00000064, 0x00000005,
3650 0x00080001, 0x00030002, 0x00000074, 0x00000034, 0x0000008c, 0x00000005, 0x00100001, 0x00010001,
3651 0x0000009c, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000,
3652 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000, 0x41300000,
3653 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000,
3654 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3655 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3656 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002,
3657 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3658 0x00000000, 0xffffffff, 0x00000028, 0x00000000, 0x00000198, 0x46580200, 0x0053fffe, 0x42415443,
3659 0x0000001c, 0x00000117, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000114, 0x00000030,
3660 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x00337374, 0x76007374, 0xabab0031, 0x00030001,
3661 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000,
3662 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000037, 0x0000003c, 0x0000004c,
3663 0x00000050, 0x00000060, 0x00000064, 0x00000005, 0x00080001, 0x00030002, 0x00000074, 0x00000034,
3664 0x0000008c, 0x00000005, 0x00100001, 0x00010001, 0x0000009c, 0x3f800000, 0x40000000, 0x40400000,
3665 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000,
3666 0x41000000, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000,
3667 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x4d007874, 0x6f726369, 0x74666f73,
3668 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3669 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001,
3670 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
3671 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000027, 0x00000000,
3672 0x0000017c, 0x46580200, 0x004cfffe, 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001,
3673 0x0000001c, 0x20000100, 0x000000f8, 0x00000030, 0x00000002, 0x00000005, 0x00000088, 0x00000098,
3674 0x00327374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000,
3675 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3676 0x00000034, 0x00000038, 0x00000048, 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001,
3677 0x00030002, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3678 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
3679 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
3680 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3681 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3682 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3683 0x00000002, 0x00000010, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3684 0x00000000, 0x00000000, 0xffffffff, 0x00000026, 0x00000000, 0x0000017c, 0x46580200, 0x004cfffe,
3685 0x42415443, 0x0000001c, 0x000000fb, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x000000f8,
3686 0x00000030, 0x00000002, 0x00000002, 0x00000088, 0x00000098, 0x00327374, 0xab003176, 0x00030001,
3687 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000,
3688 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000034, 0x00000038, 0x00000048,
3689 0x0000004c, 0x0000005c, 0x00000060, 0x00000005, 0x00080001, 0x00030002, 0x00000070, 0x00000000,
3690 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3691 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000,
3692 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x4d007874,
3693 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3694 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
3695 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
3696 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3697 0x00000024, 0x00000000, 0x00000770, 0x46580200, 0x008cfffe, 0x42415443, 0x0000001c, 0x000001fb,
3698 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x000001f8, 0x0000006c, 0x000b0002, 0x00000001,
3699 0x00000074, 0x00000084, 0x00000094, 0x00060002, 0x00000004, 0x0000009c, 0x000000ac, 0x000000ec,
3700 0x00000002, 0x00000006, 0x00000160, 0x00000170, 0x000001d0, 0x000a0002, 0x00000001, 0x000001d8,
3701 0x000001e8, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000,
3702 0x40400000, 0x40000000, 0x3f800000, 0x3478346d, 0xababab00, 0x00030003, 0x00040004, 0x00000001,
3703 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, 0x42240000, 0x41400000, 0x41b00000, 0x42000000,
3704 0x42280000, 0x41500000, 0x41b80000, 0x42040000, 0x422c0000, 0x41600000, 0x41c00000, 0x42080000,
3705 0x42300000, 0x00337374, 0x76007374, 0xabab0031, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3706 0xab007666, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001,
3707 0x00000001, 0x00000000, 0x000000f3, 0x000000f8, 0x00000108, 0x0000010c, 0x0000011c, 0x00000120,
3708 0x00000005, 0x00080001, 0x00030002, 0x00000130, 0x000000f0, 0x00000148, 0x00000005, 0x00100001,
3709 0x00010001, 0x00000158, 0x3f800000, 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000,
3710 0x00000000, 0x00000000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x41100000, 0x41200000,
3711 0x41300000, 0x00000000, 0x41400000, 0x00000000, 0x00000000, 0x00000000, 0x41500000, 0x41600000,
3712 0x41700000, 0x41800000, 0x33636576, 0xababab00, 0x00030001, 0x00030001, 0x00000001, 0x00000000,
3713 0x447a4000, 0x447a8000, 0x447ac000, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3714 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3715 0x00313131, 0x008afffe, 0x54494c43, 0x00000044, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3716 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3717 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3718 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3719 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3720 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3721 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3722 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3723 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3724 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3725 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3726 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3727 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000,
3728 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000,
3729 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3730 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3731 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x40080000, 0x00000000, 0x3ff00000,
3732 0x00000000, 0x40000000, 0x00000000, 0x00000000, 0x00c1fffe, 0x434c5846, 0x0000000e, 0x50000004,
3733 0x00000002, 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000002, 0x0000002e, 0x00000001,
3734 0x0000003c, 0x00000000, 0x00000007, 0x00000000, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3735 0x0000001c, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007,
3736 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002,
3737 0x0000002e, 0x00000001, 0x0000003c, 0x00000000, 0x00000007, 0x00000002, 0x50000004, 0x00000002,
3738 0x00000000, 0x00000002, 0x00000024, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x0000003c,
3739 0x00000000, 0x00000007, 0x00000003, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x0000002f,
3740 0x00000000, 0x00000002, 0x0000002f, 0x00000000, 0x00000007, 0x00000004, 0x50000004, 0x00000002,
3741 0x00000000, 0x00000002, 0x00000018, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030,
3742 0x00000000, 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x0000001c,
3743 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x00000009,
3744 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000007, 0x00000004,
3745 0x00000001, 0x00000030, 0x00000000, 0x00000007, 0x0000000a, 0x50000004, 0x00000002, 0x00000000,
3746 0x00000002, 0x00000024, 0x00000001, 0x00000007, 0x00000004, 0x00000001, 0x00000030, 0x00000000,
3747 0x00000007, 0x0000000b, 0x50000004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3748 0x00000007, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x50000003, 0x00000002, 0x00000000,
3749 0x00000002, 0x00000028, 0x00000001, 0x00000002, 0x0000002e, 0x00000001, 0x00000030, 0x00000000,
3750 0x00000004, 0x00000002, 0x70e00001, 0x00000006, 0x00000000, 0x00000001, 0x00000041, 0x00000000,
3751 0x00000001, 0x00000042, 0x00000000, 0x00000001, 0x00000040, 0x00000001, 0x00000002, 0x0000002f,
3752 0x00000001, 0x00000030, 0x00000001, 0x00000002, 0x0000002f, 0x00000001, 0x00000031, 0x00000001,
3753 0x00000002, 0x0000002f, 0x00000001, 0x00000032, 0x00000000, 0x00000004, 0x00000003, 0xa0500001,
3754 0x00000002, 0x00000000, 0x00000002, 0x0000002c, 0x00000000, 0x00000001, 0x00000040, 0x00000000,
3755 0x00000007, 0x00000000, 0x10000001, 0x00000001, 0x00000001, 0x00000007, 0x00000000, 0x00000002,
3756 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3757 0x00000000, 0xffffffff, 0x00000023, 0x00000000, 0x000004ec, 0x46580200, 0x005afffe, 0x42415443,
3758 0x0000001c, 0x00000133, 0x46580200, 0x00000004, 0x0000001c, 0x20000100, 0x00000130, 0x0000006c,
3759 0x00000002, 0x00000003, 0x00000078, 0x00000088, 0x000000b8, 0x000a0002, 0x00000001, 0x000000c0,
3760 0x000000d0, 0x000000e0, 0x00080002, 0x00000001, 0x000000e8, 0x000000f8, 0x00000108, 0x00090002,
3761 0x00000001, 0x00000110, 0x00000120, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001, 0x00040001,
3762 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000, 0x41200000,
3763 0x41200000, 0x41200000, 0x459c4800, 0x459c5000, 0x459c5800, 0x459c6000, 0x56695f67, 0x00746365,
3764 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000,
3765 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3766 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3767 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3768 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3769 0x00313131, 0x007afffe, 0x54494c43, 0x0000003c, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3770 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3771 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3772 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3773 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3774 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3775 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3776 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3777 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3778 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3779 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3780 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x00000000, 0x00000000,
3781 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3ff00000,
3782 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3783 0x00000000, 0x3ff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3784 0x00000000, 0x00000000, 0x00000000, 0x3ff00000, 0x0062fffe, 0x434c5846, 0x00000008, 0x50000004,
3785 0x00000002, 0x00000000, 0x00000002, 0x00000020, 0x00000001, 0x00000002, 0x0000002a, 0x00000001,
3786 0x0000002c, 0x00000000, 0x00000004, 0x00000000, 0x10400001, 0x00000001, 0x00000000, 0x00000002,
3787 0x00000025, 0x00000000, 0x00000007, 0x00000000, 0x10100001, 0x00000001, 0x00000000, 0x00000007,
3788 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0xa0400001, 0x00000002, 0x00000000, 0x00000002,
3789 0x00000025, 0x00000000, 0x00000001, 0x0000002c, 0x00000000, 0x00000007, 0x00000000, 0xa0400001,
3790 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000,
3791 0x00000007, 0x00000008, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000028, 0x00000001,
3792 0x00000007, 0x00000008, 0x00000001, 0x0000002c, 0x00000000, 0x00000004, 0x00000001, 0xa0400001,
3793 0x00000002, 0x00000001, 0x00000002, 0x0000002b, 0x00000002, 0x00000010, 0x00000001, 0x00000002,
3794 0x0000002b, 0x00000002, 0x0000001d, 0x00000000, 0x00000004, 0x00000002, 0xa0400001, 0x00000002,
3795 0x00000001, 0x00000002, 0x00000028, 0x00000002, 0x00000001, 0x00000001, 0x00000002, 0x0000002b,
3796 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3797 0x00000000, 0x00000000, 0xffffffff, 0x00000022, 0x00000000, 0x000002cc, 0x46580200, 0x0033fffe,
3798 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
3799 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
3800 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3801 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
3802 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
3803 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3804 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 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, 0x0061fffe, 0x434c5846,
3808 0x00000006, 0xa0500001, 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002,
3809 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0xa0500001, 0x00000002, 0x00000000, 0x00000002,
3810 0x00000000, 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000001, 0xa0400001,
3811 0x00000002, 0x00000000, 0x00000007, 0x00000001, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3812 0x00000004, 0x00000000, 0x70e00001, 0x00000006, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3813 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004,
3814 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000002, 0x00000006, 0x00000000, 0x00000004,
3815 0x00000001, 0x70e00001, 0x00000008, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002,
3816 0x00000002, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3817 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000005,
3818 0x00000000, 0x00000002, 0x00000005, 0x00000000, 0x00000004, 0x00000002, 0x10000001, 0x00000001,
3819 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f,
3820 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248, 0x46580200,
3821 0x003efffe, 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100,
3822 0x000000c0, 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002,
3823 0x00000001, 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0, 0x00000070,
3824 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3825 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3826 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001, 0x00040001,
3827 0x00000001, 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3828 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0022fffe,
3829 0x54494c43, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3830 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3831 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3832 0x00000000, 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3833 0x00000000, 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002, 0x00000000,
3834 0x00000001, 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000,
3835 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000000,
3836 0x00000000, 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000008,
3837 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000,
3838 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3839 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0, 0x46580200,
3840 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3841 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3842 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3843 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3844 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3845 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3846 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000,
3847 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3848 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3849 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x002afffe,
3850 0x434c5846, 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3851 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002, 0x00000000,
3852 0x00000002, 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000002,
3853 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000000,
3854 0x10000001, 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003,
3855 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f, 0x00000000,
3856 0x000001a8, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3857 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3858 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3859 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3860 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe,
3861 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3862 0x00000000, 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3863 0x00000000, 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001, 0x00000000,
3864 0x00000002, 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001, 0x00000000,
3865 0x00000002, 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001, 0x00000000,
3866 0x00000002, 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001, 0x00000000,
3867 0x00000002, 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002, 0x00000000,
3868 0x00000001, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
3869 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e, 0x00000000,
3870 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3871 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3872 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3873 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3874 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3875 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001, 0x00000000,
3876 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3877 0x00000000, 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
3878 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
3879 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
3880 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874,
3881 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3882 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
3883 0x434c5846, 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3884 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3885 0x0000001c, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097,
3886 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001,
3887 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f,
3888 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3889 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
3890 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3891 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3892 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004, 0x00000002,
3893 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
3894 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001b,
3895 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200,
3896 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c,
3897 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463,
3898 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3899 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000,
3900 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3901 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3902 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002, 0x00000000,
3903 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
3904 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a, 0x00000000,
3905 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3906 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3907 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3908 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3909 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3910 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001, 0x00000000,
3911 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3912 0x00000000, 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe,
3913 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
3914 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001,
3915 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874,
3916 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3917 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe,
3918 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3919 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000,
3920 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000,
3921 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000,
3922 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3923 0x00000018, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
3924 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
3925 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3926 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3927 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3928 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10100004,
3929 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3930 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000124,
3931 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c,
3932 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c,
3933 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3934 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463,
3935 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000,
3936 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320,
3937 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000,
3938 0x000ffffe, 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002, 0x00000000,
3939 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3940 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124, 0x46580200,
3941 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3942 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3943 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3944 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3945 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3946 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3947 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
3948 0x434c5846, 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3949 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3950 0x00000000, 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
3951 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
3952 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
3953 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3954 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
3955 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
3956 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3957 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
3958 0x00000001, 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3959 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3960 0x00000000, 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443,
3961 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044,
3962 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074,
3963 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3964 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3965 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3966 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3967 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001,
3968 0x20500004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004,
3969 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3970 0xffffffff, 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
3971 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002,
3972 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3973 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73,
3974 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3975 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004,
3976 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
3977 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001,
3978 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002,
3979 0x10700001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003,
3980 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012, 0x00000000,
3981 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3982 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3983 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3984 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3985 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3986 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000,
3987 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000,
3988 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000,
3989 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000,
3990 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3991 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000002, 0x00000134, 0x00000008, 0x615f7370,
3992 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3993 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3994 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000,
3995 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3996 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe,
3997 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3998 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3999 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0xa0400001, 0x00000002, 0x00000000,
4000 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
4001 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0x00000002,
4002 0x00000134, 0x00000008, 0x615f7376, 0x00327272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c,
4003 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002,
4004 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001,
4005 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73,
4006 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
4007 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, 0x00000008, 0x00000000, 0x00000000, 0x00000000,
4008 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xbff00000, 0x00000000,
4009 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001,
4010 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000001, 0x00000004,
4011 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e,
4012 0x00000000, 0x00000002, 0x00000000, 0x000000f0, 0x46580200, 0x0026fffe, 0x42415443, 0x0000001c,
4013 0x00000063, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000060, 0x00000030, 0x00000002,
4014 0x00000001, 0x00000040, 0x00000050, 0x74636576, 0x6d61735f, 0x72656c70, 0xababab00, 0x00030001,
4015 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x4d007874,
4016 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4017 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
4018 0x434c5846, 0x00000001, 0xa0400001, 0x00000002, 0x00000000, 0x00000002, 0x00000001, 0x00000000,
4019 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
4020 0xffffffff, 0x0000001e, 0x00000000, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
4021 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
4022 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x56695f67, 0x00746365, 0x00020001,
4023 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, 0x40000000, 0x3f800000, 0x4d007874,
4024 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
4025 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
4026 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000,
4027 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0xffffffff, 0x0000001e, 0x00000000,
4028 0x00000000, 0x00000001, 0x00000005, 0x31786574, 0x00000000,
4030 #define TEST_EFFECT_PRESHADER_VSHADER_POS 2710
4031 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
4033 #define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \
4034 test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d)
4035 static void test_effect_preshader_compare_shader_bytecode_(unsigned int line,
4036 const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo)
4038 unsigned int i = 0;
4040 todo_wine_if(todo)
4041 ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n");
4043 if (!bytecode)
4044 return;
4046 while (bytecode[i++] != 0x0000ffff)
4049 if (!bytecode_size)
4050 bytecode_size = i * sizeof(*bytecode);
4051 else
4052 ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size);
4054 todo_wine_if(todo)
4055 ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS
4056 + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size),
4057 "Incorrect shader selected.\n");
4060 #define test_effect_preshader_compare_shader(a, b, c) \
4061 test_effect_preshader_compare_shader_(__LINE__, a, b, c)
4062 static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device,
4063 int expected_shader_index, BOOL todo)
4065 IDirect3DVertexShader9 *vshader;
4066 void *byte_code;
4067 unsigned int byte_code_size;
4068 HRESULT hr;
4070 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4071 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DDevice9_GetVertexShader result %#x.\n", hr);
4073 todo_wine_if(todo)
4074 ok_(__FILE__, line)(!!vshader, "Got NULL vshader.\n");
4075 if (!vshader)
4076 return;
4078 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
4079 ok_(__FILE__, line)(hr == D3D_OK, "IDirect3DVertexShader9_GetFunction %#x.\n", hr);
4080 ok_(__FILE__, line)(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
4082 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
4083 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
4084 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4086 test_effect_preshader_compare_shader_bytecode_(line, byte_code,
4087 byte_code_size, expected_shader_index, todo);
4089 HeapFree(GetProcessHeap(), 0, byte_code);
4090 IDirect3DVertexShader9_Release(vshader);
4093 static const struct
4095 const char *comment;
4096 BOOL todo[4];
4097 unsigned int result[4];
4098 unsigned int ulps;
4100 test_effect_preshader_op_expected[] =
4102 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4103 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
4104 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
4105 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
4106 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
4107 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
4108 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
4109 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
4111 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
4112 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
4113 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
4114 #if __x86_64__
4115 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
4116 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
4117 #else
4118 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
4119 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
4120 #endif
4121 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
4122 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
4123 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}},
4125 {"dotswiz", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0xc0d33334, 0xc10ccccd, 0}},
4126 {"reladdr", {FALSE, FALSE, FALSE, FALSE}, {0xc00ccccd, 0x3f800000, 0, 0x41200000}},
4127 {"reladdr2", {FALSE, FALSE, FALSE, FALSE}, {0, 0, 0x447ac000, 0x40000000}},
4130 enum expected_state_update
4132 EXPECTED_STATE_ZERO,
4133 EXPECTED_STATE_UPDATED,
4134 EXPECTED_STATE_ANYTHING
4137 #define test_effect_preshader_op_results(a, b, c) test_effect_preshader_op_results_(__LINE__, a, b, c)
4138 static void test_effect_preshader_op_results_(unsigned int line, IDirect3DDevice9 *device,
4139 const enum expected_state_update *expected_state, const char *updated_param)
4141 static const D3DCOLORVALUE black = {0.0f};
4142 unsigned int i, j;
4143 D3DLIGHT9 light;
4144 const float *v;
4145 HRESULT hr;
4147 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_op_expected); ++i)
4149 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
4150 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4152 v = i < 8 ? &light.Diffuse.r : (i < 16 ? &light.Ambient.r : &light.Specular.r);
4153 if (!expected_state || expected_state[i] == EXPECTED_STATE_UPDATED)
4155 for (j = 0; j < 4; ++j)
4157 todo_wine_if(test_effect_preshader_op_expected[i].todo[j])
4158 ok_(__FILE__, line)(compare_float(v[j],
4159 ((const float *)test_effect_preshader_op_expected[i].result)[j],
4160 test_effect_preshader_op_expected[i].ulps),
4161 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
4162 test_effect_preshader_op_expected[i].comment, j,
4163 test_effect_preshader_op_expected[i].result[j],
4164 ((const unsigned int *)v)[j], v[j]);
4167 else if (expected_state[i] == EXPECTED_STATE_ZERO)
4169 ok_(__FILE__, line)(!memcmp(v, &black, sizeof(black)),
4170 "Parameter %s, test %d, operation %s, state updated unexpectedly.\n",
4171 updated_param, i, test_effect_preshader_op_expected[i].comment);
4176 static const D3DXVECTOR4 fvect_filler = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
4178 static void test_effect_preshader_clear_vconsts(IDirect3DDevice9 *device)
4180 unsigned int i;
4181 HRESULT hr;
4183 for (i = 0; i < 256; ++i)
4185 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_filler.x, 1);
4186 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4190 static const D3DXVECTOR4 test_effect_preshader_fvect_v[] =
4192 {0.0f, 0.0f, 0.0f, 0.0f},
4193 {0.0f, 0.0f, 0.0f, 0.0f},
4194 {0.0f, 0.0f, 0.0f, 0.0f},
4195 {1.0f, 2.0f, 3.0f, 0.0f},
4196 {4.0f, 0.0f, 0.0f, 0.0f},
4197 {5.0f, 6.0f, 7.0f, 8.0f},
4198 {1.0f, 2.0f, 3.0f, 0.0f},
4199 {4.0f, 0.0f, 0.0f, 0.0f},
4200 {5.0f, 6.0f, 7.0f, 8.0f},
4201 {9.0f, 10.0f, 11.0f, 0.0f},
4202 {12.0f, 0.0f, 0.0f, 0.0f},
4203 {13.0f, 14.0f, 15.0f, 16.0f},
4204 {11.0f, 12.0f, 13.0f, 0.0f},
4205 {21.0f, 22.0f, 23.0f, 0.0f},
4206 {31.0f, 32.0f, 33.0f, 0.0f},
4207 {41.0f, 42.0f, 43.0f, 0.0f},
4208 {11.0f, 21.0f, 31.0f, 0.0f},
4209 {12.0f, 22.0f, 32.0f, 0.0f},
4210 {13.0f, 23.0f, 33.0f, 0.0f},
4211 {14.0f, 24.0f, 34.0f, 0.0f},
4212 {11.0f, 12.0f, 13.0f, 14.0f},
4213 {21.0f, 22.0f, 23.0f, 24.0f},
4214 {31.0f, 32.0f, 33.0f, 34.0f},
4215 {11.0f, 21.0f, 31.0f, 41.0f},
4216 {12.0f, 22.0f, 32.0f, 42.0f},
4217 {13.0f, 23.0f, 33.0f, 43.0f},
4218 {9.0f, 10.0f, 11.0f, 0.0f},
4219 {12.0f, 0.0f, 0.0f, 0.0f},
4220 {13.0f, 14.0f, 15.0f, 16.0f},
4221 {92.0f, 0.0f, 0.0f, 0.0f},
4222 {93.0f, 0.0f, 0.0f, 0.0f},
4223 {0.0f, 0.0f, 0.0f, 0.0f},
4224 {91.0f, 0.0f, 0.0f, 0.0f},
4225 {4.0f, 5.0f, 6.0f, 7.0f},
4227 #define TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE (sizeof(unsigned int) * 8)
4229 #define test_effect_preshader_compare_vconsts(a, b, c) \
4230 test_effect_preshader_compare_vconsts_(__LINE__, a, b, c)
4231 static void test_effect_preshader_compare_vconsts_(unsigned int line, IDirect3DDevice9 *device,
4232 const unsigned int *const_updated_mask, const char *updated_param)
4234 HRESULT hr;
4235 unsigned int i;
4236 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_v)];
4238 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x,
4239 ARRAY_SIZE(test_effect_preshader_fvect_v));
4240 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4242 if (!const_updated_mask)
4244 ok_(__FILE__, line)(!memcmp(fdata, test_effect_preshader_fvect_v, sizeof(test_effect_preshader_fvect_v)),
4245 "Vertex shader float constants do not match.\n");
4247 else
4249 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_fvect_v); ++i)
4251 if (const_updated_mask[i / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE]
4252 & (1u << (i % TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE)))
4254 ok_(__FILE__, line)(!memcmp(&fdata[i], &test_effect_preshader_fvect_v[i], sizeof(fdata[i])),
4255 "Vertex shader float constants do not match, expected (%g, %g, %g, %g), \
4256 got (%g, %g, %g, %g), parameter %s.\n",
4257 test_effect_preshader_fvect_v[i].x, test_effect_preshader_fvect_v[i].y,
4258 test_effect_preshader_fvect_v[i].z, test_effect_preshader_fvect_v[i].w,
4259 fdata[i].x, fdata[i].y, fdata[i].z, fdata[i].w, updated_param);
4261 else
4263 ok_(__FILE__, line)(!memcmp(&fdata[i], &fvect_filler, sizeof(fdata[i])),
4264 "Vertex shader float constants updated unexpectedly, parameter %s.\n", updated_param);
4269 for (i = ARRAY_SIZE(test_effect_preshader_fvect_v); i < 256; ++i)
4271 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
4272 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
4273 ok_(__FILE__, line)(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4274 "Vertex shader float constants do not match.\n");
4278 static void test_effect_preshader(IDirect3DDevice9 *device)
4280 static const D3DXVECTOR4 test_effect_preshader_fvect_p[] =
4282 {11.0f, 21.0f, 0.0f, 0.0f},
4283 {12.0f, 22.0f, 0.0f, 0.0f},
4284 {13.0f, 23.0f, 0.0f, 0.0f},
4285 {11.0f, 12.0f, 0.0f, 0.0f},
4286 {21.0f, 22.0f, 0.0f, 0.0f},
4287 {31.0f, 32.0f, 0.0f, 0.0f},
4288 {11.0f, 12.0f, 0.0f, 0.0f},
4289 {21.0f, 22.0f, 0.0f, 0.0f},
4290 {11.0f, 21.0f, 0.0f, 0.0f},
4291 {12.0f, 22.0f, 0.0f, 0.0f},
4292 {11.0f, 12.0f, 13.0f, 0.0f},
4293 {21.0f, 22.0f, 23.0f, 0.0f},
4294 {11.0f, 21.0f, 31.0f, 0.0f},
4295 {12.0f, 22.0f, 32.0f, 0.0f}
4297 static const BOOL test_effect_preshader_bconsts[] =
4299 TRUE, FALSE, TRUE, FALSE, TRUE, FALSE
4301 static const int test_effect_preshader_iconsts[][4] =
4303 {4, 3, 2, 1}
4305 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
4306 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
4307 static const int ivect_empty[4] = {-1, -1, -1, -1};
4308 HRESULT hr;
4309 ID3DXEffect *effect;
4310 D3DXHANDLE par;
4311 unsigned int npasses;
4312 DWORD value;
4313 BOOL bval;
4314 D3DXVECTOR4 fdata[ARRAY_SIZE(test_effect_preshader_fvect_p)];
4315 int idata[ARRAY_SIZE(test_effect_preshader_iconsts)][4];
4316 BOOL bdata[ARRAY_SIZE(test_effect_preshader_bconsts)];
4317 IDirect3DVertexShader9 *vshader;
4318 unsigned int i;
4319 D3DCAPS9 caps;
4321 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
4322 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
4323 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
4324 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
4326 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
4327 return;
4330 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4331 NULL, NULL, 0, NULL, &effect, NULL);
4332 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4334 test_effect_preshader_clear_vconsts(device);
4336 for (i = 0; i < 224; ++i)
4338 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_filler.x, 1);
4339 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4341 bval = FALSE;
4342 for (i = 0; i < 16; ++i)
4344 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
4345 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4347 for (i = 0; i < 16; ++i)
4349 hr = IDirect3DDevice9_SetPixelShaderConstantI(device, i, ivect_empty, 1);
4350 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4353 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
4354 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4356 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
4357 ok(par != NULL, "GetParameterByName failed.\n");
4359 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4360 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4362 hr = effect->lpVtbl->BeginPass(effect, 0);
4363 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4365 hr = effect->lpVtbl->BeginPass(effect, 0);
4366 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4368 hr = effect->lpVtbl->BeginPass(effect, 1);
4369 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
4371 test_effect_preshader_compare_vconsts(device, NULL, NULL);
4373 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x,
4374 ARRAY_SIZE(test_effect_preshader_fvect_p));
4375 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4376 ok(!memcmp(fdata, test_effect_preshader_fvect_p, sizeof(test_effect_preshader_fvect_p)),
4377 "Pixel shader float constants do not match.\n");
4378 for (i = ARRAY_SIZE(test_effect_preshader_fvect_p); i < 224; ++i)
4380 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
4381 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4382 ok(!memcmp(fdata, &fvect_filler, sizeof(fvect_filler)),
4383 "Pixel shader float constants do not match.\n");
4385 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, 0, idata[0],
4386 ARRAY_SIZE(test_effect_preshader_iconsts));
4387 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4388 ok(!memcmp(idata, test_effect_preshader_iconsts, sizeof(test_effect_preshader_iconsts)),
4389 "Pixel shader integer constants do not match.\n");
4390 for (i = ARRAY_SIZE(test_effect_preshader_iconsts); i < 16; ++i)
4392 hr = IDirect3DDevice9_GetPixelShaderConstantI(device, i, idata[0], 1);
4393 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4394 ok(!memcmp(idata[0], ivect_empty, sizeof(ivect_empty)),
4395 "Pixel shader integer constants do not match.\n");
4398 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata,
4399 ARRAY_SIZE(test_effect_preshader_bconsts));
4400 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4401 for (i = 0; i < ARRAY_SIZE(test_effect_preshader_bconsts); ++i)
4402 todo_wine_if(!bdata[i] != !test_effect_preshader_bconsts[i])
4403 ok(!bdata[i] == !test_effect_preshader_bconsts[i],
4404 "Pixel shader boolean constants do not match.\n");
4405 for (; i < 16; ++i)
4407 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, i, &bval, 1);
4408 ok(hr == D3D_OK && !bval, "Got result %#x, boolean register value %u.\n", hr, bval);
4411 test_effect_preshader_op_results(device, NULL, NULL);
4413 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
4414 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4415 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4416 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
4417 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4418 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4419 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
4420 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4421 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
4422 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
4423 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4424 todo_wine ok(value == 3, "Unexpected sampler 0 magfilter %u.\n", value);
4426 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
4427 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4428 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
4429 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
4430 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4431 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
4432 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
4433 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4434 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
4435 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
4436 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4437 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
4439 hr = effect->lpVtbl->EndPass(effect);
4441 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4442 ok(par != NULL, "GetParameterByName failed.\n");
4443 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
4444 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4445 hr = effect->lpVtbl->BeginPass(effect, 1);
4446 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4448 test_effect_preshader_compare_shader(device, 1, FALSE);
4450 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4451 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4453 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
4454 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4455 hr = effect->lpVtbl->CommitChanges(effect);
4456 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4457 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4458 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4459 ok(!vshader, "Incorrect shader selected.\n");
4461 hr = effect->lpVtbl->EndPass(effect);
4462 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4464 hr = effect->lpVtbl->End(effect);
4465 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4466 effect->lpVtbl->Release(effect);
4469 struct test_preshader_op_def
4471 const char *mnem;
4472 unsigned int opcode;
4473 unsigned int args_count;
4474 unsigned int expected_result[4];
4475 D3DXVECTOR4 fvect1, fvect2;
4476 unsigned int ulps;
4477 BOOL todo[4];
4480 static void test_preshader_op(IDirect3DDevice9 *device, const DWORD *sample_effect_blob,
4481 unsigned int sample_effect_blob_size, const struct test_preshader_op_def *test)
4483 static const struct
4485 unsigned int pos;
4486 unsigned int result_index;
4487 unsigned int ins_count;
4489 blob_position[] =
4491 {0, 0, 0},
4492 {5549, 0, 4},
4493 {5400, 2, 1}
4495 DWORD *test_effect_blob;
4496 HRESULT hr;
4497 ID3DXEffect *effect;
4498 D3DLIGHT9 light;
4499 unsigned int i, passes_count;
4500 float *v;
4501 unsigned int op_pos, op_step;
4502 D3DXHANDLE param;
4504 op_step = 2 + (test->args_count + 1) * 3;
4505 op_pos = blob_position[test->args_count].pos;
4507 test_effect_blob = HeapAlloc(GetProcessHeap(), 0, sample_effect_blob_size);
4508 memcpy(test_effect_blob, sample_effect_blob, sample_effect_blob_size);
4509 for (i = 0; i < blob_position[test->args_count].ins_count; ++i)
4510 test_effect_blob[op_pos + i * op_step] = test->opcode;
4512 hr = D3DXCreateEffect(device, test_effect_blob, sample_effect_blob_size,
4513 NULL, NULL, 0, NULL, &effect, NULL);
4514 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4515 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4516 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4518 param = effect->lpVtbl->GetParameterByName(effect, NULL, "opvect1");
4519 ok(!!param, "GetParameterByName failed.\n");
4520 hr = effect->lpVtbl->SetVector(effect, param, &test->fvect1);
4521 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4523 if (test->args_count > 1)
4525 param = effect->lpVtbl->GetParameterByName(effect, NULL, "opvect2");
4526 ok(!!param, "GetParameterByName failed.\n");
4527 hr = effect->lpVtbl->SetVector(effect, param, &test->fvect2);
4528 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
4531 hr = effect->lpVtbl->BeginPass(effect, 0);
4532 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4534 hr = IDirect3DDevice9_GetLight(device, blob_position[test->args_count].result_index, &light);
4535 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4536 v = &light.Diffuse.r;
4537 for (i = 0; i < 4; ++i)
4538 todo_wine_if(test->todo[i])
4539 ok(compare_float(v[i], ((float *)test->expected_result)[i], test->ulps),
4540 "Operation %s, component %u, expected %#x (%g), got %#x (%g).\n", test->mnem, i,
4541 test->expected_result[i], ((float *)test->expected_result)[i], ((unsigned int *)v)[i], v[i]);
4543 hr = effect->lpVtbl->EndPass(effect);
4544 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4545 hr = effect->lpVtbl->End(effect);
4546 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4547 effect->lpVtbl->Release(effect);
4548 HeapFree(GetProcessHeap(), 0, test_effect_blob);
4551 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
4553 const struct test_preshader_op_def op_tests[] =
4555 {"exp", 0x10500001, 1, {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000},
4556 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4557 {"log", 0x10600001, 1, {0, 0x40000000, 0x3f9199b7, 0x43000000},
4558 {0.0f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4559 {"asin", 0x10a00001, 1, {0xbe9c00ad, 0xffc00000, 0xffc00000, 0xffc00000},
4560 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4561 {"acos", 0x10b00001, 1, {0x3ff01006, 0xffc00000, 0xffc00000, 0xffc00000},
4562 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4563 {"atan", 0x10c00001, 1, {0xbe9539d4, 0x3fa9b465, 0xbf927420, 0x3fc90fdb},
4564 {-0.3f, 4.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
4565 {"atan2 test #1", 0x20600004, 2, {0xbfc90fdb, 0x40490fdb, 0x80000000, 0x7fc00000},
4566 {-0.3f, 0.0f, -0.0f, NAN}, {0.0f, -0.0f, 0.0f, 1.0f}},
4567 {"atan2 test #2", 0x20600004, 2, {0xbfc90fdb, 0, 0xc0490fdb, 0},
4568 {-0.3f, 0.0f, -0.0f, -0.0f}, {-0.0f, 0.0f, -0.0f, 1.0f}},
4569 {"div", 0x20800004, 2, {0, 0, 0, 0},
4570 {-0.3f, 0.0f, -2.2f, NAN}, {0.0f, -0.0f, -3.0f, 1.0f}},
4571 {"0 * INF", 0x20500004, 2, {0xffc00000, 0xffc00000, 0xc0d33334, 0x7f800000},
4572 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {INFINITY, INFINITY, 3.0f, 4.0f}},
4574 unsigned int i;
4576 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
4577 test_preshader_op(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4578 &op_tests[i]);
4581 static void test_isparameterused_children(unsigned int line, ID3DXEffect *effect,
4582 D3DXHANDLE tech, D3DXHANDLE param)
4584 D3DXPARAMETER_DESC desc;
4585 D3DXHANDLE param_child;
4586 unsigned int i, child_count;
4587 HRESULT hr;
4589 hr = effect->lpVtbl->GetParameterDesc(effect, param, &desc);
4590 ok_(__FILE__, line)(hr == D3D_OK, "GetParameterDesc failed, result %#x.\n", hr);
4591 child_count = desc.Elements ? desc.Elements : desc.StructMembers;
4592 for (i = 0; i < child_count; ++i)
4594 param_child = desc.Elements ? effect->lpVtbl->GetParameterElement(effect, param, i)
4595 : effect->lpVtbl->GetParameter(effect, param, i);
4596 ok_(__FILE__, line)(!!param_child, "Failed getting child parameter %s[%u].\n", desc.Name, i);
4597 ok_(__FILE__, line)(!effect->lpVtbl->IsParameterUsed(effect, param_child, tech),
4598 "Unexpected IsParameterUsed() result for %s[%u].\n", desc.Name, i);
4599 test_isparameterused_children(line, effect, tech, param_child);
4603 #define test_isparameterused_param_with_children(args...) \
4604 test_isparameterused_param_with_children_(__LINE__, args)
4605 static void test_isparameterused_param_with_children_(unsigned int line, ID3DXEffect *effect,
4606 ID3DXEffect *effect2, D3DXHANDLE tech, const char *name, BOOL expected_result)
4608 D3DXHANDLE param;
4610 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, (D3DXHANDLE)name, tech)
4611 == expected_result, "Unexpected IsParameterUsed() result for %s (referenced by name).\n", name);
4613 if (effect2)
4614 param = effect2->lpVtbl->GetParameterByName(effect2, NULL, name);
4615 else
4616 param = effect->lpVtbl->GetParameterByName(effect, NULL, name);
4617 ok_(__FILE__, line)(!!param, "GetParameterByName failed for %s.\n", name);
4619 ok_(__FILE__, line)(effect->lpVtbl->IsParameterUsed(effect, param, tech) == expected_result,
4620 "Unexpected IsParameterUsed() result for %s (referenced by handle).\n", name);
4622 test_isparameterused_children(line, effect, tech, param);
4625 static void test_effect_isparameterused(IDirect3DDevice9 *device)
4627 static const struct
4629 const char *name;
4630 BOOL expected_result;
4632 check_parameters[] =
4634 {"g_Pos1", TRUE},
4635 {"g_Pos2", TRUE},
4636 {"g_Selector", TRUE},
4637 {"opvect1", TRUE},
4638 {"opvect2", TRUE},
4639 {"opvect3", TRUE},
4640 {"arr2", TRUE},
4641 {"vs_arr", TRUE},
4642 {"g_iVect", TRUE},
4643 {"vect_sampler", TRUE},
4644 {"tex1", TRUE},
4645 {"tex2", FALSE},
4646 {"sampler1", TRUE},
4647 {"ts1", TRUE},
4648 {"ts2", TRUE},
4649 {"ts3", TRUE},
4651 ID3DXEffect *effect, *effect2;
4652 HRESULT hr;
4653 D3DXHANDLE tech;
4654 unsigned int i;
4656 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4657 NULL, NULL, 0, NULL, &effect, NULL);
4658 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4660 tech = effect->lpVtbl->GetTechniqueByName(effect, "tech0");
4661 ok(!!tech, "GetTechniqueByName failed.\n");
4663 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
4664 test_isparameterused_param_with_children(effect, NULL, tech, check_parameters[i].name,
4665 check_parameters[i].expected_result);
4667 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4668 NULL, NULL, 0, NULL, &effect2, NULL);
4669 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4671 for (i = 0; i < ARRAY_SIZE(check_parameters); ++i)
4672 test_isparameterused_param_with_children(effect, effect2, tech, check_parameters[i].name,
4673 check_parameters[i].expected_result);
4675 effect2->lpVtbl->Release(effect2);
4677 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
4678 NULL, NULL, 0, NULL, &effect2, NULL);
4679 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4681 test_isparameterused_param_with_children(effect, effect2, tech, "sampler1", TRUE);
4682 effect2->lpVtbl->Release(effect2);
4684 effect->lpVtbl->Release(effect);
4687 static void test_effect_out_of_bounds_selector(IDirect3DDevice9 *device)
4689 ID3DXEffect *effect;
4690 HRESULT hr;
4691 D3DXHANDLE param;
4692 int ivect[4];
4693 unsigned int passes_count;
4694 IDirect3DVertexShader9 *vshader;
4696 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4697 NULL, NULL, 0, NULL, &effect, NULL);
4699 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4700 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4702 ivect[0] = ivect[1] = ivect[3] = 1;
4704 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4705 ok(!!param, "GetParameterByName failed.\n");
4706 ivect[2] = 3;
4707 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4708 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4710 hr = effect->lpVtbl->BeginPass(effect, 0);
4711 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4712 hr = effect->lpVtbl->EndPass(effect);
4713 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4715 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4716 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4718 hr = effect->lpVtbl->BeginPass(effect, 1);
4719 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4721 /* Second try reports success and selects array element used previously.
4722 * Probably array index is not recomputed and previous index value is used. */
4723 hr = effect->lpVtbl->BeginPass(effect, 1);
4724 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4725 test_effect_preshader_compare_shader(device, 2, FALSE);
4727 /* Confirm that array element selected is the previous good one and does not depend
4728 * on computed (out of bound) index value. */
4729 ivect[2] = 1;
4730 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4731 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4732 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4733 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4734 hr = effect->lpVtbl->CommitChanges(effect);
4735 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4736 test_effect_preshader_compare_shader(device, 1, FALSE);
4737 hr = effect->lpVtbl->EndPass(effect);
4738 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4739 ivect[2] = 3;
4740 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4741 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4742 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4743 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4744 hr = effect->lpVtbl->BeginPass(effect, 1);
4745 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4746 hr = effect->lpVtbl->BeginPass(effect, 1);
4747 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4748 test_effect_preshader_compare_shader(device, 1, FALSE);
4750 /* End and begin effect again to ensure it will not trigger array
4751 * index recompute and error return from BeginPass. */
4752 hr = effect->lpVtbl->EndPass(effect);
4753 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4754 hr = effect->lpVtbl->End(effect);
4755 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4756 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4757 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4758 hr = effect->lpVtbl->BeginPass(effect, 1);
4759 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4760 test_effect_preshader_compare_shader(device, 1, FALSE);
4761 hr = effect->lpVtbl->EndPass(effect);
4762 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4765 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4766 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4768 ivect[2] = -2;
4769 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4770 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4772 hr = effect->lpVtbl->BeginPass(effect, 1);
4773 ok(hr == E_FAIL, "Got result %#x.\n", hr);
4775 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4776 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4777 ok(!vshader, "Got non NULL vshader.\n");
4779 hr = effect->lpVtbl->BeginPass(effect, 1);
4780 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4782 test_effect_preshader_compare_shader(device, 1, FALSE);
4784 hr = effect->lpVtbl->EndPass(effect);
4785 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4787 ivect[2] = -1;
4788 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4789 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4791 hr = effect->lpVtbl->BeginPass(effect, 1);
4792 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4794 test_effect_preshader_compare_shader(device, 0, FALSE);
4796 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4797 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4799 ivect[2] = 3;
4800 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4801 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4802 hr = effect->lpVtbl->CommitChanges(effect);
4803 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4805 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4806 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4807 ok(!vshader, "Got non NULL vshader.\n");
4809 ivect[2] = -1;
4810 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4811 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4812 hr = effect->lpVtbl->CommitChanges(effect);
4813 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4815 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
4816 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4817 ok(!vshader, "Got non NULL vshader.\n");
4819 ivect[2] = 1;
4820 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
4821 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4822 hr = effect->lpVtbl->CommitChanges(effect);
4823 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4825 test_effect_preshader_compare_shader(device, 1, FALSE);
4827 hr = effect->lpVtbl->EndPass(effect);
4828 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4830 hr = effect->lpVtbl->End(effect);
4831 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4833 effect->lpVtbl->Release(effect);
4836 static void test_effect_commitchanges(IDirect3DDevice9 *device)
4838 static const struct
4840 const char *param_name;
4841 enum expected_state_update state_updated[ARRAY_SIZE(test_effect_preshader_op_expected)];
4843 check_op_parameters[] =
4845 {"opvect1", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4846 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4847 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4848 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
4849 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
4850 {"opvect2", {EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4851 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4852 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED,
4853 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_ANYTHING,
4854 EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED, EXPECTED_STATE_UPDATED}},
4855 {"opvect3", {EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
4856 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_UPDATED,
4857 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO,
4858 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ANYTHING,
4859 EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO, EXPECTED_STATE_ZERO}},
4861 static const struct
4863 const char *param_name;
4864 const unsigned int const_updated_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
4865 + TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE];
4867 check_vconsts_parameters[] =
4869 {"g_Selector", {0x00000000, 0x00000002}},
4870 {"g_Pos1", {0x80000000, 0x00000002}},
4871 {"g_Pos2", {0x00000000, 0x00000002}},
4872 {"m4x3column", {0x03800000, 0x00000000}},
4873 {"m3x4column", {0x000f0000, 0x00000000}},
4874 {"m4x3row", {0x0000f000, 0x00000000}},
4875 {"m3x4row", {0x00700000, 0x00000000}},
4876 {"ts1", {0x1c000000, 0x00000000}},
4877 {"ts2", {0x0000003f, 0x00000000}},
4878 {"arr1", {0x00000000, 0x00000001}},
4879 {"arr2", {0x60000000, 0x00000000}},
4880 {"ts3", {0x00000fc0, 0x00000000}},
4882 static const unsigned int const_no_update_mask[(ARRAY_SIZE(test_effect_preshader_fvect_v)
4883 + TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE - 1) / TEST_EFFECT_FVECT_BITMASK_BLOCK_SIZE];
4884 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT};
4886 ID3DXEffect *effect;
4887 HRESULT hr;
4888 D3DXHANDLE param;
4889 unsigned int i, passes_count, value;
4890 int ivect[4];
4891 D3DXVECTOR4 fvect;
4892 IDirect3DVertexShader9 *vshader;
4894 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
4895 NULL, NULL, 0, NULL, &effect, NULL);
4896 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4898 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
4899 ok(!!param, "GetParameterByName failed.\n");
4901 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
4902 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4904 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
4905 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4907 hr = effect->lpVtbl->BeginPass(effect, 0);
4908 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4910 for (i = 0; i < ARRAY_SIZE(check_op_parameters); ++i)
4912 unsigned int j;
4914 for (j = 0; j < 8; ++j)
4916 hr = IDirect3DDevice9_SetLight(device, j, &light_filler);
4917 ok(hr == D3D_OK, "Got result %#x, i %u, j %u.\n", hr, i, j);
4919 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_op_parameters[i].param_name);
4920 ok(!!param, "GetParameterByName failed.\n");
4921 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(fvect));
4922 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4923 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(fvect));
4924 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4925 hr = effect->lpVtbl->CommitChanges(effect);
4926 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4928 test_effect_preshader_op_results(device, check_op_parameters[i].state_updated,
4929 check_op_parameters[i].param_name);
4932 for (i = 0; i < ARRAY_SIZE(check_vconsts_parameters); ++i)
4934 unsigned char buffer[256];
4936 test_effect_preshader_clear_vconsts(device);
4937 param = effect->lpVtbl->GetParameterByName(effect, NULL, check_vconsts_parameters[i].param_name);
4938 ok(!!param, "GetParameterByName failed.\n");
4939 hr = effect->lpVtbl->GetValue(effect, param, buffer, sizeof(buffer));
4940 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4941 hr = effect->lpVtbl->SetValue(effect, param, buffer, sizeof(buffer));
4942 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4943 hr = effect->lpVtbl->CommitChanges(effect);
4944 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4946 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[i].const_updated_mask,
4947 check_vconsts_parameters[i].param_name);
4950 test_effect_preshader_clear_vconsts(device);
4951 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Selector");
4952 ok(!!param, "GetParameterByName failed.\n");
4953 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
4954 hr = effect->lpVtbl->SetVectorArray(effect, param, &fvect, 1);
4955 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4956 hr = effect->lpVtbl->CommitChanges(effect);
4957 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4958 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[0].const_updated_mask,
4959 check_vconsts_parameters[0].param_name);
4961 test_effect_preshader_clear_vconsts(device);
4962 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
4963 ok(!!param, "GetParameterByName failed.\n");
4964 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
4965 ok(!!param, "GetParameterElement failed.\n");
4966 hr = effect->lpVtbl->SetFloat(effect, param, 92.0f);
4967 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4968 hr = effect->lpVtbl->CommitChanges(effect);
4969 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4970 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
4971 check_vconsts_parameters[10].param_name);
4973 test_effect_preshader_clear_vconsts(device);
4974 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
4975 ok(!!param, "GetParameterByName failed.\n");
4976 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
4977 ok(!!param, "GetParameterElement failed.\n");
4978 fvect.x = 93.0f;
4979 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(fvect.x));
4980 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4981 hr = effect->lpVtbl->CommitChanges(effect);
4982 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4983 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
4984 check_vconsts_parameters[10].param_name);
4986 test_effect_preshader_clear_vconsts(device);
4987 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
4988 ok(!!param, "GetParameterByName failed.\n");
4989 fvect.x = 92.0f;
4990 hr = effect->lpVtbl->SetFloatArray(effect, param, &fvect.x, 1);
4991 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4992 hr = effect->lpVtbl->CommitChanges(effect);
4993 ok(hr == D3D_OK, "Got result %#x.\n", hr);
4994 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[10].const_updated_mask,
4995 check_vconsts_parameters[10].param_name);
4997 test_effect_preshader_clear_vconsts(device);
4998 param = effect->lpVtbl->GetParameterByName(effect, NULL, "arr2");
4999 ok(!!param, "GetParameterByName failed.\n");
5000 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5001 ok(!!param, "GetParameterElement failed.\n");
5002 hr = effect->lpVtbl->SetInt(effect, param, 93);
5003 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5004 hr = effect->lpVtbl->CommitChanges(effect);
5005 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5006 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5007 check_vconsts_parameters[10].param_name);
5009 test_effect_preshader_clear_vconsts(device);
5010 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos1");
5011 ok(!!param, "GetParameterByName failed.\n");
5012 fvect.x = fvect.y = fvect.z = fvect.w = 0.0f;
5013 hr = effect->lpVtbl->SetVector(effect, param, &fvect);
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);
5017 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[1].const_updated_mask,
5018 check_vconsts_parameters[1].param_name);
5020 test_effect_preshader_clear_vconsts(device);
5021 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts1");
5022 ok(!!param, "GetParameterByName failed.\n");
5023 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5024 ok(!!param, "GetParameterByName failed.\n");
5025 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5026 ok(!!param, "GetParameterByName failed.\n");
5027 fvect.x = 12;
5028 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5029 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5030 hr = effect->lpVtbl->CommitChanges(effect);
5031 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5032 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[7].const_updated_mask,
5033 check_vconsts_parameters[7].param_name);
5035 *(float *)&value = 9999.0f;
5036 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5037 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5038 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5039 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5040 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5041 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5042 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5043 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5044 test_effect_preshader_clear_vconsts(device);
5045 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts2");
5046 ok(!!param, "GetParameterByName failed.\n");
5047 param = effect->lpVtbl->GetParameterElement(effect, param, 0);
5048 ok(!!param, "GetParameterByName failed.\n");
5049 param = effect->lpVtbl->GetParameterByName(effect, param, "v1");
5050 ok(!!param, "GetParameterByName failed.\n");
5051 hr = effect->lpVtbl->GetValue(effect, param, &fvect, sizeof(float) * 3);
5052 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5053 hr = effect->lpVtbl->SetValue(effect, param, &fvect, sizeof(float) * 3);
5054 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5055 hr = effect->lpVtbl->CommitChanges(effect);
5056 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5057 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5058 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5059 ok(value == 0, "Unexpected fog density %g.\n", *(float *)&value);
5060 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5061 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5062 ok(*(float *)&value == 4.0f, "Unexpected fog start %g.\n", *(float *)&value);
5063 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5064 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5065 ok(*(float *)&value == 9999.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5066 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5067 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5068 ok(*(float *)&value == 9999.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5069 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[8].const_updated_mask,
5070 check_vconsts_parameters[8].param_name);
5072 *(float *)&value = 9999.0f;
5073 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGDENSITY, value);
5074 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5075 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, value);
5076 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5077 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_A, value);
5078 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5079 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSCALE_B, value);
5080 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5081 test_effect_preshader_clear_vconsts(device);
5082 param = effect->lpVtbl->GetParameterByName(effect, NULL, "ts3");
5083 ok(!!param, "GetParameterByName failed.\n");
5084 param = effect->lpVtbl->GetParameterByName(effect, param, "ts");
5085 ok(!!param, "GetParameterByName failed.\n");
5086 param = effect->lpVtbl->GetParameterElement(effect, param, 1);
5087 ok(!!param, "GetParameterByName failed.\n");
5088 param = effect->lpVtbl->GetParameterByName(effect, param, "fv");
5089 ok(!!param, "GetParameterByName failed.\n");
5090 hr = effect->lpVtbl->GetValue(effect, param, &fvect.x, sizeof(float));
5091 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5092 hr = effect->lpVtbl->SetValue(effect, param, &fvect.x, sizeof(float));
5093 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5094 hr = effect->lpVtbl->CommitChanges(effect);
5095 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5096 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGDENSITY, &value);
5097 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5098 ok(*(float *)&value == 9999.0f, "Unexpected fog density %g.\n", *(float *)&value);
5099 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_FOGSTART, &value);
5100 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5101 ok(*(float *)&value == 9999.0f, "Unexpected fog start %g.\n", *(float *)&value);
5102 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_A, &value);
5103 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5104 ok(*(float *)&value == 4.0f, "Unexpected point scale A %g.\n", *(float *)&value);
5105 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSCALE_B, &value);
5106 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5107 ok(*(float *)&value == 12.0f, "Unexpected point scale B %g.\n", *(float *)&value);
5108 test_effect_preshader_compare_vconsts(device, check_vconsts_parameters[11].const_updated_mask,
5109 check_vconsts_parameters[11].param_name);
5111 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5112 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5113 ok(value == 3, "Unexpected sampler 0 minfilter %u.\n", value);
5115 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
5116 ok(!!param, "GetParameterByName failed.\n");
5117 ivect[0] = ivect[1] = ivect[2] = ivect[3] = 1;
5118 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5119 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5121 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, 0);
5122 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5123 hr = IDirect3DDevice9_SetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, 0);
5124 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5125 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MINFILTER, 0);
5126 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5127 hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, 0);
5128 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5130 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
5131 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5132 test_effect_preshader_clear_vconsts(device);
5134 hr = effect->lpVtbl->CommitChanges(effect);
5135 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5137 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5138 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5139 ok(!vshader, "Got non NULL vshader.\n");
5140 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5141 "selector g_iVect");
5142 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MINFILTER, &value);
5143 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5144 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5145 hr = IDirect3DDevice9_GetSamplerState(device, D3DVERTEXTEXTURESAMPLER0, D3DSAMP_MAGFILTER, &value);
5146 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5147 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5148 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MINFILTER, &value);
5149 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5150 ok(value == 1, "Unexpected sampler 0 minfilter %u.\n", value);
5151 hr = IDirect3DDevice9_GetSamplerState(device, 0, D3DSAMP_MAGFILTER, &value);
5152 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5153 ok(value == 0, "Unexpected sampler 0 minfilter %u.\n", value);
5155 ivect[3] = 2;
5156 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5157 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5158 ivect[3] = 1;
5159 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5160 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5161 hr = effect->lpVtbl->CommitChanges(effect);
5162 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5163 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5164 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5165 ok(!vshader, "Got non NULL vshader.\n");
5166 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5167 "selector g_iVect");
5168 ivect[3] = 2;
5169 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
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 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
5174 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5175 ok(!!vshader, "Got NULL vshader.\n");
5176 IDirect3DVertexShader9_Release(vshader);
5177 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
5178 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5179 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
5180 "Vertex shader float constants do not match.\n");
5181 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, &fvect_filler.x, 1);
5182 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5183 test_effect_preshader_compare_vconsts(device, const_no_update_mask,
5184 "selector g_iVect");
5185 ivect[3] = 1;
5186 hr = effect->lpVtbl->SetValue(effect, param, ivect, sizeof(ivect));
5187 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5188 hr = effect->lpVtbl->CommitChanges(effect);
5189 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5190 test_effect_preshader_compare_vconsts(device, NULL, NULL);
5192 hr = effect->lpVtbl->EndPass(effect);
5193 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5195 hr = effect->lpVtbl->End(effect);
5196 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5198 effect->lpVtbl->Release(effect);
5201 static void test_effect_preshader_relative_addressing(IDirect3DDevice9 *device)
5203 static const struct
5205 D3DXVECTOR4 opvect2;
5206 D3DXVECTOR4 g_ivect;
5207 unsigned int expected[4];
5209 test_out_of_bounds_index[] =
5211 {{1.0f, 2.0f, 3.0f, 4.0f}, {101.0f, 101.0f, 101.0f, 101.0f}, {0, 0x42ca0000, 0x3f800000, 0}},
5212 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 3333.0f},
5213 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5214 {{1.0f, 2.0f, 3.0f, 4.0f}, {3333.0f, 1094.0f, 2222.0f, 1.0f},
5215 {0x447ac000, 0x3f800000, 0x447a8000, 0x453b9000}},
5216 {{1.0f, 2.0f, 3.0f, 4.0f}, {1.0f, 1094.0f, 2222.0f, 3333.0f},
5217 {0x447ac000, 0x45505000, 0x3f800000, 0x453ba000}},
5218 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 1111.0f},
5219 {0x447ac000, 0x448ae000, 0, 0}},
5220 {{1.0f, 2.0f, 3.0f, 4.0f}, {1111.0f, 1094.0f, 2222.0f, 3333.0f},
5221 {0x447ac000, 0x45505000, 0x3f800000, 0}},
5222 {{-1111.0f, 1094.0f, -2222.0f, -3333.0f}, {4.0f, 3.0f, 2.0f, 1.0f},
5223 {0x447ac000, 0x40800000, 0x447a8000, 0x453b9000}},
5224 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1.0f, -1.0f, -1.0f, -1.0f}, {0, 0xbf800000, 0, 0}},
5225 {{1.0f, 2.0f, 3.0f, 4.0f}, {-2.0f, -2.0f, -2.0f, -2.0f}, {0, 0xc0000000, 0x459c4800, 0}},
5226 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3.0f, -3.0f, -3.0f, -3.0f}, {0, 0xc0400000, 0x453b9000, 0}},
5227 {{1.0f, 2.0f, 3.0f, 4.0f}, {-4.0f, -4.0f, -4.0f, -4.0f}, {0, 0xc0800000, 0x44fa2000, 0}},
5228 {{1.0f, 2.0f, 3.0f, 4.0f}, {-5.0f, -5.0f, -5.0f, -5.0f}, {0, 0xc0a00000, 0x459c5000, 0}},
5229 {{1.0f, 2.0f, 3.0f, 4.0f}, {-6.0f, -6.0f, -6.0f, -6.0f}, {0, 0xc0c00000, 0x453ba000, 0xc1400000}},
5230 {{1.0f, 2.0f, 3.0f, 4.0f}, {-7.0f, -7.0f, -7.0f, -7.0f}, {0, 0xc0e00000, 0x44fa4000, 0x40400000}},
5231 {{1.0f, 2.0f, 3.0f, 4.0f}, {-8.0f, -8.0f, -8.0f, -8.0f}, {0, 0xc1000000, 0, 0x44fa6000}},
5232 {{1.0f, 2.0f, 3.0f, 4.0f}, {-9.0f, -9.0f, -9.0f, -9.0f}, {0, 0xc1100000, 0, 0}},
5233 {{1.0f, 2.0f, 3.0f, 4.0f}, {-10.0f, -10.0f, -10.0f, -10.0f}, {0, 0xc1200000, 0xc1200000, 0}},
5234 {{1.0f, 2.0f, 3.0f, 4.0f}, {-11.0f, -11.0f, -11.0f, -11.0f}, {0, 0xc1300000, 0x3f800000, 0}},
5235 {{1.0f, 2.0f, 3.0f, 4.0f}, {-12.0f, -12.0f, -12.0f, -12.0f}, {0, 0xc1400000, 0x447a4000, 0}},
5236 {{1.0f, 2.0f, 3.0f, 4.0f}, {5.0f, 5.0f, 5.0f, 5.0f}, {0, 0x40a00000, 0x3f800000, 0}},
5237 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -3333.0f},
5238 {0x447ac000, 0xc5505000, 0x459c5000, 0x40000000}},
5239 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -1111.0f},
5240 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x3f800000}},
5241 {{1.0f, 2.0f, 3.0f, 4.0f}, {-3333.0f, 1094.0f, -2222.0f, -3333.0f},
5242 {0x447ac000, 0xc5505000, 0x459c5000, 0}},
5243 {{1.0f, 2.0f, 3.0f, 4.0f}, {-1111.0f, 1094.0f, -2222.0f, -1111.0f},
5244 {0x447ac000, 0xc48ae000, 0x44fa4000, 0x40400000}},
5246 static const struct
5248 unsigned int zw[2];
5250 expected_light_specular[] =
5252 {{0, 0x44fa2000}},
5253 {{0x447a8000, 0x453b9000}},
5254 {{0x40000000, 0x459c4800}},
5255 {{0xbf800000, 0}},
5256 {{0x447a4000, 0}},
5257 {{0x3f800000, 0}},
5258 {{0xbf800000, 0}},
5259 {{0, 0}},
5260 {{0, 0x447a4000}},
5261 {{0x44fa4000, 0x3f800000}},
5262 {{0x453ba000, 0xbf800000}},
5263 {{0x459c5000, 0}},
5264 {{0x44fa2000, 0}},
5265 {{0x453b9000, 0}},
5266 {{0x459c4800, 0}},
5267 {{0, 0}},
5269 static const struct
5271 int index_value;
5272 unsigned int expected[4];
5274 test_index_to_immediate_table[] =
5276 {-1000000, {0, 0x40800000, 0x45bbd800, 0x41300000}},
5277 {-1001, {0x448d4000, 0x41300000, 0, 0}},
5278 {-32, {0x448d4000, 0x40800000, 0, 0}},
5279 {-31, {0x45843000, 0x41400000, 0, 0}},
5280 {-30, {0x46a64000, 0x41400000, 0x447a4000, 0x3f800000}},
5281 {-29, {0, 0x447a4000, 0x447a8000, 0x40000000}},
5282 {-28, {0, 0, 0x447ac000, 0x40400000}},
5283 {-27, {0, 0x3f800000, 0, 0}},
5284 {-26, {0, 0x41100000, 0x45bbd800, 0x41300000}},
5285 {-25, {0, 0x41300000, 0, 0}},
5286 {-24, {0, 0x41600000, 0, 0}},
5287 {-23, {0, 0, 0, 0}},
5288 {-22, {0, 0, 0, 0}},
5289 {-21, {0, 0x40a00000, 0, 0}},
5290 {-20, {0, 0x41500000, 0, 0}},
5291 {-19, {0, 0x41500000, 0, 0}},
5292 {-18, {0, 0xc1900000, 0, 0}},
5293 {-17, {0, 0, 0, 0}},
5294 {-16, {0, 0x40800000, 0, 0}},
5295 {-15, {0, 0x41400000, 0, 0}},
5296 {-14, {0, 0x41400000, 0, 0}},
5297 {-13, {0, 0x447a4000, 0x447a4000, 0x3f800000}},
5298 {-12, {0, 0, 0, 0}},
5299 {-11, {0, 0x3f800000, 0, 0}},
5300 {-10, {0, 0x41100000, 0, 0}},
5301 {-9, {0, 0x41300000, 0, 0}},
5302 {-8, {0, 0x41600000, 0, 0}},
5303 {-7, {0, 0, 0, 0}},
5304 {-6, {0, 0, 0, 0}},
5305 {-5, {0, 0x40a00000, 0, 0}},
5306 {-4, {0, 0x41500000, 0, 0}},
5307 {-3, {0, 0x41500000, 0, 0}},
5308 {-2, {0, 0xc0000000, 0, 0}},
5309 {-1, {0, 0, 0, 0}},
5310 {0, {0x45052000, 0x40800000, 0x447a4000, 0x3f800000}},
5311 {1, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5312 {2, {0, 0x41400000, 0x447ac000, 0x40400000}},
5313 {3, {0, 0x447a4000, 0, 0}},
5314 {4, {0, 0, 0x45bbd800, 0x41300000}},
5315 {5, {0, 0x3f800000, 0, 0}},
5316 {6, {0, 0x41100000, 0, 0}},
5317 {7, {0, 0x41300000, 0, 0}},
5318 {8, {0, 0x41600000, 0, 0}},
5319 {9, {0, 0, 0, 0}},
5320 {10, {0, 0, 0, 0}},
5321 {11, {0, 0x40a00000, 0, 0}},
5322 {12, {0, 0x41500000, 0, 0}},
5323 {13, {0, 0x41500000, 0, 0}},
5324 {14, {0, 0x41600000, 0, 0}},
5325 {15, {0, 0, 0, 0}},
5326 {16, {0, 0x40800000, 0, 0}},
5327 {17, {0x45052000, 0x41400000, 0x447a4000, 0x3f800000}},
5328 {18, {0x467e6000, 0x41400000, 0x447a8000, 0x40000000}},
5329 {19, {0, 0x447a4000, 0x447ac000, 0x40400000}},
5330 {20, {0, 0, 0, 0}},
5331 {21, {0, 0x3f800000, 0x45bbd800, 0x41300000}},
5332 {22, {0, 0x41100000, 0, 0}},
5333 {23, {0, 0x41300000, 0, 0}},
5334 {24, {0, 0x41600000, 0, 0}},
5335 {25, {0, 0, 0, 0}},
5336 {26, {0, 0, 0, 0}},
5337 {27, {0, 0x40a00000, 0, 0}},
5338 {28, {0, 0x41500000, 0, 0}},
5339 {29, {0, 0x41500000, 0, 0}},
5340 {30, {0, 0x41f00000, 0, 0}},
5341 {31, {0, 0, 0, 0}},
5342 {1001, {0, 0, 0, 0}},
5343 {1000000, {0, 0x40800000, 0, 0}},
5345 static const D3DLIGHT9 light_filler = {D3DLIGHT_POINT, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
5346 {1.0f, 1.0f, 1.0f, 1.0f}};
5347 unsigned int j, passes_count;
5348 const unsigned int *expected;
5349 const float *expected_float;
5350 ID3DXEffect *effect;
5351 D3DXVECTOR4 fvect;
5352 D3DLIGHT9 light;
5353 const float *v;
5354 HRESULT hr;
5355 int i;
5357 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5358 NULL, NULL, 0, NULL, &effect, NULL);
5359 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5361 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5362 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5363 hr = effect->lpVtbl->BeginPass(effect, 0);
5364 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5366 fvect.x = 1001.0f; fvect.y = 1002.0f; fvect.z = 1003.0f; fvect.w = 1004.0f;
5367 hr = effect->lpVtbl->SetVector(effect, "opvect1", &fvect);
5368 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5370 fvect.x = 2001.0f; fvect.y = 2002.0f; fvect.z = 2003.0f; fvect.w = 2004.0f;
5371 hr = effect->lpVtbl->SetVector(effect, "g_Selector[0]", &fvect);
5372 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5374 fvect.x = 3001.0f; fvect.y = 3002.0f; fvect.z = 3003.0f; fvect.w = 3004.0f;
5375 hr = effect->lpVtbl->SetVector(effect, "g_Selector[1]", &fvect);
5376 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5378 v = &light.Specular.r;
5379 for (i = 0; i < ARRAY_SIZE(test_out_of_bounds_index); ++i)
5381 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[i].opvect2);
5382 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5383 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[i].g_ivect);
5384 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5386 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5387 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5389 hr = effect->lpVtbl->CommitChanges(effect);
5390 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5392 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5393 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5395 expected = test_out_of_bounds_index[i].expected;
5396 expected_float = (const float *)expected;
5398 for (j = 0; j < 4; ++j)
5400 ok(compare_float(v[j], expected_float[j], 0),
5401 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5402 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5406 hr = effect->lpVtbl->SetVector(effect, "opvect2", &test_out_of_bounds_index[7].opvect2);
5407 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5408 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &test_out_of_bounds_index[7].g_ivect);
5409 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5411 hr = IDirect3DDevice9_SetLight(device, 1, &light_filler);
5412 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5414 fvect = test_out_of_bounds_index[7].g_ivect;
5415 v = &light.Specular.b;
5416 for (i = -100; i < 100; ++i)
5418 fvect.w = i;
5419 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5420 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5421 hr = effect->lpVtbl->CommitChanges(effect);
5422 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5424 hr = IDirect3DDevice9_GetLight(device, 1, &light);
5425 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5427 expected = expected_light_specular[(unsigned int)i % ARRAY_SIZE(expected_light_specular)].zw;
5428 expected_float = (const float *)expected;
5430 for (j = 0; j < 2; ++j)
5432 ok(compare_float(v[j], expected_float[j], 0),
5433 "i %d, component %u, expected %#x (%g), got %#x (%g).\n",
5434 i, j + 2, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5438 v = &light.Specular.r;
5439 for (i = 0; i < ARRAY_SIZE(test_index_to_immediate_table); ++i)
5441 fvect.x = fvect.y = fvect.z = fvect.w = test_index_to_immediate_table[i].index_value;
5442 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
5443 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5444 hr = effect->lpVtbl->CommitChanges(effect);
5445 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5447 hr = IDirect3DDevice9_GetLight(device, 2, &light);
5448 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5450 expected = test_index_to_immediate_table[i].expected;
5451 expected_float = (const float *)expected;
5453 for (j = 0; j < 4; ++j)
5455 ok(compare_float(v[j], expected_float[j], 0),
5456 "Test %d, component %u, expected %#x (%g), got %#x (%g).\n",
5457 i, j, expected[j], expected_float[j], ((const unsigned int *)v)[j], v[j]);
5461 hr = effect->lpVtbl->EndPass(effect);
5462 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5463 hr = effect->lpVtbl->End(effect);
5464 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5466 effect->lpVtbl->Release(effect);
5469 struct test_state_manager_update
5471 unsigned int state_op;
5472 DWORD param1;
5473 DWORD param2;
5476 struct test_manager
5478 ID3DXEffectStateManager ID3DXEffectStateManager_iface;
5479 LONG ref;
5481 IDirect3DDevice9 *device;
5482 struct test_state_manager_update *update_record;
5483 unsigned int update_record_count;
5484 unsigned int update_record_size;
5487 #define INITIAL_UPDATE_RECORD_SIZE 64
5489 static struct test_manager *impl_from_ID3DXEffectStateManager(ID3DXEffectStateManager *iface)
5491 return CONTAINING_RECORD(iface, struct test_manager, ID3DXEffectStateManager_iface);
5494 static void free_test_effect_state_manager(struct test_manager *state_manager)
5496 HeapFree(GetProcessHeap(), 0, state_manager->update_record);
5497 state_manager->update_record = NULL;
5499 IDirect3DDevice9_Release(state_manager->device);
5502 static ULONG WINAPI test_manager_AddRef(ID3DXEffectStateManager *iface)
5504 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5506 return InterlockedIncrement(&state_manager->ref);
5509 static ULONG WINAPI test_manager_Release(ID3DXEffectStateManager *iface)
5511 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5512 ULONG ref = InterlockedDecrement(&state_manager->ref);
5514 if (!ref)
5516 free_test_effect_state_manager(state_manager);
5517 HeapFree(GetProcessHeap(), 0, state_manager);
5519 return ref;
5522 static HRESULT test_process_set_state(ID3DXEffectStateManager *iface,
5523 unsigned int state_op, DWORD param1, DWORD param2)
5525 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5527 if (state_manager->update_record_count == state_manager->update_record_size)
5529 if (!state_manager->update_record_size)
5531 state_manager->update_record_size = INITIAL_UPDATE_RECORD_SIZE;
5532 state_manager->update_record = HeapAlloc(GetProcessHeap(), 0,
5533 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5535 else
5537 state_manager->update_record_size *= 2;
5538 state_manager->update_record = HeapReAlloc(GetProcessHeap(), 0, state_manager->update_record,
5539 sizeof(*state_manager->update_record) * state_manager->update_record_size);
5542 state_manager->update_record[state_manager->update_record_count].state_op = state_op;
5543 state_manager->update_record[state_manager->update_record_count].param1 = param1;
5544 state_manager->update_record[state_manager->update_record_count].param2 = param2;
5545 ++state_manager->update_record_count;
5546 return D3D_OK;
5549 static HRESULT WINAPI test_manager_SetTransform(ID3DXEffectStateManager *iface,
5550 D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
5552 return test_process_set_state(iface, 0, state, 0);
5555 static HRESULT WINAPI test_manager_SetMaterial(ID3DXEffectStateManager *iface,
5556 const D3DMATERIAL9 *material)
5558 return test_process_set_state(iface, 1, 0, 0);
5561 static HRESULT WINAPI test_manager_SetLight(ID3DXEffectStateManager *iface,
5562 DWORD index, const D3DLIGHT9 *light)
5564 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5566 IDirect3DDevice9_SetLight(state_manager->device, index, light);
5567 return test_process_set_state(iface, 2, index, 0);
5570 static HRESULT WINAPI test_manager_LightEnable(ID3DXEffectStateManager *iface,
5571 DWORD index, BOOL enable)
5573 struct test_manager *state_manager = impl_from_ID3DXEffectStateManager(iface);
5575 IDirect3DDevice9_LightEnable(state_manager->device, index, enable);
5576 return test_process_set_state(iface, 3, index, 0);
5579 static HRESULT WINAPI test_manager_SetRenderState(ID3DXEffectStateManager *iface,
5580 D3DRENDERSTATETYPE state, DWORD value)
5582 return test_process_set_state(iface, 4, state, 0);
5585 static HRESULT WINAPI test_manager_SetTexture(ID3DXEffectStateManager *iface,
5586 DWORD stage, struct IDirect3DBaseTexture9 *texture)
5588 return test_process_set_state(iface, 5, stage, 0);
5591 static HRESULT WINAPI test_manager_SetTextureStageState(ID3DXEffectStateManager *iface,
5592 DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
5594 return test_process_set_state(iface, 6, stage, type);
5597 static HRESULT WINAPI test_manager_SetSamplerState(ID3DXEffectStateManager *iface,
5598 DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
5600 return test_process_set_state(iface, 7, sampler, type);
5603 static HRESULT WINAPI test_manager_SetNPatchMode(ID3DXEffectStateManager *iface,
5604 FLOAT num_segments)
5606 return test_process_set_state(iface, 8, 0, 0);
5609 static HRESULT WINAPI test_manager_SetFVF(ID3DXEffectStateManager *iface,
5610 DWORD format)
5612 return test_process_set_state(iface, 9, 0, 0);
5615 static HRESULT WINAPI test_manager_SetVertexShader(ID3DXEffectStateManager *iface,
5616 struct IDirect3DVertexShader9 *shader)
5618 return test_process_set_state(iface, 10, 0, 0);
5621 static HRESULT WINAPI test_manager_SetVertexShaderConstantF(ID3DXEffectStateManager *iface,
5622 UINT register_index, const FLOAT *constant_data, UINT register_count)
5624 return test_process_set_state(iface, 11, register_index, register_count);
5627 static HRESULT WINAPI test_manager_SetVertexShaderConstantI(ID3DXEffectStateManager *iface,
5628 UINT register_index, const INT *constant_data, UINT register_count)
5630 return test_process_set_state(iface, 12, register_index, register_count);
5633 static HRESULT WINAPI test_manager_SetVertexShaderConstantB(ID3DXEffectStateManager *iface,
5634 UINT register_index, const BOOL *constant_data, UINT register_count)
5636 return test_process_set_state(iface, 13, register_index, register_count);
5639 static HRESULT WINAPI test_manager_SetPixelShader(ID3DXEffectStateManager *iface,
5640 struct IDirect3DPixelShader9 *shader)
5642 return test_process_set_state(iface, 14, 0, 0);
5645 static HRESULT WINAPI test_manager_SetPixelShaderConstantF(ID3DXEffectStateManager *iface,
5646 UINT register_index, const FLOAT *constant_data, UINT register_count)
5648 return test_process_set_state(iface, 15, register_index, register_count);
5651 static HRESULT WINAPI test_manager_SetPixelShaderConstantI(ID3DXEffectStateManager *iface,
5652 UINT register_index, const INT *constant_data, UINT register_count)
5654 return test_process_set_state(iface, 16, register_index, register_count);
5657 static HRESULT WINAPI test_manager_SetPixelShaderConstantB(ID3DXEffectStateManager *iface,
5658 UINT register_index, const BOOL *constant_data, UINT register_count)
5660 return test_process_set_state(iface, 17, register_index, register_count);
5663 static void test_effect_state_manager_init(struct test_manager *state_manager,
5664 IDirect3DDevice9 *device)
5666 static const struct ID3DXEffectStateManagerVtbl test_ID3DXEffectStateManager_Vtbl =
5668 /*** IUnknown methods ***/
5669 NULL,
5670 test_manager_AddRef,
5671 test_manager_Release,
5672 /*** ID3DXEffectStateManager methods ***/
5673 test_manager_SetTransform,
5674 test_manager_SetMaterial,
5675 test_manager_SetLight,
5676 test_manager_LightEnable,
5677 test_manager_SetRenderState,
5678 test_manager_SetTexture,
5679 test_manager_SetTextureStageState,
5680 test_manager_SetSamplerState,
5681 test_manager_SetNPatchMode,
5682 test_manager_SetFVF,
5683 test_manager_SetVertexShader,
5684 test_manager_SetVertexShaderConstantF,
5685 test_manager_SetVertexShaderConstantI,
5686 test_manager_SetVertexShaderConstantB,
5687 test_manager_SetPixelShader,
5688 test_manager_SetPixelShaderConstantF,
5689 test_manager_SetPixelShaderConstantI,
5690 test_manager_SetPixelShaderConstantB,
5693 state_manager->ID3DXEffectStateManager_iface.lpVtbl = &test_ID3DXEffectStateManager_Vtbl;
5694 state_manager->ref = 1;
5696 IDirect3DDevice9_AddRef(device);
5697 state_manager->device = device;
5700 static const char *test_effect_state_manager_state_names[] =
5702 "SetTransform",
5703 "SetMaterial",
5704 "SetLight",
5705 "LightEnable",
5706 "SetRenderState",
5707 "SetTexture",
5708 "SetTextureStageState",
5709 "SetSamplerState",
5710 "SetNPatchMode",
5711 "SetFVF",
5712 "SetVertexShader",
5713 "SetVertexShaderConstantF",
5714 "SetVertexShaderConstantI",
5715 "SetVertexShaderConstantB",
5716 "SetPixelShader",
5717 "SetPixelShaderConstantF",
5718 "SetPixelShaderConstantI",
5719 "SetPixelShaderConstantB",
5722 static int compare_update_record(const void *a, const void *b)
5724 const struct test_state_manager_update *r1 = (const struct test_state_manager_update *)a;
5725 const struct test_state_manager_update *r2 = (const struct test_state_manager_update *)b;
5727 if (r1->state_op != r2->state_op)
5728 return r1->state_op - r2->state_op;
5729 if (r1->param1 != r2->param1)
5730 return r1->param1 - r2->param1;
5731 return r1->param2 - r2->param2;
5734 static void test_effect_state_manager(IDirect3DDevice9 *device)
5736 static const struct test_state_manager_update expected_updates[] =
5738 {2, 0, 0},
5739 {2, 1, 0},
5740 {2, 2, 0},
5741 {2, 3, 0},
5742 {2, 4, 0},
5743 {2, 5, 0},
5744 {2, 6, 0},
5745 {2, 7, 0},
5746 {3, 0, 0},
5747 {3, 1, 0},
5748 {3, 2, 0},
5749 {3, 3, 0},
5750 {3, 4, 0},
5751 {3, 5, 0},
5752 {3, 6, 0},
5753 {3, 7, 0},
5754 {4, 28, 0},
5755 {4, 36, 0},
5756 {4, 38, 0},
5757 {4, 158, 0},
5758 {4, 159, 0},
5759 {5, 0, 0},
5760 {5, 257, 0},
5761 {7, 0, 5},
5762 {7, 0, 6},
5763 {7, 257, 5},
5764 {7, 257, 6},
5765 {10, 0, 0},
5766 {11, 0, 34},
5767 {14, 0, 0},
5768 {15, 0, 14},
5769 {16, 0, 1},
5770 {17, 0, 5},
5772 static D3DLIGHT9 light_filler =
5773 {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}};
5774 struct test_manager *state_manager;
5775 unsigned int passes_count, i, n;
5776 ID3DXEffect *effect;
5777 ULONG refcount;
5778 HRESULT hr;
5780 state_manager = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*state_manager));
5781 test_effect_state_manager_init(state_manager, device);
5783 for (i = 0; i < 8; ++i)
5785 hr = IDirect3DDevice9_SetLight(device, i, &light_filler);
5786 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5789 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5790 NULL, NULL, 0, NULL, &effect, NULL);
5791 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5793 hr = effect->lpVtbl->SetStateManager(effect, &state_manager->ID3DXEffectStateManager_iface);
5794 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5796 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
5797 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5799 hr = effect->lpVtbl->BeginPass(effect, 0);
5800 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5802 hr = effect->lpVtbl->EndPass(effect);
5803 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5805 hr = effect->lpVtbl->End(effect);
5806 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5808 effect->lpVtbl->Release(effect);
5810 qsort(state_manager->update_record, state_manager->update_record_count,
5811 sizeof(*state_manager->update_record), compare_update_record);
5813 ok(ARRAY_SIZE(expected_updates) == state_manager->update_record_count,
5814 "Got %u update records.\n", state_manager->update_record_count);
5815 n = min(ARRAY_SIZE(expected_updates), state_manager->update_record_count);
5816 for (i = 0; i < n; ++i)
5818 ok(!memcmp(&expected_updates[i], &state_manager->update_record[i],
5819 sizeof(expected_updates[i])),
5820 "Update record mismatch, expected %s, %u, %u, got %s, %u, %u.\n",
5821 test_effect_state_manager_state_names[expected_updates[i].state_op],
5822 expected_updates[i].param1, expected_updates[i].param2,
5823 test_effect_state_manager_state_names[state_manager->update_record[i].state_op],
5824 state_manager->update_record[i].param1, state_manager->update_record[i].param2);
5827 for (i = 0; i < 8; ++i)
5829 D3DLIGHT9 light;
5831 hr = IDirect3DDevice9_GetLight(device, i, &light);
5832 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5833 ok(!memcmp(&light, &light_filler, sizeof(light)), "Light %u mismatch.\n", i);
5836 refcount = state_manager->ID3DXEffectStateManager_iface.lpVtbl->Release(
5837 &state_manager->ID3DXEffectStateManager_iface);
5838 ok(!refcount, "State manager was not properly freed, refcount %u.\n", refcount);
5841 static void test_cross_effect_handle(IDirect3DDevice9 *device)
5843 ID3DXEffect *effect1, *effect2;
5844 D3DXHANDLE param1, param2;
5845 static int expected_ivect[4] = {28, 29, 30, 31};
5846 int ivect[4];
5847 HRESULT hr;
5849 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5850 NULL, NULL, 0, NULL, &effect1, NULL);
5851 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5852 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
5853 NULL, NULL, 0, NULL, &effect2, NULL);
5854 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5856 ok(effect1 != effect2, "Got same effect unexpectedly.\n");
5858 param1 = effect1->lpVtbl->GetParameterByName(effect1, NULL, "g_iVect");
5859 ok(!!param1, "GetParameterByName failed.\n");
5861 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "g_iVect");
5862 ok(!!param2, "GetParameterByName failed.\n");
5864 ok(param1 != param2, "Got same parameter handle unexpectedly.\n");
5866 hr = effect2->lpVtbl->SetValue(effect2, param1, expected_ivect, sizeof(expected_ivect));
5867 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5869 hr = effect1->lpVtbl->GetValue(effect1, param1, ivect, sizeof(ivect));
5870 ok(hr == D3D_OK, "Got result %#x.\n", hr);
5872 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
5874 effect2->lpVtbl->Release(effect2);
5875 effect1->lpVtbl->Release(effect1);
5878 #if 0
5879 struct test_struct
5881 float3 v1_2;
5882 float fv_2;
5883 float4 v2_2;
5886 shared float arr2[1];
5887 shared test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
5889 struct VS_OUTPUT
5891 float4 Position : POSITION;
5894 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION)
5896 VS_OUTPUT Output;
5898 Output.Position = arr2[0] * vPos;
5899 return Output;
5902 shared vertexshader vs_arr2[2] = {compile vs_3_0 RenderSceneVS(), NULL};
5904 technique tech0
5906 pass p0
5908 FogEnable = TRUE;
5909 FogDensity = arr2[0];
5910 PointScale_A = ts2[0].fv_2;
5911 VertexShader = vs_arr2[0];
5914 pass p1
5916 VertexShader = vs_arr2[1];
5919 #endif
5920 static const DWORD test_effect_shared_parameters_blob[] =
5922 0xfeff0901, 0x000001dc, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000001,
5923 0x00000001, 0x00000001, 0x00000000, 0x00000005, 0x32727261, 0x00000000, 0x00000000, 0x00000005,
5924 0x000000dc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00000001, 0x000000e4, 0x00000000,
5925 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000000f0, 0x00000000, 0x00000000,
5926 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000000fc, 0x00000000, 0x00000000, 0x00000004,
5927 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5928 0x00000000, 0x3f800000, 0x40000000, 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000,
5929 0x41000000, 0x00000004, 0x00327374, 0x00000005, 0x325f3176, 0x00000000, 0x00000005, 0x325f7666,
5930 0x00000000, 0x00000005, 0x325f3276, 0x00000000, 0x00000010, 0x00000004, 0x00000124, 0x00000000,
5931 0x00000002, 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00327272, 0x00000001, 0x00000002,
5932 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
5933 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000003,
5934 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000010,
5935 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000004, 0x00000010,
5936 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574,
5937 0x00000030, 0x00000003, 0x00000001, 0x00000006, 0x00000005, 0x00000004, 0x00000020, 0x00000001,
5938 0x00000000, 0x00000030, 0x0000009c, 0x00000001, 0x00000000, 0x00000108, 0x0000011c, 0x00000001,
5939 0x00000000, 0x000001d0, 0x00000000, 0x00000002, 0x000001a8, 0x00000000, 0x00000004, 0x0000000e,
5940 0x00000000, 0x00000134, 0x00000130, 0x00000014, 0x00000000, 0x00000154, 0x00000150, 0x00000041,
5941 0x00000000, 0x00000174, 0x00000170, 0x00000092, 0x00000000, 0x00000194, 0x00000190, 0x000001c8,
5942 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x000001b4, 0x000001b0, 0x00000002, 0x00000004,
5943 0x00000001, 0x000000c8, 0xfffe0300, 0x0025fffe, 0x42415443, 0x0000001c, 0x0000005f, 0xfffe0300,
5944 0x00000001, 0x0000001c, 0x00000000, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
5945 0x00000048, 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x00000000,
5946 0x00000000, 0x00000000, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
5947 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
5948 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, 0x80000000, 0xe00f0000, 0x03000005,
5949 0xe00f0000, 0xa0000000, 0x90e40000, 0x0000ffff, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
5950 0xffffffff, 0x00000000, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d31, 0x00000000,
5951 0x00000000, 0xffffffff, 0x00000003, 0x00000001, 0x0000000b, 0x615f7376, 0x5b327272, 0x00005d30,
5952 0x00000000, 0x00000000, 0xffffffff, 0x00000002, 0x00000000, 0x00000188, 0x46580200, 0x004ffffe,
5953 0x42415443, 0x0000001c, 0x00000107, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000104,
5954 0x00000030, 0x00000002, 0x00000002, 0x00000094, 0x000000a4, 0x00327374, 0x325f3176, 0xababab00,
5955 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0x325f7666, 0xababab00, 0x00030000, 0x00010001,
5956 0x00000001, 0x00000000, 0x325f3276, 0xababab00, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
5957 0x00000034, 0x0000003c, 0x0000004c, 0x00000054, 0x00000064, 0x0000006c, 0x00000005, 0x00080001,
5958 0x00030002, 0x0000007c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
5959 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
5960 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, 0x40c00000,
5961 0x40e00000, 0x41000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
5962 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
5963 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
5964 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
5965 0x00000000, 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe,
5966 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058,
5967 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x32727261, 0xababab00, 0x00030000,
5968 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x4d007874,
5969 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
5970 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe,
5971 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
5972 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
5975 #define test_effect_shared_vs_arr_compare_helper(args...) \
5976 test_effect_shared_vs_arr_compare_helper_(__LINE__, args)
5977 static void test_effect_shared_vs_arr_compare_helper_(unsigned int line, ID3DXEffect *effect,
5978 D3DXHANDLE param_child, struct IDirect3DVertexShader9 *vshader1, unsigned int element,
5979 BOOL todo)
5981 struct IDirect3DVertexShader9 *vshader2;
5982 D3DXHANDLE param_child2;
5983 HRESULT hr;
5985 param_child2 = effect->lpVtbl->GetParameterElement(effect, "vs_arr2", element);
5986 ok_(__FILE__, line)(!!param_child2, "GetParameterElement failed.\n");
5987 ok_(__FILE__, line)(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
5988 hr = effect->lpVtbl->GetVertexShader(effect, param_child2, &vshader2);
5989 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
5990 todo_wine_if(todo)
5991 ok_(__FILE__, line)(vshader1 == vshader2, "Shared shader interface pointers differ.\n");
5992 if (vshader2)
5993 IDirect3DVertexShader9_Release(vshader2);
5996 #define test_effect_shared_parameters_compare_vconst(args...) \
5997 test_effect_shared_parameters_compare_vconst_(__LINE__, args)
5998 static void test_effect_shared_parameters_compare_vconst_(unsigned int line, IDirect3DDevice9 *device,
5999 unsigned int index, const D3DXVECTOR4 *expected_fvect, BOOL todo)
6001 D3DXVECTOR4 fvect;
6002 HRESULT hr;
6004 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, index, &fvect.x, 1);
6005 ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr);
6006 todo_wine_if(todo)
6007 ok_(__FILE__, line)(!memcmp(&fvect, expected_fvect, sizeof(fvect)),
6008 "Unexpected constant value %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6011 static void test_effect_shared_parameters(IDirect3DDevice9 *device)
6013 ID3DXEffect *effect1, *effect2, *effect3, *effect4;
6014 ID3DXEffectPool *pool;
6015 HRESULT hr;
6016 D3DXHANDLE param, param_child, param2, param_child2;
6017 unsigned int i, passes_count;
6018 ULONG refcount;
6019 D3DXVECTOR4 fvect;
6020 float fval[2];
6022 hr = D3DXCreateEffectPool(&pool);
6023 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6025 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6026 NULL, NULL, 0, pool, &effect2, NULL);
6027 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6028 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6029 effect2->lpVtbl->Release(effect2);
6031 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6032 NULL, NULL, 0, pool, &effect2, NULL);
6033 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6034 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6035 ok(fvect.x == 92.0f, "Unexpected parameter value %g.\n", fvect.x);
6036 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 28.0f);
6038 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6039 NULL, NULL, 0, pool, &effect1, NULL);
6040 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6042 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6043 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6045 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6046 NULL, NULL, 0, pool, &effect3, NULL);
6047 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6048 hr = D3DXCreateEffect(device, test_effect_shared_parameters_blob, sizeof(test_effect_shared_parameters_blob),
6049 NULL, NULL, 0, pool, &effect4, NULL);
6050 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6052 effect2->lpVtbl->SetFloat(effect2, "arr2[0]", 3.0f);
6053 effect2->lpVtbl->SetFloat(effect2, "ts2[0].fv", 3.0f);
6055 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6056 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6057 effect4->lpVtbl->SetFloat(effect4, "arr2[0]", 28.0f);
6058 effect3->lpVtbl->GetFloat(effect3, "arr2[0]", &fvect.x);
6059 ok(fvect.x == 28.0f, "Unexpected parameter value %g.\n", fvect.x);
6060 effect1->lpVtbl->GetFloat(effect1, "arr2[0]", &fvect.x);
6061 ok(fvect.x == 3.0f, "Unexpected parameter value %g.\n", fvect.x);
6063 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "ts2[0].fv_2");
6064 ok(!!param, "GetParameterByName failed.\n");
6065 effect3->lpVtbl->GetFloat(effect3, param, &fvect.x);
6066 ok(fvect.x == 0.0f, "Unexpected parameter value %g.\n", fvect.x);
6068 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6069 ok(!!param, "GetParameterByName failed.\n");
6070 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6071 "Unexpected IsParameterUsed result.\n");
6073 param = effect3->lpVtbl->GetParameterByName(effect3, NULL, "arr2");
6074 ok(!!param, "GetParameterByName failed.\n");
6075 ok(effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6076 "Unexpected IsParameterUsed result.\n");
6078 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "vs_arr2");
6079 ok(!!param, "GetParameterByName failed.\n");
6080 todo_wine
6081 ok(!effect3->lpVtbl->IsParameterUsed(effect3, param, "tech0"),
6082 "Unexpected IsParameterUsed result.\n");
6084 ok(effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2", "tech0"),
6085 "Unexpected IsParameterUsed result.\n");
6086 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[0]", "tech0"),
6087 "Unexpected IsParameterUsed result.\n");
6088 ok(!effect3->lpVtbl->IsParameterUsed(effect3, "vs_arr2[1]", "tech0"),
6089 "Unexpected IsParameterUsed result.\n");
6091 ok(effect1->lpVtbl->IsParameterUsed(effect1, param, "tech0"),
6092 "Unexpected IsParameterUsed result.\n");
6094 hr = effect3->lpVtbl->Begin(effect3, &passes_count, 0);
6095 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6097 if (0)
6099 /* Native d3dx crashes in BeginPass(). This is the case of shader array declared shared
6100 * but initialized with different shaders using different parameters. */
6101 hr = effect3->lpVtbl->BeginPass(effect3, 0);
6102 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6104 hr = effect3->lpVtbl->EndPass(effect3);
6105 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6108 test_effect_preshader_clear_vconsts(device);
6109 fvect.x = fvect.y = fvect.z = fvect.w = 28.0f;
6110 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6111 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6112 hr = effect1->lpVtbl->SetVector(effect1, "g_Pos1", &fvect);
6113 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6115 hr = effect3->lpVtbl->BeginPass(effect3, 1);
6116 todo_wine
6117 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6119 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fvect.x, 1);
6120 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6121 todo_wine
6122 ok(fvect.x == 0.0f && fvect.y == 0.0f && fvect.z == 0.0f && fvect.w == 0.0f,
6123 "Unexpected vector %g, %g, %g, %g.\n", fvect.x, fvect.y, fvect.z, fvect.w);
6125 hr = effect3->lpVtbl->EndPass(effect3);
6126 todo_wine
6127 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6129 hr = effect3->lpVtbl->End(effect3);
6130 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6132 for (i = 0; i < 2; ++i)
6134 struct IDirect3DVertexShader9 *vshader1;
6136 param_child = effect1->lpVtbl->GetParameterElement(effect1, "vs_arr2", i);
6137 ok(!!param_child, "GetParameterElement failed.\n");
6138 hr = effect1->lpVtbl->GetVertexShader(effect1, param_child, &vshader1);
6139 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6141 test_effect_shared_vs_arr_compare_helper(effect2, param_child, vshader1, i, FALSE);
6142 test_effect_shared_vs_arr_compare_helper(effect3, param_child, vshader1, i, FALSE);
6143 test_effect_shared_vs_arr_compare_helper(effect4, param_child, vshader1, i, FALSE);
6144 IDirect3DVertexShader9_Release(vshader1);
6147 effect3->lpVtbl->Release(effect3);
6148 effect4->lpVtbl->Release(effect4);
6150 fval[0] = 1.0f;
6151 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr1", fval, 1);
6152 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6153 fval[0] = 0.0f;
6154 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr1", fval, 1);
6155 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6156 ok(fval[0] == 91.0f, "Unexpected value %g.\n", fval[0]);
6158 param = effect1->lpVtbl->GetParameterByName(effect1, NULL, "arr2");
6159 ok(!!param, "GetParameterByName failed.\n");
6160 param2 = effect2->lpVtbl->GetParameterByName(effect2, NULL, "arr2");
6161 ok(!!param, "GetParameterByName failed.\n");
6162 ok(param != param2, "Got same parameter handle unexpectedly.\n");
6163 param_child = effect1->lpVtbl->GetParameterElement(effect1, param, 0);
6164 ok(!!param_child, "GetParameterElement failed.\n");
6165 param_child2 = effect1->lpVtbl->GetParameterElement(effect2, param2, 0);
6166 ok(!!param_child2, "GetParameterElement failed.\n");
6167 ok(param_child != param_child2, "Got same parameter handle unexpectedly.\n");
6169 fval[0] = 33.0f;
6170 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 1);
6171 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6172 fval[0] = 0.0f;
6173 hr = effect1->lpVtbl->GetFloatArray(effect1, "arr2", fval, 2);
6174 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6175 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6176 fval[0] = 0.0f;
6177 hr = effect2->lpVtbl->GetFloatArray(effect2, "arr2", fval, 2);
6178 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6179 ok(fval[0] == 33.0f && fval[1] == 93.0f, "Unexpected values %g, %g.\n", fval[0], fval[1]);
6181 hr = effect1->lpVtbl->Begin(effect1, &passes_count, 0);
6182 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6184 hr = effect2->lpVtbl->Begin(effect2, &passes_count, 0);
6185 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6187 hr = effect1->lpVtbl->BeginPass(effect1, 0);
6188 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6190 fvect.x = 1.0f;
6191 fvect.y = fvect.z = fvect.w = 0.0f;
6192 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6194 hr = effect1->lpVtbl->BeginPass(effect2, 0);
6195 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6197 fvect.x = 91.0f;
6198 test_effect_shared_parameters_compare_vconst(device, 32, &fvect, FALSE);
6199 fvect.x = 33.0f;
6200 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6202 fval[0] = 28.0f;
6203 fval[1] = -1.0f;
6204 hr = effect1->lpVtbl->SetFloatArray(effect1, "arr2", fval, 2);
6205 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6207 test_effect_preshader_clear_vconsts(device);
6209 hr = effect1->lpVtbl->CommitChanges(effect1);
6210 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6212 fvect.x = 28.0f;
6213 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6214 fvect.x = -1.0f;
6215 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6217 test_effect_preshader_clear_vconsts(device);
6219 hr = effect1->lpVtbl->CommitChanges(effect1);
6220 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6222 test_effect_shared_parameters_compare_vconst(device, 29, &fvect_filler, FALSE);
6223 test_effect_shared_parameters_compare_vconst(device, 30, &fvect_filler, FALSE);
6225 hr = effect2->lpVtbl->CommitChanges(effect2);
6226 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6228 fvect.x = 28.0f;
6229 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6230 fvect.x = -1.0f;
6231 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6233 fval[0] = -2.0f;
6234 hr = effect2->lpVtbl->SetFloat(effect2, "arr2[0]", fval[0]);
6235 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6236 hr = effect1->lpVtbl->CommitChanges(effect1);
6237 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6239 fvect.x = -2.0f;
6240 test_effect_shared_parameters_compare_vconst(device, 29, &fvect, FALSE);
6241 fvect.x = -1.0f;
6242 test_effect_shared_parameters_compare_vconst(device, 30, &fvect, FALSE);
6244 fvect.x = fvect.y = fvect.z = fvect.w = 1111.0f;
6245 hr = effect2->lpVtbl->SetVector(effect2, "g_Pos1", &fvect);
6246 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6248 hr = effect1->lpVtbl->CommitChanges(effect1);
6249 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6250 test_effect_shared_parameters_compare_vconst(device, 31, &fvect_filler, FALSE);
6252 hr = effect1->lpVtbl->CommitChanges(effect2);
6253 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6254 test_effect_shared_parameters_compare_vconst(device, 31, &fvect, FALSE);
6256 hr = effect1->lpVtbl->End(effect1);
6257 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6259 hr = effect2->lpVtbl->End(effect2);
6260 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6262 if (0)
6264 refcount = pool->lpVtbl->Release(pool);
6265 ok(refcount == 2, "Unexpected refcount %u.\n", refcount);
6267 refcount = pool->lpVtbl->Release(pool);
6268 ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
6270 refcount = pool->lpVtbl->Release(pool);
6271 ok(!refcount, "Unexpected refcount %u.\n", refcount);
6273 /* Native d3dx crashes in GetFloat(). */
6274 effect2->lpVtbl->GetFloat(effect2, "arr2[0]", &fvect.x);
6277 effect1->lpVtbl->Release(effect1);
6278 effect2->lpVtbl->Release(effect2);
6280 refcount = pool->lpVtbl->Release(pool);
6281 ok(!refcount, "Effect pool was not properly freed, refcount %u.\n", refcount);
6284 static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device)
6286 ID3DXEffect *effect;
6287 D3DXHANDLE param;
6288 static int expected_ivect[4] = {28, 29, 30, 31};
6289 int ivect[4];
6290 HRESULT hr;
6292 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6293 NULL, NULL, D3DXFX_LARGEADDRESSAWARE, NULL, &effect, NULL);
6294 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6296 param = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
6297 ok(!!param, "GetParameterByName failed.\n");
6299 hr = effect->lpVtbl->SetValue(effect, param, expected_ivect, sizeof(expected_ivect));
6300 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6302 hr = effect->lpVtbl->GetValue(effect, param, ivect, sizeof(ivect));
6303 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6305 ok(!memcmp(ivect, expected_ivect, sizeof(expected_ivect)), "Vector value mismatch.\n");
6307 if (0)
6309 /* Native d3dx crashes in GetValue(). */
6310 hr = effect->lpVtbl->GetValue(effect, "g_iVect", ivect, sizeof(ivect));
6311 ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
6314 effect->lpVtbl->Release(effect);
6317 static void test_effect_get_pass_desc(IDirect3DDevice9 *device)
6319 unsigned int passes_count;
6320 ID3DXEffect *effect;
6321 D3DXPASS_DESC desc;
6322 D3DXVECTOR4 fvect;
6323 D3DXHANDLE pass;
6324 HRESULT hr;
6326 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6327 NULL, NULL, 0, NULL, &effect, NULL);
6328 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6330 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6331 ok(!!pass, "GetPass() failed.\n");
6333 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6334 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6335 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6337 fvect.x = fvect.y = fvect.w = 0.0f;
6338 fvect.z = 0.0f;
6339 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6340 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6342 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6343 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6344 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6346 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6348 fvect.z = 3.0f;
6349 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6350 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6352 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6353 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6354 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6356 /* Repeating call to confirm GetPassDesc() returns same error on the second call,
6357 * as it is not the case sometimes for BeginPass() with out of bound access. */
6358 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6359 ok(hr == E_FAIL, "Got result %#x.\n", hr);
6360 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6362 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
6363 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6365 hr = effect->lpVtbl->BeginPass(effect, 1);
6366 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6368 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6369 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6371 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, FALSE);
6373 fvect.z = 2.0f;
6374 hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect);
6375 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6376 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6377 test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, FALSE);
6379 effect->lpVtbl->Release(effect);
6381 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
6382 NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL);
6383 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6385 pass = effect->lpVtbl->GetPass(effect, "tech0", 1);
6386 ok(!!pass, "GetPass() failed.\n");
6388 hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
6389 ok(hr == D3D_OK, "Got result %#x.\n", hr);
6391 ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n");
6392 ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n");
6394 effect->lpVtbl->Release(effect);
6397 START_TEST(effect)
6399 HWND wnd;
6400 IDirect3D9 *d3d;
6401 IDirect3DDevice9 *device;
6402 D3DPRESENT_PARAMETERS d3dpp;
6403 HRESULT hr;
6404 ULONG count;
6406 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
6407 640, 480, NULL, NULL, NULL, NULL)))
6409 skip("Couldn't create application window\n");
6410 return;
6412 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
6414 skip("Couldn't create IDirect3D9 object\n");
6415 DestroyWindow(wnd);
6416 return;
6419 ZeroMemory(&d3dpp, sizeof(d3dpp));
6420 d3dpp.Windowed = TRUE;
6421 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
6422 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
6423 if (FAILED(hr)) {
6424 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
6425 IDirect3D9_Release(d3d);
6426 DestroyWindow(wnd);
6427 return;
6430 test_create_effect_and_pool(device);
6431 test_create_effect_compiler();
6432 test_effect_parameter_value(device);
6433 test_effect_setvalue_object(device);
6434 test_effect_variable_names(device);
6435 test_effect_compilation_errors(device);
6436 test_effect_states(device);
6437 test_effect_preshader(device);
6438 test_effect_preshader_ops(device);
6439 test_effect_isparameterused(device);
6440 test_effect_out_of_bounds_selector(device);
6441 test_effect_commitchanges(device);
6442 test_effect_preshader_relative_addressing(device);
6443 test_effect_state_manager(device);
6444 test_cross_effect_handle(device);
6445 test_effect_shared_parameters(device);
6446 test_effect_large_address_aware_flag(device);
6447 test_effect_get_pass_desc(device);
6449 count = IDirect3DDevice9_Release(device);
6450 ok(count == 0, "The device was not properly freed: refcount %u\n", count);
6452 count = IDirect3D9_Release(d3d);
6453 ok(count == 0, "Release failed %u\n", count);
6455 DestroyWindow(wnd);