Newer
Older

Francisco Casas
committed
[pixel shader]
struct apple
{
float3 aa;
int bb;
};
float4 main() : sv_target
{
float f[4] = {1, 2, 3, 4};
struct apple a;
a = (struct apple) f;
return a.aa.xyzx;
}
[test]
draw quad
probe all rgba (1.0, 2.0, 3.0, 1.0)

Francisco Casas
committed
[pixel shader]
struct apple
{
float3 aa;
int bb;
float cc;
};
float4 main() : sv_target
{
struct apple a = {5, 6, 7, 8.8, 9.0};
float f[4];
f = (float[4]) a;
return float4(f);
}
[test]
draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)

Francisco Casas
committed
[pixel shader]
float4 main() : sv_target
{
float f[6] = {1, 2, 3, 4, 5, 6};
int i[4];
i = (int[4]) f;
return float4(i[0], i[1], i[2], i[3]);
}
[test]
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)

Francisco Casas
committed
[pixel shader]
Texture2D tex;
struct apple
{
int2 aa;
Texture2D bb;
float cc;
};
struct banana
{
float aa[2];
Texture2D bb;
int cc;
};
float4 main() : sv_target
{
struct apple a = {1, 2, tex, 7.2};
struct banana b;
b = (struct banana) a;
return b.cc;
}
[test]
draw quad
probe all rgba (7.0, 7.0, 7.0, 7.0)

Francisco Casas
committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[pixel shader]
Texture2D tex;
struct apple
{
int2 aa;
Texture2D bb;
float cc;
float4 dd;
Texture2D ee;
};
struct banana
{
float aa[2];
Texture2D bb;
int cc;
};
float4 main() : sv_target
{
struct apple a = {1, 2, tex, 3, 4, 5, 6, 7, tex};
struct banana b;
b = (struct banana) a;
return b.cc;
}
[test]
draw quad
probe all rgba (3.0, 3.0, 3.0, 3.0)

Francisco Casas
committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[pixel shader fail]
struct apple
{
int2 aa;
float bb;
};
struct banana
{
int2 aa;
float bb;
float cc;
};
float4 main() : sv_target
{
struct apple a = {1, 2, 3};
struct banana b;
b = (struct banana) a;
return b.bb;
}
[pixel shader]
float4 main() : sv_target
{
float4 v = float4(10.1, 20.2, 30.3, 40.4);
int i[3];
i = (int[3]) v;
return float4(i[0], i[1], i[2], i[2]);
}
[test]

Francisco Casas
committed
draw quad
probe all rgba (10.0, 20.0, 30.0, 30.0)

Francisco Casas
committed
[pixel shader]
struct apple
{
int aa;
float bb[2];
};
float4 main() : sv_target
{
float4 f = {10.4, 11.4, 12.4, 13.4};
struct apple a;
a = (struct apple) f;
return float4(a.aa, a.aa, a.bb[0], a.bb[1]);
}
[test]

Francisco Casas
committed
draw quad
probe all rgba (10.0, 10.0, 11.4, 12.4)
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
[pixel shader]
float4 main() : sv_target
{
float f[5] = {11, 12, 13, 14, 15};
int4 i;
i = (int4) f;
return i;
}
[test]
draw quad
probe all rgba (11.0, 12.0, 13.0, 14.0)
[pixel shader]
struct apple
{
int2 aa;
float bb[2];
float cc;
};
float4 main() : sv_target
{
struct apple a = {21, 22, 23.4, 24.4, 25.0};
int4 i;
i = (int4) a;
return i;
}
[test]
draw quad
probe all rgba (21.0, 22.0, 23.0, 24.0)
[pixel shader]
float4 main() : sv_target
{
float4 f = {31.4, 32.4, 33.4, 34.4};
int3 i;
i = (int3) f;
return float4(i.x, i.y, i.z, i.z);
}
[test]
draw quad
probe all rgba (31.0, 32.0, 33.0, 33.0)
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
[pixel shader]
struct apple
{
int2 aa;
float2 bb;
};
float4 main() : sv_target
{
struct apple a = {41, 42, 43, 44};
float2x2 mat;
mat = (float2x2) a;
return float4(mat);
}
[test]
draw quad
probe all rgba (41.0, 42.0, 43.0, 44.0)
[pixel shader fail]
struct apple
{
float2 aa;
float3 bb;
};
float4 main() : sv_target
{
struct apple a = {1, 2, 3, 4, 5};
float2x2 mat;
mat = (float2x2) a;
return float4(mat);
}
[pixel shader]
struct apple
{
float3 aa;
int bb;
};
float4 main() : sv_target
{
float2x2 mat = {55, 56, 57, 58};
struct apple a;
a = (struct apple) mat;
return float4(a.aa, a.bb);
}
[test]
draw quad
probe all rgba (55.0, 56.0, 57.0, 58.0)
[pixel shader fail]
struct apple
{
float2 aa;
float2 bb;
};
float4 main() : sv_target
{
float3x2 mat = {1, 2, 3, 4, 5, 6};
struct apple a;
a = (struct apple) mat;
return float4(a.aa, a.bb);
}
[pixel shader]
float4 main() : sv_target
{
float arr[4] = {61, 62, 63, 64};
int2x2 mat;
mat = (int2x2) arr;
return float4(mat);
}
[test]
draw quad
probe all rgba (61.0, 62.0, 63.0, 64.0)
[pixel shader fail]
float4 main() : sv_target
{
float arr[5] = {1, 2, 3, 4, 5};
float2x2 mat;
mat = (float2x2) arr;
return float4(mat);
}
[pixel shader]
float4 main() : sv_target
{
float2x2 mat = {71, 72, 73, 74};
int arr[4];
arr = (int[4]) mat;
return float4(arr);
}
[test]
draw quad
probe all rgba (71.0, 72.0, 73.0, 74.0)
[pixel shader fail]
float4 main() : sv_target
{
float2x2 mat = {1, 2, 3, 4};
int arr[3];
arr = (int[3]) mat;
return 0;
}
[pixel shader fail]
float4 main() : sv_target
{
float2x2 mat = {1, 2, 3, 4};
float3 vec;
vec = (float3) mat;
return 0;
}

Francisco Casas
committed
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
[pixel shader fail]
float4 main() : sv_target
{
float arr[5] = {1, 2, 3, 4, 5};
float4x1 mat;
mat = (float4x1) arr;
return 0;
}
[pixel shader]
float4 main() : sv_target
{
float arr[5] = {81, 82, 83, 84, 85};
int1x4 mat;
mat = (int1x4) arr;
return float4(mat);
}
[test]
draw quad
probe all rgba (81.0, 82.0, 83.0, 84.0)
[pixel shader]
float4 main() : sv_target
{
float4x1 mat = {91, 92, 93, 94};
int arr[3];
arr = (int[3]) mat;
return float4(arr, 0);
}
[test]
draw quad
probe all rgba (91.0, 92.0, 93.0, 0.0)
[pixel shader]
float4 main() : sv_target
{
float1x4 mat = {11, 12, 13, 14};
int arr[3];
arr = (int[3]) mat;
return float4(arr, 0);
}
[test]
draw quad
probe all rgba (11.0, 12.0, 13.0, 0.0)
[pixel shader fail]
struct apple
{
float3 aa;
float2 bb;
};
float4 main() : sv_target
{
struct apple a = {1, 2, 3, 4, 5};
float4x1 mat;
mat = (float4x1) a;
return 0;
}
[pixel shader]
struct apple
{
float3 aa;
float2 bb;
};
float4 main() : sv_target
{
struct apple a = {21, 22, 23, 24, 25};
float1x4 mat;
mat = (float1x4) a;
return float4(mat);
}
[test]
draw quad
probe all rgba (21.0, 22.0, 23.0, 24.0)
[pixel shader]
struct apple
{
int aa;
float2 bb;
};
float4 main() : sv_target
{
float4x1 mat = {31, 32, 33, 34};
struct apple a;
a = (struct apple) mat;
return float4(a.aa, a.bb, 0);
}
[test]
draw quad
probe all rgba (31.0, 32.0, 33.0, 0.0)
[pixel shader]
struct apple
{
int aa;
float2 bb;
};
float4 main() : sv_target
{
float1x4 mat = {41, 42, 43, 44};
struct apple a;
a = (struct apple) mat;
return float4(a.aa, a.bb, 0);
}
[test]
draw quad
probe all rgba (41.0, 42.0, 43.0, 0.0)
[pixel shader]
float4 main() : sv_target
{
float4 vec = {51, 52, 53, 54};
int1x3 mat;
mat = (int1x3) vec;
return float4(mat, 0);
}
[test]
draw quad
probe all rgba (51.0, 52.0, 53.0, 0.0)
[pixel shader fail]
float4 main() : sv_target
{
float4 vec = {1, 2, 3, 4};
float3x1 mat;
mat = (float3x1) vec;
return 0;
}
[pixel shader]
float4 main() : sv_target
{
float1x4 mat = {61, 62, 63, 64};
int3 vec;
vec = (int1x3) mat;
return float4(vec, 0);
}
[test]
draw quad
probe all rgba (61.0, 62.0, 63.0, 0.0)
[pixel shader]
float4 main() : sv_target
{
float4x1 mat = {71, 72, 73, 74};
int3 vec;
vec = (int3) mat;
return float4(vec, 0);
}
[test]
draw quad
probe all rgba (71.0, 72.0, 73.0, 0.0)