Initial implementation of direct-mapped subset of HLSL intrinsics with type subset.
This checkin implements about half of the HLSL intrinsics for a subset of their entire type support (but a useful subset). The uncommented lines in TBuiltInParseablesHlsl::identifyBuiltIns shows which are connected.
This commit is contained in:
parent
85b52f304d
commit
4b67732c13
16 changed files with 5433 additions and 37 deletions
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.assoc.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -35,7 +35,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -76,7 +76,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "a1"
|
||||
Name 10 "a2"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.float1.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 1-component vector of float)
|
||||
|
|
@ -31,7 +31,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 1-component vector of float)
|
||||
|
|
@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 11 "ShaderFunction(vf1;f1;"
|
||||
Name 9 "inFloat1"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.float4.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 4-component vector of float)
|
||||
|
|
@ -24,7 +24,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 4-component vector of float)
|
||||
|
|
@ -54,7 +54,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 11 "ShaderFunction(vf4;"
|
||||
Name 10 "input"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 4-component vector of float)
|
||||
|
|
@ -64,7 +64,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 4-component vector of float)
|
||||
|
|
@ -134,7 +134,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "input"
|
||||
Name 12 "AmbientIntensity"
|
||||
|
|
|
|||
2178
Test/baseResults/hlsl.intrinsics.frag.out
Normal file
2178
Test/baseResults/hlsl.intrinsics.frag.out
Normal file
File diff suppressed because it is too large
Load diff
1994
Test/baseResults/hlsl.intrinsics.vert.out
Normal file
1994
Test/baseResults/hlsl.intrinsics.vert.out
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.matType.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 1-component vector of float)
|
||||
|
|
@ -22,7 +22,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:1 move second child to first child (temp 1-component vector of float)
|
||||
|
|
@ -51,7 +51,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 11 "ShaderFunction(vf1;f1;"
|
||||
Name 9 "inFloat1"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.max.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -17,7 +17,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -40,7 +40,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "input1"
|
||||
Name 11 "input2"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.precedence.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:10 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -23,7 +23,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:10 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float)
|
||||
|
|
@ -52,7 +52,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "a1"
|
||||
Name 11 "a2"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.precedence2.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:10 Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int)
|
||||
|
|
@ -31,7 +31,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:10 Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int)
|
||||
|
|
@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 8 "a1"
|
||||
Name 10 "a2"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hlsl.sin.frag
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
|
||||
|
|
@ -15,7 +15,7 @@ gl_FragCoord origin is upper left
|
|||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 100
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
|
||||
|
|
@ -36,7 +36,7 @@ gl_FragCoord origin is upper left
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction"
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 100
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "input"
|
||||
2: TypeVoid
|
||||
|
|
|
|||
353
Test/hlsl.intrinsics.frag
Normal file
353
Test/hlsl.intrinsics.frag
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
float PixelShaderFunction(float inF0, float inF1, float inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
cos(inF0);
|
||||
cosh(inF0);
|
||||
countbits(7);
|
||||
ddx(inF0);
|
||||
ddx_coarse(inF0);
|
||||
ddx_fine(inF0);
|
||||
ddy(inF0);
|
||||
ddy_coarse(inF0);
|
||||
ddy_fine(inF0);
|
||||
degrees(inF0);
|
||||
// EvaluateAttributeAtCentroid(inF0);
|
||||
// EvaluateAttributeAtSample(inF0, 0);
|
||||
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
|
||||
exp(inF0);
|
||||
exp2(inF0);
|
||||
firstbithigh(7);
|
||||
firstbitlow(7);
|
||||
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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reversebits(2);
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float1 PixelShaderFunction(float1 inF0, float1 inF1, float1 inF2)
|
||||
{
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
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);
|
||||
// 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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int2(1,2));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float2(1,2);
|
||||
}
|
||||
|
||||
float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
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);
|
||||
// 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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int3(1,2,3));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float3(1,2,3);
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
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);
|
||||
// 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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int4(1,2,3,4));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float4(1,2,3,4);
|
||||
}
|
||||
|
||||
// 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); \
|
||||
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); \
|
||||
log2(inF0); \
|
||||
max(inF0, inF1); \
|
||||
min(inF0, inF1); \
|
||||
pow(inF0, inF1); \
|
||||
radians(inF0); \
|
||||
round(inF0); \
|
||||
rsqrt(inF0); \
|
||||
sign(inF0); \
|
||||
sin(inF0); \
|
||||
sinh(inF0); \
|
||||
smoothstep(inF0, inF1, inF2); \
|
||||
sqrt(inF0); \
|
||||
step(inF0, inF1); \
|
||||
tan(inF0); \
|
||||
tanh(inF0); \
|
||||
transpose(inF0); \
|
||||
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()
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float2x2(2,2,2,2);
|
||||
}
|
||||
|
||||
float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
|
||||
{
|
||||
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
|
||||
MATFNS()
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float3x3(3,3,3,3,3,3,3,3,3);
|
||||
}
|
||||
|
||||
float4x4 PixelShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2)
|
||||
{
|
||||
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
|
||||
MATFNS()
|
||||
|
||||
// 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);
|
||||
}
|
||||
323
Test/hlsl.intrinsics.vert
Normal file
323
Test/hlsl.intrinsics.vert
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
float VertexShaderFunction(float inF0, float inF1, float inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
cos(inF0);
|
||||
cosh(inF0);
|
||||
countbits(7);
|
||||
degrees(inF0);
|
||||
// EvaluateAttributeAtCentroid(inF0);
|
||||
// EvaluateAttributeAtSample(inF0, 0);
|
||||
// TODO: EvaluateAttributeSnapped(inF0, int2(1,2));
|
||||
exp(inF0);
|
||||
exp2(inF0);
|
||||
firstbithigh(7);
|
||||
firstbitlow(7);
|
||||
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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reversebits(2);
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2)
|
||||
{
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
cos(inF0);
|
||||
cosh(inF0);
|
||||
countbits(int2(7,3));
|
||||
degrees(inF0);
|
||||
distance(inF0, inF1);
|
||||
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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int2(1,2));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float2(1,2);
|
||||
}
|
||||
|
||||
float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
cos(inF0);
|
||||
cosh(inF0);
|
||||
countbits(int3(7,3,5));
|
||||
cross(inF0, inF1);
|
||||
degrees(inF0);
|
||||
distance(inF0, inF1);
|
||||
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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int3(1,2,3));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float3(1,2,3);
|
||||
}
|
||||
|
||||
float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2)
|
||||
{
|
||||
all(inF0);
|
||||
abs(inF0);
|
||||
acos(inF0);
|
||||
any(inF0);
|
||||
asin(inF0);
|
||||
atan(inF0);
|
||||
atan2(inF0, inF1);
|
||||
ceil(inF0);
|
||||
clamp(inF0, inF1, inF2);
|
||||
cos(inF0);
|
||||
cosh(inF0);
|
||||
countbits(int4(7,3,5,2));
|
||||
degrees(inF0);
|
||||
distance(inF0, inF1);
|
||||
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);
|
||||
// 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);
|
||||
log2(inF0);
|
||||
max(inF0, inF1);
|
||||
min(inF0, inF1);
|
||||
// TODO: mul(inF0, inF1);
|
||||
normalize(inF0);
|
||||
pow(inF0, inF1);
|
||||
radians(inF0);
|
||||
reflect(inF0, inF1);
|
||||
refract(inF0, inF1, 2.0);
|
||||
reversebits(int4(1,2,3,4));
|
||||
round(inF0);
|
||||
rsqrt(inF0);
|
||||
sign(inF0);
|
||||
sin(inF0);
|
||||
sinh(inF0);
|
||||
smoothstep(inF0, inF1, inF2);
|
||||
sqrt(inF0);
|
||||
step(inF0, inF1);
|
||||
tan(inF0);
|
||||
tanh(inF0);
|
||||
// TODO: sampler intrinsics, when we can declare the types.
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float4(1,2,3,4);
|
||||
}
|
||||
|
||||
// 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); \
|
||||
clamp(inF0, inF1, inF2); \
|
||||
cos(inF0); \
|
||||
cosh(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); \
|
||||
log2(inF0); \
|
||||
max(inF0, inF1); \
|
||||
min(inF0, inF1); \
|
||||
pow(inF0, inF1); \
|
||||
radians(inF0); \
|
||||
round(inF0); \
|
||||
rsqrt(inF0); \
|
||||
sign(inF0); \
|
||||
sin(inF0); \
|
||||
sinh(inF0); \
|
||||
smoothstep(inF0, inF1, inF2); \
|
||||
sqrt(inF0); \
|
||||
step(inF0, inF1); \
|
||||
tan(inF0); \
|
||||
tanh(inF0); \
|
||||
transpose(inF0); \
|
||||
trunc(inF0);
|
||||
|
||||
// TODO: turn on non-square matrix tests when protos are available.
|
||||
|
||||
float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2)
|
||||
{
|
||||
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
|
||||
MATFNS()
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float2x2(2,2,2,2);
|
||||
}
|
||||
|
||||
float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2)
|
||||
{
|
||||
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
|
||||
MATFNS()
|
||||
|
||||
// TODO: ... add when float1 prototypes are generated
|
||||
return float3x3(3,3,3,3,3,3,3,3,3);
|
||||
}
|
||||
|
||||
float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2)
|
||||
{
|
||||
// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
|
||||
MATFNS()
|
||||
|
||||
// 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue