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
dca93d6b
Commit
dca93d6b
authored
Dec 14, 2016
by
John Kessenich
Committed by
GitHub
Dec 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #629 from null77/fix-unicode
Change unicode dash to ASCII.
parents
95abd284
cebd97eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Constant.cpp
glslang/MachineIndependent/Constant.cpp
+7
-7
No files found.
glslang/MachineIndependent/Constant.cpp
View file @
dca93d6b
...
@@ -57,7 +57,7 @@ bool isNan(double x)
...
@@ -57,7 +57,7 @@ bool isNan(double x)
u
.
d
=
x
;
u
.
d
=
x
;
int
bitPatternL
=
u
.
i
[
0
];
int
bitPatternL
=
u
.
i
[
0
];
int
bitPatternH
=
u
.
i
[
1
];
int
bitPatternH
=
u
.
i
[
1
];
return
(
bitPatternH
&
0x7ff80000
)
==
0x7ff80000
&&
return
(
bitPatternH
&
0x7ff80000
)
==
0x7ff80000
&&
((
bitPatternH
&
0xFFFFF
)
!=
0
||
bitPatternL
!=
0
);
((
bitPatternH
&
0xFFFFF
)
!=
0
||
bitPatternL
!=
0
);
}
}
...
@@ -68,7 +68,7 @@ bool isInf(double x)
...
@@ -68,7 +68,7 @@ bool isInf(double x)
u
.
d
=
x
;
u
.
d
=
x
;
int
bitPatternL
=
u
.
i
[
0
];
int
bitPatternL
=
u
.
i
[
0
];
int
bitPatternH
=
u
.
i
[
1
];
int
bitPatternH
=
u
.
i
[
1
];
return
(
bitPatternH
&
0x7ff00000
)
==
0x7ff00000
&&
return
(
bitPatternH
&
0x7ff00000
)
==
0x7ff00000
&&
(
bitPatternH
&
0xFFFFF
)
==
0
&&
bitPatternL
==
0
;
(
bitPatternH
&
0xFFFFF
)
==
0
&&
bitPatternL
==
0
;
}
}
...
@@ -131,7 +131,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
...
@@ -131,7 +131,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
TConstUnionArray
smearedArray
(
newComps
,
rightNode
->
getConstArray
()[
0
]);
TConstUnionArray
smearedArray
(
newComps
,
rightNode
->
getConstArray
()[
0
]);
rightUnionArray
=
smearedArray
;
rightUnionArray
=
smearedArray
;
}
else
if
(
constComps
>
1
&&
newComps
==
1
)
{
}
else
if
(
constComps
>
1
&&
newComps
==
1
)
{
// for a case like vec4 f = 1.2 + vec4(2,3,4,5);
// for a case like vec4 f = 1.2 + vec4(2,3,4,5);
newComps
=
constComps
;
newComps
=
constComps
;
rightUnionArray
=
rightNode
->
getConstArray
();
rightUnionArray
=
rightNode
->
getConstArray
();
TConstUnionArray
smearedArray
(
newComps
,
getConstArray
()[
0
]);
TConstUnionArray
smearedArray
(
newComps
,
getConstArray
()[
0
]);
...
@@ -626,7 +626,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
...
@@ -626,7 +626,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
//
//
// Do constant folding for an aggregate node that has all its children
// Do constant folding for an aggregate node that has all its children
// as constants and an operator that requires constant folding.
// as constants and an operator that requires constant folding.
//
//
TIntermTyped
*
TIntermediate
::
fold
(
TIntermAggregate
*
aggrNode
)
TIntermTyped
*
TIntermediate
::
fold
(
TIntermAggregate
*
aggrNode
)
{
{
if
(
!
areAllChildConst
(
aggrNode
))
if
(
!
areAllChildConst
(
aggrNode
))
...
@@ -802,7 +802,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
...
@@ -802,7 +802,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
break
;
break
;
case
EOpSmoothStep
:
case
EOpSmoothStep
:
{
{
double
t
=
(
childConstUnions
[
2
][
arg2comp
].
getDConst
()
-
childConstUnions
[
0
][
arg0comp
].
getDConst
())
/
double
t
=
(
childConstUnions
[
2
][
arg2comp
].
getDConst
()
-
childConstUnions
[
0
][
arg0comp
].
getDConst
())
/
(
childConstUnions
[
1
][
arg1comp
].
getDConst
()
-
childConstUnions
[
0
][
arg0comp
].
getDConst
());
(
childConstUnions
[
1
][
arg1comp
].
getDConst
()
-
childConstUnions
[
0
][
arg0comp
].
getDConst
());
if
(
t
<
0.0
)
if
(
t
<
0.0
)
t
=
0.0
;
t
=
0.0
;
...
@@ -841,7 +841,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
...
@@ -841,7 +841,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
newConstArray
[
2
]
=
childConstUnions
[
0
][
0
]
*
childConstUnions
[
1
][
1
]
-
childConstUnions
[
0
][
1
]
*
childConstUnions
[
1
][
0
];
newConstArray
[
2
]
=
childConstUnions
[
0
][
0
]
*
childConstUnions
[
1
][
1
]
-
childConstUnions
[
0
][
1
]
*
childConstUnions
[
1
][
0
];
break
;
break
;
case
EOpFaceForward
:
case
EOpFaceForward
:
// If dot(Nref, I) < 0 return N, otherwise return N: Arguments are (N, I, Nref).
// If dot(Nref, I) < 0 return N, otherwise return
-
N: Arguments are (N, I, Nref).
dot
=
childConstUnions
[
1
].
dot
(
childConstUnions
[
2
]);
dot
=
childConstUnions
[
1
].
dot
(
childConstUnions
[
2
]);
for
(
int
comp
=
0
;
comp
<
numComps
;
++
comp
)
{
for
(
int
comp
=
0
;
comp
<
numComps
;
++
comp
)
{
if
(
dot
<
0.0
)
if
(
dot
<
0.0
)
...
@@ -968,7 +968,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
...
@@ -968,7 +968,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
}
}
//
//
// Make a constant vector node or constant scalar node, representing a given
// Make a constant vector node or constant scalar node, representing a given
// constant vector and constant swizzle into it.
// constant vector and constant swizzle into it.
//
//
TIntermTyped
*
TIntermediate
::
foldSwizzle
(
TIntermTyped
*
node
,
TVectorFields
&
fields
,
const
TSourceLoc
&
loc
)
TIntermTyped
*
TIntermediate
::
foldSwizzle
(
TIntermTyped
*
node
,
TVectorFields
&
fields
,
const
TSourceLoc
&
loc
)
...
...
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