Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
5bec2b56
Commit
5bec2b56
authored
May 06, 2016
by
qining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integer type operation should not be noContraction
parent
34d25718
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
precise.tesc.out
Test/baseResults/precise.tesc.out
+0
-0
precise_struct_block.vert.out
Test/baseResults/precise_struct_block.vert.out
+4
-4
precise.tesc
Test/precise.tesc
+10
-10
precise_struct_block.vert
Test/precise_struct_block.vert
+1
-1
propagateNoContraction.cpp
glslang/MachineIndependent/propagateNoContraction.cpp
+1
-1
No files found.
Test/baseResults/precise.tesc.out
View file @
5bec2b56
This diff is collapsed.
Click to expand it.
Test/baseResults/precise_struct_block.vert.out
View file @
5bec2b56
...
@@ -325,8 +325,8 @@ Shader version: 450
...
@@ -325,8 +325,8 @@ Shader version: 450
0:63 0 (const int)
0:63 0 (const int)
0:63 'k' (temp int)
0:63 'k' (temp int)
0:63 Convert int to float (temp float)
0:63 Convert int to float (temp float)
0:63 add (
noContraction
temp int)
0:63 add (temp int)
0:63 component-wise multiply (
noContraction
temp int)
0:63 component-wise multiply (temp int)
0:63 'i' (noContraction temp int)
0:63 'i' (noContraction temp int)
0:63 'j' (noContraction temp int)
0:63 'j' (noContraction temp int)
0:63 'k' (noContraction temp int)
0:63 'k' (noContraction temp int)
...
@@ -848,8 +848,8 @@ Shader version: 450
...
@@ -848,8 +848,8 @@ Shader version: 450
0:63 0 (const int)
0:63 0 (const int)
0:63 'k' (temp int)
0:63 'k' (temp int)
0:63 Convert int to float (temp float)
0:63 Convert int to float (temp float)
0:63 add (
noContraction
temp int)
0:63 add (temp int)
0:63 component-wise multiply (
noContraction
temp int)
0:63 component-wise multiply (temp int)
0:63 'i' (noContraction temp int)
0:63 'i' (noContraction temp int)
0:63 'j' (noContraction temp int)
0:63 'j' (noContraction temp int)
0:63 'k' (noContraction temp int)
0:63 'k' (noContraction temp int)
...
...
Test/precise.tesc
View file @
5bec2b56
...
@@ -14,17 +14,17 @@ float minimal() {
...
@@ -14,17 +14,17 @@ float minimal() {
void continuous_assignment() {
void continuous_assignment() {
precise float result = 5.0;
precise float result = 5.0;
int a = 1
0;
float a = 10.
0;
int b = 2
0;
float b = 20.
0;
result = a = b + 4; // b + 4 should be 'noContraction'.
result = a = b + 4; // b + 4 should be 'noContraction'.
}
}
void convert() {
void convert() {
precise
float
result;
precise
double
result;
int a = 1
0;
float a = 10.
0;
int b = 2
0;
float b = 20.
0;
b = a + b; // a + b should be 'noContraction'.
b = a + b; // a + b should be 'noContraction'.
result =
float
(b); // convert operation should not be 'noContraction'.
result =
double
(b); // convert operation should not be 'noContraction'.
}
}
float loop_for() {
float loop_for() {
...
@@ -43,13 +43,13 @@ float loop_for() {
...
@@ -43,13 +43,13 @@ float loop_for() {
}
}
void loop_array(void) {
void loop_array(void) {
precise
int result = 5
;
precise
float result
;
int x = 22;
int x = 22;
int y = 33;
int y = 33;
in
t a0[3];
floa
t a0[3];
result +=
x + y
; // x + y should be 'noContraction' also result + rvalue.
result +=
float(x) + float(y)
; // x + y should be 'noContraction' also result + rvalue.
for (int i = 0; i < 3; ++i) {
for (int i = 0; i < 3; ++i) {
// a's dereference + 2 should be 'noContraction'.
// a's dereference + 2 should be 'noContraction'.
...
@@ -66,7 +66,7 @@ void loop_while() {
...
@@ -66,7 +66,7 @@ void loop_while() {
while (result < 10) {
while (result < 10) {
result += 3.12 + b; // result + 3.12 should be 'noContraction'.
result += 3.12 + b; // result + 3.12 should be 'noContraction'.
}
}
result = a + b + 5; // b + 5 should
be 'noCtraction' and also a + rvalue
.
result = a + b + 5; // b + 5 should
not be 'noCtraction' because all operands are integers
.
result = 11.1;
result = 11.1;
}
}
...
...
Test/precise_struct_block.vert
View file @
5bec2b56
...
@@ -60,7 +60,7 @@ float complex_array_struct() {
...
@@ -60,7 +60,7 @@ float complex_array_struct() {
for
(
int
j
=
0
;
j
<
6
;
j
++
)
{
for
(
int
j
=
0
;
j
<
6
;
j
++
)
{
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
t3
[
i
].
t2
.
t1c
[
j
].
t1_array
[
k
]
=
i
*
j
+
k
;
// No
Contraction
t3
[
i
].
t2
.
t1c
[
j
].
t1_array
[
k
]
=
i
*
j
+
k
;
// No
t NoContraction because all operands are integers
}
}
t3
[
i
].
t2
.
t1c
[
j
].
t1_scalar
=
j
*
2
.
0
/
i
;
// Not NoContraction
t3
[
i
].
t2
.
t1c
[
j
].
t1_scalar
=
j
*
2
.
0
/
i
;
// Not NoContraction
}
}
...
...
glslang/MachineIndependent/propagateNoContraction.cpp
View file @
5bec2b56
...
@@ -712,7 +712,7 @@ protected:
...
@@ -712,7 +712,7 @@ protected:
return
false
;
return
false
;
}
}
// If this is an arithmetic operation, marks this node as 'noContraction'.
// If this is an arithmetic operation, marks this node as 'noContraction'.
if
(
isArithmeticOperation
(
node
->
getOp
()))
{
if
(
isArithmeticOperation
(
node
->
getOp
())
&&
node
->
getBasicType
()
!=
glslang
::
EbtInt
)
{
node
->
getWritableType
().
getQualifier
().
noContraction
=
true
;
node
->
getWritableType
().
getQualifier
().
noContraction
=
true
;
}
}
// As this node is not an object node, need to traverse the children nodes.
// As this node is not an object node, need to traverse the children nodes.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment