20 lines
912 B
Plaintext
20 lines
912 B
Plaintext
|
|
uniform float4x4 testMatrix4x4; // = {1, 2, 3, 4, 5, 6, 7, 8, ...}
|
||
|
|
uniform half4 colorGreen, colorRed;
|
||
|
|
|
||
|
|
half4 main(float2 coords) {
|
||
|
|
const float4 constValA = half4(1, 2, 3, 4);
|
||
|
|
const float4 constValB = half4(5, 6, 7, 8);
|
||
|
|
float4 inputA = float4(testMatrix4x4[0]);
|
||
|
|
float4 inputB = float4(testMatrix4x4[1]);
|
||
|
|
float4 expected = float4(5, 17, 38, 70);
|
||
|
|
|
||
|
|
return (dot(inputA.x, inputB.x) == expected.x &&
|
||
|
|
dot(inputA.xy, inputB.xy) == expected.y &&
|
||
|
|
dot(inputA.xyz, inputB.xyz) == expected.z &&
|
||
|
|
dot(inputA.xyzw, inputB.xyzw) == expected.w &&
|
||
|
|
dot(constValA.x, constValB.x) == expected.x &&
|
||
|
|
dot(constValA.xy, constValB.xy) == expected.y &&
|
||
|
|
dot(constValA.xyz, constValB.xyz) == expected.z &&
|
||
|
|
dot(constValA.xyzw, constValB.xyzw) == expected.w) ? colorGreen : colorRed;
|
||
|
|
}
|