Perform update_precision on constructors and converts

Fixes #2740
This commit is contained in:
Greg Fischer 2021-09-02 10:49:46 -06:00
parent 2fb89a0072
commit 8ef6a4cb4d
24 changed files with 120 additions and 73 deletions

View File

@ -24,18 +24,18 @@ ERROR: node is still EOpNull!
0:42 Function Definition: main( ( global void)
0:42 Function Parameters:
0:44 Sequence
0:44 texture ( global lowp 4-component vector of int)
0:44 texture ( global lowp 4-component vector of int, operation at mediump)
0:44 sampler: direct index for structure ( global lowp isampler3D)
0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t})
0:44 Constant:
0:44 2 (const int)
0:44 Construct vec3 ( temp lowp 3-component vector of float)
0:44 Convert int to float ( temp lowp float)
0:44 Construct vec3 ( temp mediump 3-component vector of float)
0:44 Convert int to float ( temp mediump float)
0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int)
0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni})
0:44 Constant:
0:44 1 (const int)
0:44 Convert uint to float ( temp lowp float)
0:44 Convert uint to float ( temp mediump float)
0:44 direct index ( temp mediump uint)
0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint)
0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, layout( column_major) global structure{ global mediump int a} t} fbs})
@ -43,7 +43,7 @@ ERROR: node is still EOpNull!
0:44 0 (const uint)
0:44 Constant:
0:44 1 (const int)
0:44 Convert uint to float ( temp lowp float)
0:44 Convert uint to float ( temp mediump float)
0:44 direct index ( temp mediump uint)
0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint)
0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni})
@ -92,18 +92,18 @@ ERROR: node is still EOpNull!
0:42 Function Definition: main( ( global void)
0:42 Function Parameters:
0:44 Sequence
0:44 texture ( global lowp 4-component vector of int)
0:44 texture ( global lowp 4-component vector of int, operation at mediump)
0:44 sampler: direct index for structure ( global lowp isampler3D)
0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t})
0:44 Constant:
0:44 2 (const int)
0:44 Construct vec3 ( temp lowp 3-component vector of float)
0:44 Convert int to float ( temp lowp float)
0:44 Construct vec3 ( temp mediump 3-component vector of float)
0:44 Convert int to float ( temp mediump float)
0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int)
0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni})
0:44 Constant:
0:44 1 (const int)
0:44 Convert uint to float ( temp lowp float)
0:44 Convert uint to float ( temp mediump float)
0:44 direct index ( temp mediump uint)
0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint)
0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, layout( column_major) global structure{ global mediump int a} t} fbs})
@ -111,7 +111,7 @@ ERROR: node is still EOpNull!
0:44 0 (const uint)
0:44 Constant:
0:44 1 (const int)
0:44 Convert uint to float ( temp lowp float)
0:44 Convert uint to float ( temp mediump float)
0:44 direct index ( temp mediump uint)
0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint)
0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni})

View File

@ -180,7 +180,7 @@ ERROR: node is still EOpNull!
0:91 'i' ( temp highp int)
0:92 imageStore ( global highp void)
0:92 'ii2da' ( writeonly uniform highp iimage2DArray)
0:92 Construct ivec3 ( temp 3-component vector of int)
0:92 Construct ivec3 ( temp highp 3-component vector of int)
0:92 'i' ( temp highp int)
0:92 'i' ( temp highp int)
0:92 'i' ( temp highp int)
@ -189,9 +189,9 @@ ERROR: node is still EOpNull!
0:92 0 (const int)
0:92 0 (const int)
0:92 0 (const int)
0:93 imageLoad ( global mediump 4-component vector of float)
0:93 imageLoad ( global mediump 4-component vector of float, operation at highp)
0:93 'img2Drgba' (layout( rgba32f) readonly uniform mediump image2D)
0:93 Construct ivec2 ( temp mediump 2-component vector of int)
0:93 Construct ivec2 ( temp highp 2-component vector of int)
0:93 'i' ( temp highp int)
0:93 'i' ( temp highp int)
0:94 imageLoad ( global highp 4-component vector of int)

View File

