d3dx9: Add 'exp' preshader opcode.
[wine.git] / dlls / d3dx9_36 / tests / effect.c
blobaea3ded8b76fb5037e56e82d9005910762bfe25b
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 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr))
27 /* helper functions */
28 static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps)
30 INT x = *(INT *)&f;
31 INT y = *(INT *)&g;
33 if (x < 0)
34 x = INT_MIN - x;
35 if (y < 0)
36 y = INT_MIN - y;
38 if (abs(x - y) > ulps)
39 return FALSE;
41 return TRUE;
44 static inline INT get_int(D3DXPARAMETER_TYPE type, const void *data)
46 INT i;
48 switch (type)
50 case D3DXPT_FLOAT:
51 i = *(FLOAT *)data;
52 break;
54 case D3DXPT_INT:
55 i = *(INT *)data;
56 break;
58 case D3DXPT_BOOL:
59 i = *(BOOL *)data;
60 break;
62 default:
63 i = 0;
64 ok(0, "Unhandled type %x.\n", type);
65 break;
68 return i;
71 static inline float get_float(D3DXPARAMETER_TYPE type, const void *data)
73 float f;
75 switch (type)
77 case D3DXPT_FLOAT:
78 f = *(FLOAT *)data;
79 break;
81 case D3DXPT_INT:
82 f = *(INT *)data;
83 break;
85 case D3DXPT_BOOL:
86 f = *(BOOL *)data;
87 break;
89 default:
90 f = 0.0f;
91 ok(0, "Unhandled type %x.\n", type);
92 break;
95 return f;
98 static inline BOOL get_bool(const void *data)
100 return !!*(BOOL *)data;
103 static void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype)
105 switch (outtype)
107 case D3DXPT_FLOAT:
108 *(FLOAT *)outdata = get_float(intype, indata);
109 break;
111 case D3DXPT_BOOL:
112 *(BOOL *)outdata = get_bool(indata);
113 break;
115 case D3DXPT_INT:
116 *(INT *)outdata = get_int(intype, indata);
117 break;
119 case D3DXPT_PIXELSHADER:
120 case D3DXPT_VERTEXSHADER:
121 case D3DXPT_TEXTURE2D:
122 case D3DXPT_STRING:
123 *(INT *)outdata = 0x12345678;
124 break;
126 default:
127 ok(0, "Unhandled type %x.\n", outtype);
128 *(INT *)outdata = 0;
129 break;
133 static const char effect_desc[] =
134 "Technique\n"
135 "{\n"
136 "}\n";
138 static void test_create_effect_and_pool(IDirect3DDevice9 *device)
140 HRESULT hr;
141 ID3DXEffect *effect;
142 ID3DXBaseEffect *base;
143 ULONG count;
144 IDirect3DDevice9 *device2;
145 ID3DXEffectStateManager *manager = (ID3DXEffectStateManager *)0xdeadbeef;
146 ID3DXEffectPool *pool = (ID3DXEffectPool *)0xdeadbeef, *pool2;
148 hr = D3DXCreateEffect(NULL, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
149 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
151 hr = D3DXCreateEffect(device, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
152 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
154 hr = D3DXCreateEffect(device, effect_desc, 0, NULL, NULL, 0, NULL, NULL, NULL);
155 ok(hr == E_FAIL, "Got result %x, expected %x (D3DXERR_INVALIDDATA)\n", hr, E_FAIL);
157 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL, NULL);
158 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
160 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, &effect, NULL);
161 todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
162 if (FAILED(hr))
164 skip("Failed to compile effect, skipping test.\n");
165 return;
168 hr = effect->lpVtbl->QueryInterface(effect, &IID_ID3DXBaseEffect, (void **)&base);
169 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
171 hr = effect->lpVtbl->GetStateManager(effect, NULL);
172 ok(hr == D3DERR_INVALIDCALL, "GetStateManager failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
174 hr = effect->lpVtbl->GetStateManager(effect, &manager);
175 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
176 ok(!manager, "GetStateManager failed, got %p\n", manager);
178 /* this works, but it is not recommended! */
179 hr = effect->lpVtbl->SetStateManager(effect, (ID3DXEffectStateManager *)device);
180 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
182 hr = effect->lpVtbl->GetStateManager(effect, &manager);
183 ok(hr == D3D_OK, "GetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
184 ok(manager != NULL, "GetStateManager failed\n");
186 IDirect3DDevice9_AddRef(device);
187 count = IDirect3DDevice9_Release(device);
188 ok(count == 4, "Release failed, got %u, expected 4\n", count);
190 count = IUnknown_Release(manager);
191 ok(count == 3, "Release failed, got %u, expected 3\n", count);
193 hr = effect->lpVtbl->SetStateManager(effect, NULL);
194 ok(hr == D3D_OK, "SetStateManager failed, got %x, expected 0 (D3D_OK)\n", hr);
196 hr = effect->lpVtbl->GetPool(effect, &pool);
197 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
198 ok(!pool, "GetPool failed, got %p\n", pool);
200 hr = effect->lpVtbl->GetPool(effect, NULL);
201 ok(hr == D3DERR_INVALIDCALL, "GetPool failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
203 hr = effect->lpVtbl->GetDevice(effect, &device2);
204 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
206 hr = effect->lpVtbl->GetDevice(effect, NULL);
207 ok(hr == D3DERR_INVALIDCALL, "GetDevice failed, got %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
209 count = IDirect3DDevice9_Release(device2);
210 ok(count == 2, "Release failed, got %u, expected 2\n", count);
212 count = effect->lpVtbl->Release(effect);
213 ok(count == 0, "Release failed %u\n", count);
215 hr = D3DXCreateEffectPool(NULL);
216 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
218 hr = D3DXCreateEffectPool(&pool);
219 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
221 count = pool->lpVtbl->Release(pool);
222 ok(count == 0, "Release failed %u\n", count);
224 hr = D3DXCreateEffectPool(&pool);
225 ok(hr == S_OK, "Got result %x, expected 0 (S_OK)\n", hr);
227 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, NULL, NULL);
228 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
230 hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2);
231 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
232 ok(pool == pool2, "Release failed, got %p, expected %p\n", pool2, pool);
234 count = pool2->lpVtbl->Release(pool2);
235 ok(count == 1, "Release failed, got %u, expected 1\n", count);
237 hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9, (void **)&device2);
238 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
240 count = IDirect3DDevice9_Release(device2);
241 ok(count == 1, "Release failed, got %u, expected 1\n", count);
243 hr = D3DXCreateEffect(device, effect_desc, sizeof(effect_desc), NULL, NULL, 0, pool, &effect, NULL);
244 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
246 hr = effect->lpVtbl->GetPool(effect, &pool);
247 ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr);
248 ok(pool == pool2, "GetPool failed, got %p, expected %p\n", pool2, pool);
250 count = pool2->lpVtbl->Release(pool2);
251 ok(count == 2, "Release failed, got %u, expected 2\n", count);
253 count = effect->lpVtbl->Release(effect);
254 ok(count == 0, "Release failed %u\n", count);
256 count = pool->lpVtbl->Release(pool);
257 ok(count == 0, "Release failed %u\n", count);
260 static void test_create_effect_compiler(void)
262 HRESULT hr;
263 ID3DXEffectCompiler *compiler, *compiler2;
264 ID3DXBaseEffect *base;
265 IUnknown *unknown;
266 ULONG count;
268 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, &compiler, NULL);
269 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
271 hr = D3DXCreateEffectCompiler(NULL, 0, NULL, NULL, 0, NULL, NULL);
272 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
274 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, &compiler, NULL);
275 todo_wine ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
276 if (FAILED(hr))
278 skip("D3DXCreateEffectCompiler failed, skipping test.\n");
279 return;
282 count = compiler->lpVtbl->Release(compiler);
283 ok(count == 0, "Release failed %u\n", count);
285 hr = D3DXCreateEffectCompiler(effect_desc, 0, NULL, NULL, 0, NULL, NULL);
286 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
288 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
289 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
291 hr = D3DXCreateEffectCompiler(NULL, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
292 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
294 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, NULL, NULL);
295 ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL);
297 hr = D3DXCreateEffectCompiler(effect_desc, sizeof(effect_desc), NULL, NULL, 0, &compiler, NULL);
298 ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK);
300 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXBaseEffect, (void **)&base);
301 ok(hr == E_NOINTERFACE, "QueryInterface failed, got %x, expected %x (E_NOINTERFACE)\n", hr, E_NOINTERFACE);
303 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_ID3DXEffectCompiler, (void **)&compiler2);
304 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
306 hr = compiler->lpVtbl->QueryInterface(compiler, &IID_IUnknown, (void **)&unknown);
307 ok(hr == D3D_OK, "QueryInterface failed, got %x, expected %x (D3D_OK)\n", hr, D3D_OK);
309 count = unknown->lpVtbl->Release(unknown);
310 ok(count == 2, "Release failed, got %u, expected %u\n", count, 2);
312 count = compiler2->lpVtbl->Release(compiler2);
313 ok(count == 1, "Release failed, got %u, expected %u\n", count, 1);
315 count = compiler->lpVtbl->Release(compiler);
316 ok(count == 0, "Release failed %u\n", count);
320 * Parameter value test
322 struct test_effect_parameter_value_result
324 const char *full_name;
325 D3DXPARAMETER_DESC desc;
326 UINT value_offset; /* start position for the value in the blob */
330 * fxc.exe /Tfx_2_0
332 #if 0
333 float f = 0.1;
334 float1 f1 = {1.1};
335 float2 f2 = {2.1, 2.2};
336 float3 f3 = {3.1, 3.2, 3.3};
337 float4 f4 = {4.1, 4.2, 4.3, 4.4};
338 float1x1 f11 = {11.1};
339 float1x2 f12 = {12.1, 12.2};
340 float1x3 f13 = {13.1, 13.2, 13.3};
341 float1x4 f14 = {14.1, 14.2, 14.3, 14.4};
342 float2x1 f21 = {{21.11, 21.21}};
343 float2x2 f22 = {{22.11, 22.21}, {22.12, 22.22}};
344 float2x3 f23 = {{23.11, 23.21}, {23.12, 23.22}, {23.13, 23.23}};
345 float2x4 f24 = {{24.11, 24.21}, {24.12, 24.22}, {24.13, 24.23}, {24.14, 24.24}};
346 float3x1 f31 = {{31.11, 31.21, 31.31}};
347 float3x2 f32 = {{32.11, 32.21, 32.31}, {32.12, 32.22, 32.32}};
348 float3x3 f33 = {{33.11, 33.21, 33.31}, {33.12, 33.22, 33.32},
349 {33.13, 33.23, 33.33}};
350 float3x4 f34 = {{34.11, 34.21, 34.31}, {34.12, 34.22, 34.32},
351 {34.13, 34.23, 34.33}, {34.14, 34.24, 34.34}};
352 float4x1 f41 = {{41.11, 41.21, 41.31, 41.41}};
353 float4x2 f42 = {{42.11, 42.21, 42.31, 42.41}, {42.12, 42.22, 42.32, 42.42}};
354 float4x3 f43 = {{43.11, 43.21, 43.31, 43.41}, {43.12, 43.22, 43.32, 43.42},
355 {43.13, 43.23, 43.33, 43.43}};
356 float4x4 f44 = {{44.11, 44.21, 44.31, 44.41}, {44.12, 44.22, 44.32, 44.42},
357 {44.13, 44.23, 44.33, 44.43}, {44.14, 44.24, 44.34, 44.44}};
358 float f_2[2] = {0.101, 0.102};
359 float1 f1_2[2] = {{1.101}, {1.102}};
360 float2 f2_2[2] = {{2.101, 2.201}, {2.102, 2.202}};
361 float3 f3_2[2] = {{3.101, 3.201, 3.301}, {3.102, 3.202, 3.302}};
362 float4 f4_2[2] = {{4.101, 4.201, 4.301, 4.401}, {4.102, 4.202, 4.302, 4.402}};
363 float1x1 f11_2[2] = {{11.101}, {11.102}};
364 float1x2 f12_2[2] = {{12.101, 12.201}, {12.102, 12.202}};
365 float1x3 f13_2[2] = {{13.101, 13.201, 13.301}, {13.102, 13.202, 13.302}};
366 float1x4 f14_2[2] = {{14.101, 14.201, 14.301, 14.401}, {14.102, 14.202, 14.302, 14.402}};
367 float2x1 f21_2[2] = {{{21.1101, 21.2101}}, {{21.1102, 21.2102}}};
368 float2x2 f22_2[2] = {{{22.1101, 22.2101}, {22.1201, 22.2201}}, {{22.1102, 22.2102}, {22.1202, 22.2202}}};
369 float2x3 f23_2[2] = {{{23.1101, 23.2101}, {23.1201, 23.2201}, {23.1301, 23.2301}}, {{23.1102, 23.2102},
370 {23.1202, 23.2202}, {23.1302, 23.2302}}};
371 float2x4 f24_2[2] = {{{24.1101, 24.2101}, {24.1201, 24.2201}, {24.1301, 24.2301}, {24.1401, 24.2401}},
372 {{24.1102, 24.2102}, {24.1202, 24.2202}, {24.1302, 24.2302}, {24.1402, 24.2402}}};
373 float3x1 f31_2[2] = {{{31.1101, 31.2101, 31.3101}}, {{31.1102, 31.2102, 31.3102}}};
374 float3x2 f32_2[2] = {{{32.1101, 32.2101, 32.3101}, {32.1201, 32.2201, 32.3201}},
375 {{32.1102, 32.2102, 32.3102}, {32.1202, 32.2202, 32.3202}}};
376 float3x3 f33_2[2] = {{{33.1101, 33.2101, 33.3101}, {33.1201, 33.2201, 33.3201},
377 {33.1301, 33.2301, 33.3301}}, {{33.1102, 33.2102, 33.3102}, {33.1202, 33.2202, 33.3202},
378 {33.1302, 33.2302, 33.3302}}};
379 float3x4 f34_2[2] = {{{34.1101, 34.2101, 34.3101}, {34.1201, 34.2201, 34.3201},
380 {34.1301, 34.2301, 34.3301}, {34.1401, 34.2401, 34.3401}}, {{34.1102, 34.2102, 34.3102},
381 {34.1202, 34.2202, 34.3202}, {34.1302, 34.2302, 34.3302}, {34.1402, 34.2402, 34.3402}}};
382 float4x1 f41_2[2] = {{{41.1101, 41.2101, 41.3101, 41.4101}}, {{41.1102, 41.2102, 41.3102, 41.4102}}};
383 float4x2 f42_2[2] = {{{42.1101, 42.2101, 42.3101, 42.4101}, {42.1201, 42.2201, 42.3201, 42.4201}},
384 {{42.1102, 42.2102, 42.3102, 42.4102}, {42.1202, 42.2202, 42.3202, 42.4202}}};
385 float4x3 f43_2[2] = {{{43.1101, 43.2101, 43.3101, 43.4101}, {43.1201, 43.2201, 43.3201, 43.4201},
386 {43.1301, 43.2301, 43.3301, 43.4301}}, {{43.1102, 43.2102, 43.3102, 43.4102},
387 {43.1202, 43.2202, 43.3202, 43.4202}, {43.1302, 43.2302, 43.3302, 43.4302}}};
388 float4x4 f44_2[2] = {{{44.1101, 44.2101, 44.3101, 44.4101}, {44.1201, 44.2201, 44.3201, 44.4201},
389 {44.1301, 44.2301, 44.3301, 44.4301}, {44.1401, 44.2401, 44.3401, 44.4401}},
390 {{44.1102, 44.2102, 44.3102, 44.4102}, {44.1202, 44.2202, 44.3202, 44.4202},
391 {44.1302, 44.2302, 44.3302, 44.4302}, {44.1402, 44.2402, 44.3402, 44.4402}}};
392 technique t { pass p { } }
393 #endif
394 static const DWORD test_effect_parameter_value_blob_float[] =
396 0xfeff0901, 0x00000b80, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
397 0x00000001, 0x00000001, 0x3dcccccd, 0x00000002, 0x00000066, 0x00000003, 0x00000001, 0x0000004c,
398 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x3f8ccccd, 0x00000003, 0x00003166, 0x00000003,
399 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x40066666, 0x400ccccd,
400 0x00000003, 0x00003266, 0x00000003, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
401 0x00000001, 0x40466666, 0x404ccccd, 0x40533333, 0x00000003, 0x00003366, 0x00000003, 0x00000001,
402 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x40833333, 0x40866666, 0x4089999a,
403 0x408ccccd, 0x00000003, 0x00003466, 0x00000003, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
404 0x00000001, 0x00000001, 0x4131999a, 0x00000004, 0x00313166, 0x00000003, 0x00000002, 0x00000130,
405 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x4141999a, 0x41433333, 0x00000004, 0x00323166,
406 0x00000003, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x4151999a,
407 0x41533333, 0x4154cccd, 0x00000004, 0x00333166, 0x00000003, 0x00000002, 0x00000194, 0x00000000,
408 0x00000000, 0x00000001, 0x00000004, 0x4161999a, 0x41633333, 0x4164cccd, 0x41666666, 0x00000004,
409 0x00343166, 0x00000003, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
410 0x41a8e148, 0x41a9ae14, 0x00000004, 0x00313266, 0x00000003, 0x00000002, 0x000001f4, 0x00000000,
411 0x00000000, 0x00000002, 0x00000002, 0x41b0e148, 0x41b1ae14, 0x41b0f5c3, 0x41b1c28f, 0x00000004,
412 0x00323266, 0x00000003, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
413 0x41b8e148, 0x41b9ae14, 0x41b8f5c3, 0x41b9c28f, 0x41b90a3d, 0x41b9d70a, 0x00000004, 0x00333266,
414 0x00000003, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x41c0e148,
415 0x41c1ae14, 0x41c0f5c3, 0x41c1c28f, 0x41c10a3d, 0x41c1d70a, 0x41c11eb8, 0x41c1eb85, 0x00000004,
416 0x00343266, 0x00000003, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
417 0x41f8e148, 0x41f9ae14, 0x41fa7ae1, 0x00000004, 0x00313366, 0x00000003, 0x00000002, 0x000002e0,
418 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x420070a4, 0x4200d70a, 0x42013d71, 0x42007ae1,
419 0x4200e148, 0x420147ae, 0x00000004, 0x00323366, 0x00000003, 0x00000002, 0x00000328, 0x00000000,
420 0x00000000, 0x00000003, 0x00000003, 0x420470a4, 0x4204d70a, 0x42053d71, 0x42047ae1, 0x4204e148,
421 0x420547ae, 0x4204851f, 0x4204eb85, 0x420551ec, 0x00000004, 0x00333366, 0x00000003, 0x00000002,
422 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x420870a4, 0x4208d70a, 0x42093d71,
423 0x42087ae1, 0x4208e148, 0x420947ae, 0x4208851f, 0x4208eb85, 0x420951ec, 0x42088f5c, 0x4208f5c3,
424 0x42095c29, 0x00000004, 0x00343366, 0x00000003, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
425 0x00000004, 0x00000001, 0x422470a4, 0x4224d70a, 0x42253d71, 0x4225a3d7, 0x00000004, 0x00313466,
426 0x00000003, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x422870a4,
427 0x4228d70a, 0x42293d71, 0x4229a3d7, 0x42287ae1, 0x4228e148, 0x422947ae, 0x4229ae14, 0x00000004,
428 0x00323466, 0x00000003, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
429 0x422c70a4, 0x422cd70a, 0x422d3d71, 0x422da3d7, 0x422c7ae1, 0x422ce148, 0x422d47ae, 0x422dae14,
430 0x422c851f, 0x422ceb85, 0x422d51ec, 0x422db852, 0x00000004, 0x00333466, 0x00000003, 0x00000002,
431 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x423070a4, 0x4230d70a, 0x42313d71,
432 0x4231a3d7, 0x42307ae1, 0x4230e148, 0x423147ae, 0x4231ae14, 0x4230851f, 0x4230eb85, 0x423151ec,
433 0x4231b852, 0x42308f5c, 0x4230f5c3, 0x42315c29, 0x4231c28f, 0x00000004, 0x00343466, 0x00000003,
434 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x3dced917, 0x3dd0e560,
435 0x00000004, 0x00325f66, 0x00000003, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
436 0x00000001, 0x3f8ced91, 0x3f8d0e56, 0x00000005, 0x325f3166, 0x00000000, 0x00000003, 0x00000001,
437 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x400676c9, 0x400cdd2f, 0x4006872b,
438 0x400ced91, 0x00000005, 0x325f3266, 0x00000000, 0x00000003, 0x00000001, 0x0000057c, 0x00000000,
439 0x00000002, 0x00000003, 0x00000001, 0x404676c9, 0x404cdd2f, 0x40534396, 0x4046872b, 0x404ced91,
440 0x405353f8, 0x00000005, 0x325f3366, 0x00000000, 0x00000003, 0x00000001, 0x000005c4, 0x00000000,
441 0x00000002, 0x00000004, 0x00000001, 0x40833b64, 0x40866e98, 0x4089a1cb, 0x408cd4fe, 0x40834396,
442 0x408676c9, 0x4089a9fc, 0x408cdd2f, 0x00000005, 0x325f3466, 0x00000000, 0x00000003, 0x00000002,
443 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x41319db2, 0x4131a1cb, 0x00000006,
444 0x5f313166, 0x00000032, 0x00000003, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
445 0x00000002, 0x41419db2, 0x4143374c, 0x4141a1cb, 0x41433b64, 0x00000006, 0x5f323166, 0x00000032,
446 0x00000003, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x41519db2,
447 0x4153374c, 0x4154d0e5, 0x4151a1cb, 0x41533b64, 0x4154d4fe, 0x00000006, 0x5f333166, 0x00000032,
448 0x00000003, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x41619db2,
449 0x4163374c, 0x4164d0e5, 0x41666a7f, 0x4161a1cb, 0x41633b64, 0x4164d4fe, 0x41666e98, 0x00000006,
450 0x5f343166, 0x00000032, 0x00000003, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
451 0x00000001, 0x41a8e17c, 0x41a9ae49, 0x41a8e1b1, 0x41a9ae7d, 0x00000006, 0x5f313266, 0x00000032,
452 0x00000003, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x41b0e17c,
453 0x41b1ae49, 0x41b0f5f7, 0x41b1c2c4, 0x41b0e1b1, 0x41b1ae7d, 0x41b0f62b, 0x41b1c2f8, 0x00000006,
454 0x5f323266, 0x00000032, 0x00000003, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
455 0x00000003, 0x41b8e17c, 0x41b9ae49, 0x41b8f5f7, 0x41b9c2c4, 0x41b90a72, 0x41b9d73f, 0x41b8e1b1,
456 0x41b9ae7d, 0x41b8f62b, 0x41b9c2f8, 0x41b90aa6, 0x41b9d773, 0x00000006, 0x5f333266, 0x00000032,
457 0x00000003, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x41c0e17c,
458 0x41c1ae49, 0x41c0f5f7, 0x41c1c2c4, 0x41c10a72, 0x41c1d73f, 0x41c11eed, 0x41c1ebba, 0x41c0e1b1,
459 0x41c1ae7d, 0x41c0f62b, 0x41c1c2f8, 0x41c10aa6, 0x41c1d773, 0x41c11f21, 0x41c1ebee, 0x00000006,
460 0x5f343266, 0x00000032, 0x00000003, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
461 0x00000001, 0x41f8e17c, 0x41f9ae49, 0x41fa7b16, 0x41f8e1b1, 0x41f9ae7d, 0x41fa7b4a, 0x00000006,
462 0x5f313366, 0x00000032, 0x00000003, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
463 0x00000002, 0x420070be, 0x4200d724, 0x42013d8b, 0x42007afb, 0x4200e162, 0x420147c8, 0x420070d8,
464 0x4200d73f, 0x42013da5, 0x42007b16, 0x4200e17c, 0x420147e3, 0x00000006, 0x5f323366, 0x00000032,
465 0x00000003, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x420470be,
466 0x4204d724, 0x42053d8b, 0x42047afb, 0x4204e162, 0x420547c8, 0x42048539, 0x4204eb9f, 0x42055206,
467 0x420470d8, 0x4204d73f, 0x42053da5, 0x42047b16, 0x4204e17c, 0x420547e3, 0x42048553, 0x4204ebba,
468 0x42055220, 0x00000006, 0x5f333366, 0x00000032, 0x00000003, 0x00000002, 0x00000984, 0x00000000,
469 0x00000002, 0x00000003, 0x00000004, 0x420870be, 0x4208d724, 0x42093d8b, 0x42087afb, 0x4208e162,
470 0x420947c8, 0x42088539, 0x4208eb9f, 0x42095206, 0x42088f76, 0x4208f5dd, 0x42095c43, 0x420870d8,
471 0x4208d73f, 0x42093da5, 0x42087b16, 0x4208e17c, 0x420947e3, 0x42088553, 0x4208ebba, 0x42095220,
472 0x42088f91, 0x4208f5f7, 0x42095c5d, 0x00000006, 0x5f343366, 0x00000032, 0x00000003, 0x00000002,
473 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x422470be, 0x4224d724, 0x42253d8b,
474 0x4225a3f1, 0x422470d8, 0x4224d73f, 0x42253da5, 0x4225a40b, 0x00000006, 0x5f313466, 0x00000032,
475 0x00000003, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x422870be,
476 0x4228d724, 0x42293d8b, 0x4229a3f1, 0x42287afb, 0x4228e162, 0x422947c8, 0x4229ae2f, 0x422870d8,
477 0x4228d73f, 0x42293da5, 0x4229a40b, 0x42287b16, 0x4228e17c, 0x422947e3, 0x4229ae49, 0x00000006,
478 0x5f323466, 0x00000032, 0x00000003, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
479 0x00000003, 0x422c70be, 0x422cd724, 0x422d3d8b, 0x422da3f1, 0x422c7afb, 0x422ce162, 0x422d47c8,
480 0x422dae2f, 0x422c8539, 0x422ceb9f, 0x422d5206, 0x422db86c, 0x422c70d8, 0x422cd73f, 0x422d3da5,
481 0x422da40b, 0x422c7b16, 0x422ce17c, 0x422d47e3, 0x422dae49, 0x422c8553, 0x422cebba, 0x422d5220,
482 0x422db886, 0x00000006, 0x5f333466, 0x00000032, 0x00000003, 0x00000002, 0x00000b64, 0x00000000,
483 0x00000002, 0x00000004, 0x00000004, 0x423070be, 0x4230d724, 0x42313d8b, 0x4231a3f1, 0x42307afb,
484 0x4230e162, 0x423147c8, 0x4231ae2f, 0x42308539, 0x4230eb9f, 0x42315206, 0x4231b86c, 0x42308f76,
485 0x4230f5dd, 0x42315c43, 0x4231c2aa, 0x423070d8, 0x4230d73f, 0x42313da5, 0x4231a40b, 0x42307b16,
486 0x4230e17c, 0x423147e3, 0x4231ae49, 0x42308553, 0x4230ebba, 0x42315220, 0x4231b886, 0x42308f91,
487 0x4230f5f7, 0x42315c5d, 0x4231c2c4, 0x00000006, 0x5f343466, 0x00000032, 0x00000002, 0x00000070,
488 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
489 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
490 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
491 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
492 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
493 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
494 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
495 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
496 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
497 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
498 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
499 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
500 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
501 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
502 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
503 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
504 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
505 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
506 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
507 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
508 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
509 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
510 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
513 struct test_effect_parameter_value_result test_effect_parameter_value_result_float[] =
515 {"f", {"f", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 10},
516 {"f1", {"f1", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 20},
517 {"f2", {"f2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 30},
518 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 41},
519 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 53},
520 {"f11", {"f11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 0, 0, 0, 0, 4}, 66},
521 {"f12", {"f12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 0, 0, 0, 0, 8}, 76},
522 {"f13", {"f13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 87},
523 {"f14", {"f14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 99},
524 {"f21", {"f21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 0, 0, 0, 0, 8}, 112},
525 {"f22", {"f22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 0, 0, 0, 0, 16}, 123},
526 {"f23", {"f23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 0, 0, 0, 0, 24}, 136},
527 {"f24", {"f24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 0, 0, 0, 0, 32}, 151},
528 {"f31", {"f31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 0, 0, 0, 0, 12}, 168},
529 {"f32", {"f32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 0, 0, 0, 0, 24}, 180},
530 {"f33", {"f33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 0, 0, 0, 0, 36}, 195},
531 {"f34", {"f34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 0, 0, 0, 0, 48}, 213},
532 {"f41", {"f41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 0, 0, 0, 0, 16}, 234},
533 {"f42", {"f42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 0, 0, 0, 0, 32}, 247},
534 {"f43", {"f43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 0, 0, 0, 0, 48}, 264},
535 {"f44", {"f44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 0, 0, 0, 0, 64}, 285},
536 {"f_2", {"f_2", NULL, D3DXPC_SCALAR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 310},
537 {"f1_2", {"f1_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 321},
538 {"f2_2", {"f2_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 333},
539 {"f3_2", {"f3_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 347},
540 {"f4_2", {"f4_2", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 363},
541 {"f11_2", {"f11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 1, 2, 0, 0, 0, 8}, 381},
542 {"f12_2", {"f12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 2, 2, 0, 0, 0, 16}, 393},
543 {"f13_2", {"f13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 3, 2, 0, 0, 0, 24}, 407},
544 {"f14_2", {"f14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 1, 4, 2, 0, 0, 0, 32}, 423},
545 {"f21_2", {"f21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 1, 2, 0, 0, 0, 16}, 441},
546 {"f22_2", {"f22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 2, 2, 0, 0, 0, 32}, 455},
547 {"f23_2", {"f23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 3, 2, 0, 0, 0, 48}, 473},
548 {"f24_2", {"f24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 2, 4, 2, 0, 0, 0, 64}, 495},
549 {"f31_2", {"f31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 1, 2, 0, 0, 0, 24}, 521},
550 {"f32_2", {"f32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 2, 2, 0, 0, 0, 48}, 537},
551 {"f33_2", {"f33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 3, 2, 0, 0, 0, 72}, 559},
552 {"f34_2", {"f34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 3, 4, 2, 0, 0, 0, 96}, 587},
553 {"f41_2", {"f41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 1, 2, 0, 0, 0, 32}, 621},
554 {"f42_2", {"f42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 2, 2, 0, 0, 0, 64}, 639},
555 {"f43_2", {"f43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 3, 2, 0, 0, 0, 96}, 665},
556 {"f44_2", {"f44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4, 2, 0, 0, 0, 128}, 699},
560 * fxc.exe /Tfx_2_0
562 #if 0
563 int i = 1;
564 int1 i1 = {11};
565 int2 i2 = {21, 22};
566 int3 i3 = {31, 32, 33};
567 int4 i4 = {41, 42, 43, 44};
568 int1x1 i11 = {111};
569 int1x2 i12 = {121, 122};
570 int1x3 i13 = {131, 132, 133};
571 int1x4 i14 = {141, 142, 143, 144};
572 int2x1 i21 = {{2111, 2121}};
573 int2x2 i22 = {{2211, 2221}, {2212, 2222}};
574 int2x3 i23 = {{2311, 2321}, {2312, 2322}, {2313, 2323}};
575 int2x4 i24 = {{2411, 2421}, {2412, 2422}, {2413, 2423}, {2414, 2424}};
576 int3x1 i31 = {{3111, 3121, 3131}};
577 int3x2 i32 = {{3211, 3221, 3231}, {3212, 3222, 3232}};
578 int3x3 i33 = {{3311, 3321, 3331}, {3312, 3322, 3332},
579 {3313, 3323, 3333}};
580 int3x4 i34 = {{3411, 3421, 3431}, {3412, 3422, 3432},
581 {3413, 3423, 3433}, {3414, 3424, 3434}};
582 int4x1 i41 = {{4111, 4121, 4131, 4141}};
583 int4x2 i42 = {{4211, 4221, 4231, 4241}, {4212, 4222, 4232, 4242}};
584 int4x3 i43 = {{4311, 4321, 4331, 4341}, {4312, 4322, 4332, 4342},
585 {4313, 4323, 4333, 4343}};
586 int4x4 i44 = {{4411, 4421, 4431, 4441}, {4412, 4422, 4432, 4442},
587 {4413, 4423, 4433, 4443}, {4414, 4424, 4434, 4444}};
588 int i_2[2] = {0101, 0102};
589 int1 i1_2[2] = {{1101}, {1102}};
590 int2 i2_2[2] = {{2101, 2201}, {2102, 2202}};
591 int3 i3_2[2] = {{3101, 3201, 3301}, {3102, 3202, 3302}};
592 int4 i4_2[2] = {{4101, 4201, 4301, 4401}, {4102, 4202, 4302, 4402}};
593 int1x1 i11_2[2] = {{11101}, {11102}};
594 int1x2 i12_2[2] = {{12101, 12201}, {12102, 12202}};
595 int1x3 i13_2[2] = {{13101, 13201, 13301}, {13102, 13202, 13302}};
596 int1x4 i14_2[2] = {{14101, 14201, 14301, 14401}, {14102, 14202, 14302, 14402}};
597 int2x1 i21_2[2] = {{{211101, 212101}}, {{211102, 212102}}};
598 int2x2 i22_2[2] = {{{221101, 222101}, {221201, 222201}}, {{221102, 222102}, {221202, 222202}}};
599 int2x3 i23_2[2] = {{{231101, 232101}, {231201, 232201}, {231301, 232301}}, {{231102, 232102},
600 {231202, 232202}, {231302, 232302}}};
601 int2x4 i24_2[2] = {{{241101, 242101}, {241201, 242201}, {241301, 242301}, {241401, 242401}},
602 {{241102, 242102}, {241202, 242202}, {241302, 242302}, {241402, 242402}}};
603 int3x1 i31_2[2] = {{{311101, 312101, 313101}}, {{311102, 312102, 313102}}};
604 int3x2 i32_2[2] = {{{321101, 322101, 323101}, {321201, 322201, 323201}},
605 {{321102, 322102, 323102}, {321202, 322202, 323202}}};
606 int3x3 i33_2[2] = {{{331101, 332101, 333101}, {331201, 332201, 333201},
607 {331301, 332301, 333301}}, {{331102, 332102, 333102}, {331202, 332202, 333202},
608 {331302, 332302, 333302}}};
609 int3x4 i34_2[2] = {{{341101, 342101, 343101}, {341201, 342201, 343201},
610 {341301, 342301, 343301}, {341401, 342401, 343401}}, {{341102, 342102, 343102},
611 {341202, 342202, 343202}, {341302, 342302, 343302}, {341402, 342402, 343402}}};
612 int4x1 i41_2[2] = {{{411101, 412101, 413101, 414101}}, {{411102, 412102, 413102, 414102}}};
613 int4x2 i42_2[2] = {{{421101, 422101, 423101, 424101}, {421201, 422201, 423201, 424201}},
614 {{421102, 422102, 423102, 424102}, {421202, 422202, 423202, 424202}}};
615 int4x3 i43_2[2] = {{{431101, 432101, 433101, 434101}, {431201, 432201, 433201, 434201},
616 {431301, 432301, 433301, 434301}}, {{431102, 432102, 433102, 434102},
617 {431202, 432202, 433202, 434202}, {431302, 432302, 433302, 434302}}};
618 int4x4 i44_2[2] = {{{441101, 442101, 443101, 444101}, {441201, 442201, 443201, 444201},
619 {441301, 442301, 443301, 444301}, {441401, 442401, 443401, 444401}},
620 {{441102, 442102, 443102, 444102}, {441202, 442202, 443202, 444202},
621 {441302, 442302, 443302, 444302}, {441402, 442402, 443402, 444402}}};
622 technique t { pass p { } }
623 #endif
624 static const DWORD test_effect_parameter_value_blob_int[] =
626 0xfeff0901, 0x00000b80, 0x00000000, 0x00000002, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
627 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000069, 0x00000002, 0x00000001, 0x0000004c,
628 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x0000000b, 0x00000003, 0x00003169, 0x00000002,
629 0x00000001, 0x00000078, 0x00000000, 0x00000000, 0x00000002, 0x00000001, 0x00000015, 0x00000016,
630 0x00000003, 0x00003269, 0x00000002, 0x00000001, 0x000000a8, 0x00000000, 0x00000000, 0x00000003,
631 0x00000001, 0x0000001f, 0x00000020, 0x00000021, 0x00000003, 0x00003369, 0x00000002, 0x00000001,
632 0x000000dc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000029, 0x0000002a, 0x0000002b,
633 0x0000002c, 0x00000003, 0x00003469, 0x00000002, 0x00000002, 0x00000104, 0x00000000, 0x00000000,
634 0x00000001, 0x00000001, 0x0000006f, 0x00000004, 0x00313169, 0x00000002, 0x00000002, 0x00000130,
635 0x00000000, 0x00000000, 0x00000001, 0x00000002, 0x00000079, 0x0000007a, 0x00000004, 0x00323169,
636 0x00000002, 0x00000002, 0x00000160, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000083,
637 0x00000084, 0x00000085, 0x00000004, 0x00333169, 0x00000002, 0x00000002, 0x00000194, 0x00000000,
638 0x00000000, 0x00000001, 0x00000004, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000004,
639 0x00343169, 0x00000002, 0x00000002, 0x000001c0, 0x00000000, 0x00000000, 0x00000002, 0x00000001,
640 0x0000083f, 0x00000849, 0x00000004, 0x00313269, 0x00000002, 0x00000002, 0x000001f4, 0x00000000,
641 0x00000000, 0x00000002, 0x00000002, 0x000008a3, 0x000008ad, 0x000008a4, 0x000008ae, 0x00000004,
642 0x00323269, 0x00000002, 0x00000002, 0x00000230, 0x00000000, 0x00000000, 0x00000002, 0x00000003,
643 0x00000907, 0x00000911, 0x00000908, 0x00000912, 0x00000909, 0x00000913, 0x00000004, 0x00333269,
644 0x00000002, 0x00000002, 0x00000274, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x0000096b,
645 0x00000975, 0x0000096c, 0x00000976, 0x0000096d, 0x00000977, 0x0000096e, 0x00000978, 0x00000004,
646 0x00343269, 0x00000002, 0x00000002, 0x000002a4, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
647 0x00000c27, 0x00000c31, 0x00000c3b, 0x00000004, 0x00313369, 0x00000002, 0x00000002, 0x000002e0,
648 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000c8b, 0x00000c95, 0x00000c9f, 0x00000c8c,
649 0x00000c96, 0x00000ca0, 0x00000004, 0x00323369, 0x00000002, 0x00000002, 0x00000328, 0x00000000,
650 0x00000000, 0x00000003, 0x00000003, 0x00000cef, 0x00000cf9, 0x00000d03, 0x00000cf0, 0x00000cfa,
651 0x00000d04, 0x00000cf1, 0x00000cfb, 0x00000d05, 0x00000004, 0x00333369, 0x00000002, 0x00000002,
652 0x0000037c, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x00000d53, 0x00000d5d, 0x00000d67,
653 0x00000d54, 0x00000d5e, 0x00000d68, 0x00000d55, 0x00000d5f, 0x00000d69, 0x00000d56, 0x00000d60,
654 0x00000d6a, 0x00000004, 0x00343369, 0x00000002, 0x00000002, 0x000003b0, 0x00000000, 0x00000000,
655 0x00000004, 0x00000001, 0x0000100f, 0x00001019, 0x00001023, 0x0000102d, 0x00000004, 0x00313469,
656 0x00000002, 0x00000002, 0x000003f4, 0x00000000, 0x00000000, 0x00000004, 0x00000002, 0x00001073,
657 0x0000107d, 0x00001087, 0x00001091, 0x00001074, 0x0000107e, 0x00001088, 0x00001092, 0x00000004,
658 0x00323469, 0x00000002, 0x00000002, 0x00000448, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
659 0x000010d7, 0x000010e1, 0x000010eb, 0x000010f5, 0x000010d8, 0x000010e2, 0x000010ec, 0x000010f6,
660 0x000010d9, 0x000010e3, 0x000010ed, 0x000010f7, 0x00000004, 0x00333469, 0x00000002, 0x00000002,
661 0x000004ac, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x0000113b, 0x00001145, 0x0000114f,
662 0x00001159, 0x0000113c, 0x00001146, 0x00001150, 0x0000115a, 0x0000113d, 0x00001147, 0x00001151,
663 0x0000115b, 0x0000113e, 0x00001148, 0x00001152, 0x0000115c, 0x00000004, 0x00343469, 0x00000002,
664 0x00000000, 0x000004d8, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00000041, 0x00000042,
665 0x00000004, 0x00325f69, 0x00000002, 0x00000001, 0x00000504, 0x00000000, 0x00000002, 0x00000001,
666 0x00000001, 0x0000044d, 0x0000044e, 0x00000005, 0x325f3169, 0x00000000, 0x00000002, 0x00000001,
667 0x0000053c, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000835, 0x00000899, 0x00000836,
668 0x0000089a, 0x00000005, 0x325f3269, 0x00000000, 0x00000002, 0x00000001, 0x0000057c, 0x00000000,
669 0x00000002, 0x00000003, 0x00000001, 0x00000c1d, 0x00000c81, 0x00000ce5, 0x00000c1e, 0x00000c82,
670 0x00000ce6, 0x00000005, 0x325f3369, 0x00000000, 0x00000002, 0x00000001, 0x000005c4, 0x00000000,
671 0x00000002, 0x00000004, 0x00000001, 0x00001005, 0x00001069, 0x000010cd, 0x00001131, 0x00001006,
672 0x0000106a, 0x000010ce, 0x00001132, 0x00000005, 0x325f3469, 0x00000000, 0x00000002, 0x00000002,
673 0x000005f4, 0x00000000, 0x00000002, 0x00000001, 0x00000001, 0x00002b5d, 0x00002b5e, 0x00000006,
674 0x5f313169, 0x00000032, 0x00000002, 0x00000002, 0x0000062c, 0x00000000, 0x00000002, 0x00000001,
675 0x00000002, 0x00002f45, 0x00002fa9, 0x00002f46, 0x00002faa, 0x00000006, 0x5f323169, 0x00000032,
676 0x00000002, 0x00000002, 0x0000066c, 0x00000000, 0x00000002, 0x00000001, 0x00000003, 0x0000332d,
677 0x00003391, 0x000033f5, 0x0000332e, 0x00003392, 0x000033f6, 0x00000006, 0x5f333169, 0x00000032,
678 0x00000002, 0x00000002, 0x000006b4, 0x00000000, 0x00000002, 0x00000001, 0x00000004, 0x00003715,
679 0x00003779, 0x000037dd, 0x00003841, 0x00003716, 0x0000377a, 0x000037de, 0x00003842, 0x00000006,
680 0x5f343169, 0x00000032, 0x00000002, 0x00000002, 0x000006ec, 0x00000000, 0x00000002, 0x00000002,
681 0x00000001, 0x0003389d, 0x00033c85, 0x0003389e, 0x00033c86, 0x00000006, 0x5f313269, 0x00000032,
682 0x00000002, 0x00000002, 0x00000734, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00035fad,
683 0x00036395, 0x00036011, 0x000363f9, 0x00035fae, 0x00036396, 0x00036012, 0x000363fa, 0x00000006,
684 0x5f323269, 0x00000032, 0x00000002, 0x00000002, 0x0000078c, 0x00000000, 0x00000002, 0x00000002,
685 0x00000003, 0x000386bd, 0x00038aa5, 0x00038721, 0x00038b09, 0x00038785, 0x00038b6d, 0x000386be,
686 0x00038aa6, 0x00038722, 0x00038b0a, 0x00038786, 0x00038b6e, 0x00000006, 0x5f333269, 0x00000032,
687 0x00000002, 0x00000002, 0x000007f4, 0x00000000, 0x00000002, 0x00000002, 0x00000004, 0x0003adcd,
688 0x0003b1b5, 0x0003ae31, 0x0003b219, 0x0003ae95, 0x0003b27d, 0x0003aef9, 0x0003b2e1, 0x0003adce,
689 0x0003b1b6, 0x0003ae32, 0x0003b21a, 0x0003ae96, 0x0003b27e, 0x0003aefa, 0x0003b2e2, 0x00000006,
690 0x5f343269, 0x00000032, 0x00000002, 0x00000002, 0x00000834, 0x00000000, 0x00000002, 0x00000003,
691 0x00000001, 0x0004bf3d, 0x0004c325, 0x0004c70d, 0x0004bf3e, 0x0004c326, 0x0004c70e, 0x00000006,
692 0x5f313369, 0x00000032, 0x00000002, 0x00000002, 0x0000088c, 0x00000000, 0x00000002, 0x00000003,
693 0x00000002, 0x0004e64d, 0x0004ea35, 0x0004ee1d, 0x0004e6b1, 0x0004ea99, 0x0004ee81, 0x0004e64e,
694 0x0004ea36, 0x0004ee1e, 0x0004e6b2, 0x0004ea9a, 0x0004ee82, 0x00000006, 0x5f323369, 0x00000032,
695 0x00000002, 0x00000002, 0x000008fc, 0x00000000, 0x00000002, 0x00000003, 0x00000003, 0x00050d5d,
696 0x00051145, 0x0005152d, 0x00050dc1, 0x000511a9, 0x00051591, 0x00050e25, 0x0005120d, 0x000515f5,
697 0x00050d5e, 0x00051146, 0x0005152e, 0x00050dc2, 0x000511aa, 0x00051592, 0x00050e26, 0x0005120e,
698 0x000515f6, 0x00000006, 0x5f333369, 0x00000032, 0x00000002, 0x00000002, 0x00000984, 0x00000000,
699 0x00000002, 0x00000003, 0x00000004, 0x0005346d, 0x00053855, 0x00053c3d, 0x000534d1, 0x000538b9,
700 0x00053ca1, 0x00053535, 0x0005391d, 0x00053d05, 0x00053599, 0x00053981, 0x00053d69, 0x0005346e,
701 0x00053856, 0x00053c3e, 0x000534d2, 0x000538ba, 0x00053ca2, 0x00053536, 0x0005391e, 0x00053d06,
702 0x0005359a, 0x00053982, 0x00053d6a, 0x00000006, 0x5f343369, 0x00000032, 0x00000002, 0x00000002,
703 0x000009cc, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x000645dd, 0x000649c5, 0x00064dad,
704 0x00065195, 0x000645de, 0x000649c6, 0x00064dae, 0x00065196, 0x00000006, 0x5f313469, 0x00000032,
705 0x00000002, 0x00000002, 0x00000a34, 0x00000000, 0x00000002, 0x00000004, 0x00000002, 0x00066ced,
706 0x000670d5, 0x000674bd, 0x000678a5, 0x00066d51, 0x00067139, 0x00067521, 0x00067909, 0x00066cee,
707 0x000670d6, 0x000674be, 0x000678a6, 0x00066d52, 0x0006713a, 0x00067522, 0x0006790a, 0x00000006,
708 0x5f323469, 0x00000032, 0x00000002, 0x00000002, 0x00000abc, 0x00000000, 0x00000002, 0x00000004,
709 0x00000003, 0x000693fd, 0x000697e5, 0x00069bcd, 0x00069fb5, 0x00069461, 0x00069849, 0x00069c31,
710 0x0006a019, 0x000694c5, 0x000698ad, 0x00069c95, 0x0006a07d, 0x000693fe, 0x000697e6, 0x00069bce,
711 0x00069fb6, 0x00069462, 0x0006984a, 0x00069c32, 0x0006a01a, 0x000694c6, 0x000698ae, 0x00069c96,
712 0x0006a07e, 0x00000006, 0x5f333469, 0x00000032, 0x00000002, 0x00000002, 0x00000b64, 0x00000000,
713 0x00000002, 0x00000004, 0x00000004, 0x0006bb0d, 0x0006bef5, 0x0006c2dd, 0x0006c6c5, 0x0006bb71,
714 0x0006bf59, 0x0006c341, 0x0006c729, 0x0006bbd5, 0x0006bfbd, 0x0006c3a5, 0x0006c78d, 0x0006bc39,
715 0x0006c021, 0x0006c409, 0x0006c7f1, 0x0006bb0e, 0x0006bef6, 0x0006c2de, 0x0006c6c6, 0x0006bb72,
716 0x0006bf5a, 0x0006c342, 0x0006c72a, 0x0006bbd6, 0x0006bfbe, 0x0006c3a6, 0x0006c78e, 0x0006bc3a,
717 0x0006c022, 0x0006c40a, 0x0006c7f2, 0x00000006, 0x5f343469, 0x00000032, 0x00000002, 0x00000070,
718 0x00000002, 0x00000074, 0x0000002a, 0x00000001, 0x00000001, 0x00000001, 0x00000004, 0x00000020,
719 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, 0x00000000, 0x00000054, 0x00000070,
720 0x00000000, 0x00000000, 0x00000080, 0x0000009c, 0x00000000, 0x00000000, 0x000000b0, 0x000000cc,
721 0x00000000, 0x00000000, 0x000000e4, 0x00000100, 0x00000000, 0x00000000, 0x0000010c, 0x00000128,
722 0x00000000, 0x00000000, 0x00000138, 0x00000154, 0x00000000, 0x00000000, 0x00000168, 0x00000184,
723 0x00000000, 0x00000000, 0x0000019c, 0x000001b8, 0x00000000, 0x00000000, 0x000001c8, 0x000001e4,
724 0x00000000, 0x00000000, 0x000001fc, 0x00000218, 0x00000000, 0x00000000, 0x00000238, 0x00000254,
725 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002ac, 0x000002c8,
726 0x00000000, 0x00000000, 0x000002e8, 0x00000304, 0x00000000, 0x00000000, 0x00000330, 0x0000034c,
727 0x00000000, 0x00000000, 0x00000384, 0x000003a0, 0x00000000, 0x00000000, 0x000003b8, 0x000003d4,
728 0x00000000, 0x00000000, 0x000003fc, 0x00000418, 0x00000000, 0x00000000, 0x00000450, 0x0000046c,
729 0x00000000, 0x00000000, 0x000004b4, 0x000004d0, 0x00000000, 0x00000000, 0x000004e0, 0x000004fc,
730 0x00000000, 0x00000000, 0x00000510, 0x0000052c, 0x00000000, 0x00000000, 0x00000548, 0x00000564,
731 0x00000000, 0x00000000, 0x00000588, 0x000005a4, 0x00000000, 0x00000000, 0x000005d0, 0x000005ec,
732 0x00000000, 0x00000000, 0x00000600, 0x0000061c, 0x00000000, 0x00000000, 0x00000638, 0x00000654,
733 0x00000000, 0x00000000, 0x00000678, 0x00000694, 0x00000000, 0x00000000, 0x000006c0, 0x000006dc,
734 0x00000000, 0x00000000, 0x000006f8, 0x00000714, 0x00000000, 0x00000000, 0x00000740, 0x0000075c,
735 0x00000000, 0x00000000, 0x00000798, 0x000007b4, 0x00000000, 0x00000000, 0x00000800, 0x0000081c,
736 0x00000000, 0x00000000, 0x00000840, 0x0000085c, 0x00000000, 0x00000000, 0x00000898, 0x000008b4,
737 0x00000000, 0x00000000, 0x00000908, 0x00000924, 0x00000000, 0x00000000, 0x00000990, 0x000009ac,
738 0x00000000, 0x00000000, 0x000009d8, 0x000009f4, 0x00000000, 0x00000000, 0x00000a40, 0x00000a5c,
739 0x00000000, 0x00000000, 0x00000ac8, 0x00000ae4, 0x00000000, 0x00000000, 0x00000b78, 0x00000000,
740 0x00000001, 0x00000b70, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
743 struct test_effect_parameter_value_result test_effect_parameter_value_result_int[] =
745 {"i", {"i", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 10},
746 {"i1", {"i1", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 20},
747 {"i2", {"i2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 30},
748 {"i3", {"i3", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 41},
749 {"i4", {"i4", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 53},
750 {"i11", {"i11", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 0, 0, 0, 0, 4}, 66},
751 {"i12", {"i12", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 0, 0, 0, 0, 8}, 76},
752 {"i13", {"i13", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 0, 0, 0, 0, 12}, 87},
753 {"i14", {"i14", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 0, 0, 0, 0, 16}, 99},
754 {"i21", {"i21", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 0, 0, 0, 0, 8}, 112},
755 {"i22", {"i22", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 0, 0, 0, 0, 16}, 123},
756 {"i23", {"i23", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 0, 0, 0, 0, 24}, 136},
757 {"i24", {"i24", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 0, 0, 0, 0, 32}, 151},
758 {"i31", {"i31", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 0, 0, 0, 0, 12}, 168},
759 {"i32", {"i32", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 0, 0, 0, 0, 24}, 180},
760 {"i33", {"i33", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 0, 0, 0, 0, 36}, 195},
761 {"i34", {"i34", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 0, 0, 0, 0, 48}, 213},
762 {"i41", {"i41", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 0, 0, 0, 0, 16}, 234},
763 {"i42", {"i42", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 0, 0, 0, 0, 32}, 247},
764 {"i43", {"i43", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 0, 0, 0, 0, 48}, 264},
765 {"i44", {"i44", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 0, 0, 0, 0, 64}, 285},
766 {"i_2", {"i_2", NULL, D3DXPC_SCALAR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 310},
767 {"i1_2", {"i1_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 321},
768 {"i2_2", {"i2_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 333},
769 {"i3_2", {"i3_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 347},
770 {"i4_2", {"i4_2", NULL, D3DXPC_VECTOR, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 363},
771 {"i11_2", {"i11_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 1, 2, 0, 0, 0, 8}, 381},
772 {"i12_2", {"i12_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 2, 2, 0, 0, 0, 16}, 393},
773 {"i13_2", {"i13_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 3, 2, 0, 0, 0, 24}, 407},
774 {"i14_2", {"i14_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 1, 4, 2, 0, 0, 0, 32}, 423},
775 {"i21_2", {"i21_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 1, 2, 0, 0, 0, 16}, 441},
776 {"i22_2", {"i22_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 2, 2, 0, 0, 0, 32}, 455},
777 {"i23_2", {"i23_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 2, 0, 0, 0, 48}, 473},
778 {"i24_2", {"i24_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 4, 2, 0, 0, 0, 64}, 495},
779 {"i31_2", {"i31_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 1, 2, 0, 0, 0, 24}, 521},
780 {"i32_2", {"i32_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 2, 2, 0, 0, 0, 48}, 537},
781 {"i33_2", {"i33_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 3, 2, 0, 0, 0, 72}, 559},
782 {"i34_2", {"i34_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 3, 4, 2, 0, 0, 0, 96}, 587},
783 {"i41_2", {"i41_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 1, 2, 0, 0, 0, 32}, 621},
784 {"i42_2", {"i42_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 2, 2, 0, 0, 0, 64}, 639},
785 {"i43_2", {"i43_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 3, 2, 0, 0, 0, 96}, 665},
786 {"i44_2", {"i44_2", NULL, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 4, 4, 2, 0, 0, 0, 128}, 699},
790 * fxc.exe /Tfx_2_0
792 #if 0
793 string s = "test";
794 string s_2[2] = {"test1", "test2"};
795 texture2D tex;
796 Vertexshader v;
797 Vertexshader v_2[2];
798 Pixelshader p;
799 Pixelshader p_2[2];
800 technique t { pass p { } }
801 #endif
802 static const DWORD test_effect_parameter_value_blob_object[] =
804 0xfeff0901, 0x00000100, 0x00000000, 0x00000004, 0x00000004, 0x0000001c, 0x00000000, 0x00000000,
805 0x00000001, 0x00000002, 0x00000073, 0x00000004, 0x00000004, 0x00000040, 0x00000000, 0x00000002,
806 0x00000002, 0x00000003, 0x00000004, 0x00325f73, 0x00000007, 0x00000004, 0x00000060, 0x00000000,
807 0x00000000, 0x00000004, 0x00000004, 0x00786574, 0x00000010, 0x00000004, 0x00000080, 0x00000000,
808 0x00000000, 0x00000005, 0x00000002, 0x00000076, 0x00000010, 0x00000004, 0x000000a4, 0x00000000,
809 0x00000002, 0x00000006, 0x00000007, 0x00000004, 0x00325f76, 0x0000000f, 0x00000004, 0x000000c4,
810 0x00000000, 0x00000000, 0x00000008, 0x00000002, 0x00000070, 0x0000000f, 0x00000004, 0x000000e8,
811 0x00000000, 0x00000002, 0x00000009, 0x0000000a, 0x00000004, 0x00325f70, 0x00000002, 0x00000070,
812 0x00000002, 0x00000074, 0x00000007, 0x00000001, 0x00000007, 0x0000000b, 0x00000004, 0x00000018,
813 0x00000000, 0x00000000, 0x00000024, 0x00000038, 0x00000000, 0x00000000, 0x00000048, 0x0000005c,
814 0x00000000, 0x00000000, 0x00000068, 0x0000007c, 0x00000000, 0x00000000, 0x00000088, 0x0000009c,
815 0x00000000, 0x00000000, 0x000000ac, 0x000000c0, 0x00000000, 0x00000000, 0x000000cc, 0x000000e0,
816 0x00000000, 0x00000000, 0x000000f8, 0x00000000, 0x00000001, 0x000000f0, 0x00000000, 0x00000000,
817 0x0000000a, 0x00000000, 0x00000009, 0x00000000, 0x0000000a, 0x00000000, 0x00000008, 0x00000000,
818 0x00000006, 0x00000000, 0x00000007, 0x00000000, 0x00000005, 0x00000000, 0x00000004, 0x00000000,
819 0x00000002, 0x00000006, 0x74736574, 0x00000031, 0x00000003, 0x00000006, 0x74736574, 0x00000032,
820 0x00000001, 0x00000005, 0x74736574, 0x00000000,
823 struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
825 {"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
826 {"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
827 {"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
828 {"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
829 {"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
830 {"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
831 {"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
835 * fxc.exe /Tfx_2_0
837 #if 0
838 float3 f3 = {-3.1, 153.2, 283.3};
839 float3 f3min = {-31.1, -31.2, -31.3};
840 float3 f3max = {320.1, 320.2, 320.3};
841 float4 f4 = {-4.1, 154.2, 284.3, 34.4};
842 float4 f4min = {-41.1, -41.2, -41.3, -41.4};
843 float4 f4max = {420.1, 42.20, 420.3, 420.4};
844 technique t { pass p { } }
845 #endif
846 static const DWORD test_effect_parameter_value_blob_special[] =
848 0xfeff0901, 0x00000150, 0x00000000, 0x00000003, 0x00000001, 0x0000002c, 0x00000000, 0x00000000,
849 0x00000003, 0x00000001, 0xc0466666, 0x43193333, 0x438da666, 0x00000003, 0x00003366, 0x00000003,
850 0x00000001, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0xc1f8cccd, 0xc1f9999a,
851 0xc1fa6666, 0x00000006, 0x696d3366, 0x0000006e, 0x00000003, 0x00000001, 0x00000090, 0x00000000,
852 0x00000000, 0x00000003, 0x00000001, 0x43a00ccd, 0x43a0199a, 0x43a02666, 0x00000006, 0x616d3366,
853 0x00000078, 0x00000003, 0x00000001, 0x000000c8, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
854 0xc0833333, 0x431a3333, 0x438e2666, 0x4209999a, 0x00000003, 0x00003466, 0x00000003, 0x00000001,
855 0x000000fc, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0xc2246666, 0xc224cccd, 0xc2253333,
856 0xc225999a, 0x00000006, 0x696d3466, 0x0000006e, 0x00000003, 0x00000001, 0x00000134, 0x00000000,
857 0x00000000, 0x00000004, 0x00000001, 0x43d20ccd, 0x4228cccd, 0x43d22666, 0x43d23333, 0x00000006,
858 0x616d3466, 0x00000078, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001,
859 0x00000001, 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x00000034, 0x00000050,
860 0x00000000, 0x00000000, 0x00000068, 0x00000084, 0x00000000, 0x00000000, 0x0000009c, 0x000000b8,
861 0x00000000, 0x00000000, 0x000000d0, 0x000000ec, 0x00000000, 0x00000000, 0x00000108, 0x00000124,
862 0x00000000, 0x00000000, 0x00000148, 0x00000000, 0x00000001, 0x00000140, 0x00000000, 0x00000000,
863 0x00000000, 0x00000000,
866 struct test_effect_parameter_value_result test_effect_parameter_value_result_special[] =
868 {"f3", {"f3", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 10},
869 {"f3min", {"f3min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 22},
870 {"f3max", {"f3max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 3, 0, 0, 0, 0, 12}, 35},
871 {"f4", {"f4", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 48},
872 {"f4min", {"f4min", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 61},
873 {"f4max", {"f4max", NULL, D3DXPC_VECTOR, D3DXPT_FLOAT, 1, 4, 0, 0, 0, 0, 16}, 75},
876 #define ADD_PARAMETER_VALUE(x) {\
877 test_effect_parameter_value_blob_ ## x,\
878 sizeof(test_effect_parameter_value_blob_ ## x),\
879 test_effect_parameter_value_result_ ## x,\
880 sizeof(test_effect_parameter_value_result_ ## x)/sizeof(*test_effect_parameter_value_result_ ## x),\
883 static const struct
885 const DWORD *blob;
886 UINT blob_size;
887 const struct test_effect_parameter_value_result *res;
888 UINT res_count;
890 test_effect_parameter_value_data[] =
892 ADD_PARAMETER_VALUE(float),
893 ADD_PARAMETER_VALUE(int),
894 ADD_PARAMETER_VALUE(object),
895 ADD_PARAMETER_VALUE(special),
898 #undef ADD_PARAMETER_VALUE
900 /* Multiple of 16 to cover complete matrices */
901 #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48
902 /* Constants for special INT/FLOAT conversation */
903 #define INT_FLOAT_MULTI 255.0f
904 #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
906 static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res,
907 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
909 const D3DXPARAMETER_DESC *res_desc = &res->desc;
910 const char *res_full_name = res->full_name;
911 DWORD value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
912 HRESULT hr;
913 UINT l;
915 memset(value, 0xab, sizeof(value));
916 hr = effect->lpVtbl->GetValue(effect, parameter, value, res_desc->Bytes);
917 if (res_desc->Class == D3DXPC_SCALAR
918 || res_desc->Class == D3DXPC_VECTOR
919 || res_desc->Class == D3DXPC_MATRIX_ROWS)
921 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
923 for (l = 0; l < res_desc->Bytes / sizeof(*value); ++l)
925 ok(value[l] == res_value[l], "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
926 i, res_full_name, l, value[l], res_value[l]);
929 for (l = res_desc->Bytes / sizeof(*value); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
931 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
932 i, res_full_name, l, value[l], 0xabababab);
935 else if (res_desc->Class == D3DXPC_OBJECT)
937 switch (res_desc->Type)
939 case D3DXPT_PIXELSHADER:
940 case D3DXPT_VERTEXSHADER:
941 case D3DXPT_TEXTURE2D:
942 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
944 for (l = 0; l < (res_desc->Elements ? res_desc->Elements : 1); ++l)
946 IUnknown *unk = *((IUnknown **)value + l);
947 if (unk) IUnknown_Release(unk);
949 break;
951 case D3DXPT_STRING:
952 ok(hr == D3D_OK, "%u - %s: GetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
953 break;
955 default:
956 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
957 break;
960 else
962 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
963 i, res_full_name, hr, D3DERR_INVALIDCALL);
965 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
967 ok(value[l] == 0xabababab, "%u - %s: GetValue value[%u] failed, got %#x, expected %#x\n",
968 i, res_full_name, l, value[l], 0xabababab);
973 static void test_effect_parameter_value_GetBool(const struct test_effect_parameter_value_result *res,
974 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
976 const D3DXPARAMETER_DESC *res_desc = &res->desc;
977 const char *res_full_name = res->full_name;
978 BOOL bvalue = 0xabababab;
979 HRESULT hr;
981 hr = effect->lpVtbl->GetBool(effect, parameter, &bvalue);
982 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
984 ok(hr == D3D_OK, "%u - %s: GetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
985 ok(bvalue == get_bool(res_value), "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
986 i, res_full_name, bvalue, get_bool(res_value));
988 else
990 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
991 i, res_full_name, hr, D3DERR_INVALIDCALL);
992 ok(bvalue == 0xabababab, "%u - %s: GetBool bvalue failed, got %#x, expected %#x\n",
993 i, res_full_name, bvalue, 0xabababab);
997 static void test_effect_parameter_value_GetBoolArray(const struct test_effect_parameter_value_result *res,
998 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1000 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1001 const char *res_full_name = res->full_name;
1002 BOOL bavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1003 HRESULT hr;
1004 UINT l, err = 0;
1006 memset(bavalue, 0xab, sizeof(bavalue));
1007 hr = effect->lpVtbl->GetBoolArray(effect, parameter, bavalue, res_desc->Bytes / sizeof(*bavalue));
1008 if (res_desc->Class == D3DXPC_SCALAR
1009 || res_desc->Class == D3DXPC_VECTOR
1010 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1012 ok(hr == D3D_OK, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1014 for (l = 0; l < res_desc->Bytes / sizeof(*bavalue); ++l)
1016 if (bavalue[l] != get_bool(&res_value[l])) ++err;
1019 for (l = res_desc->Bytes / sizeof(*bavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1021 if (bavalue[l] != 0xabababab) ++err;
1024 else
1026 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1027 i, res_full_name, hr, D3DERR_INVALIDCALL);
1029 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (bavalue[l] != 0xabababab) ++err;
1031 ok(!err, "%u - %s: GetBoolArray failed with %u errors\n", i, res_full_name, err);
1034 static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res,
1035 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1037 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1038 const char *res_full_name = res->full_name;
1039 INT ivalue = 0xabababab;
1040 HRESULT hr;
1042 hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue);
1043 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1045 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1046 ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1047 i, res_full_name, ivalue, get_int(res_desc->Type, res_value));
1049 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
1050 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
1051 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
1053 INT tmp;
1055 ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1057 tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI);
1058 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8;
1059 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16;
1060 if (res_desc->Columns * res_desc->Rows > 3)
1062 tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24;
1065 ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n",
1066 i, res_full_name, ivalue, tmp);
1068 else
1070 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1071 i, res_full_name, hr, D3DERR_INVALIDCALL);
1072 ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n",
1073 i, res_full_name, ivalue, 0xabababab);
1077 static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res,
1078 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1080 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1081 const char *res_full_name = res->full_name;
1082 INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1083 HRESULT hr;
1084 UINT l, err = 0;
1086 memset(iavalue, 0xab, sizeof(iavalue));
1087 hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue));
1088 if (res_desc->Class == D3DXPC_SCALAR
1089 || res_desc->Class == D3DXPC_VECTOR
1090 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1092 ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1094 for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l)
1096 if (iavalue[l] != get_int(res_desc->Type, &res_value[l])) ++err;
1099 for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1101 if (iavalue[l] != 0xabababab) ++err;
1104 else
1106 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1107 i, res_full_name, hr, D3DERR_INVALIDCALL);
1109 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (iavalue[l] != 0xabababab) ++err;
1111 ok(!err, "%u - %s: GetIntArray failed with %u errors\n", i, res_full_name, err);
1114 static void test_effect_parameter_value_GetFloat(const struct test_effect_parameter_value_result *res,
1115 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1117 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1118 const char *res_full_name = res->full_name;
1119 HRESULT hr;
1120 DWORD cmp = 0xabababab;
1121 FLOAT fvalue = *(FLOAT *)&cmp;
1123 hr = effect->lpVtbl->GetFloat(effect, parameter, &fvalue);
1124 if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1)
1126 ok(hr == D3D_OK, "%u - %s: GetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1127 ok(compare_float(fvalue, get_float(res_desc->Type, res_value), 512), "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1128 i, res_full_name, fvalue, get_float(res_desc->Type, res_value));
1130 else
1132 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1133 i, res_full_name, hr, D3DERR_INVALIDCALL);
1134 ok(fvalue == *(FLOAT *)&cmp, "%u - %s: GetFloat fvalue failed, got %f, expected %f\n",
1135 i, res_full_name, fvalue, *(FLOAT *)&cmp);
1139 static void test_effect_parameter_value_GetFloatArray(const struct test_effect_parameter_value_result *res,
1140 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1142 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1143 const char *res_full_name = res->full_name;
1144 FLOAT favalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1145 HRESULT hr;
1146 UINT l, err = 0;
1147 DWORD cmp = 0xabababab;
1149 memset(favalue, 0xab, sizeof(favalue));
1150 hr = effect->lpVtbl->GetFloatArray(effect, parameter, favalue, res_desc->Bytes / sizeof(*favalue));
1151 if (res_desc->Class == D3DXPC_SCALAR
1152 || res_desc->Class == D3DXPC_VECTOR
1153 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1155 ok(hr == D3D_OK, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1157 for (l = 0; l < res_desc->Bytes / sizeof(*favalue); ++l)
1159 if (!compare_float(favalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1162 for (l = res_desc->Bytes / sizeof(*favalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
1164 if (favalue[l] != *(FLOAT *)&cmp) ++err;
1167 else
1169 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1170 i, res_full_name, hr, D3DERR_INVALIDCALL);
1172 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (favalue[l] != *(FLOAT *)&cmp) ++err;
1174 ok(!err, "%u - %s: GetFloatArray failed with %u errors\n", i, res_full_name, err);
1177 static void test_effect_parameter_value_GetVector(const struct test_effect_parameter_value_result *res,
1178 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1180 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1181 const char *res_full_name = res->full_name;
1182 HRESULT hr;
1183 DWORD cmp = 0xabababab;
1184 FLOAT fvalue[4];
1185 UINT l, err = 0;
1187 memset(fvalue, 0xab, sizeof(fvalue));
1188 hr = effect->lpVtbl->GetVector(effect, parameter, (D3DXVECTOR4 *)&fvalue);
1189 if (!res_desc->Elements &&
1190 (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR) &&
1191 res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
1193 DWORD tmp;
1195 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1197 tmp = (DWORD)(*(fvalue + 2) * INT_FLOAT_MULTI);
1198 tmp += ((DWORD)(*(fvalue + 1) * INT_FLOAT_MULTI)) << 8;
1199 tmp += ((DWORD)(*fvalue * INT_FLOAT_MULTI)) << 16;
1200 tmp += ((DWORD)(*(fvalue + 3) * INT_FLOAT_MULTI)) << 24;
1202 if (*res_value != tmp) ++err;
1204 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_SCALAR || res_desc->Class == D3DXPC_VECTOR))
1206 ok(hr == D3D_OK, "%u - %s: GetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1208 for (l = 0; l < res_desc->Columns; ++l)
1210 if (!compare_float(fvalue[l], get_float(res_desc->Type, &res_value[l]), 512)) ++err;
1213 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l] != 0.0f) ++err;
1215 else
1217 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1218 i, res_full_name, hr, D3DERR_INVALIDCALL);
1220 for (l = 0; l < 4; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1222 ok(!err, "%u - %s: GetVector failed with %u errors\n", i, res_full_name, err);
1225 static void test_effect_parameter_value_GetVectorArray(const struct test_effect_parameter_value_result *res,
1226 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1228 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1229 const char *res_full_name = res->full_name;
1230 HRESULT hr;
1231 DWORD cmp = 0xabababab;
1232 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1233 UINT l, k, element, err = 0;
1235 for (element = 0; element <= res_desc->Elements + 1; ++element)
1237 memset(fvalue, 0xab, sizeof(fvalue));
1238 hr = effect->lpVtbl->GetVectorArray(effect, parameter, (D3DXVECTOR4 *)&fvalue, element);
1239 if (!element)
1241 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1243 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1245 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_VECTOR)
1247 ok(hr == D3D_OK, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1249 for (k = 0; k < element; ++k)
1251 for (l = 0; l < res_desc->Columns; ++l)
1253 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1254 &res_value[l + k * res_desc->Columns]), 512))
1255 ++err;
1258 for (l = res_desc->Columns; l < 4; ++l) if (fvalue[l + k * 4] != 0.0f) ++err;
1261 for (l = element * 4; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1263 else
1265 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetVectorArray failed, got %#x, expected %#x\n",
1266 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1268 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1270 ok(!err, "%u - %s[%u]: GetVectorArray failed with %u errors\n", i, res_full_name, element, err);
1274 static void test_effect_parameter_value_GetMatrix(const struct test_effect_parameter_value_result *res,
1275 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1277 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1278 const char *res_full_name = res->full_name;
1279 HRESULT hr;
1280 DWORD cmp = 0xabababab;
1281 FLOAT fvalue[16];
1282 UINT l, k, err = 0;
1284 memset(fvalue, 0xab, sizeof(fvalue));
1285 hr = effect->lpVtbl->GetMatrix(effect, parameter, (D3DXMATRIX *)&fvalue);
1286 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1288 ok(hr == D3D_OK, "%u - %s: GetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1290 for (k = 0; k < 4; ++k)
1292 for (l = 0; l < 4; ++l)
1294 if (k < res_desc->Columns && l < res_desc->Rows)
1296 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1297 &res_value[l * res_desc->Columns + k]), 512))
1298 ++err;
1300 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1304 else
1306 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1307 i, res_full_name, hr, D3DERR_INVALIDCALL);
1309 for (l = 0; l < sizeof(fvalue) / sizeof(*fvalue); ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1311 ok(!err, "%u - %s: GetMatrix failed with %u errors\n", i, res_full_name, err);
1314 static void test_effect_parameter_value_GetMatrixArray(const struct test_effect_parameter_value_result *res,
1315 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1317 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1318 const char *res_full_name = res->full_name;
1319 HRESULT hr;
1320 DWORD cmp = 0xabababab;
1321 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1322 UINT l, k, m, element, err = 0;
1324 for (element = 0; element <= res_desc->Elements + 1; ++element)
1326 memset(fvalue, 0xab, sizeof(fvalue));
1327 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1328 if (!element)
1330 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1332 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1334 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1336 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, element, hr, D3D_OK);
1338 for (m = 0; m < element; ++m)
1340 for (k = 0; k < 4; ++k)
1342 for (l = 0; l < 4; ++l)
1344 if (k < res_desc->Columns && l < res_desc->Rows)
1346 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1347 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1348 ++err;
1350 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1355 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1357 else
1359 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixArray failed, got %#x, expected %#x\n",
1360 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1362 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1364 ok(!err, "%u - %s[%u]: GetMatrixArray failed with %u errors\n", i, res_full_name, element, err);
1368 static void test_effect_parameter_value_GetMatrixPointerArray(const struct test_effect_parameter_value_result *res,
1369 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1371 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1372 const char *res_full_name = res->full_name;
1373 HRESULT hr;
1374 DWORD cmp = 0xabababab;
1375 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1376 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1377 UINT l, k, m, element, err = 0;
1379 for (element = 0; element <= res_desc->Elements + 1; ++element)
1381 memset(fvalue, 0xab, sizeof(fvalue));
1382 for (l = 0; l < element; ++l)
1384 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1386 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
1387 if (!element)
1389 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1390 i, res_full_name, element, hr, D3D_OK);
1392 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1394 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1396 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1397 i, res_full_name, element, hr, D3D_OK);
1399 for (m = 0; m < element; ++m)
1401 for (k = 0; k < 4; ++k)
1403 for (l = 0; l < 4; ++l)
1405 if (k < res_desc->Columns && l < res_desc->Rows)
1407 if (!compare_float(fvalue[m * 16 + l * 4 + k], get_float(res_desc->Type,
1408 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1409 ++err;
1411 else if (fvalue[m * 16 + l * 4 + k] != 0.0f) ++err;
1416 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1418 else
1420 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1422 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1423 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1425 ok(!err, "%u - %s[%u]: GetMatrixPointerArray failed with %u errors\n", i, res_full_name, element, err);
1429 static void test_effect_parameter_value_GetMatrixTranspose(const struct test_effect_parameter_value_result *res,
1430 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1432 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1433 const char *res_full_name = res->full_name;
1434 HRESULT hr;
1435 DWORD cmp = 0xabababab;
1436 FLOAT fvalue[16];
1437 UINT l, k, err = 0;
1439 memset(fvalue, 0xab, sizeof(fvalue));
1440 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, (D3DXMATRIX *)&fvalue);
1441 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1443 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1445 for (k = 0; k < 4; ++k)
1447 for (l = 0; l < 4; ++l)
1449 if (k < res_desc->Columns && l < res_desc->Rows)
1451 if (!compare_float(fvalue[l + k * 4], get_float(res_desc->Type,
1452 &res_value[l * res_desc->Columns + k]), 512))
1453 ++err;
1455 else if (fvalue[l + k * 4] != 0.0f) ++err;
1459 else if (!res_desc->Elements && (res_desc->Class == D3DXPC_VECTOR || res_desc->Class == D3DXPC_SCALAR))
1461 ok(hr == D3D_OK, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1463 for (k = 0; k < 4; ++k)
1465 for (l = 0; l < 4; ++l)
1467 if (k < res_desc->Columns && l < res_desc->Rows)
1469 if (!compare_float(fvalue[l * 4 + k], get_float(res_desc->Type,
1470 &res_value[l * res_desc->Columns + k]), 512))
1471 ++err;
1473 else if (fvalue[l * 4 + k] != 0.0f) ++err;
1477 else
1479 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1480 i, res_full_name, hr, D3DERR_INVALIDCALL);
1482 for (l = 0; l < sizeof(fvalue) / sizeof(*fvalue); ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1484 ok(!err, "%u - %s: GetMatrixTranspose failed with %u errors\n", i, res_full_name, err);
1487 static void test_effect_parameter_value_GetMatrixTransposeArray(const struct test_effect_parameter_value_result *res,
1488 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1490 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1491 const char *res_full_name = res->full_name;
1492 HRESULT hr;
1493 DWORD cmp = 0xabababab;
1494 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1495 UINT l, k, m, element, err = 0;
1497 for (element = 0; element <= res_desc->Elements + 1; ++element)
1499 memset(fvalue, 0xab, sizeof(fvalue));
1500 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)&fvalue, element);
1501 if (!element)
1503 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1504 i, res_full_name, element, hr, D3D_OK);
1506 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1508 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1510 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1511 i, res_full_name, element, hr, D3D_OK);
1513 for (m = 0; m < element; ++m)
1515 for (k = 0; k < 4; ++k)
1517 for (l = 0; l < 4; ++l)
1519 if (k < res_desc->Columns && l < res_desc->Rows)
1521 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1522 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1523 ++err;
1525 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1530 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1532 else
1534 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1535 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1537 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1539 ok(!err, "%u - %s[%u]: GetMatrixTransposeArray failed with %u errors\n", i, res_full_name, element, err);
1543 static void test_effect_parameter_value_GetMatrixTransposePointerArray(const struct test_effect_parameter_value_result *res,
1544 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1546 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1547 const char *res_full_name = res->full_name;
1548 HRESULT hr;
1549 DWORD cmp = 0xabababab;
1550 FLOAT fvalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1551 D3DXMATRIX *matrix_pointer_array[sizeof(fvalue)/sizeof(D3DXMATRIX)];
1552 UINT l, k, m, element, err = 0;
1554 for (element = 0; element <= res_desc->Elements + 1; ++element)
1556 memset(fvalue, 0xab, sizeof(fvalue));
1557 for (l = 0; l < element; ++l)
1559 matrix_pointer_array[l] = (D3DXMATRIX *)&fvalue[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
1561 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
1562 if (!element)
1564 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1565 i, res_full_name, element, hr, D3D_OK);
1567 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1569 else if (element <= res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
1571 ok(hr == D3D_OK, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1572 i, res_full_name, element, hr, D3D_OK);
1574 for (m = 0; m < element; ++m)
1576 for (k = 0; k < 4; ++k)
1578 for (l = 0; l < 4; ++l)
1580 if (k < res_desc->Columns && l < res_desc->Rows)
1582 if (!compare_float(fvalue[m * 16 + l + k * 4], get_float(res_desc->Type,
1583 &res_value[m * res_desc->Columns * res_desc->Rows + l * res_desc->Columns + k]), 512))
1584 ++err;
1586 else if (fvalue[m * 16 + l + k * 4] != 0.0f) ++err;
1591 for (l = element * 16; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1593 else
1595 ok(hr == D3DERR_INVALIDCALL, "%u - %s[%u]: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1596 i, res_full_name, element, hr, D3DERR_INVALIDCALL);
1598 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) if (fvalue[l] != *(FLOAT *)&cmp) ++err;
1600 ok(!err, "%u - %s[%u]: GetMatrixTransposePointerArray failed with %u errors\n", i, res_full_name, element, err);
1604 static void test_effect_parameter_value_GetTestGroup(const struct test_effect_parameter_value_result *res,
1605 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1607 test_effect_parameter_value_GetValue(res, effect, res_value, parameter, i);
1608 test_effect_parameter_value_GetBool(res, effect, res_value, parameter, i);
1609 test_effect_parameter_value_GetBoolArray(res, effect, res_value, parameter, i);
1610 test_effect_parameter_value_GetInt(res, effect, res_value, parameter, i);
1611 test_effect_parameter_value_GetIntArray(res, effect, res_value, parameter, i);
1612 test_effect_parameter_value_GetFloat(res, effect, res_value, parameter, i);
1613 test_effect_parameter_value_GetFloatArray(res, effect, res_value, parameter, i);
1614 test_effect_parameter_value_GetVector(res, effect, res_value, parameter, i);
1615 test_effect_parameter_value_GetVectorArray(res, effect, res_value, parameter, i);
1616 test_effect_parameter_value_GetMatrix(res, effect, res_value, parameter, i);
1617 test_effect_parameter_value_GetMatrixArray(res, effect, res_value, parameter, i);
1618 test_effect_parameter_value_GetMatrixPointerArray(res, effect, res_value, parameter, i);
1619 test_effect_parameter_value_GetMatrixTranspose(res, effect, res_value, parameter, i);
1620 test_effect_parameter_value_GetMatrixTransposeArray(res, effect, res_value, parameter, i);
1621 test_effect_parameter_value_GetMatrixTransposePointerArray(res, effect, res_value, parameter, i);
1624 static void test_effect_parameter_value_ResetValue(const struct test_effect_parameter_value_result *res,
1625 ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i)
1627 const D3DXPARAMETER_DESC *res_desc = &res->desc;
1628 const char *res_full_name = res->full_name;
1629 HRESULT hr;
1631 if (res_desc->Class == D3DXPC_SCALAR
1632 || res_desc->Class == D3DXPC_VECTOR
1633 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1635 hr = effect->lpVtbl->SetValue(effect, parameter, res_value, res_desc->Bytes);
1636 ok(hr == D3D_OK, "%u - %s: SetValue failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1638 else
1640 /* nothing to do */
1641 switch (res_desc->Type)
1643 case D3DXPT_PIXELSHADER:
1644 case D3DXPT_VERTEXSHADER:
1645 case D3DXPT_TEXTURE2D:
1646 case D3DXPT_STRING:
1647 break;
1649 default:
1650 ok(0, "Type is %u, this should not happen!\n", res_desc->Type);
1651 break;
1656 static void test_effect_parameter_value(IDirect3DDevice9 *device)
1658 UINT i;
1659 UINT effect_count = sizeof(test_effect_parameter_value_data) / sizeof(*test_effect_parameter_value_data);
1661 for (i = 0; i < effect_count; ++i)
1663 const struct test_effect_parameter_value_result *res = test_effect_parameter_value_data[i].res;
1664 UINT res_count = test_effect_parameter_value_data[i].res_count;
1665 const DWORD *blob = test_effect_parameter_value_data[i].blob;
1666 UINT blob_size = test_effect_parameter_value_data[i].blob_size;
1667 HRESULT hr;
1668 ID3DXEffect *effect;
1669 D3DXEFFECT_DESC edesc;
1670 ULONG count;
1671 UINT k;
1673 hr = D3DXCreateEffect(device, blob, blob_size, NULL, NULL, 0, NULL, &effect, NULL);
1674 ok(hr == D3D_OK, "%u: D3DXCreateEffect failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1676 hr = effect->lpVtbl->GetDesc(effect, &edesc);
1677 ok(hr == D3D_OK, "%u: GetDesc failed, got %#x, expected %#x\n", i, hr, D3D_OK);
1678 ok(edesc.Parameters == res_count, "%u: Parameters failed, got %u, expected %u\n",
1679 i, edesc.Parameters, res_count);
1681 for (k = 0; k < res_count; ++k)
1683 const D3DXPARAMETER_DESC *res_desc = &res[k].desc;
1684 const char *res_full_name = res[k].full_name;
1685 UINT res_value_offset = res[k].value_offset;
1686 D3DXHANDLE parameter;
1687 D3DXPARAMETER_DESC pdesc;
1688 BOOL bvalue = TRUE;
1689 INT ivalue = 42;
1690 FLOAT fvalue = 2.71828f;
1691 DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1692 DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE];
1693 UINT l, n, m, element;
1694 const D3DXMATRIX *matrix_pointer_array[sizeof(input_value)/sizeof(D3DXMATRIX)];
1696 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, res_full_name);
1697 ok(parameter != NULL, "%u - %s: GetParameterByName failed\n", i, res_full_name);
1699 hr = effect->lpVtbl->GetParameterDesc(effect, parameter, &pdesc);
1700 ok(hr == D3D_OK, "%u - %s: GetParameterDesc failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1702 ok(res_desc->Name ? !strcmp(pdesc.Name, res_desc->Name) : !pdesc.Name,
1703 "%u - %s: GetParameterDesc Name failed, got \"%s\", expected \"%s\"\n",
1704 i, res_full_name, pdesc.Name, res_desc->Name);
1705 ok(res_desc->Semantic ? !strcmp(pdesc.Semantic, res_desc->Semantic) : !pdesc.Semantic,
1706 "%u - %s: GetParameterDesc Semantic failed, got \"%s\", expected \"%s\"\n",
1707 i, res_full_name, pdesc.Semantic, res_desc->Semantic);
1708 ok(res_desc->Class == pdesc.Class, "%u - %s: GetParameterDesc Class failed, got %#x, expected %#x\n",
1709 i, res_full_name, pdesc.Class, res_desc->Class);
1710 ok(res_desc->Type == pdesc.Type, "%u - %s: GetParameterDesc Type failed, got %#x, expected %#x\n",
1711 i, res_full_name, pdesc.Type, res_desc->Type);
1712 ok(res_desc->Rows == pdesc.Rows, "%u - %s: GetParameterDesc Rows failed, got %u, expected %u\n",
1713 i, res_full_name, pdesc.Rows, res_desc->Rows);
1714 ok(res_desc->Columns == pdesc.Columns, "%u - %s: GetParameterDesc Columns failed, got %u, expected %u\n",
1715 i, res_full_name, pdesc.Columns, res_desc->Columns);
1716 ok(res_desc->Elements == pdesc.Elements, "%u - %s: GetParameterDesc Elements failed, got %u, expected %u\n",
1717 i, res_full_name, pdesc.Elements, res_desc->Elements);
1718 ok(res_desc->Annotations == pdesc.Annotations, "%u - %s: GetParameterDesc Annotations failed, got %u, expected %u\n",
1719 i, res_full_name, pdesc.Annotations, res_desc->Annotations);
1720 ok(res_desc->StructMembers == pdesc.StructMembers, "%u - %s: GetParameterDesc StructMembers failed, got %u, expected %u\n",
1721 i, res_full_name, pdesc.StructMembers, res_desc->StructMembers);
1722 ok(res_desc->Flags == pdesc.Flags, "%u - %s: GetParameterDesc Flags failed, got %u, expected %u\n",
1723 i, res_full_name, pdesc.Flags, res_desc->Flags);
1724 ok(res_desc->Bytes == pdesc.Bytes, "%u - %s: GetParameterDesc Bytes, got %u, expected %u\n",
1725 i, res_full_name, pdesc.Bytes, res_desc->Bytes);
1727 /* check size */
1728 ok(EFFECT_PARAMETER_VALUE_ARRAY_SIZE >= res_desc->Bytes / 4 +
1729 (res_desc->Elements ? res_desc->Bytes / 4 / res_desc->Elements : 0),
1730 "%u - %s: Warning: Array size too small\n", i, res_full_name);
1732 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1733 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1734 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1737 * check invalid calls
1738 * These will crash:
1739 * effect->lpVtbl->SetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1740 * effect->lpVtbl->SetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1741 * effect->lpVtbl->SetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1742 * effect->lpVtbl->SetVector(effect, parameter, NULL);
1743 * effect->lpVtbl->SetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1744 * effect->lpVtbl->SetMatrix(effect, parameter, NULL);
1745 * effect->lpVtbl->GetMatrix(effect, parameter, NULL);
1746 * effect->lpVtbl->SetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1747 * effect->lpVtbl->SetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1748 * effect->lpVtbl->SetMatrixTranspose(effect, parameter, NULL);
1749 * effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1750 * effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1751 * effect->lpVtbl->GetValue(effect, parameter, NULL, res_desc->Bytes);
1752 * effect->lpVtbl->SetValue(effect, parameter, NULL, res_desc->Bytes);
1754 hr = effect->lpVtbl->SetBool(effect, NULL, bvalue);
1755 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1756 i, res_full_name, hr, D3DERR_INVALIDCALL);
1758 hr = effect->lpVtbl->GetBool(effect, NULL, &bvalue);
1759 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1760 i, res_full_name, hr, D3DERR_INVALIDCALL);
1762 hr = effect->lpVtbl->GetBool(effect, parameter, NULL);
1763 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBool failed, got %#x, expected %#x\n",
1764 i, res_full_name, hr, D3DERR_INVALIDCALL);
1766 hr = effect->lpVtbl->SetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1767 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1768 i, res_full_name, hr, D3DERR_INVALIDCALL);
1770 hr = effect->lpVtbl->GetBoolArray(effect, NULL, (BOOL *)input_value, res_desc->Bytes / sizeof(BOOL));
1771 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1772 i, res_full_name, hr, D3DERR_INVALIDCALL);
1774 hr = effect->lpVtbl->GetBoolArray(effect, parameter, NULL, res_desc->Bytes / sizeof(BOOL));
1775 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetBoolArray failed, got %#x, expected %#x\n",
1776 i, res_full_name, hr, D3DERR_INVALIDCALL);
1778 hr = effect->lpVtbl->SetInt(effect, NULL, ivalue);
1779 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
1780 i, res_full_name, hr, D3DERR_INVALIDCALL);
1782 hr = effect->lpVtbl->GetInt(effect, NULL, &ivalue);
1783 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1784 i, res_full_name, hr, D3DERR_INVALIDCALL);
1786 hr = effect->lpVtbl->GetInt(effect, parameter, NULL);
1787 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n",
1788 i, res_full_name, hr, D3DERR_INVALIDCALL);
1790 hr = effect->lpVtbl->SetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1791 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
1792 i, res_full_name, hr, D3DERR_INVALIDCALL);
1794 hr = effect->lpVtbl->GetIntArray(effect, NULL, (INT *)input_value, res_desc->Bytes / sizeof(INT));
1795 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1796 i, res_full_name, hr, D3DERR_INVALIDCALL);
1798 hr = effect->lpVtbl->GetIntArray(effect, parameter, NULL, res_desc->Bytes / sizeof(INT));
1799 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n",
1800 i, res_full_name, hr, D3DERR_INVALIDCALL);
1802 hr = effect->lpVtbl->SetFloat(effect, NULL, fvalue);
1803 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
1804 i, res_full_name, hr, D3DERR_INVALIDCALL);
1806 hr = effect->lpVtbl->GetFloat(effect, NULL, &fvalue);
1807 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1808 i, res_full_name, hr, D3DERR_INVALIDCALL);
1810 hr = effect->lpVtbl->GetFloat(effect, parameter, NULL);
1811 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloat failed, got %#x, expected %#x\n",
1812 i, res_full_name, hr, D3DERR_INVALIDCALL);
1814 hr = effect->lpVtbl->SetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1815 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
1816 i, res_full_name, hr, D3DERR_INVALIDCALL);
1818 hr = effect->lpVtbl->GetFloatArray(effect, NULL, (FLOAT *)input_value, res_desc->Bytes / sizeof(FLOAT));
1819 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1820 i, res_full_name, hr, D3DERR_INVALIDCALL);
1822 hr = effect->lpVtbl->GetFloatArray(effect, parameter, NULL, res_desc->Bytes / sizeof(FLOAT));
1823 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetFloatArray failed, got %#x, expected %#x\n",
1824 i, res_full_name, hr, D3DERR_INVALIDCALL);
1826 hr = effect->lpVtbl->SetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1827 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
1828 i, res_full_name, hr, D3DERR_INVALIDCALL);
1830 hr = effect->lpVtbl->GetVector(effect, NULL, (D3DXVECTOR4 *)input_value);
1831 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1832 i, res_full_name, hr, D3DERR_INVALIDCALL);
1834 hr = effect->lpVtbl->GetVector(effect, parameter, NULL);
1835 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVector failed, got %#x, expected %#x\n",
1836 i, res_full_name, hr, D3DERR_INVALIDCALL);
1838 hr = effect->lpVtbl->SetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1839 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
1840 i, res_full_name, hr, D3DERR_INVALIDCALL);
1842 hr = effect->lpVtbl->GetVectorArray(effect, NULL, (D3DXVECTOR4 *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1843 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1844 i, res_full_name, hr, D3DERR_INVALIDCALL);
1846 hr = effect->lpVtbl->GetVectorArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1847 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetVectorArray failed, got %#x, expected %#x\n",
1848 i, res_full_name, hr, D3DERR_INVALIDCALL);
1850 hr = effect->lpVtbl->SetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1851 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
1852 i, res_full_name, hr, D3DERR_INVALIDCALL);
1854 hr = effect->lpVtbl->GetMatrix(effect, NULL, (D3DXMATRIX *)input_value);
1855 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrix failed, got %#x, expected %#x\n",
1856 i, res_full_name, hr, D3DERR_INVALIDCALL);
1858 hr = effect->lpVtbl->SetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1859 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
1860 i, res_full_name, hr, D3DERR_INVALIDCALL);
1862 hr = effect->lpVtbl->GetMatrixArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1863 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1864 i, res_full_name, hr, D3DERR_INVALIDCALL);
1866 hr = effect->lpVtbl->GetMatrixArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1867 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixArray failed, got %#x, expected %#x\n",
1868 i, res_full_name, hr, D3DERR_INVALIDCALL);
1870 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1871 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1872 i, res_full_name, hr, D3DERR_INVALIDCALL);
1874 hr = effect->lpVtbl->SetMatrixPointerArray(effect, NULL, matrix_pointer_array, 0);
1875 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
1876 i, res_full_name, hr, D3DERR_INVALIDCALL);
1878 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, 0);
1879 ok(hr == D3D_OK, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1880 i, res_full_name, hr, D3D_OK);
1882 hr = effect->lpVtbl->GetMatrixPointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1883 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1884 i, res_full_name, hr, D3DERR_INVALIDCALL);
1886 hr = effect->lpVtbl->GetMatrixPointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1887 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixPointerArray failed, got %#x, expected %#x\n",
1888 i, res_full_name, hr, D3DERR_INVALIDCALL);
1890 hr = effect->lpVtbl->SetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1891 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
1892 i, res_full_name, hr, D3DERR_INVALIDCALL);
1894 hr = effect->lpVtbl->GetMatrixTranspose(effect, NULL, (D3DXMATRIX *)input_value);
1895 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1896 i, res_full_name, hr, D3DERR_INVALIDCALL);
1898 hr = effect->lpVtbl->GetMatrixTranspose(effect, parameter, NULL);
1899 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTranspose failed, got %#x, expected %#x\n",
1900 i, res_full_name, hr, D3DERR_INVALIDCALL);
1902 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1903 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
1904 i, res_full_name, hr, D3DERR_INVALIDCALL);
1906 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, NULL, (D3DXMATRIX *)input_value, res_desc->Elements ? res_desc->Elements : 1);
1907 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1908 i, res_full_name, hr, D3DERR_INVALIDCALL);
1910 hr = effect->lpVtbl->GetMatrixTransposeArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1911 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposeArray failed, got %#x, expected %#x\n",
1912 i, res_full_name, hr, D3DERR_INVALIDCALL);
1914 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, res_desc->Elements ? res_desc->Elements : 1);
1915 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1916 i, res_full_name, hr, D3DERR_INVALIDCALL);
1918 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, NULL, matrix_pointer_array, 0);
1919 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1920 i, res_full_name, hr, D3DERR_INVALIDCALL);
1922 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, 0);
1923 ok(hr == D3D_OK, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1924 i, res_full_name, hr, D3D_OK);
1926 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, NULL, NULL, res_desc->Elements ? res_desc->Elements : 1);
1927 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1928 i, res_full_name, hr, D3DERR_INVALIDCALL);
1930 hr = effect->lpVtbl->GetMatrixTransposePointerArray(effect, parameter, NULL, res_desc->Elements ? res_desc->Elements : 1);
1931 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
1932 i, res_full_name, hr, D3DERR_INVALIDCALL);
1934 hr = effect->lpVtbl->SetValue(effect, NULL, input_value, res_desc->Bytes);
1935 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1936 i, res_full_name, hr, D3DERR_INVALIDCALL);
1938 hr = effect->lpVtbl->SetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1939 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetValue failed, got %#x, expected %#x\n",
1940 i, res_full_name, hr, D3DERR_INVALIDCALL);
1942 hr = effect->lpVtbl->GetValue(effect, NULL, input_value, res_desc->Bytes);
1943 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1944 i, res_full_name, hr, D3DERR_INVALIDCALL);
1946 hr = effect->lpVtbl->GetValue(effect, parameter, input_value, res_desc->Bytes - 1);
1947 ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetValue failed, got %#x, expected %#x\n",
1948 i, res_full_name, hr, D3DERR_INVALIDCALL);
1950 test_effect_parameter_value_GetTestGroup(&res[k], effect, &blob[res_value_offset], parameter, i);
1952 /* SetBool */
1953 bvalue = 5;
1954 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1955 hr = effect->lpVtbl->SetBool(effect, parameter, bvalue);
1956 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
1958 bvalue = TRUE;
1959 set_number(expected_value, res_desc->Type, &bvalue, D3DXPT_BOOL);
1960 ok(hr == D3D_OK, "%u - %s: SetBool failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1962 else
1964 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBool failed, got %#x, expected %#x\n",
1965 i, res_full_name, hr, D3DERR_INVALIDCALL);
1967 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
1968 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1970 /* SetBoolArray */
1971 *input_value = 1;
1972 for (l = 1; l < res_desc->Bytes / sizeof(*input_value); ++l)
1974 *(input_value + l) = *(input_value + l - 1) + 1;
1976 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1977 hr = effect->lpVtbl->SetBoolArray(effect, parameter, (BOOL *)input_value, res_desc->Bytes / sizeof(*input_value));
1978 if (res_desc->Class == D3DXPC_SCALAR
1979 || res_desc->Class == D3DXPC_VECTOR
1980 || res_desc->Class == D3DXPC_MATRIX_ROWS)
1982 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
1984 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_BOOL);
1986 ok(hr == D3D_OK, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
1988 else
1990 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetBoolArray failed, got %#x, expected %#x\n",
1991 i, res_full_name, hr, D3DERR_INVALIDCALL);
1993 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
1994 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
1996 /* SetInt */
1997 ivalue = 0x1fbf02ff;
1998 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
1999 hr = effect->lpVtbl->SetInt(effect, parameter, ivalue);
2000 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2002 set_number(expected_value, res_desc->Type, &ivalue, D3DXPT_INT);
2003 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2005 else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT &&
2006 ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) ||
2007 (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1)))
2009 FLOAT tmp = ((ivalue & 0xff0000) >> 16) * INT_FLOAT_MULTI_INVERSE;
2010 set_number(expected_value, res_desc->Type, &tmp, D3DXPT_FLOAT);
2011 tmp = ((ivalue & 0xff00) >> 8) * INT_FLOAT_MULTI_INVERSE;
2012 set_number(expected_value + 1, res_desc->Type, &tmp, D3DXPT_FLOAT);
2013 tmp = (ivalue & 0xff) * INT_FLOAT_MULTI_INVERSE;
2014 set_number(expected_value + 2, res_desc->Type, &tmp, D3DXPT_FLOAT);
2015 tmp = ((ivalue & 0xff000000) >> 24) * INT_FLOAT_MULTI_INVERSE;
2016 set_number(expected_value + 3, res_desc->Type, &tmp, D3DXPT_FLOAT);
2018 ok(hr == D3D_OK, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2019 i, res_full_name, hr, D3D_OK);
2021 else
2023 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetInt failed, got %#x, expected %#x\n",
2024 i, res_full_name, hr, D3DERR_INVALIDCALL);
2026 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2027 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2029 /* SetIntArray */
2030 *input_value = 123456;
2031 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2033 *(input_value + l) = *(input_value + l - 1) + 23;
2035 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2036 hr = effect->lpVtbl->SetIntArray(effect, parameter, (INT *)input_value, res_desc->Bytes / sizeof(*input_value));
2037 if (res_desc->Class == D3DXPC_SCALAR
2038 || res_desc->Class == D3DXPC_VECTOR
2039 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2041 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2043 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_INT);
2045 ok(hr == D3D_OK, "%u - %s: SetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2047 else
2049 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetIntArray failed, got %#x, expected %#x\n",
2050 i, res_full_name, hr, D3DERR_INVALIDCALL);
2052 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2053 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2055 /* SetFloat */
2056 fvalue = 1.33;
2057 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2058 hr = effect->lpVtbl->SetFloat(effect, parameter, fvalue);
2059 if (!res_desc->Elements && res_desc->Rows == 1 && res_desc->Columns == 1)
2061 set_number(expected_value, res_desc->Type, &fvalue, D3DXPT_FLOAT);
2062 ok(hr == D3D_OK, "%u - %s: SetFloat failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2064 else
2066 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloat failed, got %#x, expected %#x\n",
2067 i, res_full_name, hr, D3DERR_INVALIDCALL);
2069 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2070 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2072 /* SetFloatArray */
2073 fvalue = 1.33;
2074 for (l = 0; l < res_desc->Bytes / sizeof(fvalue); ++l)
2076 *(input_value + l) = *(DWORD *)&fvalue;
2077 fvalue += 1.12;
2079 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2080 hr = effect->lpVtbl->SetFloatArray(effect, parameter, (FLOAT *)input_value, res_desc->Bytes / sizeof(*input_value));
2081 if (res_desc->Class == D3DXPC_SCALAR
2082 || res_desc->Class == D3DXPC_VECTOR
2083 || res_desc->Class == D3DXPC_MATRIX_ROWS)
2085 for (l = 0; l < res_desc->Bytes / sizeof(*input_value); ++l)
2087 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2089 ok(hr == D3D_OK, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2091 else
2093 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetFloatArray failed, got %#x, expected %#x\n",
2094 i, res_full_name, hr, D3DERR_INVALIDCALL);
2096 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2097 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2099 /* SetVector */
2100 fvalue = -1.33;
2101 for (l = 0; l < 4; ++l)
2103 *(input_value + l) = *(DWORD *)&fvalue;
2104 fvalue += 1.12;
2106 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2107 hr = effect->lpVtbl->SetVector(effect, parameter, (D3DXVECTOR4 *)input_value);
2108 if (!res_desc->Elements &&
2109 (res_desc->Class == D3DXPC_SCALAR
2110 || res_desc->Class == D3DXPC_VECTOR))
2112 /* only values between 0 and INT_FLOAT_MULTI are valid */
2113 if (res_desc->Type == D3DXPT_INT && res_desc->Bytes == 4)
2115 *expected_value = (DWORD)(max(min(*(FLOAT *)(input_value + 2), 1.0f), 0.0f) * INT_FLOAT_MULTI);
2116 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 1), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 8;
2117 *expected_value += ((DWORD)(max(min(*(FLOAT *)input_value, 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 16;
2118 *expected_value += ((DWORD)(max(min(*(FLOAT *)(input_value + 3), 1.0f), 0.0f) * INT_FLOAT_MULTI)) << 24;
2120 else
2122 for (l = 0; l < 4; ++l)
2124 set_number(expected_value + l, res_desc->Type, input_value + l, D3DXPT_FLOAT);
2127 ok(hr == D3D_OK, "%u - %s: SetVector failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2129 else
2131 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVector failed, got %#x, expected %#x\n",
2132 i, res_full_name, hr, D3DERR_INVALIDCALL);
2134 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2135 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2137 /* SetVectorArray */
2138 for (element = 0; element < res_desc->Elements + 1; ++element)
2140 fvalue = 1.33;
2141 for (l = 0; l < element * 4; ++l)
2143 *(input_value + l) = *(DWORD *)&fvalue;
2144 fvalue += 1.12;
2146 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2147 hr = effect->lpVtbl->SetVectorArray(effect, parameter, (D3DXVECTOR4 *)input_value, element);
2148 if (res_desc->Elements && res_desc->Class == D3DXPC_VECTOR && element <= res_desc->Elements)
2150 for (m = 0; m < element; ++m)
2152 for (l = 0; l < res_desc->Columns; ++l)
2154 set_number(expected_value + m * res_desc->Columns + l, res_desc->Type, input_value + m * 4 + l, D3DXPT_FLOAT);
2157 ok(hr == D3D_OK, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2159 else
2161 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetVectorArray failed, got %#x, expected %#x\n",
2162 i, res_full_name, hr, D3DERR_INVALIDCALL);
2164 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2165 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2168 /* SetMatrix */
2169 fvalue = 1.33;
2170 for (l = 0; l < 16; ++l)
2172 *(input_value + l) = *(DWORD *)&fvalue;
2173 fvalue += 1.12;
2175 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2176 hr = effect->lpVtbl->SetMatrix(effect, parameter, (D3DXMATRIX *)input_value);
2177 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2179 for (l = 0; l < 4; ++l)
2181 for (m = 0; m < 4; ++m)
2183 if (m < res_desc->Rows && l < res_desc->Columns)
2184 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2185 input_value + l + m * 4, D3DXPT_FLOAT);
2189 ok(hr == D3D_OK, "%u - %s: SetMatrix failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2191 else
2193 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrix failed, got %#x, expected %#x\n",
2194 i, res_full_name, hr, D3DERR_INVALIDCALL);
2196 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2197 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2199 /* SetMatrixArray */
2200 for (element = 0; element < res_desc->Elements + 1; ++element)
2202 fvalue = 1.33;
2203 for (l = 0; l < element * 16; ++l)
2205 *(input_value + l) = *(DWORD *)&fvalue;
2206 fvalue += 1.12;
2208 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2209 hr = effect->lpVtbl->SetMatrixArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2210 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2212 for (n = 0; n < element; ++n)
2214 for (l = 0; l < 4; ++l)
2216 for (m = 0; m < 4; ++m)
2218 if (m < res_desc->Rows && l < res_desc->Columns)
2219 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2220 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2225 ok(hr == D3D_OK, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2227 else
2229 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixArray failed, got %#x, expected %#x\n",
2230 i, res_full_name, hr, D3DERR_INVALIDCALL);
2232 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2233 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2236 /* SetMatrixPointerArray */
2237 for (element = 0; element < res_desc->Elements + 1; ++element)
2239 fvalue = 1.33;
2240 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2242 *(input_value + l) = *(DWORD *)&fvalue;
2243 fvalue += 1.12;
2245 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2246 for (l = 0; l < element; ++l)
2248 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2250 hr = effect->lpVtbl->SetMatrixPointerArray(effect, parameter, matrix_pointer_array, element);
2251 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2253 for (n = 0; n < element; ++n)
2255 for (l = 0; l < 4; ++l)
2257 for (m = 0; m < 4; ++m)
2259 if (m < res_desc->Rows && l < res_desc->Columns)
2260 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2261 res_desc->Type, input_value + l + m * 4 + n * 16, D3DXPT_FLOAT);
2266 ok(hr == D3D_OK, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2267 i, res_full_name, hr, D3D_OK);
2269 else
2271 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixPointerArray failed, got %#x, expected %#x\n",
2272 i, res_full_name, hr, D3DERR_INVALIDCALL);
2274 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2275 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2278 /* SetMatrixTranspose */
2279 fvalue = 1.33;
2280 for (l = 0; l < 16; ++l)
2282 *(input_value + l) = *(DWORD *)&fvalue;
2283 fvalue += 1.12;
2285 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2286 hr = effect->lpVtbl->SetMatrixTranspose(effect, parameter, (D3DXMATRIX *)input_value);
2287 if (!res_desc->Elements && res_desc->Class == D3DXPC_MATRIX_ROWS)
2289 for (l = 0; l < 4; ++l)
2291 for (m = 0; m < 4; ++m)
2293 if (m < res_desc->Rows && l < res_desc->Columns)
2294 set_number(expected_value + l + m * res_desc->Columns, res_desc->Type,
2295 input_value + l * 4 + m, D3DXPT_FLOAT);
2299 ok(hr == D3D_OK, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2301 else
2303 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTranspose failed, got %#x, expected %#x\n",
2304 i, res_full_name, hr, D3DERR_INVALIDCALL);
2306 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2307 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2309 /* SetMatrixTransposeArray */
2310 for (element = 0; element < res_desc->Elements + 1; ++element)
2312 fvalue = 1.33;
2313 for (l = 0; l < element * 16; ++l)
2315 *(input_value + l) = *(DWORD *)&fvalue;
2316 fvalue += 1.12;
2318 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2319 hr = effect->lpVtbl->SetMatrixTransposeArray(effect, parameter, (D3DXMATRIX *)input_value, element);
2320 if (res_desc->Class == D3DXPC_MATRIX_ROWS && element <= res_desc->Elements)
2322 for (n = 0; n < element; ++n)
2324 for (l = 0; l < 4; ++l)
2326 for (m = 0; m < 4; ++m)
2328 if (m < res_desc->Rows && l < res_desc->Columns)
2329 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2330 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2335 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK);
2337 else
2339 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposeArray failed, got %#x, expected %#x\n",
2340 i, res_full_name, hr, D3DERR_INVALIDCALL);
2342 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2343 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2346 /* SetMatrixTransposePointerArray */
2347 for (element = 0; element < res_desc->Elements + 1; ++element)
2349 fvalue = 1.33;
2350 for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l)
2352 *(input_value + l) = *(DWORD *)&fvalue;
2353 fvalue += 1.12;
2355 memcpy(expected_value, &blob[res_value_offset], res_desc->Bytes);
2356 for (l = 0; l < element; ++l)
2358 matrix_pointer_array[l] = (D3DXMATRIX *)&input_value[l * sizeof(**matrix_pointer_array) / sizeof(FLOAT)];
2360 hr = effect->lpVtbl->SetMatrixTransposePointerArray(effect, parameter, matrix_pointer_array, element);
2361 if (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Elements >= element)
2363 for (n = 0; n < element; ++n)
2365 for (l = 0; l < 4; ++l)
2367 for (m = 0; m < 4; ++m)
2369 if (m < res_desc->Rows && l < res_desc->Columns)
2370 set_number(expected_value + l + m * res_desc->Columns + n * res_desc->Columns * res_desc->Rows,
2371 res_desc->Type, input_value + l * 4 + m + n * 16, D3DXPT_FLOAT);
2376 ok(hr == D3D_OK, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2377 i, res_full_name, hr, D3D_OK);
2379 else
2381 ok(hr == D3DERR_INVALIDCALL, "%u - %s: SetMatrixTransposePointerArray failed, got %#x, expected %#x\n",
2382 i, res_full_name, hr, D3DERR_INVALIDCALL);
2384 test_effect_parameter_value_GetTestGroup(&res[k], effect, expected_value, parameter, i);
2385 test_effect_parameter_value_ResetValue(&res[k], effect, &blob[res_value_offset], parameter, i);
2389 count = effect->lpVtbl->Release(effect);
2390 ok(!count, "Release failed %u\n", count);
2394 static void test_effect_setvalue_object(IDirect3DDevice9 *device)
2396 ID3DXEffect *effect;
2397 D3DXHANDLE parameter;
2398 IDirect3DTexture9 *texture;
2399 IDirect3DTexture9 *texture_set;
2400 HRESULT hr;
2401 ULONG count;
2403 hr = D3DXCreateEffect(device, test_effect_parameter_value_blob_object,
2404 sizeof(test_effect_parameter_value_blob_object), NULL, NULL, 0, NULL, &effect, NULL);
2405 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2407 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "tex");
2408 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2410 texture = NULL;
2411 hr = D3DXCreateTexture(device, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DPOOL_DEFAULT, &texture);
2412 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2413 hr = effect->lpVtbl->SetValue(effect, parameter, &texture, sizeof(texture));
2414 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2415 texture_set = NULL;
2416 hr = effect->lpVtbl->GetValue(effect, parameter, &texture_set, sizeof(texture_set));
2417 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2418 ok(texture == texture_set, "Texture does not match.\n");
2420 count = IDirect3DTexture9_Release(texture_set);
2421 ok(count == 2, "Got reference count %u, expected 2.\n", count);
2422 texture_set = NULL;
2423 hr = effect->lpVtbl->SetValue(effect, parameter, &texture_set, sizeof(texture_set));
2424 ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK).\n", hr);
2425 count = IDirect3DTexture9_Release(texture);
2426 ok(!count, "Got reference count %u, expected 0.\n", count);
2428 effect->lpVtbl->Release(effect);
2432 * fxc.exe /Tfx_2_0
2434 #if 0
2435 float a = 2.1;
2436 float b[1];
2437 float c <float d = 3;>;
2438 struct {float e;} f;
2439 float g <float h[1] = {3};>;
2440 struct s {float j;};
2441 float i <s k[1] = {4};>;
2442 technique t <s l[1] = {5};> { pass p <s m[1] = {6};> { } }
2443 #endif
2444 static const DWORD test_effect_variable_names_blob[] =
2446 0xfeff0901, 0x0000024c, 0x00000000, 0x00000003, 0x00000000, 0x00000024, 0x00000000, 0x00000000,
2447 0x00000001, 0x00000001, 0x40066666, 0x00000002, 0x00000061, 0x00000003, 0x00000000, 0x0000004c,
2448 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000062, 0x00000003,
2449 0x00000000, 0x0000009c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000,
2450 0x00000003, 0x00000000, 0x00000094, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2451 0x00000064, 0x00000002, 0x00000063, 0x00000000, 0x00000005, 0x000000dc, 0x00000000, 0x00000000,
2452 0x00000001, 0x00000003, 0x00000000, 0x000000e4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2453 0x00000000, 0x00000002, 0x00000066, 0x00000002, 0x00000065, 0x00000003, 0x00000000, 0x00000134,
2454 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x40400000, 0x00000003, 0x00000000,
2455 0x0000012c, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000002, 0x00000068, 0x00000002,
2456 0x00000067, 0x00000003, 0x00000000, 0x000001a4, 0x00000000, 0x00000000, 0x00000001, 0x00000001,
2457 0x00000000, 0x40800000, 0x00000000, 0x00000005, 0x00000194, 0x00000000, 0x00000001, 0x00000001,
2458 0x00000003, 0x00000000, 0x0000019c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002,
2459 0x0000006b, 0x00000002, 0x0000006a, 0x00000002, 0x00000069, 0x40a00000, 0x00000000, 0x00000005,
2460 0x000001e4, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000, 0x000001ec, 0x00000000,
2461 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006c, 0x00000002, 0x0000006a, 0x40c00000,
2462 0x00000000, 0x00000005, 0x0000022c, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000000,
2463 0x00000234, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000002, 0x0000006d, 0x00000002,
2464 0x0000006a, 0x00000002, 0x00000070, 0x00000002, 0x00000074, 0x00000006, 0x00000001, 0x00000001,
2465 0x00000001, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000,
2466 0x00000000, 0x00000054, 0x00000070, 0x00000000, 0x00000001, 0x00000078, 0x00000074, 0x000000a4,
2467 0x000000d8, 0x00000000, 0x00000000, 0x000000ec, 0x00000108, 0x00000000, 0x00000001, 0x00000110,
2468 0x0000010c, 0x0000013c, 0x00000158, 0x00000000, 0x00000001, 0x00000160, 0x0000015c, 0x00000244,
2469 0x00000001, 0x00000001, 0x000001b0, 0x000001ac, 0x0000023c, 0x00000001, 0x00000000, 0x000001f8,
2470 0x000001f4, 0x00000000, 0x00000000,
2473 static void test_effect_variable_names(IDirect3DDevice9 *device)
2475 ID3DXEffect *effect;
2476 ULONG count;
2477 HRESULT hr;
2478 D3DXHANDLE parameter, p;
2480 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2481 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, NULL);
2482 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2485 * check invalid calls
2486 * This will crash:
2487 * effect->lpVtbl->GetAnnotationByName(effect, "invalid1", "invalid2");
2489 p = effect->lpVtbl->GetParameterByName(effect, NULL, NULL);
2490 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2492 p = effect->lpVtbl->GetParameterByName(effect, NULL, "invalid1");
2493 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2495 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", NULL);
2496 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2498 p = effect->lpVtbl->GetParameterByName(effect, "invalid1", "invalid2");
2499 ok(p == NULL, "GetParameterByName failed, got %p, expected %p\n", p, NULL);
2501 /* float a; */
2502 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "a");
2503 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2505 p = effect->lpVtbl->GetParameterByName(effect, "a", NULL);
2506 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2508 /* members */
2509 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.");
2510 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2512 p = effect->lpVtbl->GetParameterByName(effect, "a.", NULL);
2513 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2515 p = effect->lpVtbl->GetParameterByName(effect, "a", ".");
2516 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2518 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a.invalid");
2519 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2521 p = effect->lpVtbl->GetParameterByName(effect, "a.invalid", NULL);
2522 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2524 p = effect->lpVtbl->GetParameterByName(effect, "a", ".invalid");
2525 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2527 p = effect->lpVtbl->GetParameterByName(effect, "a.", "invalid");
2528 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2530 p = effect->lpVtbl->GetParameterByName(effect, "a", "invalid");
2531 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2533 /* elements */
2534 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[]");
2535 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2537 p = effect->lpVtbl->GetParameterByName(effect, "a[]", NULL);
2538 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2540 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a[0]");
2541 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2543 p = effect->lpVtbl->GetParameterByName(effect, "a[0]", NULL);
2544 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2546 p = effect->lpVtbl->GetParameterByName(effect, "a", "[0]");
2547 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2549 p = effect->lpVtbl->GetParameterElement(effect, "a", 0);
2550 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2552 /* annotations */
2553 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@");
2554 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2556 p = effect->lpVtbl->GetParameterByName(effect, "a@", NULL);
2557 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2559 p = effect->lpVtbl->GetParameterByName(effect, "a", "@invalid");
2560 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2562 p = effect->lpVtbl->GetParameterByName(effect, "a@", "invalid");
2563 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2565 p = effect->lpVtbl->GetParameterByName(effect, NULL, "a@invalid");
2566 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2568 p = effect->lpVtbl->GetParameterByName(effect, "a@invalid", NULL);
2569 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2571 p = effect->lpVtbl->GetAnnotationByName(effect, "a", NULL);
2572 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2574 p = effect->lpVtbl->GetAnnotationByName(effect, "a", "invalid");
2575 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2577 p = effect->lpVtbl->GetAnnotation(effect, "a", 0);
2578 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2580 /* float b[1]; */
2581 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b");
2582 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2584 p = effect->lpVtbl->GetParameterByName(effect, "b", NULL);
2585 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2587 /* elements */
2588 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[]");
2589 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2591 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "b[0]");
2592 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2594 p = effect->lpVtbl->GetParameterByName(effect, "b[0]", NULL);
2595 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2597 p = effect->lpVtbl->GetParameterElement(effect, "b", 0);
2598 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2600 p = effect->lpVtbl->GetParameterByName(effect, "b", "[0]");
2601 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2603 p = effect->lpVtbl->GetParameterByName(effect, NULL, "b[1]");
2604 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2606 p = effect->lpVtbl->GetParameterElement(effect, "b", 1);
2607 ok(p == NULL, "GetParameterElement failed, got %p\n", p);
2609 /* float c <float d = 3;>; */
2610 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c");
2611 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2613 p = effect->lpVtbl->GetParameterByName(effect, "c", NULL);
2614 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2616 /* annotations */
2617 p = effect->lpVtbl->GetParameterByName(effect, "c", "@d");
2618 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2620 p = effect->lpVtbl->GetParameterByName(effect, "c@", "d");
2621 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2623 p = effect->lpVtbl->GetParameterByName(effect, NULL, "c@invalid");
2624 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2626 p = effect->lpVtbl->GetParameterByName(effect, "c@invalid", NULL);
2627 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2629 p = effect->lpVtbl->GetAnnotationByName(effect, "c", NULL);
2630 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2632 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "invalid");
2633 ok(p == NULL, "GetAnnotationByName failed, got %p\n", p);
2635 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "c@d");
2636 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2638 p = effect->lpVtbl->GetParameterByName(effect, "c@d", NULL);
2639 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2641 p = effect->lpVtbl->GetAnnotationByName(effect, "c", "d");
2642 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2644 p = effect->lpVtbl->GetAnnotation(effect, "c", 0);
2645 ok(parameter == p, "GetAnnotation failed, got %p, expected %p\n", p, parameter);
2647 p = effect->lpVtbl->GetAnnotation(effect, "c", 1);
2648 ok(p == NULL, "GetAnnotation failed, got %p\n", p);
2650 /* struct {float e;} f; */
2651 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f");
2652 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2654 p = effect->lpVtbl->GetParameterByName(effect, "f", NULL);
2655 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2657 /* members */
2658 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "f.e");
2659 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2661 p = effect->lpVtbl->GetParameterByName(effect, "f.e", NULL);
2662 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2664 p = effect->lpVtbl->GetParameterByName(effect, "f", "e");
2665 ok(parameter == p, "GetParameterByName failed, got %p, expected %p\n", p, parameter);
2667 p = effect->lpVtbl->GetParameterByName(effect, "f", ".e");
2668 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2670 p = effect->lpVtbl->GetParameterByName(effect, "f.", "e");
2671 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2673 p = effect->lpVtbl->GetParameterByName(effect, "f.invalid", NULL);
2674 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2676 p = effect->lpVtbl->GetParameterByName(effect, NULL, "f.invalid");
2677 ok(p == NULL, "GetParameterByName failed, got %p\n", p);
2679 /* float g <float h[1] = {3};>; */
2680 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "g@h[0]");
2681 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2683 p = effect->lpVtbl->GetAnnotationByName(effect, "g", "h[0]");
2684 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2686 p = effect->lpVtbl->GetParameterElement(effect, "g@h", 0);
2687 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2689 p = effect->lpVtbl->GetParameterElement(effect, effect->lpVtbl->GetAnnotation(effect, "g", 0), 0);
2690 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2692 /* struct s {float j;}; float i <s k[1] = {4};>; */
2693 parameter = effect->lpVtbl->GetParameterByName(effect, NULL, "i@k[0].j");
2694 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2696 p = effect->lpVtbl->GetAnnotationByName(effect, "i", "k[0].j");
2697 ok(parameter == p, "GetAnnotationByName failed, got %p, expected %p\n", p, parameter);
2699 p = effect->lpVtbl->GetParameterByName(effect, effect->lpVtbl->GetParameterElement(effect, "i@k", 0), "j");
2700 ok(parameter == p, "GetParameterElement failed, got %p, expected %p\n", p, parameter);
2702 /* technique t <s l[1] = {5};> */
2703 parameter = effect->lpVtbl->GetAnnotationByName(effect, "t", "l[0].j");
2704 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2706 /* pass p <s m[1] = {6};> */
2707 parameter = effect->lpVtbl->GetAnnotationByName(effect, effect->lpVtbl->GetPassByName(effect, "t", "p"), "m[0].j");
2708 ok(parameter != NULL, "GetParameterByName failed, got %p\n", parameter);
2710 count = effect->lpVtbl->Release(effect);
2711 ok(!count, "Release failed %u\n", count);
2714 static void test_effect_compilation_errors(IDirect3DDevice9 *device)
2716 ID3DXEffect *effect;
2717 ID3DXBuffer *compilation_errors;
2718 HRESULT hr;
2720 /* Test binary effect */
2721 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2722 hr = D3DXCreateEffect(NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, &compilation_errors);
2723 ok(hr == D3DERR_INVALIDCALL, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
2724 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2726 compilation_errors = (ID3DXBuffer*)0xdeadbeef;
2727 hr = D3DXCreateEffect(device, test_effect_variable_names_blob,
2728 sizeof(test_effect_variable_names_blob), NULL, NULL, 0, NULL, &effect, &compilation_errors);
2729 ok(hr == D3D_OK, "D3DXCreateEffect failed, got %#x, expected %#x\n", hr, D3D_OK);
2730 ok(!compilation_errors, "Returned %p\n", compilation_errors);
2731 effect->lpVtbl->Release(effect);
2735 * fxc.exe /Tfx_2_0
2737 #if 0
2738 vertexshader vs_arr1[2] =
2742 vs_1_1
2743 def c0, 1, 1, 1, 1
2744 mov oPos, c0
2748 vs_2_0
2749 def c0, 2, 2, 2, 2
2750 mov oPos, c0
2754 sampler sampler1 =
2755 sampler_state
2757 MipFilter = LINEAR;
2760 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};
2761 technique tech0
2763 pass p0
2765 vertexshader = vs_arr1[1];
2766 VertexShaderConstant1[3] = {2,2,2,2};
2767 BlendOp = 2;
2768 AlphaOp[3] = 4;
2769 ZEnable = true;
2770 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};
2771 ViewTransform=(camera);
2772 LightEnable[2] = TRUE;
2773 LightType[2] = POINT;
2774 LightPosition[2] = {4.0f, 5.0f, 6.0f};
2775 Sampler[1] = sampler1;
2778 #endif
2779 static const DWORD test_effect_states_effect_blob[] =
2781 0xfeff0901, 0x000002e8, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002,
2782 0x00000001, 0x00000002, 0x00000008, 0x615f7376, 0x00317272, 0x0000000a, 0x00000004, 0x00000074,
2783 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
2784 0x00000001, 0x00000001, 0x00000001, 0x000000ab, 0x00000100, 0x00000044, 0x00000040, 0x00000009,
2785 0x706d6173, 0x3172656c, 0x00000000, 0x00000003, 0x00000002, 0x000000e0, 0x000000ec, 0x00000000,
2786 0x00000004, 0x00000004, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2787 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2788 0x00000000, 0x40c00000, 0x00000007, 0x656d6163, 0x00006172, 0x00000005, 0x57454956, 0x00000000,
2789 0x00000003, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x40000000, 0x40000000,
2790 0x40000000, 0x40000000, 0x00000003, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
2791 0x00000001, 0x00000002, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2792 0x00000001, 0x00000004, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2793 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
2794 0x00000001, 0x40000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2795 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2796 0x40800000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0x00000001,
2797 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2798 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2799 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001,
2800 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001,
2801 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x40800000,
2802 0x40a00000, 0x40c00000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2803 0x00000001, 0x00000000, 0x0000000a, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
2804 0x00003070, 0x00000006, 0x68636574, 0x00000030, 0x00000003, 0x00000001, 0x00000005, 0x00000004,
2805 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000060, 0x00000000, 0x00000000,
2806 0x00000084, 0x000000a0, 0x00000000, 0x00000000, 0x000002dc, 0x00000000, 0x00000001, 0x000002d4,
2807 0x00000000, 0x0000000b, 0x00000092, 0x00000000, 0x000000fc, 0x000000f8, 0x00000098, 0x00000003,
2808 0x00000120, 0x00000110, 0x0000004b, 0x00000000, 0x00000140, 0x0000013c, 0x0000006b, 0x00000003,
2809 0x00000160, 0x0000015c, 0x00000000, 0x00000000, 0x00000180, 0x0000017c, 0x0000007d, 0x00000001,
2810 0x000001dc, 0x0000019c, 0x0000007c, 0x00000000, 0x00000238, 0x000001f8, 0x00000091, 0x00000002,
2811 0x00000258, 0x00000254, 0x00000084, 0x00000002, 0x00000278, 0x00000274, 0x00000088, 0x00000002,
2812 0x000002a0, 0x00000294, 0x000000b2, 0x00000001, 0x000002c0, 0x000002bc, 0x00000002, 0x00000003,
2813 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000,
2814 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, 0xfffe0200,
2815 0x05000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x02000001, 0xc00f0000,
2816 0xa0e40000, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000000a, 0x00000001, 0x00000009,
2817 0x706d6173, 0x3172656c, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000006, 0x00000000,
2818 0x0000016c, 0x46580200, 0x0030fffe, 0x42415443, 0x0000001c, 0x0000008b, 0x46580200, 0x00000001,
2819 0x0000001c, 0x20000100, 0x00000088, 0x00000030, 0x00000002, 0x00000004, 0x00000038, 0x00000048,
2820 0x656d6163, 0xab006172, 0x00030003, 0x00040004, 0x00000001, 0x00000000, 0x40800000, 0x00000000,
2821 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2822 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40c00000, 0x4d007874, 0x6f726369,
2823 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
2824 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
2825 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
2826 0x00000000, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004,
2827 0x00000004, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000004,
2828 0x00000008, 0x10000004, 0x00000001, 0x00000000, 0x00000002, 0x0000000c, 0x00000000, 0x00000004,
2829 0x0000000c, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000000,
2830 0x00000001, 0x0000000b, 0x615f7376, 0x5b317272, 0x00005d31,
2832 #define TEST_EFFECT_STATES_VSHADER_POS 271
2834 static void test_effect_states(IDirect3DDevice9 *device)
2836 D3DMATRIX test_mat =
2838 -1.0f, 0.0f, 0.0f, 0.0f,
2839 0.0f, 0.0f, 0.0f, 0.0f,
2840 0.0f, 0.0f, 0.0f, 0.0f,
2841 0.0f, 0.0f, 0.0f, 0.0f
2842 }}};
2843 D3DMATRIX test_mat_camera =
2845 4.0f, 0.0f, 0.0f, 0.0f,
2846 0.0f, 0.0f, 0.0f, 0.0f,
2847 0.0f, 0.0f, 0.0f, 0.0f,
2848 0.0f, 0.0f, 0.0f, 6.0f
2849 }}};
2850 D3DMATRIX test_mat_world1 =
2852 2.0f, 0.0f, 0.0f, 0.0f,
2853 0.0f, 0.0f, 0.0f, 0.0f,
2854 0.0f, 0.0f, 0.0f, 0.0f,
2855 0.0f, 0.0f, 0.0f, 4.0f
2856 }}};
2857 D3DMATRIX mat;
2858 HRESULT hr;
2859 ID3DXEffect *effect;
2860 UINT npasses;
2861 DWORD value;
2862 IDirect3DVertexShader9 *vshader;
2863 void *byte_code;
2864 UINT byte_code_size;
2865 BOOL bval;
2866 D3DLIGHT9 light;
2867 float float_data[4];
2869 hr = D3DXCreateEffect(device, test_effect_states_effect_blob, sizeof(test_effect_states_effect_blob),
2870 NULL, NULL, 0, NULL, &effect, NULL);
2871 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2873 /* State affected in passes saved/restored even if no pass
2874 was performed. States not present in passes are not saved &
2875 restored */
2876 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
2877 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2878 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 1);
2879 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2881 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2882 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2883 ok(npasses == 1, "Expected 1 pass, got %u\n", npasses);
2885 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
2886 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2887 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAFUNC, 2);
2888 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2890 hr = effect->lpVtbl->End(effect);
2891 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2893 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2894 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2895 ok(value == 1, "Got result %u, expected %u.\n", value, 1);
2896 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ALPHAFUNC, &value);
2897 ok(value == 2, "Got result %u, expected %u.\n", value, 2);
2899 /* Test states application in BeginPass. No states are restored
2900 on EndPass. */
2901 hr = IDirect3DDevice9_SetSamplerState(device, 1, D3DSAMP_MIPFILTER, 0);
2902 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2903 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, 0);
2904 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2906 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
2907 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2908 if (hr == D3D_OK)
2909 ok(!bval, "Got result %u, expected 0.\n", bval);
2911 hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(1), &test_mat);
2912 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
2913 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2915 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2916 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2917 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix does not match.\n");
2919 hr = effect->lpVtbl->BeginPass(effect, 0);
2920 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2922 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2923 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2924 ok(!memcmp(mat.m, test_mat_world1.m, sizeof(mat)), "World matrix does not match.\n");
2926 hr = IDirect3DDevice9_GetTransform(device, D3DTS_VIEW, &mat);
2927 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2928 ok(!memcmp(mat.m, test_mat_camera.m, sizeof(mat)), "View matrix does not match.\n");
2930 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2931 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2932 ok(value == 2, "Got result %u, expected %u\n", value, 2);
2934 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
2935 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2936 ok(vshader != NULL, "Got NULL vshader.\n");
2937 if (vshader)
2939 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
2940 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2941 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
2942 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
2943 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2944 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
2945 ok(!memcmp(byte_code, &test_effect_states_effect_blob[TEST_EFFECT_STATES_VSHADER_POS], byte_code_size),
2946 "Incorrect shader selected.\n");
2947 HeapFree(GetProcessHeap(), 0, byte_code);
2948 IDirect3DVertexShader9_Release(vshader);
2951 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
2952 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2953 if (hr == D3D_OK)
2954 ok(bval, "Got result %u, expected TRUE.\n", bval);
2955 hr = IDirect3DDevice9_GetLight(device, 2, &light);
2956 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2957 if (hr == D3D_OK)
2958 ok(light.Position.x == 4.0f && light.Position.y == 5.0f && light.Position.z == 6.0f,
2959 "Got unexpected light position (%f, %f, %f).\n", light.Position.x, light.Position.y, light.Position.z);
2960 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 3, float_data, 1);
2961 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2962 ok(float_data[0] == 2.0f && float_data[1] == 2.0f && float_data[2] == 2.0f && float_data[3] == 2.0f,
2963 "Got unexpected vertex shader floats: (%f %f %f %f).\n",
2964 float_data[0], float_data[1], float_data[2], float_data[3]);
2966 hr = effect->lpVtbl->EndPass(effect);
2967 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2968 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
2969 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2970 ok(value == 2, "Got result %u, expected %u\n", value, 2);
2972 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_ZENABLE, &value);
2973 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2974 ok(value, "Got result %u, expected TRUE.\n", value);
2976 hr = IDirect3DDevice9_GetSamplerState(device, 1, D3DSAMP_MIPFILTER, &value);
2977 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2978 ok(value == D3DTEXF_LINEAR, "Unexpected sampler 1 mipfilter %u.\n", value);
2980 hr = IDirect3DDevice9_GetTextureStageState(device, 3, D3DTSS_ALPHAOP, &value);
2981 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2982 ok(value == 4, "Unexpected texture stage 3 AlphaOp %u.\n", value);
2984 hr = effect->lpVtbl->End(effect);
2985 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2987 hr = IDirect3DDevice9_GetTransform(device, D3DTS_WORLDMATRIX(1), &mat);
2988 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2989 ok(!memcmp(mat.m, test_mat.m, sizeof(mat)), "World matrix not restored.\n");
2991 hr = IDirect3DDevice9_GetLightEnable(device, 2, &bval);
2992 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
2993 if (hr == D3D_OK)
2994 ok(!bval, "Got result %u, expected 0.\n", bval);
2996 /* State is not restored if effect is released without End call */
2997 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 1);
2998 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3000 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3001 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3003 hr = IDirect3DDevice9_SetRenderState(device, D3DRS_BLENDOP, 3);
3004 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3006 effect->lpVtbl->Release(effect);
3008 hr = IDirect3DDevice9_GetRenderState(device, D3DRS_BLENDOP, &value);
3009 ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr);
3010 ok(value == 3, "Got result %u, expected %u.\n", value, 1);
3014 * fxc.exe /Tfx_2_0
3016 #if 0
3017 float4 g_Pos1;
3018 float4 g_Pos2;
3019 float4 g_Selector[2] = {{0, 0, 0, 0}, {10, 10, 10, 10}};
3021 float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3022 float4 opvect2 = {1.0, 2.0, -3.0, 4.0};
3023 float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F};
3025 int4 g_iVect = {4, 3, 2, 1};
3027 vertexshader vs_arr[3] =
3031 vs_1_0
3032 def c0, 1, 1, 1, 1
3033 mov oPos, c0
3037 vs_1_1
3038 def c0, 2, 2, 2, 2
3039 mov oPos, c0
3043 vs_2_0
3044 def c0, 3, 3, 3, 3
3045 mov oPos, c0
3049 row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}};
3050 row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3051 column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}};
3052 column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}};
3053 row_major float2x2 m2x2row = {{11, 12}, {21, 22}};
3054 column_major float2x2 m2x2column = {{11, 12}, {21, 22}};
3055 row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}};
3056 column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}};
3057 row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}};
3058 column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}};
3060 row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}};
3061 column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}};
3063 struct test_struct
3065 float3 v1;
3066 float fv;
3067 float4 v2;
3070 test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}};
3071 test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}};
3073 float arr1[1] = {91};
3074 float arr2[2] = {92, 93};
3076 struct VS_OUTPUT
3078 float4 Position : POSITION;
3079 float2 TextureUV : TEXCOORD0;
3080 float4 Diffuse : COLOR0;
3082 VS_OUTPUT RenderSceneVS(float4 vPos : POSITION,
3083 float3 vNormal : NORMAL,
3084 float2 vTexCoord0 : TEXCOORD0,
3085 uniform int nNumLights,
3086 uniform bool bTexture)
3088 VS_OUTPUT Output;
3090 if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y)
3091 Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7);
3092 else
3093 Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7);
3094 Output.TextureUV = float2(0, 0);
3095 Output.Diffuse = 0;
3096 Output.Diffuse.xyz = mul(vPos, m4x3column);
3097 Output.Diffuse += mul(vPos, m3x4column);
3098 Output.Diffuse += mul(vPos, m3x4row);
3099 Output.Diffuse.xyz += mul(vPos, m4x3row);
3100 Output.Diffuse += mul(vPos, ts1[0].fv);
3101 Output.Diffuse += mul(vPos, ts1[0].v2);
3102 Output.Diffuse += mul(vPos, ts2[1].fv);
3103 Output.Diffuse += mul(vPos, ts2[1].v2);
3104 Output.Diffuse += mul(vPos, arr1[0]);
3105 Output.Diffuse += mul(vPos, arr2[1]);
3106 return Output;
3109 struct PS_OUTPUT
3111 float4 RGBColor : COLOR0; /* Pixel color */
3113 PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb)
3115 PS_OUTPUT Output;
3117 Output.RGBColor = In.Diffuse;
3118 Output.RGBColor.xy += mul(In.Diffuse, m2x2row);
3119 Output.RGBColor.xy += mul(In.Diffuse, m2x2column);
3120 Output.RGBColor.xy += mul(In.Diffuse, m3x2row);
3121 Output.RGBColor.xy += mul(In.Diffuse, m3x2column);
3122 Output.RGBColor.xyz += mul(In.Diffuse, m2x3row);
3123 Output.RGBColor.xyz += mul(In.Diffuse, m2x3column);
3124 if (mb[1][1])
3126 Output.RGBColor += sin(Output.RGBColor);
3127 Output.RGBColor += cos(Output.RGBColor);
3128 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column);
3129 Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row);
3130 Output.RGBColor.xy += mul(Output.RGBColor, m3x2column);
3131 Output.RGBColor.xy += mul(Output.RGBColor, m3x2row);
3133 return Output;
3136 technique tech0
3138 pass p0
3140 VertexShader = compile vs_3_0 RenderSceneVS(1, true);
3141 PixelShader = compile ps_3_0 RenderScenePS(mb2x3row);
3143 LightEnable[0] = TRUE;
3144 LightEnable[1] = TRUE;
3145 LightEnable[2] = TRUE;
3146 LightEnable[3] = TRUE;
3147 LightEnable[4] = TRUE;
3148 LightEnable[5] = TRUE;
3149 LightEnable[6] = TRUE;
3150 LightEnable[7] = TRUE;
3151 LightType[0] = POINT;
3152 LightType[1] = POINT;
3153 LightType[2] = POINT;
3154 LightType[3] = POINT;
3155 LightType[4] = POINT;
3156 LightType[5] = POINT;
3157 LightType[6] = POINT;
3158 LightType[7] = POINT;
3159 LightDiffuse[0] = 1 / opvect1;
3160 LightDiffuse[1] = rsqrt(opvect1);
3161 LightDiffuse[2] = opvect1 * opvect2;
3162 LightDiffuse[3] = opvect1 + opvect2;
3163 LightDiffuse[4] = float4(opvect1 < opvect2);
3164 LightDiffuse[5] = float4(opvect1 >= opvect2);
3165 LightDiffuse[6] = -opvect1;
3166 LightDiffuse[7] = rcp(opvect1);
3168 LightAmbient[0] = frac(opvect1);
3169 LightAmbient[1] = min(opvect1, opvect2);
3170 LightAmbient[2] = max(opvect1, opvect2);
3171 LightAmbient[3] = sin(opvect1);
3172 LightAmbient[4] = cos(opvect1);
3173 LightAmbient[5] = 1e-2 / opvect1;
3174 LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0);
3175 LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3;
3177 pass p1
3179 VertexShader = vs_arr[g_iVect.z];
3182 #endif
3183 static const DWORD test_effect_preshader_effect_blob[] =
3185 0xfeff0901, 0x00000c30, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000,
3186 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67,
3187 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3188 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003,
3189 0x00000001, 0x000000b0, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3190 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x0000000b, 0x65535f67,
3191 0x7463656c, 0x0000726f, 0x00000003, 0x00000001, 0x000000ec, 0x00000000, 0x00000000, 0x00000004,
3192 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463,
3193 0x00000003, 0x00000001, 0x00000124, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000,
3194 0x40000000, 0xc0400000, 0x40800000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003, 0x00000001,
3195 0x0000015c, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd,
3196 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463, 0x00000002, 0x00000001, 0x00000194, 0x00000000,
3197 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001, 0x00000008,
3198 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x000001c0, 0x00000000, 0x00000003, 0x00000001,
3199 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002, 0x00000218,
3200 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000,
3201 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000,
3202 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002, 0x00000270, 0x00000000, 0x00000000,
3203 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000,
3204 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x00000008, 0x3478336d,
3205 0x00776f72, 0x00000003, 0x00000002, 0x000002c8, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
3206 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000,
3207 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b, 0x3378346d, 0x756c6f63, 0x00006e6d,
3208 0x00000003, 0x00000002, 0x00000324, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000,
3209 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000,
3210 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d, 0x756c6f63, 0x00006e6d, 0x00000003,
3211 0x00000002, 0x00000360, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000, 0x41400000,
3212 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72, 0x00000003, 0x00000002, 0x00000398,
3213 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000,
3214 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x000003dc, 0x00000000,
3215 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3216 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003, 0x00000002, 0x0000041c, 0x00000000,
3217 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000,
3218 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000460,
3219 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000,
3220 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72, 0x00000003, 0x00000002, 0x000004a0,
3221 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000,
3222 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63, 0x00006e6d, 0x00000001, 0x00000002,
3223 0x000004e4, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x00000001, 0x00000000, 0x00000001,
3224 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d, 0x776f7233, 0x00000000, 0x00000001,
3225 0x00000002, 0x00000528, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x00000001, 0x00000000,
3226 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c, 0x7832626d, 0x6c6f6333, 0x006e6d75,
3227 0x00000000, 0x00000005, 0x000005c4, 0x00000000, 0x00000001, 0x00000003, 0x00000003, 0x00000001,
3228 0x000005cc, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000005d4,
3229 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000005dc, 0x00000000,
3230 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000,
3231 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374, 0x00000003, 0x00003176, 0x00000003,
3232 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005, 0x00000690, 0x00000000, 0x00000002,
3233 0x00000003, 0x00000003, 0x00000001, 0x00000698, 0x00000000, 0x00000000, 0x00000003, 0x00000001,
3234 0x00000003, 0x00000000, 0x000006a0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003,
3235 0x00000001, 0x000006a8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3236 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000,
3237 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x00000004, 0x00327374,
3238 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000,
3239 0x000006d0, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261,
3240 0x00000000, 0x00000003, 0x00000000, 0x00000700, 0x00000000, 0x00000002, 0x00000001, 0x00000001,
3241 0x42b80000, 0x42ba0000, 0x00000005, 0x32727261, 0x00000000, 0x00000004, 0x00000010, 0x00000004,
3242 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x0000000f, 0x00000004, 0x00000000, 0x00000000,
3243 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3244 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3245 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3246 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3247 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3248 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3249 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3250 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3251 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3252 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3253 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3254 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3255 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3256 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3257 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3258 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001,
3259 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3260 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3261 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3262 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3263 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3264 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3265 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3266 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3267 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3268 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3269 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3270 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000,
3271 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3272 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000,
3273 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
3274 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
3275 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
3276 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001,
3277 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000,
3278 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
3279 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000,
3280 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004,
3281 0x00000001, 0x00000003, 0x00003070, 0x00000006, 0x00000010, 0x00000004, 0x00000000, 0x00000000,
3282 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574, 0x00000030, 0x00000018, 0x00000001,
3283 0x00000008, 0x00000007, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058,
3284 0x00000000, 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x000000c0, 0x000000dc,
3285 0x00000000, 0x00000000, 0x000000f8, 0x00000114, 0x00000000, 0x00000000, 0x00000130, 0x0000014c,
3286 0x00000000, 0x00000000, 0x00000168, 0x00000184, 0x00000000, 0x00000000, 0x000001a0, 0x000001b4,
3287 0x00000000, 0x00000000, 0x000001cc, 0x000001e8, 0x00000000, 0x00000000, 0x00000224, 0x00000240,
3288 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002d8, 0x000002f4,
3289 0x00000000, 0x00000000, 0x00000334, 0x00000350, 0x00000000, 0x00000000, 0x0000036c, 0x00000388,
3290 0x00000000, 0x00000000, 0x000003a8, 0x000003c4, 0x00000000, 0x00000000, 0x000003e8, 0x00000404,
3291 0x00000000, 0x00000000, 0x0000042c, 0x00000448, 0x00000000, 0x00000000, 0x0000046c, 0x00000488,
3292 0x00000000, 0x00000000, 0x000004b0, 0x000004cc, 0x00000000, 0x00000000, 0x000004f4, 0x00000510,
3293 0x00000000, 0x00000000, 0x00000538, 0x000005a4, 0x00000000, 0x00000000, 0x000005e4, 0x00000650,
3294 0x00000000, 0x00000000, 0x000006b0, 0x000006cc, 0x00000000, 0x00000000, 0x000006dc, 0x000006f8,
3295 0x00000000, 0x00000000, 0x00000c24, 0x00000000, 0x00000002, 0x00000bfc, 0x00000000, 0x00000022,
3296 0x00000092, 0x00000000, 0x00000710, 0x0000070c, 0x00000093, 0x00000000, 0x00000728, 0x00000724,
3297 0x00000091, 0x00000000, 0x00000740, 0x0000073c, 0x00000091, 0x00000001, 0x00000760, 0x0000075c,
3298 0x00000091, 0x00000002, 0x00000780, 0x0000077c, 0x00000091, 0x00000003, 0x000007a0, 0x0000079c,
3299 0x00000091, 0x00000004, 0x000007c0, 0x000007bc, 0x00000091, 0x00000005, 0x000007e0, 0x000007dc,
3300 0x00000091, 0x00000006, 0x00000800, 0x000007fc, 0x00000091, 0x00000007, 0x00000820, 0x0000081c,
3301 0x00000084, 0x00000000, 0x00000840, 0x0000083c, 0x00000084, 0x00000001, 0x00000860, 0x0000085c,
3302 0x00000084, 0x00000002, 0x00000880, 0x0000087c, 0x00000084, 0x00000003, 0x000008a0, 0x0000089c,
3303 0x00000084, 0x00000004, 0x000008c0, 0x000008bc, 0x00000084, 0x00000005, 0x000008e0, 0x000008dc,
3304 0x00000084, 0x00000006, 0x00000900, 0x000008fc, 0x00000084, 0x00000007, 0x00000920, 0x0000091c,
3305 0x00000085, 0x00000000, 0x0000094c, 0x0000093c, 0x00000085, 0x00000001, 0x00000978, 0x00000968,
3306 0x00000085, 0x00000002, 0x000009a4, 0x00000994, 0x00000085, 0x00000003, 0x000009d0, 0x000009c0,
3307 0x00000085, 0x00000004, 0x000009fc, 0x000009ec, 0x00000085, 0x00000005, 0x00000a28, 0x00000a18,
3308 0x00000085, 0x00000006, 0x00000a54, 0x00000a44, 0x00000085, 0x00000007, 0x00000a80, 0x00000a70,
3309 0x00000087, 0x00000000, 0x00000aac, 0x00000a9c, 0x00000087, 0x00000001, 0x00000ad8, 0x00000ac8,
3310 0x00000087, 0x00000002, 0x00000b04, 0x00000af4, 0x00000087, 0x00000003, 0x00000b30, 0x00000b20,
3311 0x00000087, 0x00000004, 0x00000b5c, 0x00000b4c, 0x00000087, 0x00000005, 0x00000b88, 0x00000b78,
3312 0x00000087, 0x00000006, 0x00000bb4, 0x00000ba4, 0x00000087, 0x00000007, 0x00000be0, 0x00000bd0,
3313 0x00000c1c, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x00000c08, 0x00000c04, 0x00000003,
3314 0x00000013, 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000,
3315 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c,
3316 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x00000001,
3317 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003, 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000,
3318 0x40400000, 0x40400000, 0x40400000, 0x40400000, 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff,
3319 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000002, 0x000000e8, 0x00000008, 0x615f7376,
3320 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001,
3321 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048,
3322 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000,
3323 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3324 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3325 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000,
3326 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3327 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248, 0x46580200, 0x003efffe,
3328 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100, 0x000000c0,
3329 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002, 0x00000001,
3330 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0, 0x00000070, 0x6576706f,
3331 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3332 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000,
3333 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001,
3334 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3335 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0022fffe, 0x54494c43,
3336 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3337 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3338 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3339 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3340 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001,
3341 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x20400004,
3342 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3343 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000,
3344 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000,
3345 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3346 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0, 0x46580200, 0x0033fffe,
3347 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
3348 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
3349 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3350 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
3351 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
3352 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3353 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000, 0x00000000,
3354 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3355 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3356 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x002afffe, 0x434c5846,
3357 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3358 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002,
3359 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000002, 0x10000001,
3360 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x10000001,
3361 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
3362 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f, 0x00000000, 0x000001a8,
3363 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
3364 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
3365 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3366 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3367 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43,
3368 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3369 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3370 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3371 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3372 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3373 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3374 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002, 0x00000000, 0x00000001,
3375 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3376 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e, 0x00000000, 0x000000dc,
3377 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
3378 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
3379 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3380 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3381 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3382 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001, 0x00000000, 0x00000002,
3383 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3384 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443,
3385 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
3386 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3387 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
3388 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3389 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846,
3390 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
3391 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001c,
3392 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200,
3393 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c,
3394 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463,
3395 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff,
3396 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000,
3397 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c,
3398 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe,
3399 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004, 0x00000002, 0x00000000,
3400 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000,
3401 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001b, 0x00000000,
3402 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002,
3403 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c,
3404 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001,
3405 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f,
3406 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000,
3407 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3408 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3409 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002, 0x00000000, 0x00000002,
3410 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0,
3411 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a, 0x00000000, 0x000000dc,
3412 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
3413 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
3414 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3415 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3416 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3417 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001, 0x00000000, 0x00000002,
3418 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3419 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443,
3420 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030,
3421 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001,
3422 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369,
3423 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3424 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846,
3425 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004,
3426 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004,
3427 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004,
3428 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004,
3429 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000018,
3430 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200,
3431 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038,
3432 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3433 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3434 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3435 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10100004, 0x00000001,
3436 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f,
3437 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000124, 0x46580200,
3438 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100,
3439 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002,
3440 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001,
3441 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001,
3442 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874,
3443 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3444 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe,
3445 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000,
3446 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff,
3447 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe,
3448 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094,
3449 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001,
3450 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3451 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001,
3452 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369,
3453 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072,
3454 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846,
3455 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002,
3456 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3457 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443,
3458 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044,
3459 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074,
3460 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000,
3461 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001,
3462 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73,
3463 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932,
3464 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001,
3465 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004,
3466 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000,
3467 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c,
3468 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002,
3469 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084,
3470 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000,
3471 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3472 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3473 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3474 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20500004,
3475 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000,
3476 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff,
3477 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b,
3478 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001,
3479 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3480 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820,
3481 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3482 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10700001,
3483 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10700001,
3484 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10700001,
3485 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10700001,
3486 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0,
3487 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012, 0x00000000, 0x0000013c,
3488 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c,
3489 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f,
3490 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd,
3491 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461,
3492 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43,
3493 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3494 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3495 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3496 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002,
3497 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000,
3498 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000724, 0xffff0300, 0x00a5fffe, 0x42415443,
3499 0x0000001c, 0x0000025f, 0xffff0300, 0x00000007, 0x0000001c, 0x20000000, 0x00000258, 0x000000a8,
3500 0x00080002, 0x00000002, 0x000000b4, 0x000000c4, 0x000000e4, 0x00060002, 0x00000002, 0x000000ec,
3501 0x000000fc, 0x0000011c, 0x00000002, 0x00000003, 0x00000128, 0x00000138, 0x00000168, 0x000a0002,
3502 0x00000002, 0x00000170, 0x00000180, 0x000001a0, 0x000c0002, 0x00000002, 0x000001ac, 0x000001bc,
3503 0x000001dc, 0x00030002, 0x00000003, 0x000001e4, 0x000001f4, 0x00000224, 0x00000000, 0x00000005,
3504 0x00000230, 0x00000240, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001,
3505 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000,
3506 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000,
3507 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d,
3508 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3509 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000,
3510 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000,
3511 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3512 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000,
3513 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d,
3514 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000,
3515 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000,
3516 0x00000000, 0x7832626d, 0x776f7233, 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000,
3517 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x335f7370, 0x4d00305f,
3518 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970,
3519 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000,
3520 0x3f800000, 0xbe22f983, 0x05000051, 0xa00f000f, 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba,
3521 0x05000051, 0xa00f0010, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x0200001f, 0x8000000a,
3522 0x900f0000, 0x03000005, 0x80030000, 0xa0e40007, 0x90550000, 0x04000004, 0x80030000, 0x90000000,
3523 0xa0e40006, 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40000, 0x02000001, 0x80010001,
3524 0xa000000f, 0x0400005a, 0x80010002, 0x90e40000, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002,
3525 0x90e40000, 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005,
3526 0x800c0000, 0xa0440004, 0x90550000, 0x04000004, 0x800c0000, 0x90000000, 0xa0440003, 0x80e40000,
3527 0x04000004, 0x800c0000, 0x90aa0000, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000,
3528 0x80e40000, 0x03000008, 0x80010002, 0x90e40000, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40000,
3529 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b,
3530 0x90550000, 0x04000004, 0x800e0001, 0x90000000, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000,
3531 0x90aa0000, 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40000,
3532 0xa0e40000, 0x80000001, 0x0400005a, 0x80020002, 0x90e40000, 0xa0e40001, 0x80000001, 0x0400005a,
3533 0x80040002, 0x90e40000, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002,
3534 0x01000028, 0xe0e40804, 0x02000001, 0x80080000, 0x90ff0000, 0x04000004, 0x800f0002, 0x80e40000,
3535 0xa055000f, 0xa0aa000f, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002,
3536 0xa0000010, 0xa0550010, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0003,
3537 0x80e40002, 0xa0aa0010, 0xa0ff0010, 0x04000004, 0x800f0003, 0x80e40002, 0x80e40003, 0xa0ff000f,
3538 0x04000004, 0x800f0003, 0x80e40002, 0x80e40003, 0xa000000e, 0x04000004, 0x800f0003, 0x80e40002,
3539 0x80e40003, 0xa055000e, 0x04000004, 0x800f0002, 0x80e40002, 0x80e40003, 0x80e40000, 0x03000002,
3540 0x800f0002, 0x80e40002, 0xa0aa000e, 0x04000004, 0x800f0003, 0x80e40002, 0xa1ff000e, 0xa155000e,
3541 0x02000013, 0x800f0003, 0x80e40003, 0x04000004, 0x800f0003, 0x80e40003, 0xa0000010, 0xa0550010,
3542 0x03000005, 0x800f0003, 0x80e40003, 0x80e40003, 0x04000004, 0x800f0004, 0x80e40003, 0xa0aa0010,
3543 0xa0ff0010, 0x04000004, 0x800f0004, 0x80e40003, 0x80e40004, 0xa0ff000f, 0x04000004, 0x800f0004,
3544 0x80e40003, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40003, 0x80e40004, 0xa055000e,
3545 0x04000004, 0x800f0002, 0x80e40003, 0x80e40004, 0x80e40002, 0x03000002, 0x800f0002, 0x80e40002,
3546 0xa0aa000e, 0x0400005a, 0x80010003, 0x80e40002, 0xa0e40000, 0x80000001, 0x0400005a, 0x80020003,
3547 0x80e40002, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040003, 0x80e40002, 0xa0e40002, 0x80000001,
3548 0x03000002, 0x80070001, 0x80e40002, 0x80e40003, 0x03000005, 0x80070002, 0x80550001, 0xa0e4000b,
3549 0x04000004, 0x80070002, 0x80000001, 0xa0e4000a, 0x80e40002, 0x03000002, 0x80070001, 0x80e40001,
3550 0x80e40002, 0x03000008, 0x80010002, 0x80e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x80e40001,
3551 0xa0e4000d, 0x03000002, 0x80030001, 0x80e40001, 0x80e40002, 0x03000005, 0x80030002, 0x80550001,
3552 0xa0e40004, 0x04000004, 0x80030002, 0x80000001, 0xa0e40003, 0x80e40002, 0x04000004, 0x80030002,
3553 0x80aa0001, 0xa0e40005, 0x80e40002, 0x03000002, 0x80030800, 0x80e40001, 0x80e40002, 0x02000001,
3554 0x80040800, 0x80aa0001, 0x02000001, 0x80080800, 0x80ff0002, 0x0000002a, 0x02000001, 0x80070800,
3555 0x80e40000, 0x02000001, 0x80080800, 0x90ff0000, 0x0000002b, 0x0000ffff, 0x00000000, 0x00000000,
3556 0xffffffff, 0x00000000, 0x00000000, 0x0000098c, 0xfffe0300, 0x00ebfffe, 0x42415443, 0x0000001c,
3557 0x00000377, 0xfffe0300, 0x00000008, 0x0000001c, 0x20000000, 0x00000370, 0x000000bc, 0x00190002,
3558 0x00000001, 0x000000c4, 0x000000d4, 0x000000e4, 0x00170002, 0x00000002, 0x000000ec, 0x000000fc,
3559 0x0000011c, 0x000a0002, 0x00000004, 0x00000128, 0x00000138, 0x00000178, 0x000e0002, 0x00000003,
3560 0x00000180, 0x00000190, 0x000001c0, 0x00110002, 0x00000003, 0x000001cc, 0x000001dc, 0x0000020c,
3561 0x00060002, 0x00000004, 0x00000214, 0x00000224, 0x00000264, 0x00140002, 0x00000003, 0x000002bc,
3562 0x000002cc, 0x000002fc, 0x00000002, 0x00000006, 0x00000300, 0x00000310, 0x31727261, 0xababab00,
3563 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000,
3564 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000,
3565 0x00000000, 0x00000000, 0x42ba0000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63,
3566 0xab006e6d, 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000,
3567 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000,
3568 0x00000000, 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002,
3569 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000,
3570 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d,
3571 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000,
3572 0x41f80000, 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000,
3573 0x42040000, 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000,
3574 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000,
3575 0x41f80000, 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000,
3576 0x00317374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000,
3577 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000,
3578 0x00000268, 0x0000026c, 0x0000027c, 0x00000280, 0x00000290, 0x00000294, 0x00000005, 0x00080001,
3579 0x00030001, 0x000002a4, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000,
3580 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005,
3581 0x00080001, 0x00030002, 0x000002a4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3582 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000,
3583 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000,
3584 0x40c00000, 0x40e00000, 0x41000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820,
3585 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235,
3586 0x00313131, 0x00ecfffe, 0x53455250, 0x46580201, 0x0043fffe, 0x42415443, 0x0000001c, 0x000000d7,
3587 0x46580201, 0x00000003, 0x0000001c, 0x20000100, 0x000000d4, 0x00000058, 0x00020002, 0x00000001,
3588 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088, 0x00000070, 0x00000098,
3589 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001,
3590 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003273,
3591 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001,
3592 0x00040001, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000,
3593 0x41200000, 0x41200000, 0x41200000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820,
3594 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131,
3595 0x000cfffe, 0x49535250, 0x0000001a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000,
3596 0x00000001, 0x0000001a, 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018,
3597 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3598 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3599 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3600 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
3601 0x00000000, 0x3fe00000, 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000,
3602 0x00000000, 0x40100000, 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000,
3603 0x0064fffe, 0x434c5846, 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011,
3604 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002,
3605 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007,
3606 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002,
3607 0x0000000c, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007,
3608 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004,
3609 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004,
3610 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000,
3611 0x00000007, 0x0000000c, 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000,
3612 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000,
3613 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004,
3614 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008,
3615 0x00000000, 0x00000004, 0x00000068, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f001b,
3616 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f,
3617 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002,
3618 0x03000009, 0x80010000, 0x90e40000, 0xa0e40011, 0x03000009, 0x80020000, 0x90e40000, 0xa0e40012,
3619 0x03000009, 0x80040000, 0x90e40000, 0xa0e40013, 0x03000008, 0x80010001, 0x90e40000, 0xa0e4000a,
3620 0x03000008, 0x80020001, 0x90e40000, 0xa0e4000b, 0x03000008, 0x80040001, 0x90e40000, 0xa0e4000c,
3621 0x03000008, 0x80080001, 0x90e40000, 0xa0e4000d, 0x02000001, 0x80080000, 0xa000001b, 0x03000002,
3622 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005, 0x800f0001, 0xa0e4000f, 0x90550000, 0x04000004,
3623 0x800f0001, 0x90000000, 0xa0e4000e, 0x80e40001, 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40010,
3624 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005, 0x80070001, 0xa0e40007,
3625 0x90550000, 0x04000004, 0x80070001, 0x90000000, 0xa0e40006, 0x80e40001, 0x04000004, 0x80070001,
3626 0x90aa0000, 0xa0e40008, 0x80e40001, 0x04000004, 0x80070001, 0x90ff0000, 0xa0e40009, 0x80e40001,
3627 0x03000002, 0x80070000, 0x80e40000, 0x80e40001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000015,
3628 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40016, 0x03000002, 0x800f0000, 0x80e40000,
3629 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000004, 0x80e40000, 0x03000009, 0x80010001,
3630 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000,
3631 0x90e40000, 0xa0000019, 0x80e40000, 0x04000004, 0xe00f0002, 0x90e40000, 0xa0000018, 0x80e40000,
3632 0x02000001, 0xe00f0000, 0xa0e4001a, 0x02000001, 0xe0030001, 0xa000001b, 0x0000ffff,
3634 #define TEST_EFFECT_PRESHADER_VSHADER_POS 1035
3635 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13
3637 static void test_effect_preshader(IDirect3DDevice9 *device)
3639 static const D3DXVECTOR4 test_effect_preshader_fconstsv[] =
3641 {0.0f, 0.0f, 0.0f, 0.0f},
3642 {0.0f, 0.0f, 0.0f, 0.0f},
3643 {0.0f, 0.0f, 0.0f, 0.0f},
3644 {1.0f, 2.0f, 3.0f, 0.0f},
3645 {4.0f, 0.0f, 0.0f, 0.0f},
3646 {5.0f, 6.0f, 7.0f, 8.0f},
3647 {11.0f, 12.0f, 13.0f, 0.0f},
3648 {21.0f, 22.0f, 23.0f, 0.0f},
3649 {31.0f, 32.0f, 33.0f, 0.0f},
3650 {41.0f, 42.0f, 43.0f, 0.0f},
3651 {11.0f, 21.0f, 31.0f, 0.0f},
3652 {12.0f, 22.0f, 32.0f, 0.0f},
3653 {13.0f, 23.0f, 33.0f, 0.0f},
3654 {14.0f, 24.0f, 34.0f, 0.0f},
3655 {11.0f, 12.0f, 13.0f, 14.0f},
3656 {21.0f, 22.0f, 23.0f, 24.0f},
3657 {31.0f, 32.0f, 33.0f, 34.0f},
3658 {11.0f, 21.0f, 31.0f, 41.0f},
3659 {12.0f, 22.0f, 32.0f, 42.0f},
3660 {13.0f, 23.0f, 33.0f, 43.0f},
3661 {9.0f, 10.0f, 11.0f, 0.0f},
3662 {12.0f, 0.0f, 0.0f, 0.0f},
3663 {13.0f, 14.0f, 15.0f, 16.0f},
3664 {92.0f, 0.0f, 0.0f, 0.0f},
3665 {93.0f, 0.0f, 0.0f, 0.0f},
3666 {91.0f, 0.0f, 0.0f, 0.0f},
3667 {4.0f, 5.0f, 6.0f, 7.0f}
3669 static const D3DXVECTOR4 test_effect_preshader_fconstsp[] =
3671 {11.0f, 21.0f, 0.0f, 0.0f},
3672 {12.0f, 22.0f, 0.0f, 0.0f},
3673 {13.0f, 23.0f, 0.0f, 0.0f},
3674 {11.0f, 12.0f, 0.0f, 0.0f},
3675 {21.0f, 22.0f, 0.0f, 0.0f},
3676 {31.0f, 32.0f, 0.0f, 0.0f},
3677 {11.0f, 12.0f, 0.0f, 0.0f},
3678 {21.0f, 22.0f, 0.0f, 0.0f},
3679 {11.0f, 21.0f, 0.0f, 0.0f},
3680 {12.0f, 22.0f, 0.0f, 0.0f},
3681 {11.0f, 12.0f, 13.0f, 0.0f},
3682 {21.0f, 22.0f, 23.0f, 0.0f},
3683 {11.0f, 21.0f, 31.0f, 0.0f},
3684 {12.0f, 22.0f, 32.0f, 0.0f}
3686 static const BOOL test_effect_preshader_bconsts[] =
3688 TRUE, FALSE, TRUE, FALSE, TRUE, FALSE
3690 static const struct
3692 const char *comment;
3693 BOOL todo[4];
3694 unsigned int result[4];
3695 unsigned int ulps;
3697 test_effect_preshader_op_results[] =
3699 {"1 / op", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
3700 {"rsq", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}, 1},
3701 {"mul", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}},
3702 {"add", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}},
3703 {"lt", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}},
3704 {"ge", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}},
3705 {"neg", {FALSE, FALSE, FALSE, FALSE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}},
3706 {"rcp", {FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}},
3707 {"frac", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}},
3708 {"min", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}},
3709 {"max", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}},
3710 #if __x86_64__
3711 {"sin", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}},
3712 {"cos", {FALSE, FALSE, FALSE, FALSE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}},
3713 #else
3714 {"sin", {FALSE, FALSE, FALSE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}},
3715 {"cos", {FALSE, FALSE, FALSE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}},
3716 #endif
3717 {"den mul",{FALSE, FALSE, FALSE, FALSE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}},
3718 {"dot", {FALSE, FALSE, FALSE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}},
3719 #if __x86_64__
3720 {"prec", {FALSE, FALSE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}}
3721 #else
3722 {"prec", {FALSE, FALSE, FALSE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0x00000000, 0x00000000}}
3723 #endif
3725 #define TEST_EFFECT_PRES_NFLOATV ARRAY_SIZE(test_effect_preshader_fconstsv)
3726 #define TEST_EFFECT_PRES_NFLOATP ARRAY_SIZE(test_effect_preshader_fconstsp)
3727 #define TEST_EFFECT_PRES_NFLOATMAX (TEST_EFFECT_PRES_NFLOATV > TEST_EFFECT_PRES_NFLOATP ? \
3728 TEST_EFFECT_PRES_NFLOATV : TEST_EFFECT_PRES_NFLOATP)
3729 #define TEST_EFFECT_PRES_NBOOL ARRAY_SIZE(test_effect_preshader_bconsts)
3730 #define TEST_EFFECT_PRES_NOPTESTS ARRAY_SIZE(test_effect_preshader_op_results)
3732 static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f};
3733 static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f};
3734 static const D3DXVECTOR4 fvect_empty = {-9999.0f, -9999.0f, -9999.0f, -9999.0f};
3735 HRESULT hr;
3736 ID3DXEffect *effect;
3737 D3DXHANDLE par;
3738 unsigned int npasses;
3739 BOOL bval;
3740 D3DLIGHT9 light;
3741 D3DXVECTOR4 fdata[TEST_EFFECT_PRES_NFLOATMAX];
3742 BOOL bdata[TEST_EFFECT_PRES_NBOOL];
3743 IDirect3DVertexShader9 *vshader;
3744 void *byte_code;
3745 unsigned int byte_code_size;
3746 unsigned int i, j;
3747 D3DCAPS9 caps;
3749 hr = IDirect3DDevice9_GetDeviceCaps(device, &caps);
3750 ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr);
3751 if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)
3752 || caps.PixelShaderVersion < D3DPS_VERSION(3, 0))
3754 skip("Test requires VS >= 3 and PS >= 3, skipping.\n");
3755 return;
3758 hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
3759 NULL, NULL, 0, NULL, &effect, NULL);
3760 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3762 for (i = 0; i < 256; ++i)
3764 hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_empty.x, 1);
3765 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3767 for (i = 0; i < 224; ++i)
3769 hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_empty.x, 1);
3770 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3772 bval = FALSE;
3773 for (i = 0; i < 16; ++i)
3775 hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1);
3776 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3779 hr = effect->lpVtbl->Begin(effect, &npasses, 0);
3780 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3782 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2");
3783 ok(par != NULL, "GetParameterByName failed.\n");
3785 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
3786 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
3788 hr = effect->lpVtbl->BeginPass(effect, 0);
3789 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3791 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x, TEST_EFFECT_PRES_NFLOATV);
3792 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3793 ok(!memcmp(fdata, test_effect_preshader_fconstsv, sizeof(test_effect_preshader_fconstsv)),
3794 "Vertex shader float constants do not match.\n");
3795 for (i = TEST_EFFECT_PRES_NFLOATV; i < 256; ++i)
3797 hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1);
3798 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3799 ok(!memcmp(fdata, &fvect_empty, sizeof(fvect_empty)),
3800 "Vertex shader float constants do not match.\n");
3802 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x, TEST_EFFECT_PRES_NFLOATP);
3803 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3804 ok(!memcmp(fdata, test_effect_preshader_fconstsp, sizeof(test_effect_preshader_fconstsp)),
3805 "Pixel shader float constants do not match.\n");
3806 for (i = TEST_EFFECT_PRES_NFLOATP; i < 224; ++i)
3808 hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1);
3809 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3810 ok(!memcmp(fdata, &fvect_empty, sizeof(fvect_empty)),
3811 "Vertex shader float constants do not match.\n");
3814 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, TEST_EFFECT_PRES_NBOOL);
3815 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3816 for (i = 0; i < TEST_EFFECT_PRES_NBOOL; ++i)
3817 todo_wine_if(!bdata[i] != !test_effect_preshader_bconsts[i])
3818 ok(!bdata[i] == !test_effect_preshader_bconsts[i],
3819 "Pixel shader boolean constants do not match.\n");
3820 for (; i < 16; ++i)
3822 hr = IDirect3DDevice9_GetPixelShaderConstantB(device, i, &bval, 1);
3823 ok(hr == D3D_OK && !bval, "Got result %#x, boolean register value %u.\n", hr, bval);
3826 for (i = 0; i < TEST_EFFECT_PRES_NOPTESTS; ++i)
3828 float *v;
3830 hr = IDirect3DDevice9_GetLight(device, i % 8, &light);
3831 v = i < 8 ? &light.Diffuse.r : &light.Ambient.r;
3832 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3833 for (j = 0; j < 4; ++j)
3835 todo_wine_if(test_effect_preshader_op_results[i].todo[j])
3836 ok(compare_float(v[j], ((float *)test_effect_preshader_op_results[i].result)[j],
3837 test_effect_preshader_op_results[i].ulps),
3838 "Operation %s, component %u, expected %#x, got %#x (%g).\n",
3839 test_effect_preshader_op_results[i].comment, j,
3840 test_effect_preshader_op_results[i].result[j], ((unsigned int *)v)[j], v[j]);
3844 hr = effect->lpVtbl->EndPass(effect);
3846 par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect");
3847 ok(par != NULL, "GetParameterByName failed.\n");
3848 hr = effect->lpVtbl->SetVector(effect, par, &fvect2);
3849 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
3850 hr = effect->lpVtbl->BeginPass(effect, 1);
3851 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3853 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3854 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3855 ok(!!vshader, "Got NULL vshader.\n");
3857 hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size);
3858 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3859 byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size);
3860 hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size);
3861 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3862 ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size);
3863 ok(!memcmp(byte_code,
3864 &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS +
3865 TEST_EFFECT_PRESHADER_VSHADER_LEN], byte_code_size),
3866 "Incorrect shader selected.\n");
3867 HeapFree(GetProcessHeap(), 0, byte_code);
3868 IDirect3DVertexShader9_Release(vshader);
3870 hr = IDirect3DDevice9_SetVertexShader(device, NULL);
3871 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3873 hr = effect->lpVtbl->SetVector(effect, par, &fvect1);
3874 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
3875 hr = effect->lpVtbl->CommitChanges(effect);
3876 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3877 hr = IDirect3DDevice9_GetVertexShader(device, &vshader);
3878 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3879 ok(!vshader, "Incorrect shader selected.\n");
3881 hr = effect->lpVtbl->EndPass(effect);
3882 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3884 hr = effect->lpVtbl->End(effect);
3885 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3886 effect->lpVtbl->Release(effect);
3889 struct test_preshader_op_def
3891 const char *mnem;
3892 unsigned int opcode;
3893 unsigned int args_count;
3894 unsigned int expected_result[4];
3895 D3DXVECTOR4 fvect1, fvect2;
3896 unsigned int ulps;
3897 BOOL todo[4];
3900 static void test_preshader_op(IDirect3DDevice9 *device, const DWORD *sample_effect_blob,
3901 unsigned int sample_effect_blob_size, const struct test_preshader_op_def *test)
3903 static const struct
3905 unsigned int pos;
3906 unsigned int result_index;
3908 blob_position[] =
3910 {0, 0},
3911 {2468, 0},
3912 {2319, 2}
3914 DWORD *test_effect_blob;
3915 HRESULT hr;
3916 ID3DXEffect *effect;
3917 D3DLIGHT9 light;
3918 unsigned int i, passes_count;
3919 float *v;
3920 unsigned int op_pos, op_step;
3921 D3DXHANDLE param;
3923 op_step = 2 + (test->args_count + 1) * 3;
3924 op_pos = blob_position[test->args_count].pos;
3926 test_effect_blob = HeapAlloc(GetProcessHeap(), 0, sample_effect_blob_size);
3927 memcpy(test_effect_blob, sample_effect_blob, sample_effect_blob_size);
3928 for (i = 0; i < 4; ++i)
3929 test_effect_blob[op_pos + i * op_step] = test->opcode;
3931 hr = D3DXCreateEffect(device, test_effect_blob, sample_effect_blob_size,
3932 NULL, NULL, 0, NULL, &effect, NULL);
3933 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3934 hr = effect->lpVtbl->Begin(effect, &passes_count, 0);
3935 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3937 param = effect->lpVtbl->GetParameterByName(effect, NULL, "opvect1");
3938 ok(!!param, "GetParameterByName failed.\n");
3939 hr = effect->lpVtbl->SetVector(effect, param, &test->fvect1);
3940 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
3942 if (test->args_count > 1)
3944 param = effect->lpVtbl->GetParameterByName(effect, NULL, "opvect2");
3945 ok(!!param, "GetParameterByName failed.\n");
3946 hr = effect->lpVtbl->SetVector(effect, param, &test->fvect2);
3947 ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr);
3950 hr = effect->lpVtbl->BeginPass(effect, 0);
3951 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3953 hr = IDirect3DDevice9_GetLight(device, blob_position[test->args_count].result_index, &light);
3954 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3955 v = &light.Diffuse.r;
3956 for (i = 0; i < 4; ++i)
3957 todo_wine_if(test->todo[i])
3958 ok(compare_float(v[i], ((float *)test->expected_result)[i], test->ulps),
3959 "Operation %s, component %u, expected %#x (%g), got %#x (%g).\n", test->mnem, i,
3960 test->expected_result[i], ((float *)test->expected_result)[i], ((unsigned int *)v)[i], v[i]);
3962 hr = effect->lpVtbl->EndPass(effect);
3963 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3964 hr = effect->lpVtbl->End(effect);
3965 ok(hr == D3D_OK, "Got result %#x.\n", hr);
3966 effect->lpVtbl->Release(effect);
3967 HeapFree(GetProcessHeap(), 0, test_effect_blob);
3970 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
3972 static const struct test_preshader_op_def op_tests[] =
3974 {"exp", 0x10500001, 1, {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000},
3975 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
3977 unsigned int i;
3979 for (i = 0; i < ARRAY_SIZE(op_tests); ++i)
3980 test_preshader_op(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob),
3981 &op_tests[i]);
3984 START_TEST(effect)
3986 HWND wnd;
3987 IDirect3D9 *d3d;
3988 IDirect3DDevice9 *device;
3989 D3DPRESENT_PARAMETERS d3dpp;
3990 HRESULT hr;
3991 ULONG count;
3993 if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
3994 640, 480, NULL, NULL, NULL, NULL)))
3996 skip("Couldn't create application window\n");
3997 return;
3999 if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION)))
4001 skip("Couldn't create IDirect3D9 object\n");
4002 DestroyWindow(wnd);
4003 return;
4006 ZeroMemory(&d3dpp, sizeof(d3dpp));
4007 d3dpp.Windowed = TRUE;
4008 d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
4009 hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
4010 if (FAILED(hr)) {
4011 skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
4012 IDirect3D9_Release(d3d);
4013 DestroyWindow(wnd);
4014 return;
4017 test_create_effect_and_pool(device);
4018 test_create_effect_compiler();
4019 test_effect_parameter_value(device);
4020 test_effect_setvalue_object(device);
4021 test_effect_variable_names(device);
4022 test_effect_compilation_errors(device);
4023 test_effect_states(device);
4024 test_effect_preshader(device);
4025 test_effect_preshader_ops(device);
4027 count = IDirect3DDevice9_Release(device);
4028 ok(count == 0, "The device was not properly freed: refcount %u\n", count);
4030 count = IDirect3D9_Release(d3d);
4031 ok(count == 0, "Release failed %u\n", count);
4033 DestroyWindow(wnd);