Add lerp, fix sincos return type, ret type tests, non-square mats, HLSL->AST tx semantics

This commit is contained in:
LoopDawg
2016-06-20 13:26:59 -06:00
parent a4a4d5e22c
commit 4624a02e21
9 changed files with 9098 additions and 5755 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -17,69 +17,70 @@ float PixelShaderFunction(float inF0, float inF1, float inF2, uint inU0, uint in
{
uint out_u1;
all(inF0);
abs(inF0);
acos(inF0);
any(inF0);
asin(inF0);
asint(inF0);
asuint(inF0);
asfloat(inU0);
bool r000 = all(inF0);
float r001 = abs(inF0);
float r002 = acos(inF0);
bool r003 = any(inF0);
float r004 = asin(inF0);
int r005 = asint(inF0);
uint r006 = asuint(inF0);
float r007 = asfloat(inU0);
// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
atan(inF0);
atan2(inF0, inF1);
ceil(inF0);
clamp(inF0, inF1, inF2);
float r009 = atan(inF0);
float r010 = atan2(inF0, inF1);
float r011 = ceil(inF0);
float r012 = clamp(inF0, inF1, inF2);
clip(inF0);
cos(inF0);
cosh(inF0);
countbits(7);
ddx(inF0);
ddx_coarse(inF0);
ddx_fine(inF0);
ddy(inF0);
ddy_coarse(inF0);
ddy_fine(inF0);
degrees(inF0);
float r014 = cos(inF0);
float r015 = cosh(inF0);
uint r016 = countbits(7);
float r017 = ddx(inF0);
float r018 = ddx_coarse(inF0);
float r019 = ddx_fine(inF0);
float r020 = ddy(inF0);
float r021 = ddy_coarse(inF0);
float r022 = ddy_fine(inF0);
float r023 = degrees(inF0);
// EvaluateAttributeAtCentroid(inF0);
// EvaluateAttributeAtSample(inF0, 0);
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
exp(inF0);
exp2(inF0);
firstbithigh(7);
firstbitlow(7);
floor(inF0);
float r027 = exp(inF0);
float r028 = exp2(inF0);
uint r029 = firstbithigh(7);
uint r030 = firstbitlow(7);
float r031 = floor(inF0);
// TODO: fma(inD0, inD1, inD2);
fmod(inF0, inF1);
frac(inF0);
frexp(inF0, inF1);
fwidth(inF0);
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
log(inF0);
log10(inF0);
log2(inF0);
max(inF0, inF1);
min(inF0, inF1);
pow(inF0, inF1);
radians(inF0);
rcp(inF0);
reversebits(2);
round(inF0);
rsqrt(inF0);
saturate(inF0);
sign(inF0);
sin(inF0);
float r033 = fmod(inF0, inF1);
float r034 = frac(inF0);
float r035 = frexp(inF0, inF1);
float r036 = fwidth(inF0);
bool r037 = isinf(inF0);
bool r038 = isnan(inF0);
float r039 = ldexp(inF0, inF1);
float r039a = lerp(inF0, inF1, inF2);
float r040 = log(inF0);
float r041 = log10(inF0);
float r042 = log2(inF0);
float r043 = max(inF0, inF1);
float r044 = min(inF0, inF1);
float r045 = pow(inF0, inF1);
float r046 = radians(inF0);
float r047 = rcp(inF0);
uint r048 = reversebits(2);
float r049 = round(inF0);
float r050 = rsqrt(inF0);
float r051 = saturate(inF0);
float r052 = sign(inF0);
float r053 = sin(inF0);
sincos(inF0, inF1, inF2);
sinh(inF0);
smoothstep(inF0, inF1, inF2);
sqrt(inF0);
step(inF0, inF1);
tan(inF0);
tanh(inF0);
float r055 = sinh(inF0);
float r056 = smoothstep(inF0, inF1, inF2);
float r057 = sqrt(inF0);
float r058 = step(inF0, inF1);
float r059 = tan(inF0);
float r060 = tanh(inF0);
// TODO: sampler intrinsics, when we can declare the types.
trunc(inF0);
float r061 = trunc(inF0);
return 0.0;
}
@@ -94,76 +95,80 @@ float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, ui
{
uint2 out_u2;
all(inF0);
abs(inF0);
acos(inF0);
any(inF0);
asin(inF0);
asint(inF0);
asuint(inF0);
asfloat(inU0);
bool r000 = all(inF0);
float2 r001 = abs(inF0);
float2 r002 = acos(inF0);
bool r003 = any(inF0);
float2 r004 = asin(inF0);
int2 r005 = asint(inF0);
uint2 r006 = asuint(inF0);
float2 r007 = asfloat(inU0);
// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
atan(inF0);
atan2(inF0, inF1);
ceil(inF0);
clamp(inF0, inF1, inF2);
float2 r009 = atan(inF0);
float2 r010 = atan2(inF0, inF1);
float2 r011 = ceil(inF0);
float2 r012 = clamp(inF0, inF1, inF2);
clip(inF0);
cos(inF0);
cosh(inF0);
countbits(int2(7,3));
ddx(inF0);
ddx_coarse(inF0);
ddx_fine(inF0);
ddy(inF0);
ddy_coarse(inF0);
ddy_fine(inF0);
degrees(inF0);
distance(inF0, inF1);
dot(inF0, inF1);
float2 r013 = cos(inF0);
float2 r015 = cosh(inF0);
uint2 r016 = countbits(int2(7,3));
float2 r017 = ddx(inF0);
float2 r018 = ddx_coarse(inF0);
float2 r019 = ddx_fine(inF0);
float2 r020 = ddy(inF0);
float2 r021 = ddy_coarse(inF0);
float2 r022 = ddy_fine(inF0);
float2 r023 = degrees(inF0);
// EvaluateAttributeAtCentroid(inF0);
// EvaluateAttributeAtSample(inF0, 0);
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
exp(inF0);
exp2(inF0);
faceforward(inF0, inF1, inF2);
firstbithigh(7);
firstbitlow(7);
floor(inF0);
float r026 = distance(inF0, inF1);
float r027 = dot(inF0, inF1);
// EvaluateAttributeAtCentroid(inF0);
// EvaluateAttributeAtSample(inF0, 0);
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
float2 r028 = exp(inF0);
float2 r029 = exp2(inF0);
float2 r030 = faceforward(inF0, inF1, inF2);
uint2 r031 = firstbithigh(uint2(7,8));
uint2 r032 = firstbitlow(uint2(7,8));
float2 r033 = floor(inF0);
// TODO: fma(inD0, inD1, inD2);
fmod(inF0, inF1);
frac(inF0);
frexp(inF0, inF1);
fwidth(inF0);
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
length(inF0);
log(inF0);
log10(inF0);
log2(inF0);
max(inF0, inF1);
min(inF0, inF1);
normalize(inF0);
pow(inF0, inF1);
radians(inF0);
rcp(inF0);
reflect(inF0, inF1);
refract(inF0, inF1, 2.0);
reversebits(int2(1,2));
round(inF0);
rsqrt(inF0);
saturate(inF0);
sign(inF0);
sin(inF0);
float2 r035 = fmod(inF0, inF1);
float2 r036 = frac(inF0);
float2 r037 = frexp(inF0, inF1);
float2 r038 = fwidth(inF0);
bool2 r039 = isinf(inF0);
bool2 r040 = isnan(inF0);
float2 r041 = ldexp(inF0, inF1);
float2 r039a = lerp(inF0, inF1, inF2);
float r042 = length(inF0);
float2 r043 = log(inF0);
float2 r044 = log10(inF0);
float2 r045 = log2(inF0);
float2 r046 = max(inF0, inF1);
float2 r047 = min(inF0, inF1);
float2 r048 = normalize(inF0);
float2 r049 = pow(inF0, inF1);
float2 r050 = radians(inF0);
float2 r051 = rcp(inF0);
float2 r052 = reflect(inF0, inF1);
float2 r053 = refract(inF0, inF1, 2.0);
uint2 r054 = reversebits(uint2(1,2));
float2 r055 = round(inF0);
float2 r056 = rsqrt(inF0);
float2 r057 = saturate(inF0);
float2 r058 = sign(inF0);
float2 r059 = sin(inF0);
sincos(inF0, inF1, inF2);
sinh(inF0);
smoothstep(inF0, inF1, inF2);
sqrt(inF0);
step(inF0, inF1);
tan(inF0);
tanh(inF0);
float2 r060 = sinh(inF0);
float2 r061 = smoothstep(inF0, inF1, inF2);
float2 r062 = sqrt(inF0);
float2 r063 = step(inF0, inF1);
float2 r064 = tan(inF0);
float2 r065 = tanh(inF0);
// TODO: sampler intrinsics, when we can declare the types.
trunc(inF0);
float2 r066 = trunc(inF0);
// TODO: ... add when float1 prototypes are generated
return float2(1,2);
@@ -173,77 +178,78 @@ float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, ui
{
uint3 out_u3;
all(inF0);
abs(inF0);
acos(inF0);
any(inF0);
asin(inF0);
asint(inF0);
asuint(inF0);
asfloat(inU0);
bool r000 = all(inF0);
float3 r001 = abs(inF0);
float3 r002 = acos(inF0);
bool r003 = any(inF0);
float3 r004 = asin(inF0);
int3 r005 = asint(inF0);
uint3 r006 = asuint(inF0);
float3 r007 = asfloat(inU0);
// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
atan(inF0);
atan2(inF0, inF1);
ceil(inF0);
clamp(inF0, inF1, inF2);
float3 r009 = atan(inF0);
float3 r010 = atan2(inF0, inF1);
float3 r011 = ceil(inF0);
float3 r012 = clamp(inF0, inF1, inF2);
clip(inF0);
cos(inF0);
cosh(inF0);
countbits(int3(7,3,5));
cross(inF0, inF1);
ddx(inF0);
ddx_coarse(inF0);
ddx_fine(inF0);
ddy(inF0);
ddy_coarse(inF0);
ddy_fine(inF0);
degrees(inF0);
distance(inF0, inF1);
dot(inF0, inF1);
float3 r013 = cos(inF0);
float3 r014 = cosh(inF0);
uint3 r015 = countbits(uint3(7,3,5));
float3 r016 = cross(inF0, inF1);
float3 r017 = ddx(inF0);
float3 r018 = ddx_coarse(inF0);
float3 r019 = ddx_fine(inF0);
float3 r020 = ddy(inF0);
float3 r021 = ddy_coarse(inF0);
float3 r022 = ddy_fine(inF0);
float3 r023 = degrees(inF0);
float r024 = distance(inF0, inF1);
float r025 = dot(inF0, inF1);
// EvaluateAttributeAtCentroid(inF0);
// EvaluateAttributeAtSample(inF0, 0);
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
exp(inF0);
exp2(inF0);
faceforward(inF0, inF1, inF2);
firstbithigh(7);
firstbitlow(7);
floor(inF0);
float3 r029 = exp(inF0);
float3 r030 = exp2(inF0);
float3 r031 = faceforward(inF0, inF1, inF2);
uint3 r032 = firstbithigh(uint3(2,3,4));
uint3 r033 = firstbitlow(uint3(2,3,4));
float3 r034 = floor(inF0);
// TODO: fma(inD0, inD1, inD2);
fmod(inF0, inF1);
frac(inF0);
frexp(inF0, inF1);
fwidth(inF0);
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
length(inF0);
log(inF0);
log10(inF0);
log2(inF0);
max(inF0, inF1);
min(inF0, inF1);
normalize(inF0);
pow(inF0, inF1);
radians(inF0);
rcp(inF0);
reflect(inF0, inF1);
refract(inF0, inF1, 2.0);
reversebits(int3(1,2,3));
round(inF0);
rsqrt(inF0);
saturate(inF0);
sign(inF0);
sin(inF0);
float3 r036 = fmod(inF0, inF1);
float3 r037 = frac(inF0);
float3 r038 = frexp(inF0, inF1);
float3 r039 = fwidth(inF0);
bool3 r040 = isinf(inF0);
bool3 r041 = isnan(inF0);
float3 r042 = ldexp(inF0, inF1);
float3 r039a = lerp(inF0, inF1, inF2);
float r043 = length(inF0);
float3 r044 = log(inF0);
float3 r045 = log10(inF0);
float3 r046 = log2(inF0);
float3 r047 = max(inF0, inF1);
float3 r048 = min(inF0, inF1);
float3 r049 = normalize(inF0);
float3 r050 = pow(inF0, inF1);
float3 r051 = radians(inF0);
float3 r052 = rcp(inF0);
float3 r053 = reflect(inF0, inF1);
float3 r054 = refract(inF0, inF1, 2.0);
uint3 r055 = reversebits(uint3(1,2,3));
float3 r056 = round(inF0);
float3 r057 = rsqrt(inF0);
float3 r058 = saturate(inF0);
float3 r059 = sign(inF0);
float3 r060 = sin(inF0);
sincos(inF0, inF1, inF2);
sinh(inF0);
smoothstep(inF0, inF1, inF2);
sqrt(inF0);
step(inF0, inF1);
tan(inF0);
tanh(inF0);
float3 r061 = sinh(inF0);
float3 r062 = smoothstep(inF0, inF1, inF2);
float3 r063 = sqrt(inF0);
float3 r064 = step(inF0, inF1);
float3 r065 = tan(inF0);
float3 r066 = tanh(inF0);
// TODO: sampler intrinsics, when we can declare the types.
trunc(inF0);
float3 r067 = trunc(inF0);
// TODO: ... add when float1 prototypes are generated
return float3(1,2,3);
@@ -253,77 +259,78 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, ui
{
uint4 out_u4;
all(inF0);
abs(inF0);
acos(inF0);
any(inF0);
asin(inF0);
asint(inF0);
asuint(inF0);
asfloat(inU0);
bool r000 = all(inF0);
float4 r001 = abs(inF0);
float4 r002 = acos(inF0);
bool r003 = any(inF0);
float4 r004 = asin(inF0);
int4 r005 = asint(inF0);
uint4 r006 = asuint(inF0);
float4 r007 = asfloat(inU0);
// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics
atan(inF0);
atan2(inF0, inF1);
ceil(inF0);
clamp(inF0, inF1, inF2);
float4 r009 = atan(inF0);
float4 r010 = atan2(inF0, inF1);
float4 r011 = ceil(inF0);
float4 r012 = clamp(inF0, inF1, inF2);
clip(inF0);
cos(inF0);
cosh(inF0);
countbits(int4(7,3,5,2));
ddx(inF0);
ddx_coarse(inF0);
ddx_fine(inF0);
ddy(inF0);
ddy_coarse(inF0);
ddy_fine(inF0);
degrees(inF0);
distance(inF0, inF1);
dot(inF0, inF1);
dst(inF0, inF1);
float4 r013 = cos(inF0);
float4 r014 = cosh(inF0);
uint4 r015 = countbits(uint4(7,3,5,2));
float4 r016 = ddx(inF0);
float4 r017 = ddx_coarse(inF0);
float4 r018 = ddx_fine(inF0);
float4 r019 = ddy(inF0);
float4 r020 = ddy_coarse(inF0);
float4 r021 = ddy_fine(inF0);
float4 r022 = degrees(inF0);
float r023 = distance(inF0, inF1);
float r024 = dot(inF0, inF1);
float4 r025 = dst(inF0, inF1);
// EvaluateAttributeAtCentroid(inF0);
// EvaluateAttributeAtSample(inF0, 0);
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
exp(inF0);
exp2(inF0);
faceforward(inF0, inF1, inF2);
firstbithigh(7);
firstbitlow(7);
floor(inF0);
float4 r029 = exp(inF0);
float4 r030 = exp2(inF0);
float4 r031 = faceforward(inF0, inF1, inF2);
uint4 r032 = firstbithigh(uint4(7,8,9,10));
uint4 r033 = firstbitlow(uint4(7,8,9,10));
float4 r034 = floor(inF0);
// TODO: fma(inD0, inD1, inD2);
fmod(inF0, inF1);
frac(inF0);
frexp(inF0, inF1);
fwidth(inF0);
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
length(inF0);
log(inF0);
log10(inF0);
log2(inF0);
max(inF0, inF1);
min(inF0, inF1);
normalize(inF0);
pow(inF0, inF1);
radians(inF0);
rcp(inF0);
reflect(inF0, inF1);
refract(inF0, inF1, 2.0);
reversebits(int4(1,2,3,4));
round(inF0);
rsqrt(inF0);
saturate(inF0);
sign(inF0);
sin(inF0);
float4 r036 = fmod(inF0, inF1);
float4 r037 = frac(inF0);
float4 r038 = frexp(inF0, inF1);
float4 r039 = fwidth(inF0);
bool4 r040 = isinf(inF0);
bool4 r041 = isnan(inF0);
float4 r042 = ldexp(inF0, inF1);
float4 r039a = lerp(inF0, inF1, inF2);
float r043 = length(inF0);
float4 r044 = log(inF0);
float4 r045 = log10(inF0);
float4 r046 = log2(inF0);
float4 r047 = max(inF0, inF1);
float4 r048 = min(inF0, inF1);
float4 r049 = normalize(inF0);
float4 r050 = pow(inF0, inF1);
float4 r051 = radians(inF0);
float4 r052 = rcp(inF0);
float4 r053 = reflect(inF0, inF1);
float4 r054 = refract(inF0, inF1, 2.0);
uint4 r055 = reversebits(uint4(1,2,3,4));
float4 r056 = round(inF0);
float4 r057 = rsqrt(inF0);
float4 r058 = saturate(inF0);
float4 r059 = sign(inF0);
float4 r060 = sin(inF0);
sincos(inF0, inF1, inF2);
sinh(inF0);
smoothstep(inF0, inF1, inF2);
sqrt(inF0);
step(inF0, inF1);
tan(inF0);
tanh(inF0);
float4 r061 = sinh(inF0);
float4 r062 = smoothstep(inF0, inF1, inF2);
float4 r063 = sqrt(inF0);
float4 r064 = step(inF0, inF1);
float4 r065 = tan(inF0);
float4 r066 = tanh(inF0);
// TODO: sampler intrinsics, when we can declare the types.
trunc(inF0);
float4 r067 = trunc(inF0);
// TODO: ... add when float1 prototypes are generated
return float4(1,2,3,4);
@@ -335,65 +342,64 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, ui
// asuint(inF0); \
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
#define MATFNS() \
all(inF0); \
abs(inF0); \
acos(inF0); \
any(inF0); \
asin(inF0); \
atan(inF0); \
atan2(inF0, inF1); \
ceil(inF0); \
clip(inF0); \
clamp(inF0, inF1, inF2); \
cos(inF0); \
cosh(inF0); \
ddx(inF0); \
ddx_coarse(inF0); \
ddx_fine(inF0); \
ddy(inF0); \
ddy_coarse(inF0); \
ddy_fine(inF0); \
degrees(inF0); \
determinant(inF0); \
exp(inF0); \
exp2(inF0); \
firstbithigh(7); \
firstbitlow(7); \
floor(inF0); \
fmod(inF0, inF1); \
frac(inF0); \
frexp(inF0, inF1); \
fwidth(inF0); \
ldexp(inF0, inF1); \
log(inF0); \
log10(inF0); \
log2(inF0); \
max(inF0, inF1); \
min(inF0, inF1); \
pow(inF0, inF1); \
radians(inF0); \
round(inF0); \
rsqrt(inF0); \
saturate(inF0); \
sign(inF0); \
sin(inF0); \
sincos(inF0, inF1, inF2); \
sinh(inF0); \
smoothstep(inF0, inF1, inF2); \
sqrt(inF0); \
step(inF0, inF1); \
tan(inF0); \
tanh(inF0); \
transpose(inF0); \
trunc(inF0);
#define MATFNS(MT) \
bool r000 = all(inF0); \
MT r001 = abs(inF0); \
acos(inF0); \
bool r003 = any(inF0); \
MT r004 = asin(inF0); \
MT r005 = atan(inF0); \
MT r006 = atan2(inF0, inF1); \
MT r007 = ceil(inF0); \
clip(inF0); \
MT r008 = clamp(inF0, inF1, inF2); \
MT r009 = cos(inF0); \
MT r010 = cosh(inF0); \
MT r011 = ddx(inF0); \
MT r012 = ddx_coarse(inF0); \
MT r013 = ddx_fine(inF0); \
MT r014 = ddy(inF0); \
MT r015 = ddy_coarse(inF0); \
MT r016 = ddy_fine(inF0); \
MT r017 = degrees(inF0); \
float r018 = determinant(inF0); \
MT r019 = exp(inF0); \
MT R020 = exp2(inF0); \
MT r021 = floor(inF0); \
MT r022 = fmod(inF0, inF1); \
MT r023 = frac(inF0); \
MT r024 = frexp(inF0, inF1); \
MT r025 = fwidth(inF0); \
MT r026 = ldexp(inF0, inF1); \
MT r026a = lerp(inF0, inF1, inF2); \
MT r027 = log(inF0); \
MT r028 = log10(inF0); \
MT r029 = log2(inF0); \
MT r030 = max(inF0, inF1); \
MT r031 = min(inF0, inF1); \
MT r032 = pow(inF0, inF1); \
MT r033 = radians(inF0); \
MT r034 = round(inF0); \
MT r035 = rsqrt(inF0); \
MT r036 = saturate(inF0); \
MT r037 = sign(inF0); \
MT r038 = sin(inF0); \
sincos(inF0, inF1, inF2); \
MT r039 = sinh(inF0); \
MT r049 = smoothstep(inF0, inF1, inF2); \
MT r041 = sqrt(inF0); \
MT r042 = step(inF0, inF1); \
MT r043 = tan(inF0); \
MT r044 = tanh(inF0); \
transpose(inF0); \
MT r046 = trunc(inF0);
// TODO: turn on non-square matrix tests when protos are available.
float2x2 PixelShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2)
{
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
MATFNS()
MATFNS(float2x2);
// TODO: ... add when float1 prototypes are generated
return float2x2(2,2,2,2);
@@ -402,7 +408,7 @@ float2x2 PixelShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2)
float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
{
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
MATFNS()
MATFNS(float3x3);
// TODO: ... add when float1 prototypes are generated
return float3x3(3,3,3,3,3,3,3,3,3);
@@ -411,7 +417,7 @@ float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
float4x4 PixelShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2)
{
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
MATFNS()
MATFNS(float4x4);
// TODO: ... add when float1 prototypes are generated
return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
@@ -449,3 +455,29 @@ void TestGenMul(float inF0, float inF1,
{
TESTGENMUL(float, float4, float4x4);
}
// Test some non-square mats
void TestGenMul(float inF0, float inF1,
float2 inFV2, float3 inFV3,
float2x3 inFM2x3, float3x2 inFM3x2,
float3x3 inFM3x3, float3x4 inFM3x4,
float2x4 inFM2x4)
{
float r00 = mul(inF0, inF1); // S=S*S
float2 r01 = mul(inFV2, inF0); // V=V*S
float3 r02 = mul(inFV3, inF0); // V=V*S
float2 r03 = mul(inF0, inFV2); // V=S*V
float3 r04 = mul(inF0, inFV3); // V=S*V
float r05 = mul(inFV2, inFV2); // S=V*V
float r06 = mul(inFV3, inFV3); // S=V*V
float3 r07 = mul(inFV2, inFM2x3); // V=V*M (return V dim is Mcols)
float2 r08 = mul(inFV3, inFM3x2); // V=V*M (return V dim is Mcols)
float2 r09 = mul(inFM2x3, inFV3); // V=M*V (return V dim is Mrows)
float3 r10 = mul(inFM3x2, inFV2); // V=M*V (return V dim is Mrows)
float2x3 r11 = mul(inFM2x3, inF0);
float3x2 r12 = mul(inFM3x2, inF0);
float2x2 r13 = mul(inFM2x3, inFM3x2);
float2x3 r14 = mul(inFM2x3, inFM3x3);
float2x4 r15 = mul(inFM2x3, inFM3x4);
float3x4 r16 = mul(inFM3x2, inFM2x4);
}

View File

@@ -32,6 +32,7 @@ float VertexShaderFunction(float inF0, float inF1, float inF2, uint inU0, uint i
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
lerp(inF0, inF1, inF2);
log(inF0);
log10(inF0);
log2(inF0);
@@ -102,6 +103,7 @@ float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, uint2 inU0, u
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
lerp(inF0, inF1, inF2);
length(inF0);
log(inF0);
log10(inF0);
@@ -172,6 +174,7 @@ float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, uint3 inU0, u
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
lerp(inF0, inF1, inF2);
length(inF0);
log(inF0);
log10(inF0);
@@ -242,6 +245,7 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, u
isinf(inF0);
isnan(inF0);
ldexp(inF0, inF1);
lerp(inF0, inF1, inF2);
length(inF0);
log(inF0);
log10(inF0);
@@ -303,6 +307,7 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, uint4 inU0, u
frac(inF0); \
frexp(inF0, inF1); \
ldexp(inF0, inF1); \
lerp(inF0, inF1, inF2); \
log(inF0); \
log10(inF0); \
log2(inF0); \
@@ -386,3 +391,29 @@ void TestGenMul(float inF0, float inF1,
{
TESTGENMUL(float, float4, float4x4);
}
// Test some non-square mats
void TestGenMul(float inF0, float inF1,
float2 inFV2, float3 inFV3,
float2x3 inFM2x3, float3x2 inFM3x2,
float3x3 inFM3x3, float3x4 inFM3x4,
float2x4 inFM2x4)
{
float r00 = mul(inF0, inF1); // S=S*S
float2 r01 = mul(inFV2, inF0); // V=V*S
float3 r02 = mul(inFV3, inF0); // V=V*S
float2 r03 = mul(inF0, inFV2); // V=S*V
float3 r04 = mul(inF0, inFV3); // V=S*V
float r05 = mul(inFV2, inFV2); // S=V*V
float r06 = mul(inFV3, inFV3); // S=V*V
float3 r07 = mul(inFV2, inFM2x3); // V=V*M (return V dim is Mcols)
float2 r08 = mul(inFV3, inFM3x2); // V=V*M (return V dim is Mcols)
float2 r09 = mul(inFM2x3, inFV3); // V=M*V (return V dim is Mrows)
float3 r10 = mul(inFM3x2, inFV2); // V=M*V (return V dim is Mrows)
float2x3 r11 = mul(inFM2x3, inF0);
float3x2 r12 = mul(inFM3x2, inF0);
float2x2 r13 = mul(inFM2x3, inFM3x2);
float2x3 r14 = mul(inFM2x3, inFM3x3);
float2x4 r15 = mul(inFM2x3, inFM3x4);
float3x4 r16 = mul(inFM3x2, inFM2x4);
}