@ -270,7 +270,7 @@ ERROR: node is still EOpNull!
0:42 Constant:
0:42 0.000000
0:42 0.000000
0:42 Convert float to int ( temp highp 2-component vector of int)
0:42 Convert float to int ( temp mediump 2-component vector of int)
0:42 'c2D' ( smooth in mediump 2-component vector of float)
0:43 textureProjGradOffset ( global highp 4-component vector of uint)
0:43 'usamp2d' ( uniform highp usampler2D)
@ -471,7 +471,7 @@ ERROR: node is still EOpNull!
0:211 Constant:
0:211 0.100000
0:211 0.100000
0:211 Convert float to int ( temp highp 2-component vector of int)
0:211 Convert float to int ( temp mediump 2-component vector of int)
0:211 'inf' ( smooth in mediump 2-component vector of float)
0:212 textureGatherOffsets ( global highp 4-component vector of float)
0:212 direct index ( temp highp sampler2D)
@ -507,7 +507,7 @@ ERROR: node is still EOpNull!
0:221 Constant:
0:221 0.100000
0:221 0.100000
0:221 Convert float to int ( temp highp 2-component vector of int)
0:221 Convert float to int ( temp mediump 2-component vector of int)
0:221 'inf' ( smooth in mediump 2-component vector of float)
0:222 textureGatherOffsets ( global highp 4-component vector of float)
0:222 direct index ( temp highp sampler2D)

View File

@ -330,7 +330,7 @@ ERROR: node is still EOpNull!
0:164 'sIndex' ( uniform highp int)
0:164 Constant:
0:164 2 (const int)
0:165 textureGatherOffset ( global lowp 4-component vector of float)
0:165 textureGatherOffset ( global lowp 4-component vector of float, operation at highp)
0:165 direct index ( temp lowp sampler2D)
0:165 'sArray' ( uniform 4-element array of lowp sampler2D)
0:165 Constant:
@ -338,7 +338,7 @@ ERROR: node is still EOpNull!
0:165 Constant:
0:165 0.100000
0:165 0.100000
0:165 Convert float to int ( temp lowp 2-component vector of int)
0:165 Convert float to int ( temp highp 2-component vector of int)
0:165 'inf' ( in highp 2-component vector of float)
0:166 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp)
0:166 direct index ( temp lowp sampler2D)
@ -394,7 +394,7 @@ ERROR: node is still EOpNull!
0:179 'sIndex' ( uniform highp int)
0:179 Constant:
0:179 2 (const int)
0:180 textureGatherOffset ( global lowp 4-component vector of float)
0:180 textureGatherOffset ( global lowp 4-component vector of float, operation at highp)
0:180 direct index ( temp lowp sampler2D)
0:180 'sArray' ( uniform 4-element array of lowp sampler2D)
0:180 Constant:
@ -402,7 +402,7 @@ ERROR: node is still EOpNull!
0:180 Constant:
0:180 0.100000
0:180 0.100000
0:180 Convert float to int ( temp lowp 2-component vector of int)
0:180 Convert float to int ( temp highp 2-component vector of int)
0:180 'inf' ( in highp 2-component vector of float)
0:181 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp)
0:181 direct index ( temp lowp sampler2D)

View File

@ -121,7 +121,7 @@ ERROR: node is still EOpNull!
0:76 'inf' ( smooth in mediump 2-component vector of float)
0:76 'ing' ( smooth in mediump 2-component vector of float)
0:76 'h' ( noContraction temp mediump 2-component vector of float)
0:77 textureGatherOffset ( global lowp 4-component vector of float)
0:77 textureGatherOffset ( global lowp 4-component vector of float, operation at mediump)
0:77 direct index ( temp lowp sampler2D)
0:77 'sArray' ( uniform 4-element array of lowp sampler2D)
0:77 Constant:
@ -129,7 +129,7 @@ ERROR: node is still EOpNull!
0:77 Constant:
0:77 0.100000
0:77 0.100000
0:77 Convert float to int ( temp lowp 2-component vector of int)
0:77 Convert float to int ( temp mediump 2-component vector of int)
0:77 'inf' ( smooth in mediump 2-component vector of float)
0:78 textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump)
0:78 direct index ( temp lowp sampler2D)

View File

@ -99,7 +99,7 @@ ERROR: node is still EOpNull!
0:70 'sIndex' ( uniform highp int)
0:70 Constant:
0:70 2 (const int)
0:71 textureGatherOffset ( global lowp 4-component vector of float)
0:71 textureGatherOffset ( global lowp 4-component vector of float, operation at highp)
0:71 direct index ( temp lowp sampler2D)
0:71 'sArray' ( uniform 4-element array of lowp sampler2D)
0:71 Constant:
@ -107,7 +107,7 @@ ERROR: node is still EOpNull!
0:71 Constant:
0:71 0.100000
0:71 0.100000
0:71 Convert float to int ( temp lowp 2-component vector of int)
0:71 Convert float to int ( temp highp 2-component vector of int)
0:71 'inf' ( in highp 2-component vector of float)
0:72 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp)
0:72 direct index ( temp lowp sampler2D)

