Commit 3357d870 by John Kessenich

Merge pull request #222 from Qining/support-precise

Full stack: Support *precise* qualifier
parents 7b3096a9 e543cc35
spv.precise.tesc
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
Linked tessellation control stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 72
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 12 15 20 30 40 45
ExecutionMode 4 OutputVertices 3
Source ESSL 310
SourceExtension "GL_EXT_gpu_shader5"
SourceExtension "GL_EXT_shader_io_blocks"
SourceExtension "GL_EXT_tessellation_shader"
Name 4 "main"
Name 12 "in_te_position"
Name 15 "gl_InvocationID"
Name 20 "in_tc_position"
Name 30 "gl_TessLevelInner"
Name 40 "gl_TessLevelOuter"
Name 45 "in_tc_tessParam"
Decorate 12(in_te_position) Location 0
Decorate 15(gl_InvocationID) BuiltIn InvocationId
Decorate 20(in_tc_position) Location 0
Decorate 30(gl_TessLevelInner) Patch
Decorate 30(gl_TessLevelInner) BuiltIn TessLevelInner
Decorate 40(gl_TessLevelOuter) Patch
Decorate 40(gl_TessLevelOuter) BuiltIn TessLevelOuter
Decorate 45(in_tc_tessParam) Location 1
Decorate 52 NoContraction
Decorate 53 NoContraction
Decorate 54 NoContraction
Decorate 60 NoContraction
Decorate 61 NoContraction
Decorate 62 NoContraction
Decorate 68 NoContraction
Decorate 69 NoContraction
Decorate 70 NoContraction
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 2
8: TypeInt 32 0
9: 8(int) Constant 3
10: TypeArray 7(fvec2) 9
11: TypePointer Output 10
12(in_te_position): 11(ptr) Variable Output
13: TypeInt 32 1
14: TypePointer Input 13(int)
15(gl_InvocationID): 14(ptr) Variable Input
17: 8(int) Constant 32
18: TypeArray 7(fvec2) 17
19: TypePointer Input 18
20(in_tc_position): 19(ptr) Variable Input
22: TypePointer Input 7(fvec2)
25: TypePointer Output 7(fvec2)
27: 8(int) Constant 2
28: TypeArray 6(float) 27
29: TypePointer Output 28
30(gl_TessLevelInner): 29(ptr) Variable Output
31: 13(int) Constant 0
32: 6(float) Constant 1084227584
33: TypePointer Output 6(float)
35: 13(int) Constant 1
37: 8(int) Constant 4
38: TypeArray 6(float) 37
39: TypePointer Output 38
40(gl_TessLevelOuter): 39(ptr) Variable Output
41: 6(float) Constant 1065353216
42: 6(float) Constant 1105985536
43: TypeArray 6(float) 17
44: TypePointer Input 43
45(in_tc_tessParam): 44(ptr) Variable Input
46: TypePointer Input 6(float)
49: 13(int) Constant 2
4(main): 2 Function None 3
5: Label
16: 13(int) Load 15(gl_InvocationID)
21: 13(int) Load 15(gl_InvocationID)
23: 22(ptr) AccessChain 20(in_tc_position) 21
24: 7(fvec2) Load 23
26: 25(ptr) AccessChain 12(in_te_position) 16
Store 26 24
34: 33(ptr) AccessChain 30(gl_TessLevelInner) 31
Store 34 32
36: 33(ptr) AccessChain 30(gl_TessLevelInner) 35
Store 36 32
47: 46(ptr) AccessChain 45(in_tc_tessParam) 35
48: 6(float) Load 47
50: 46(ptr) AccessChain 45(in_tc_tessParam) 49
51: 6(float) Load 50
52: 6(float) FAdd 48 51
53: 6(float) FMul 42 52
54: 6(float) FAdd 41 53
55: 33(ptr) AccessChain 40(gl_TessLevelOuter) 31
Store 55 54
56: 46(ptr) AccessChain 45(in_tc_tessParam) 49
57: 6(float) Load 56
58: 46(ptr) AccessChain 45(in_tc_tessParam) 31
59: 6(float) Load 58
60: 6(float) FAdd 57 59
61: 6(float) FMul 42 60
62: 6(float) FAdd 41 61
63: 33(ptr) AccessChain 40(gl_TessLevelOuter) 35
Store 63 62
64: 46(ptr) AccessChain 45(in_tc_tessParam) 31
65: 6(float) Load 64
66: 46(ptr) AccessChain 45(in_tc_tessParam) 35
67: 6(float) Load 66
68: 6(float) FAdd 65 67
69: 6(float) FMul 42 68
70: 6(float) FAdd 41 69
71: 33(ptr) AccessChain 40(gl_TessLevelOuter) 49
Store 71 70
Return
FunctionEnd
spv.precise.tese
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
Linked tessellation evaluation stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 119
Capability Tessellation
Capability TessellationPointSize
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationEvaluation 4 "main" 12 21 62 112
ExecutionMode 4 Triangles
ExecutionMode 4 SpacingEqual
ExecutionMode 4 VertexOrderCcw
Source ESSL 310
SourceExtension "GL_EXT_gpu_shader5"
SourceExtension "GL_EXT_shader_io_blocks"
SourceExtension "GL_EXT_tessellation_shader"
Name 4 "main"
Name 9 "pos"
Name 12 "gl_TessCoord"
Name 21 "in_te_position"
Name 45 "f"
Name 62 "in_f_color"
Name 73 "bits"
Name 77 "numBits"
Name 78 "i"
Name 110 "gl_PerVertex"
MemberName 110(gl_PerVertex) 0 "gl_Position"
MemberName 110(gl_PerVertex) 1 "gl_PointSize"
Name 112 ""
Decorate 12(gl_TessCoord) BuiltIn TessCoord
Decorate 21(in_te_position) Location 0
Decorate 27 NoContraction
Decorate 34 NoContraction
Decorate 35 NoContraction
Decorate 42 NoContraction
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
Decorate 106 NoContraction
Decorate 109 NoContraction
MemberDecorate 110(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 110(gl_PerVertex) 1 BuiltIn PointSize
Decorate 110(gl_PerVertex) Block
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 2
8: TypePointer Function 7(fvec2)
10: TypeVector 6(float) 3
11: TypePointer Input 10(fvec3)
12(gl_TessCoord): 11(ptr) Variable Input
13: TypeInt 32 0
14: 13(int) Constant 0
15: TypePointer Input 6(float)
18: 13(int) Constant 32
19: TypeArray 7(fvec2) 18
20: TypePointer Input 19
21(in_te_position): 20(ptr) Variable Input
22: TypeInt 32 1
23: 22(int) Constant 0
24: TypePointer Input 7(fvec2)
28: 13(int) Constant 1
31: 22(int) Constant 1
36: 13(int) Constant 2
39: 22(int) Constant 2
44: TypePointer Function 6(float)
46: 6(float) Constant 1077936128
57: 6(float) Constant 1056964608
60: TypeVector 6(float) 4
61: TypePointer Output 60(fvec4)
62(in_f_color): 61(ptr) Variable Output
66: 6(float) Constant 1065353216
71: TypeVector 13(int) 2
72: TypePointer Function 71(ivec2)
76: TypePointer Function 13(int)
85: TypeBool
105: 6(float) Constant 1025758986
110(gl_PerVertex): TypeStruct 60(fvec4) 6(float)
111: TypePointer Output 110(gl_PerVertex)
112: 111(ptr) Variable Output
114: 6(float) Constant 0
4(main): 2 Function None 3
5: Label
9(pos): 8(ptr) Variable Function
45(f): 44(ptr) Variable Function
73(bits): 72(ptr) Variable Function
77(numBits): 76(ptr) Variable Function
78(i): 76(ptr) Variable Function
16: 15(ptr) AccessChain 12(gl_TessCoord) 14
17: 6(float) Load 16
25: 24(ptr) AccessChain 21(in_te_position) 23
26: 7(fvec2) Load 25
27: 7(fvec2) VectorTimesScalar 26 17
29: 15(ptr) AccessChain 12(gl_TessCoord) 28
30: 6(float) Load 29
32: 24(ptr) AccessChain 21(in_te_position) 31
33: 7(fvec2) Load 32
34: 7(fvec2) VectorTimesScalar 33 30
35: 7(fvec2) FAdd 27 34
37: 15(ptr) AccessChain 12(gl_TessCoord) 36
38: 6(float) Load 37
40: 24(ptr) AccessChain 21(in_te_position) 39
41: 7(fvec2) Load 40
42: 7(fvec2) VectorTimesScalar 41 38
43: 7(fvec2) FAdd 35 42
Store 9(pos) 43
47: 15(ptr) AccessChain 12(gl_TessCoord) 14
48: 6(float) Load 47
49: 15(ptr) AccessChain 12(gl_TessCoord) 28
50: 6(float) Load 49
51: 15(ptr) AccessChain 12(gl_TessCoord) 36
52: 6(float) Load 51
53: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 50 52
54: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 48 53
55: 6(float) FMul 46 54
56: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 55
58: 6(float) FMul 56 57
59: 6(float) FAdd 58 57
Store 45(f) 59
63: 10(fvec3) Load 12(gl_TessCoord)
64: 6(float) Load 45(f)
65: 10(fvec3) VectorTimesScalar 63 64
67: 6(float) CompositeExtract 65 0
68: 6(float) CompositeExtract 65 1
69: 6(float) CompositeExtract 65 2
70: 60(fvec4) CompositeConstruct 67 68 69 66
Store 62(in_f_color) 70
74: 7(fvec2) Load 9(pos)
75: 71(ivec2) Bitcast 74
Store 73(bits) 75
Store 77(numBits) 14
Store 78(i) 14
Branch 79
79: Label
LoopMerge 81 82 None
Branch 83
83: Label
84: 13(int) Load 78(i)
86: 85(bool) ULessThan 84 18
BranchConditional 86 80 81
80: Label
87: 76(ptr) AccessChain 73(bits) 14
88: 13(int) Load 87
89: 13(int) Load 78(i)
90: 13(int) ShiftLeftLogical 88 89
91: 13(int) BitwiseAnd 90 28
92: 76(ptr) AccessChain 73(bits) 28
93: 13(int) Load 92
94: 13(int) Load 78(i)
95: 13(int) ShiftLeftLogical 93 94
96: 13(int) BitwiseAnd 95 28
97: 13(int) IAdd 91 96
98: 13(int) Load 77(numBits)
99: 13(int) IAdd 98 97
Store 77(numBits) 99
Branch 82
82: Label
100: 13(int) Load 78(i)
101: 13(int) IAdd 100 31
Store 78(i) 101
Branch 79
81: Label
102: 13(int) Load 77(numBits)
103: 13(int) BitwiseAnd 102 28
104: 6(float) ConvertUToF 103
106: 6(float) FMul 104 105
107: 7(fvec2) Load 9(pos)
108: 7(fvec2) CompositeConstruct 106 106
109: 7(fvec2) FAdd 107 108
Store 9(pos) 109
113: 7(fvec2) Load 9(pos)
115: 6(float) CompositeExtract 113 0
116: 6(float) CompositeExtract 113 1
117: 60(fvec4) CompositeConstruct 115 116 114 66
118: 61(ptr) AccessChain 112 23
Store 118 117
Return
FunctionEnd
#version 450
#extension GL_EXT_tessellation_shader : require
#extension GL_EXT_gpu_shader5 : require
float minimal() {
precise float result = 5.0;
float a = 10.0;
float b = 20.0;
float c = 30.0;
float d = 40.0;
result = a * b + c * d; // c * d, a * b and rvalue1 + rvalue2 should be 'noContraction'.
return result;
}
void continuous_assignment() {
precise float result = 5.0;
float a = 10.0;
float b = 20.0;
result = a = b + 4; // b + 4 should be 'noContraction'.
}
void convert() {
precise double result;
float a = 10.0;
float b = 20.0;
b = a + b; // a + b should be 'noContraction'.
result = double(b); // convert operation should not be 'noContraction'.
}
float loop_for() {
precise float r1 = 5.0;
precise float r2 = 10.0;
int a = 10;
int b = 20;
int c = 30;
for (int i = 0; i < a; i++) {
r1 += 3.12 + b + i; // 'noContration', this make i++ also 'noContraction'
c += 1; // 'noContration'
}
a += 1; // a + 1 should not be 'noContraction'.
r2 = c; // The calculation of c should be 'noContration'.
return float(r1 + r2); // conversion should not be 'noContration'.
}
void loop_array(void) {
precise float result;
int x = 22;
int y = 33;
float a0[3];
result += float(x) + float(y); // x + y should be 'noContraction' also result + rvalue.
for (int i = 0; i < 3; ++i) {
// a's dereference + 2 should be 'noContraction'.
result += a0[i] + 2;
// result + 1 and 3 - rvalue should be 'noContraction'.
a0[i] = 3 - result++;
}
}
void loop_while() {
precise float result = 5.0;
int a = 10;
int b = 20;
while (result < 10) {
result += 3.12 + b; // result + 3.12 should be 'noContraction'.
}
result = a + b + 5; // b + 5 should not be 'noCtraction' because all operands are integers.
result = 11.1;
}
float fma_not_decorated() {
precise float result;
float a = 1.0;
float b = 2.0;
float c = 3.0;
b = b + c; // b + c should be decorated with 'noContraction'
result = fma(a, b, c); // fma() should not be decorated with 'noContradtion'
return result;
}
precise float precise_return_exp_func() {
float a = 1.0;
float b = 2.0;
return a + b; // the ADD operation should be 'noContraction'
}
precise float precise_return_val_func() {
float a = 1.0;
float b = 2.0;
float result = a + b; // the ADD operation should be 'noContraction'
return result;
}
float precise_func_parameter(float b, precise out float c) {
float a = 0.5;
c = a + b; // noContration
return a - b; // Not noContraction
}
mat3 matrix (mat2x3 a, mat3x2 b) {
mat2x3 c = mat2x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
precise mat3 result;
result = (a + c) * b; // should be noContraction
return result;
}
void main(){}
#version 450
struct T {
float f1;
float f2;
};
out B1 {precise T s; float x;} partial_precise_block;
precise out B2 {T s; float x;} all_precise_block;
float struct_member() {
float a = 1.0;
float b = 2.0;
float c = 3.0;
float d = 4.0;
precise float result;
T S, S2, S3;
S2.f1 = a + 0.2; // NoContraction
S2.f2 = b + 0.2; // NOT NoContraction
S3.f1 = a + b; // NOT NoContraction
S = S2; // "precise" propagated through parent object nodes
result = S.f1 + 0.1; // the ADD operation should be NoContraction
return result;
}
float complex_array_struct() {
precise float result;
struct T1 {
float t1_array[3];
float t1_scalar;
};
struct T2 {
T1 t1a[5];
T1 t1b[6];
T1 t1c[7];
};
struct T3 {float f; T2 t2; vec4 v; int p;};
T3 t3[10];
for(int i=0; i<10; i++) {
t3[i].f = i / 3.0; // Not NoContraction
t3[i].v = vec4(i * 1.5); // NoContraction
t3[i].p = i + 1;
for(int j=0; j<5; j++) {
for(int k = 0; k<3; k++) {
t3[i].t2.t1a[j].t1_array[k] = i * j + k; // Not NoContraction
}
t3[i].t2.t1a[j].t1_scalar = j * 2.0 / i; // Not NoContration
}
for(int j=0; j<6; j++) {
for(int k = 0; k<3; k++) {
t3[i].t2.t1b[j].t1_array[k] = i * j + k; // Not NoContraction
}
t3[i].t2.t1b[j].t1_scalar = j * 2.0 / i; // NoContraction
}
for(int j=0; j<6; j++) {
for(int k = 0; k<3; k++) {
t3[i].t2.t1c[j].t1_array[k] = i * j + k; // Not NoContraction because all operands are integers
}
t3[i].t2.t1c[j].t1_scalar = j * 2.0 / i; // Not NoContraction
}
}
int i = 2;
result = t3[5].t2.t1c[6].t1_array[1]
+ t3[2].t2.t1b[1].t1_scalar
+ t3[i - 1].v.xy.x; // NoContraction
return result;
}
float out_block() {
float a = 0.1;
float b = 0.2;
partial_precise_block.s.f1 = a + b; // NoContraction
partial_precise_block.s.f2 = a - b; // NoContraction
partial_precise_block.x = a * b; // Not NoContraction
all_precise_block.s.f1 = a + b + 1.0; // NoContraction
all_precise_block.s.f2 = a - b - 1.0; // NoContraction
all_precise_block.x = a * b * 2.0; // Also NoContraction
return a + b; // Not NoContraction
}
void main(){}
#version 310 es
#extension GL_EXT_tessellation_shader : require
#extension GL_EXT_gpu_shader5 : require
layout(vertices = 3) out;
layout(location = 0) in highp vec2 in_tc_position[];
layout(location = 1) in highp float in_tc_tessParam[];
layout(location = 0) out highp vec2 in_te_position[];
precise gl_TessLevelOuter;
void main (void)
{
in_te_position[gl_InvocationID] = in_tc_position[gl_InvocationID];
gl_TessLevelInner[0] = 5.0;
gl_TessLevelInner[1] = 5.0;
gl_TessLevelOuter[0] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[1] + in_tc_tessParam[2]);
gl_TessLevelOuter[1] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[2] + in_tc_tessParam[0]);
gl_TessLevelOuter[2] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[0] + in_tc_tessParam[1]);
}
#version 310 es
#extension GL_EXT_tessellation_shader : require
#extension GL_EXT_gpu_shader5 : require
layout(triangles, equal_spacing) in;
layout(location = 0) in highp vec2 in_te_position[];
layout(location = 0) out mediump vec4 in_f_color;
precise gl_Position;
void main(void) {
highp vec2 pos = gl_TessCoord.x * in_te_position[0] +
gl_TessCoord.y * in_te_position[1] +
gl_TessCoord.z * in_te_position[2];
highp float f =
sqrt(3.0 * min(gl_TessCoord.x, min(gl_TessCoord.y, gl_TessCoord.z))) *
0.5 +
0.5;
in_f_color = vec4(gl_TessCoord * f, 1.0);
// Offset the position slightly, based on the parity of the bits in the float
// representation.
// This is done to detect possible small differences in edge vertex positions
// between patches.
uvec2 bits = floatBitsToUint(pos);
uint numBits = 0u;
for (uint i = 0u; i < 32u; i++)
numBits +=
((bits[0] << i) & 1u) + ((bits[1] << i) & 1u);
pos += float(numBits & 1u) * 0.04;
gl_Position = vec4(pos, 0.0, 1.0);
}
...@@ -107,6 +107,8 @@ spv.specConstant.vert ...@@ -107,6 +107,8 @@ spv.specConstant.vert
spv.specConstant.comp spv.specConstant.comp
spv.specConstantComposite.vert spv.specConstantComposite.vert
spv.specConstantOperations.vert spv.specConstantOperations.vert
spv.precise.tese
spv.precise.tesc
# GLSL-level semantics # GLSL-level semantics
vulkan.frag vulkan.frag
vulkan.vert vulkan.vert
......
...@@ -130,3 +130,5 @@ whileLoop.frag ...@@ -130,3 +130,5 @@ whileLoop.frag
nonVulkan.frag nonVulkan.frag
negativeArraySize.comp negativeArraySize.comp
spv.atomic.comp spv.atomic.comp
precise.tesc
precise_struct_block.vert
...@@ -33,6 +33,7 @@ set(SOURCES ...@@ -33,6 +33,7 @@ set(SOURCES
MachineIndependent/preprocessor/PpScanner.cpp MachineIndependent/preprocessor/PpScanner.cpp
MachineIndependent/preprocessor/PpSymbols.cpp MachineIndependent/preprocessor/PpSymbols.cpp
MachineIndependent/preprocessor/PpTokens.cpp MachineIndependent/preprocessor/PpTokens.cpp
MachineIndependent/propagateNoContraction.cpp
GenericCodeGen/CodeGen.cpp GenericCodeGen/CodeGen.cpp
GenericCodeGen/Link.cpp) GenericCodeGen/Link.cpp)
...@@ -62,6 +63,7 @@ set(HEADERS ...@@ -62,6 +63,7 @@ set(HEADERS
MachineIndependent/SymbolTable.h MachineIndependent/SymbolTable.h
MachineIndependent/Versions.h MachineIndependent/Versions.h
MachineIndependent/parseVersions.h MachineIndependent/parseVersions.h
MachineIndependent/propagateNoContraction.h
MachineIndependent/preprocessor/PpContext.h MachineIndependent/preprocessor/PpContext.h
MachineIndependent/preprocessor/PpTokens.h) MachineIndependent/preprocessor/PpTokens.h)
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "localintermediate.h" #include "localintermediate.h"
#include "RemoveTree.h" #include "RemoveTree.h"
#include "SymbolTable.h" #include "SymbolTable.h"
#include "propagateNoContraction.h"
#include <float.h> #include <float.h>
...@@ -1066,6 +1067,9 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) ...@@ -1066,6 +1067,9 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
if (aggRoot && aggRoot->getOp() == EOpNull) if (aggRoot && aggRoot->getOp() == EOpNull)
aggRoot->setOperator(EOpSequence); aggRoot->setOperator(EOpSequence);
// Propagate 'noContraction' label in backward from 'precise' variables.
glslang::PropagateNoContraction(*this);
return true; return true;
} }
......
//
// Copyright (C) 2015-2016 Google, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Visit the nodes in the glslang intermediate tree representation to
// propagate 'noContraction' qualifier.
//
#include "../Include/intermediate.h"
namespace glslang {
// Propagates the 'precise' qualifier for objects (objects marked with
// 'noContraction' qualifier) from the shader source specified 'precise'
// variables to all the involved objects, and add 'noContraction' qualifier for
// the involved arithmetic operations.
// Note that the same qualifier: 'noContraction' is used in both object nodes
// and arithmetic operation nodes, but has different meaning. For object nodes,
// 'noContraction' means the object is 'precise'; and for arithmetic operation
// nodes, it means the operation should not be contracted.
void PropagateNoContraction(const glslang::TIntermediate& intermediate);
};
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