Front-end: Implement 2nd task of issue #400; precision of result and operation.

From the ES spec + Bugzilla 15931 and GL_KHR_vulkan_glsl:
- Update precision qualifiers for all built-in function prototypes.
- Implement the new algorithm used to distinguish built-in function
  operation precisions from result precisions.
Also add tracking of separate result and operation precisions, and
use that in generating SPIR-V.
(SPIR-V cares about precision of operation, while the front-end
cares about precision of result, for propagation.)
This commit is contained in:
John Kessenich
2016-08-01 19:44:00 -06:00
parent 6c136223ed
commit f6640761c4
18 changed files with 408 additions and 308 deletions

View File

@@ -128,12 +128,12 @@ ERROR: node is still EOpNull!
0:52 Sequence
0:52 move second child to first child (temp 2-component vector of bool)
0:52 'b10' (temp 2-component vector of bool)
0:52 isnan (global 2-component vector of bool)
0:52 isnan (global 2-component vector of bool, operation at mediump)
0:52 'v2a' (global mediump 2-component vector of float)
0:53 Sequence
0:53 move second child to first child (temp 4-component vector of bool)
0:53 'b11' (temp 4-component vector of bool)
0:53 isinf (global 4-component vector of bool)
0:53 isinf (global 4-component vector of bool, operation at mediump)
0:53 'v4' (global mediump 4-component vector of float)
0:56 Sequence
0:56 move second child to first child (temp highp int)
@@ -158,17 +158,17 @@ ERROR: node is still EOpNull!
0:62 Sequence
0:62 move second child to first child (temp highp uint)
0:62 'u19' (temp mediump uint)
0:62 packSnorm2x16 (global highp uint)
0:62 packSnorm2x16 (global highp uint, operation at mediump)
0:62 'v2a' (global mediump 2-component vector of float)
0:63 Sequence
0:63 move second child to first child (temp mediump 2-component vector of float)
0:63 move second child to first child (temp highp 2-component vector of float)
0:63 'v20' (temp mediump 2-component vector of float)
0:63 unpackSnorm2x16 (global mediump 2-component vector of float)
0:63 unpackSnorm2x16 (global highp 2-component vector of float)
0:63 'uy' (global mediump uint)
0:64 Sequence
0:64 move second child to first child (temp highp uint)
0:64 'u15' (temp mediump uint)
0:64 packUnorm2x16 (global highp uint)
0:64 packUnorm2x16 (global highp uint, operation at mediump)
0:64 'v2a' (global mediump 2-component vector of float)
0:65 Sequence
0:65 move second child to first child (temp highp 2-component vector of float)
@@ -178,12 +178,12 @@ ERROR: node is still EOpNull!
0:66 Sequence
0:66 move second child to first child (temp highp uint)
0:66 'u17' (temp mediump uint)
0:66 packHalf2x16 (global highp uint)
0:66 packHalf2x16 (global highp uint, operation at mediump)
0:66 'v2b' (global mediump 2-component vector of float)
0:67 Sequence
0:67 move second child to first child (temp mediump 2-component vector of float)
0:67 'v18' (temp mediump 2-component vector of float)
0:67 unpackHalf2x16 (global mediump 2-component vector of float)
0:67 unpackHalf2x16 (global mediump 2-component vector of float, operation at highp)
0:67 'uy' (global mediump uint)
0:70 Constant:
0:70 0.000000
@@ -335,12 +335,12 @@ ERROR: node is still EOpNull!
0:52 Sequence
0:52 move second child to first child (temp 2-component vector of bool)
0:52 'b10' (temp 2-component vector of bool)
0:52 isnan (global 2-component vector of bool)
0:52 isnan (global 2-component vector of bool, operation at mediump)
0:52 'v2a' (global mediump 2-component vector of float)
0:53 Sequence
0:53 move second child to first child (temp 4-component vector of bool)
0:53 'b11' (temp 4-component vector of bool)
0:53 isinf (global 4-component vector of bool)
0:53 isinf (global 4-component vector of bool, operation at mediump)
0:53 'v4' (global mediump 4-component vector of float)
0:56 Sequence
0:56 move second child to first child (temp highp int)
@@ -365,17 +365,17 @@ ERROR: node is still EOpNull!
0:62 Sequence
0:62 move second child to first child (temp highp uint)
0:62 'u19' (temp mediump uint)
0:62 packSnorm2x16 (global highp uint)
0:62 packSnorm2x16 (global highp uint, operation at mediump)
0:62 'v2a' (global mediump 2-component vector of float)
0:63 Sequence
0:63 move second child to first child (temp mediump 2-component vector of float)
0:63 move second child to first child (temp highp 2-component vector of float)
0:63 'v20' (temp mediump 2-component vector of float)
0:63 unpackSnorm2x16 (global mediump 2-component vector of float)
0:63 unpackSnorm2x16 (global highp 2-component vector of float)
0:63 'uy' (global mediump uint)
0:64 Sequence
0:64 move second child to first child (temp highp uint)
0:64 'u15' (temp mediump uint)
0:64 packUnorm2x16 (global highp uint)
0:64 packUnorm2x16 (global highp uint, operation at mediump)
0:64 'v2a' (global mediump 2-component vector of float)
0:65 Sequence
0:65 move second child to first child (temp highp 2-component vector of float)
@@ -385,12 +385,12 @@ ERROR: node is still EOpNull!
0:66 Sequence
0:66 move second child to first child (temp highp uint)
0:66 'u17' (temp mediump uint)
0:66 packHalf2x16 (global highp uint)
0:66 packHalf2x16 (global highp uint, operation at mediump)
0:66 'v2b' (global mediump 2-component vector of float)
0:67 Sequence
0:67 move second child to first child (temp mediump 2-component vector of float)
0:67 'v18' (temp mediump 2-component vector of float)
0:67 unpackHalf2x16 (global mediump 2-component vector of float)
0:67 unpackHalf2x16 (global mediump 2-component vector of float, operation at highp)
0:67 'uy' (global mediump uint)
0:70 Constant:
0:70 0.000000