View File

@ -16,7 +16,7 @@ output primitive = points
0:12 Constant:
0:12 0 (const uint)
0:12 'gl_PrimitiveIDIn' ( in highp int PrimitiveID)
0:12 Construct uvec4 ( temp highp 4-component vector of uint)
0:12 Construct uvec4 ( temp mediump 4-component vector of uint)
0:12 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:12 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:12 Constant:
@ -47,7 +47,7 @@ output primitive = points
0:12 Constant:
0:12 0 (const uint)
0:12 'gl_PrimitiveIDIn' ( in highp int PrimitiveID)
0:12 Construct uvec4 ( temp highp 4-component vector of uint)
0:12 Construct uvec4 ( temp mediump 4-component vector of uint)
0:12 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:12 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:12 Constant:

View File

@ -13,7 +13,7 @@ vertices = 1
0:11 Constant:
0:11 0 (const uint)
0:11 'gl_PrimitiveID' ( in highp int PrimitiveID)
0:11 Construct uvec4 ( temp highp 4-component vector of uint)
0:11 Construct uvec4 ( temp mediump 4-component vector of uint)
0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:11 Constant:
@ -41,7 +41,7 @@ vertices = 1
0:11 Constant:
0:11 0 (const uint)
0:11 'gl_PrimitiveID' ( in highp int PrimitiveID)
0:11 Construct uvec4 ( temp highp 4-component vector of uint)
0:11 Construct uvec4 ( temp mediump 4-component vector of uint)
0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:11 Constant:

View File

@ -15,7 +15,7 @@ triangle order = none
0:11 Constant:
0:11 0 (const uint)
0:11 'gl_PrimitiveID' ( in highp int PrimitiveID)
0:11 Construct uvec4 ( temp highp 4-component vector of uint)
0:11 Construct uvec4 ( temp mediump 4-component vector of uint)
0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:11 Constant:
@ -45,7 +45,7 @@ triangle order = ccw
0:11 Constant:
0:11 0 (const uint)
0:11 'gl_PrimitiveID' ( in highp int PrimitiveID)
0:11 Construct uvec4 ( temp highp 4-component vector of uint)
0:11 Construct uvec4 ( temp mediump 4-component vector of uint)
0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:11 Constant:

View File

@ -12,7 +12,7 @@ Requested GL_KHR_shader_subgroup_basic
0:10 Constant:
0:10 0 (const uint)
0:10 'gl_VertexID' ( gl_VertexId highp int VertexId)
0:10 Construct uvec4 ( temp highp 4-component vector of uint)
0:10 Construct uvec4 ( temp mediump 4-component vector of uint)
0:10 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:10 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:10 Constant:
@ -41,7 +41,7 @@ Requested GL_KHR_shader_subgroup_basic
0:10 Constant:
0:10 0 (const uint)
0:10 'gl_VertexID' ( gl_VertexId highp int VertexId)
0:10 Construct uvec4 ( temp highp 4-component vector of uint)
0:10 Construct uvec4 ( temp mediump 4-component vector of uint)
0:10 'gl_SubgroupSize' ( in mediump uint SubgroupSize)
0:10 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID)
0:10 Constant:

View File

@ -73,6 +73,7 @@ spv.ext.AnyHitShader.rahit
Decorate 98(gl_SubgroupSize) RelaxedPrecision
Decorate 98(gl_SubgroupSize) BuiltIn SubgroupSize
Decorate 99 RelaxedPrecision
Decorate 100 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -38,10 +38,21 @@ spv.ext.ClosestHitShader_Subgroup.rchit
Decorate 28(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 28(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 29 RelaxedPrecision
Decorate 30 RelaxedPrecision
Decorate 34(gl_SubGroupGeMaskARB) BuiltIn SubgroupGeMaskKHR
Decorate 41 RelaxedPrecision
Decorate 42 RelaxedPrecision
Decorate 43(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR
Decorate 46 RelaxedPrecision
Decorate 46 RelaxedPrecision
Decorate 47 RelaxedPrecision
Decorate 48(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR
Decorate 51 RelaxedPrecision
Decorate 51 RelaxedPrecision
Decorate 52 RelaxedPrecision
Decorate 53(gl_SubGroupLtMaskARB) BuiltIn SubgroupLtMaskKHR
Decorate 59 RelaxedPrecision
Decorate 60 RelaxedPrecision
Decorate 61(gl_SMIDNV) BuiltIn SMIDNV
2: TypeVoid
3: TypeFunction 2

View File

@ -36,10 +36,6 @@ spv.precise.tese
Decorate 43 NoContraction
Decorate 62(in_f_color) RelaxedPrecision
Decorate 62(in_f_color) Location 0
Decorate 67 RelaxedPrecision
Decorate 68 RelaxedPrecision
Decorate 69 RelaxedPrecision
Decorate 70 RelaxedPrecision
Decorate 97 NoContraction
Decorate 99 NoContraction
Decorate 101 NoContraction

View File

@ -24,6 +24,7 @@ spv.subgroup.frag
Decorate 13(gl_SubgroupInvocationID) Flat
Decorate 13(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 14 RelaxedPrecision
Decorate 16 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -33,6 +33,7 @@ spv.subgroup.geom
Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 21 RelaxedPrecision
Decorate 23 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -30,6 +30,7 @@ spv.subgroup.tesc
Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 21 RelaxedPrecision
Decorate 23 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -32,6 +32,7 @@ spv.subgroup.tese
Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 21 RelaxedPrecision
Decorate 23 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -29,6 +29,7 @@ spv.subgroup.vert
Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 21 RelaxedPrecision
Decorate 23 RelaxedPrecision
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0

View File

@ -75,6 +75,7 @@ spv.uint.frag
Decorate 90 RelaxedPrecision
Decorate 91 RelaxedPrecision
Decorate 92 RelaxedPrecision
Decorate 93 RelaxedPrecision
Decorate 97 RelaxedPrecision
Decorate 98 RelaxedPrecision
Decorate 101 RelaxedPrecision

View File

@ -134,7 +134,7 @@ ERROR: node is still EOpNull!
0:59 Condition
0:59 Compare Equal ( temp bool)
0:59 'shiftedii' ( temp mediump int)
0:59 Convert uint to int ( temp int)
0:59 Convert uint to int ( temp mediump int)
0:59 'shiftedui' ( temp mediump uint)
0:59 true case
0:60 move second child to first child ( temp mediump 4-component vector of uint)
@ -433,7 +433,7 @@ ERROR: node is still EOpNull!
0:59 Condition
0:59 Compare Equal ( temp bool)
0:59 'shiftedii' ( temp mediump int)
0:59 Convert uint to int ( temp int)
0:59 Convert uint to int ( temp mediump int)
0:59 'shiftedui' ( temp mediump uint)
0:59 true case
0:60 move second child to first child ( temp mediump 4-component vector of uint)

View File

@ -19,10 +19,10 @@ Shader version: 450
0:14 Convert bool to float ( temp float)
0:14 'scbt' ( specialization-constant const bool)
0:14 true (const bool)
0:15 Convert int to float ( temp float)
0:15 Convert int to float ( temp highp float)
0:15 'sci2' ( specialization-constant const highp int)
0:15 2 (const int)
0:17 Convert float to int ( temp int)
0:17 Convert float to int ( temp highp int)
0:17 'scf1' ( specialization-constant const highp float)
0:17 1.000000
0:18 Convert bool to int ( specialization-constant const int)
@ -86,34 +86,34 @@ Shader version: 450
0:35 2 (const int)
0:35 'sci2' ( specialization-constant const highp int)
0:35 2 (const int)
0:37 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:37 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:37 'sci2' ( specialization-constant const highp int)
0:37 2 (const int)
0:37 'sci2' ( specialization-constant const highp int)
0:37 2 (const int)
0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:38 Construct ivec2 ( temp 2-element array of highp 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:40 Construct vec2 ( specialization-constant const 2-component vector of float)
0:40 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:40 'scf1' ( specialization-constant const highp float)
0:40 1.000000
0:40 'scf1' ( specialization-constant const highp float)
0:40 1.000000
0:41 Construct vec2 ( temp 2-element array of 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const 2-component vector of float)
0:41 Construct vec2 ( temp 2-element array of highp 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 Construct vec2 ( specialization-constant const 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 'scf1' ( specialization-constant const highp float)
@ -150,10 +150,10 @@ Shader version: 450
0:14 Convert bool to float ( temp float)
0:14 'scbt' ( specialization-constant const bool)
0:14 true (const bool)
0:15 Convert int to float ( temp float)
0:15 Convert int to float ( temp highp float)
0:15 'sci2' ( specialization-constant const highp int)
0:15 2 (const int)
0:17 Convert float to int ( temp int)
0:17 Convert float to int ( temp highp int)
0:17 'scf1' ( specialization-constant const highp float)
0:17 1.000000
0:18 Convert bool to int ( specialization-constant const int)
@ -217,34 +217,34 @@ Shader version: 450
0:35 2 (const int)
0:35 'sci2' ( specialization-constant const highp int)
0:35 2 (const int)
0:37 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:37 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:37 'sci2' ( specialization-constant const highp int)
0:37 2 (const int)
0:37 'sci2' ( specialization-constant const highp int)
0:37 2 (const int)
0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:38 Construct ivec2 ( temp 2-element array of highp 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 Construct ivec2 ( specialization-constant const 2-component vector of int)
0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:38 'sci2' ( specialization-constant const highp int)
0:38 2 (const int)
0:40 Construct vec2 ( specialization-constant const 2-component vector of float)
0:40 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:40 'scf1' ( specialization-constant const highp float)
0:40 1.000000
0:40 'scf1' ( specialization-constant const highp float)
0:40 1.000000
0:41 Construct vec2 ( temp 2-element array of 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const 2-component vector of float)
0:41 Construct vec2 ( temp 2-element array of highp 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 Construct vec2 ( specialization-constant const 2-component vector of float)
0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float)
0:41 'scf1' ( specialization-constant const highp float)
0:41 1.000000
0:41 'scf1' ( specialization-constant const highp float)

View File

@ -1643,6 +1643,7 @@ public:
~TIntermAggregate() { delete pragmaTable; }
virtual TIntermAggregate* getAsAggregate() { return this; }
virtual const TIntermAggregate* getAsAggregate() const { return this; }
virtual void updatePrecision();
virtual void setOperator(TOperator o) { op = o; }
virtual TIntermSequence& getSequence() { return sequence; }
virtual const TIntermSequence& getSequence() const { return sequence; }

View File

@ -416,20 +416,24 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
// TODO: but, did this bypass constant folding?
//
switch (op) {
case EOpConstructInt8:
case EOpConstructUint8:
case EOpConstructInt16:
case EOpConstructUint16:
case EOpConstructInt:
case EOpConstructUint:
case EOpConstructInt64:
case EOpConstructUint64:
case EOpConstructBool:
case EOpConstructFloat:
case EOpConstructDouble:
case EOpConstructFloat16:
return child;
default: break; // some compilers want this
case EOpConstructInt8:
case EOpConstructUint8:
case EOpConstructInt16:
case EOpConstructUint16:
case EOpConstructInt:
case EOpConstructUint:
case EOpConstructInt64:
case EOpConstructUint64:
case EOpConstructBool:
case EOpConstructFloat:
case EOpConstructDouble:
case EOpConstructFloat16: {
TIntermUnary* unary_node = child->getAsUnaryNode();
if (unary_node != nullptr)
unary_node->updatePrecision();
return child;
}
default: break; // some compilers want this
}
//
@ -3776,6 +3780,28 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
return false;
}
// Propagate precision qualifiers *up* from children to parent, and then
// back *down* again to the children's subtrees.
void TIntermAggregate::updatePrecision()
{
if (getBasicType() == EbtInt || getBasicType() == EbtUint ||
getBasicType() == EbtFloat || getBasicType() == EbtFloat16) {
TPrecisionQualifier maxPrecision = EpqNone;
TIntermSequence operands = getSequence();
for (unsigned int i = 0; i < operands.size(); ++i) {
TIntermTyped* typedNode = operands[i]->getAsTyped();
assert(typedNode);
maxPrecision = std::max(maxPrecision, typedNode->getQualifier().precision);
}
getQualifier().precision = maxPrecision;
for (unsigned int i = 0; i < operands.size(); ++i) {
TIntermTyped* typedNode = operands[i]->getAsTyped();
assert(typedNode);
typedNode->propagatePrecision(maxPrecision);
}
}
}
// Propagate precision qualifiers *up* from children to parent, and then
// back *down* again to the children's subtrees.
void TIntermBinary::updatePrecision()

View File

@ -7691,7 +7691,13 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode*
return nullptr;
}
return intermediate.setAggregateOperator(aggrNode, op, type, loc);
TIntermTyped *ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc);
TIntermAggregate *agg_node = ret_node->getAsAggregate();
if (agg_node && agg_node->isVector())
agg_node->updatePrecision();
return ret_node;
}
// Function for constructor implementation. Calls addUnaryMath with appropriate EOp value