Commit 1b7fd0f7 by LoopDawg

Add asdouble, fma, & mad intrinsics and change profile to allow doubles when parsing prototypes

parent e5a80727
hlsl.intrinsics.double.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:12 Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (temp float)
0:5 Function Parameters:
0:5 'inDV1a' (in double)
0:5 'inDV1b' (in double)
0:5 'inDV1c' (in double)
0:5 'inDV2' (in 2-component vector of double)
0:5 'inDV3' (in 3-component vector of double)
0:5 'inDV4' (in 4-component vector of double)
0:5 'inU1a' (in uint)
0:5 'inU1b' (in uint)
0:? Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:9 Branch: Return with expression
0:9 Constant:
0:9 0.000000
0:? Linker Objects
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:12 Function Definition: PixelShaderFunction(d1;d1;d1;vd2;vd3;vd4;u1;u1; (temp float)
0:5 Function Parameters:
0:5 'inDV1a' (in double)
0:5 'inDV1b' (in double)
0:5 'inDV1c' (in double)
0:5 'inDV2' (in 2-component vector of double)
0:5 'inDV3' (in 3-component vector of double)
0:5 'inDV4' (in 4-component vector of double)
0:5 'inU1a' (in uint)
0:5 'inU1b' (in uint)
0:? Sequence
0:6 move second child to first child (temp double)
0:6 'r00' (temp double)
0:6 fma (global double)
0:6 'inDV1a' (in double)
0:6 'inDV1b' (in double)
0:6 'inDV1c' (in double)
0:7 move second child to first child (temp double)
0:7 'r01' (temp double)
0:7 uint64BitsToDouble (temp double)
0:7 Construct uvec2 (temp 2-component vector of uint)
0:7 'inU1a' (in uint)
0:7 'inU1b' (in uint)
0:9 Branch: Return with expression
0:9 Constant:
0:9 0.000000
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 30
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 10 12 14 20 22
ExecutionMode 4 OriginUpperLeft
Source HLSL 450
Name 4 "PixelShaderFunction"
Name 8 "r00"
Name 10 "inDV1a"
Name 12 "inDV1b"
Name 14 "inDV1c"
Name 17 "r01"
Name 20 "inU1a"
Name 22 "inU1b"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 64
7: TypePointer Function 6(float)
9: TypePointer Input 6(float)
10(inDV1a): 9(ptr) Variable Input
12(inDV1b): 9(ptr) Variable Input
14(inDV1c): 9(ptr) Variable Input
18: TypeInt 32 0
19: TypePointer Input 18(int)
20(inU1a): 19(ptr) Variable Input
22(inU1b): 19(ptr) Variable Input
24: TypeVector 18(int) 2
27: TypeFloat 32
28: 27(float) Constant 0
4(PixelShaderFunction): 2 Function None 3
5: Label
8(r00): 7(ptr) Variable Function
17(r01): 7(ptr) Variable Function
11: 6(float) Load 10(inDV1a)
13: 6(float) Load 12(inDV1b)
15: 6(float) Load 14(inDV1c)
16: 6(float) ExtInst 1(GLSL.std.450) 50(Fma) 11 13 15
Store 8(r00) 16
21: 18(int) Load 20(inU1a)
23: 18(int) Load 22(inU1b)
25: 24(ivec2) CompositeConstruct 21 23
26: 6(float) Bitcast 25
Store 17(r01) 26
ReturnValue 28
FunctionEnd
...@@ -18,7 +18,6 @@ ERROR: 0:22: 'EvaluateAttributeSnapped' : no matching overloaded function found ...@@ -18,7 +18,6 @@ ERROR: 0:22: 'EvaluateAttributeSnapped' : no matching overloaded function found
ERROR: 0:23: 'f16tof32' : no matching overloaded function found ERROR: 0:23: 'f16tof32' : no matching overloaded function found
ERROR: 0:24: 'firstbithigh' : no matching overloaded function found ERROR: 0:24: 'firstbithigh' : no matching overloaded function found
ERROR: 0:25: 'firstbitlow' : no matching overloaded function found ERROR: 0:25: 'firstbitlow' : no matching overloaded function found
ERROR: 0:26: 'fma' : no matching overloaded function found
ERROR: 0:27: 'fwidth' : no matching overloaded function found ERROR: 0:27: 'fwidth' : no matching overloaded function found
ERROR: 0:28: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:28: 'InterlockedAdd' : no matching overloaded function found
ERROR: 0:29: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:29: 'InterlockedAdd' : no matching overloaded function found
...@@ -61,7 +60,6 @@ ERROR: 0:83: 'EvaluateAttributeSnapped' : no matching overloaded function found ...@@ -61,7 +60,6 @@ ERROR: 0:83: 'EvaluateAttributeSnapped' : no matching overloaded function found
ERROR: 0:84: 'f16tof32' : no matching overloaded function found ERROR: 0:84: 'f16tof32' : no matching overloaded function found
ERROR: 0:85: 'firstbithigh' : no matching overloaded function found ERROR: 0:85: 'firstbithigh' : no matching overloaded function found
ERROR: 0:86: 'firstbitlow' : no matching overloaded function found ERROR: 0:86: 'firstbitlow' : no matching overloaded function found
ERROR: 0:87: 'fma' : no matching overloaded function found
ERROR: 0:88: 'fwidth' : no matching overloaded function found ERROR: 0:88: 'fwidth' : no matching overloaded function found
ERROR: 0:89: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:89: 'InterlockedAdd' : no matching overloaded function found
ERROR: 0:90: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:90: 'InterlockedAdd' : no matching overloaded function found
...@@ -96,7 +94,6 @@ ERROR: 0:128: 'EvaluateAttributeSnapped' : no matching overloaded function found ...@@ -96,7 +94,6 @@ ERROR: 0:128: 'EvaluateAttributeSnapped' : no matching overloaded function found
ERROR: 0:129: 'f16tof32' : no matching overloaded function found ERROR: 0:129: 'f16tof32' : no matching overloaded function found
ERROR: 0:130: 'firstbithigh' : no matching overloaded function found ERROR: 0:130: 'firstbithigh' : no matching overloaded function found
ERROR: 0:131: 'firstbitlow' : no matching overloaded function found ERROR: 0:131: 'firstbitlow' : no matching overloaded function found
ERROR: 0:132: 'fma' : no matching overloaded function found
ERROR: 0:133: 'fwidth' : no matching overloaded function found ERROR: 0:133: 'fwidth' : no matching overloaded function found
ERROR: 0:134: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:134: 'InterlockedAdd' : no matching overloaded function found
ERROR: 0:135: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:135: 'InterlockedAdd' : no matching overloaded function found
...@@ -131,7 +128,6 @@ ERROR: 0:173: 'EvaluateAttributeSnapped' : no matching overloaded function found ...@@ -131,7 +128,6 @@ ERROR: 0:173: 'EvaluateAttributeSnapped' : no matching overloaded function found
ERROR: 0:174: 'f16tof32' : no matching overloaded function found ERROR: 0:174: 'f16tof32' : no matching overloaded function found
ERROR: 0:175: 'firstbithigh' : no matching overloaded function found ERROR: 0:175: 'firstbithigh' : no matching overloaded function found
ERROR: 0:176: 'firstbitlow' : no matching overloaded function found ERROR: 0:176: 'firstbitlow' : no matching overloaded function found
ERROR: 0:177: 'fma' : no matching overloaded function found
ERROR: 0:178: 'fwidth' : no matching overloaded function found ERROR: 0:178: 'fwidth' : no matching overloaded function found
ERROR: 0:179: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:179: 'InterlockedAdd' : no matching overloaded function found
ERROR: 0:180: 'InterlockedAdd' : no matching overloaded function found ERROR: 0:180: 'InterlockedAdd' : no matching overloaded function found
...@@ -150,7 +146,7 @@ ERROR: 0:192: 'InterlockedXor' : no matching overloaded function found ...@@ -150,7 +146,7 @@ ERROR: 0:192: 'InterlockedXor' : no matching overloaded function found
ERROR: 0:193: 'noise' : no matching overloaded function found ERROR: 0:193: 'noise' : no matching overloaded function found
ERROR: 0:194: 'reversebits' : no matching overloaded function found ERROR: 0:194: 'reversebits' : no matching overloaded function found
ERROR: 0:195: 'transpose' : no matching overloaded function found ERROR: 0:195: 'transpose' : no matching overloaded function found
ERROR: 151 compilation errors. No code generated. ERROR: 147 compilation errors. No code generated.
Shader version: 450 Shader version: 450
...@@ -201,8 +197,6 @@ ERROR: node is still EOpNull! ...@@ -201,8 +197,6 @@ ERROR: node is still EOpNull!
0:24 0.000000 0:24 0.000000
0:25 Constant: 0:25 Constant:
0:25 0.000000 0:25 0.000000
0:26 Constant:
0:26 0.000000
0:27 Constant: 0:27 Constant:
0:27 0.000000 0:27 0.000000
0:28 Constant: 0:28 Constant:
...@@ -307,8 +301,6 @@ ERROR: node is still EOpNull! ...@@ -307,8 +301,6 @@ ERROR: node is still EOpNull!
0:85 0.000000 0:85 0.000000
0:86 Constant: 0:86 Constant:
0:86 0.000000 0:86 0.000000
0:87 Constant:
0:87 0.000000
0:88 Constant: 0:88 Constant:
0:88 0.000000 0:88 0.000000
0:89 Constant: 0:89 Constant:
...@@ -388,8 +380,6 @@ ERROR: node is still EOpNull! ...@@ -388,8 +380,6 @@ ERROR: node is still EOpNull!
0:130 0.000000 0:130 0.000000
0:131 Constant: 0:131 Constant:
0:131 0.000000 0:131 0.000000
0:132 Constant:
0:132 0.000000
0:133 Constant: 0:133 Constant:
0:133 0.000000 0:133 0.000000
0:134 Constant: 0:134 Constant:
...@@ -470,8 +460,6 @@ ERROR: node is still EOpNull! ...@@ -470,8 +460,6 @@ ERROR: node is still EOpNull!
0:175 0.000000 0:175 0.000000
0:176 Constant: 0:176 Constant:
0:176 0.000000 0:176 0.000000
0:177 Constant:
0:177 0.000000
0:178 Constant: 0:178 Constant:
0:178 0.000000 0:178 0.000000
0:179 Constant: 0:179 Constant:
...@@ -568,8 +556,6 @@ ERROR: node is still EOpNull! ...@@ -568,8 +556,6 @@ ERROR: node is still EOpNull!
0:24 0.000000 0:24 0.000000
0:25 Constant: 0:25 Constant:
0:25 0.000000 0:25 0.000000
0:26 Constant:
0:26 0.000000
0:27 Constant: 0:27 Constant:
0:27 0.000000 0:27 0.000000
0:28 Constant: 0:28 Constant:
...@@ -674,8 +660,6 @@ ERROR: node is still EOpNull! ...@@ -674,8 +660,6 @@ ERROR: node is still EOpNull!
0:85 0.000000 0:85 0.000000
0:86 Constant: 0:86 Constant:
0:86 0.000000 0:86 0.000000
0:87 Constant:
0:87 0.000000
0:88 Constant: 0:88 Constant:
0:88 0.000000 0:88 0.000000
0:89 Constant: 0:89 Constant:
...@@ -755,8 +739,6 @@ ERROR: node is still EOpNull! ...@@ -755,8 +739,6 @@ ERROR: node is still EOpNull!
0:130 0.000000 0:130 0.000000
0:131 Constant: 0:131 Constant:
0:131 0.000000 0:131 0.000000
0:132 Constant:
0:132 0.000000
0:133 Constant: 0:133 Constant:
0:133 0.000000 0:133 0.000000
0:134 Constant: 0:134 Constant:
...@@ -837,8 +819,6 @@ ERROR: node is still EOpNull! ...@@ -837,8 +819,6 @@ ERROR: node is still EOpNull!
0:175 0.000000 0:175 0.000000
0:176 Constant: 0:176 Constant:
0:176 0.000000 0:176 0.000000
0:177 Constant:
0:177 0.000000
0:178 Constant: 0:178 Constant:
0:178 0.000000 0:178 0.000000
0:179 Constant: 0:179 Constant:
......
float PixelShaderFunction(double inDV1a, double inDV1b, double inDV1c,
double2 inDV2, double3 inDV3, double4 inDV4,
uint inU1a, uint inU1b)
{
double r00 = fma(inDV1a, inDV1b, inDV1c);
double r01 = asdouble(inU1a, inU1b);
return 0.0;
}
...@@ -23,7 +23,7 @@ float ComputeShaderFunction(float inF0, float inF1, float inF2, int inI0) ...@@ -23,7 +23,7 @@ float ComputeShaderFunction(float inF0, float inF1, float inF2, int inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
...@@ -84,7 +84,7 @@ float2 ComputeShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) ...@@ -84,7 +84,7 @@ float2 ComputeShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
...@@ -129,7 +129,7 @@ float3 ComputeShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) ...@@ -129,7 +129,7 @@ float3 ComputeShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
...@@ -174,7 +174,7 @@ float4 ComputeShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) ...@@ -174,7 +174,7 @@ float4 ComputeShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
......
...@@ -12,7 +12,7 @@ float PixelShaderFunction(float inF0, float inF1, float inF2, int inI0) ...@@ -12,7 +12,7 @@ float PixelShaderFunction(float inF0, float inF1, float inF2, int inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
// InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
// InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
// InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
...@@ -52,7 +52,7 @@ float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) ...@@ -52,7 +52,7 @@ float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
reversebits(inF0); // expected error: only integer inputs reversebits(inF0); // expected error: only integer inputs
transpose(inF0); // expected error: only valid on mats transpose(inF0); // expected error: only valid on mats
...@@ -68,7 +68,7 @@ float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) ...@@ -68,7 +68,7 @@ float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
reversebits(inF0); // expected error: only integer inputs reversebits(inF0); // expected error: only integer inputs
transpose(inF0); // expected error: only valid on mats transpose(inF0); // expected error: only valid on mats
...@@ -85,7 +85,7 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) ...@@ -85,7 +85,7 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
reversebits(inF0); // expected error: only integer inputs reversebits(inF0); // expected error: only integer inputs
transpose(inF0); // expected error: only valid on mats transpose(inF0); // expected error: only valid on mats
...@@ -100,7 +100,6 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) ...@@ -100,7 +100,6 @@ float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
f16tof32(inF0); \ f16tof32(inF0); \
firstbithigh(inF0); \ firstbithigh(inF0); \
firstbitlow(inF0); \ firstbitlow(inF0); \
fma(inF0, inF1, inF2); \
reversebits(inF0); \ reversebits(inF0); \
length(inF0); \ length(inF0); \
noise(inF0); \ noise(inF0); \
......
...@@ -39,7 +39,7 @@ float VertexShaderFunction(float inF0, float inF1, float inF2, int inI0) ...@@ -39,7 +39,7 @@ float VertexShaderFunction(float inF0, float inF1, float inF2, int inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage InterlockedAdd(gs_ua, gs_ub); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage InterlockedAdd(gs_ua, gs_ub, out_u1); // expected error: only valid in pixel stage
...@@ -102,7 +102,7 @@ float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) ...@@ -102,7 +102,7 @@ float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage InterlockedAdd(gs_ua2, gs_ub2); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage InterlockedAdd(gs_ua2, gs_ub2, out_u2); // expected error: only valid in pixel stage
...@@ -147,7 +147,7 @@ float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) ...@@ -147,7 +147,7 @@ float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage InterlockedAdd(gs_ua3, gs_ub3); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage InterlockedAdd(gs_ua3, gs_ub3, out_u3); // expected error: only valid in pixel stage
...@@ -192,7 +192,7 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) ...@@ -192,7 +192,7 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
f16tof32(inF0); // expected error: only integer inputs f16tof32(inF0); // expected error: only integer inputs
firstbithigh(inF0); // expected error: only integer inputs firstbithigh(inF0); // expected error: only integer inputs
firstbitlow(inF0); // expected error: only integer inputs firstbitlow(inF0); // expected error: only integer inputs
fma(inF0, inF1, inF2); // expected error: only double inputs // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
fwidth(inF0); // expected error: only valid in pixel stage fwidth(inF0); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage InterlockedAdd(gs_ua4, gs_ub4); // expected error: only valid in pixel stage
InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage InterlockedAdd(gs_ua4, gs_ub4, out_u4); // expected error: only valid in pixel stage
...@@ -234,7 +234,6 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) ...@@ -234,7 +234,6 @@ float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
f16tof32(inF0); \ f16tof32(inF0); \
firstbithigh(inF0); \ firstbithigh(inF0); \
firstbitlow(inF0); \ firstbitlow(inF0); \
fma(inF0, inF1, inF2); \
fwidth(inF0); \ fwidth(inF0); \
noise(inF0); \ noise(inF0); \
reversebits(inF0); \ reversebits(inF0); \
......
...@@ -524,6 +524,7 @@ enum TOperator { ...@@ -524,6 +524,7 @@ enum TOperator {
EOpF16tof32, // HLSL conversion: half of an UnpackHalf2x16 EOpF16tof32, // HLSL conversion: half of an UnpackHalf2x16
EOpLit, // HLSL lighting coefficient vector EOpLit, // HLSL lighting coefficient vector
EOpTextureBias, // HLSL texture bias: will be lowered to EOpTexture EOpTextureBias, // HLSL texture bias: will be lowered to EOpTexture
EOpAsDouble, // slightly different from EOpUint64BitsToDouble
}; };
class TIntermTraverser; class TIntermTraverser;
......
...@@ -338,8 +338,8 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo ...@@ -338,8 +338,8 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
bool correct = true; bool correct = true;
if (source == EShSourceHlsl) { if (source == EShSourceHlsl) {
version = 450; // TODO: GLSL parser is still used for builtins. version = 450; // TODO: GLSL parser is still used for builtins.
profile = ENoProfile; profile = ECoreProfile; // allow doubles in prototype parsing
return correct; return correct;
} }
......
...@@ -85,6 +85,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -85,6 +85,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"}, {"hlsl.intrinsics.barriers.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.comp", "ComputeShaderFunction"}, {"hlsl.intrinsics.comp", "ComputeShaderFunction"},
{"hlsl.intrinsics.evalfns.frag", "main"}, {"hlsl.intrinsics.evalfns.frag", "main"},
{"hlsl.intrinsics.double.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.f1632.frag", "PixelShaderFunction"}, {"hlsl.intrinsics.f1632.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.frag", "PixelShaderFunction"}, {"hlsl.intrinsics.frag", "PixelShaderFunction"},
{"hlsl.intrinsics.lit.frag", "PixelShaderFunction"}, {"hlsl.intrinsics.lit.frag", "PixelShaderFunction"},
......
...@@ -1168,6 +1168,35 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& ...@@ -1168,6 +1168,35 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
break; break;
} }
case EOpAsDouble:
{
// asdouble accepts two 32 bit ints. we can use EOpUint64BitsToDouble, but must
// first construct a uint64.
TIntermTyped* arg0 = argAggregate->getSequence()[0]->getAsTyped();
TIntermTyped* arg1 = argAggregate->getSequence()[1]->getAsTyped();
if (arg0->getType().isVector()) { // TODO: ...
error(loc, "double2 conversion not implemented", "asdouble", "");
break;
}
TIntermAggregate* uint64 = new TIntermAggregate(EOpConstructUVec2);
uint64->getSequence().push_back(arg0);
uint64->getSequence().push_back(arg1);
uint64->setType(TType(EbtUint, EvqTemporary, 2)); // convert 2 uints to a uint2
uint64->setLoc(loc);
// bitcast uint2 to a double
TIntermTyped* convert = new TIntermUnary(EOpUint64BitsToDouble);
convert->getAsUnaryNode()->setOperand(uint64);
convert->setLoc(loc);
convert->setType(TType(EbtDouble, EvqTemporary));
node = convert;
break;
}
case EOpF16tof32: case EOpF16tof32:
case EOpF32tof16: case EOpF32tof16:
{ {
......
...@@ -158,9 +158,7 @@ inline bool IsValidGlsl(const char* cname, char retOrder, char retType, char arg ...@@ -158,9 +158,7 @@ inline bool IsValidGlsl(const char* cname, char retOrder, char retType, char arg
const bool isVec = dim0Max > 1 || argType == 'V'; const bool isVec = dim0Max > 1 || argType == 'V';
const bool isMat = dim1Max > 1 || argType == 'M'; const bool isMat = dim1Max > 1 || argType == 'M';
if (argType == 'D' || // avoid double args if ((isVec && dim0 == 1) || // avoid vec1
retType == 'D' || // avoid double return
(isVec && dim0 == 1) || // avoid vec1
(isMat && dim0 == 1 && dim1 == 1)) // avoid mat1x1 (isMat && dim0 == 1 && dim1 == 1)) // avoid mat1x1
return false; return false;
...@@ -582,7 +580,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, con ...@@ -582,7 +580,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, con
symbolTable.relateToOperator("AllMemoryBarrier", EOpMemoryBarrier); symbolTable.relateToOperator("AllMemoryBarrier", EOpMemoryBarrier);
symbolTable.relateToOperator("AllMemoryBarrierWithGroupSync", EOpAllMemoryBarrierWithGroupSync); symbolTable.relateToOperator("AllMemoryBarrierWithGroupSync", EOpAllMemoryBarrierWithGroupSync);
symbolTable.relateToOperator("any", EOpAny); symbolTable.relateToOperator("any", EOpAny);
symbolTable.relateToOperator("asdouble", EOpUint64BitsToDouble); symbolTable.relateToOperator("asdouble", EOpAsDouble);
symbolTable.relateToOperator("asfloat", EOpIntBitsToFloat); symbolTable.relateToOperator("asfloat", EOpIntBitsToFloat);
symbolTable.relateToOperator("asin", EOpAsin); symbolTable.relateToOperator("asin", EOpAsin);
symbolTable.relateToOperator("asint", EOpFloatBitsToInt); symbolTable.relateToOperator("asint", EOpFloatBitsToInt);
...@@ -651,7 +649,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, con ...@@ -651,7 +649,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, con
symbolTable.relateToOperator("log", EOpLog); symbolTable.relateToOperator("log", EOpLog);
symbolTable.relateToOperator("log10", EOpLog10); symbolTable.relateToOperator("log10", EOpLog10);
symbolTable.relateToOperator("log2", EOpLog2); symbolTable.relateToOperator("log2", EOpLog2);
// symbolTable.relateToOperator("mad"); symbolTable.relateToOperator("mad", EOpFma);
symbolTable.relateToOperator("max", EOpMax); symbolTable.relateToOperator("max", EOpMax);
symbolTable.relateToOperator("min", EOpMin); symbolTable.relateToOperator("min", EOpMin);
symbolTable.relateToOperator("modf", EOpModf); symbolTable.relateToOperator("modf", EOpModf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment