Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
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
angle
Commits
c0f7c619
Commit
c0f7c619
authored
Jun 05, 2013
by
Nicolas Capens
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some uint handling.
TRAC #23185 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Nicolas Capens
parent
ab60b934
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
12 deletions
+16
-12
ConstantUnion.h
src/compiler/ConstantUnion.h
+1
-1
Intermediate.cpp
src/compiler/Intermediate.cpp
+10
-9
OutputHLSL.cpp
src/compiler/OutputHLSL.cpp
+1
-1
intermOut.cpp
src/compiler/intermOut.cpp
+3
-0
intermediate.h
src/compiler/intermediate.h
+1
-1
No files found.
src/compiler/ConstantUnion.h
View file @
c0f7c619
...
@@ -24,7 +24,7 @@ public:
...
@@ -24,7 +24,7 @@ public:
void
setBConst
(
bool
b
)
{
bConst
=
b
;
type
=
EbtBool
;
}
void
setBConst
(
bool
b
)
{
bConst
=
b
;
type
=
EbtBool
;
}
int
getIConst
()
const
{
return
iConst
;
}
int
getIConst
()
const
{
return
iConst
;
}
int
getUConst
()
const
{
return
uConst
;
}
unsigned
int
getUConst
()
const
{
return
uConst
;
}
float
getFConst
()
const
{
return
fConst
;
}
float
getFConst
()
const
{
return
fConst
;
}
bool
getBConst
()
const
{
return
bConst
;
}
bool
getBConst
()
const
{
return
bConst
;
}
...
...
src/compiler/Intermediate.cpp
View file @
c0f7c619
...
@@ -1576,21 +1576,22 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
...
@@ -1576,21 +1576,22 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
case
EOpNegative
:
case
EOpNegative
:
switch
(
getType
().
getBasicType
())
switch
(
getType
().
getBasicType
())
{
{
case
EbtFloat
:
tempConstArray
[
i
].
setFConst
(
-
unionArray
[
i
].
getFConst
());
break
;
case
EbtFloat
:
tempConstArray
[
i
].
setFConst
(
-
unionArray
[
i
].
getFConst
());
break
;
case
EbtInt
:
tempConstArray
[
i
].
setIConst
(
-
unionArray
[
i
].
getIConst
());
break
;
case
EbtInt
:
tempConstArray
[
i
].
setIConst
(
-
unionArray
[
i
].
getIConst
());
break
;
default
:
case
EbtUInt
:
tempConstArray
[
i
].
setUConst
(
static_cast
<
unsigned
int
>
(
-
static_cast
<
int
>
(
unionArray
[
i
].
getUConst
())));
break
;
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unary operation not folded into constant"
,
getLine
());
default
:
return
0
;
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unary operation not folded into constant"
,
getLine
());
return
0
;
}
}
break
;
break
;
case
EOpLogicalNot
:
// this code is written for possible future use, will not get executed currently
case
EOpLogicalNot
:
// this code is written for possible future use, will not get executed currently
switch
(
getType
().
getBasicType
())
switch
(
getType
().
getBasicType
())
{
{
case
EbtBool
:
tempConstArray
[
i
].
setBConst
(
!
unionArray
[
i
].
getBConst
());
break
;
case
EbtBool
:
tempConstArray
[
i
].
setBConst
(
!
unionArray
[
i
].
getBConst
());
break
;
default
:
default
:
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unary operation not folded into constant"
,
getLine
());
infoSink
.
info
.
message
(
EPrefixInternalError
,
"Unary operation not folded into constant"
,
getLine
());
return
0
;
return
0
;
}
}
break
;
break
;
...
...
src/compiler/OutputHLSL.cpp
View file @
c0f7c619
...
@@ -3259,7 +3259,7 @@ const ConstantUnion *OutputHLSL::writeConstantUnion(const TType &type, const Con
...
@@ -3259,7 +3259,7 @@ const ConstantUnion *OutputHLSL::writeConstantUnion(const TType &type, const Con
{
{
case
EbtFloat
:
out
<<
std
::
min
(
FLT_MAX
,
std
::
max
(
-
FLT_MAX
,
constUnion
->
getFConst
()));
break
;
case
EbtFloat
:
out
<<
std
::
min
(
FLT_MAX
,
std
::
max
(
-
FLT_MAX
,
constUnion
->
getFConst
()));
break
;
case
EbtInt
:
out
<<
constUnion
->
getIConst
();
break
;
case
EbtInt
:
out
<<
constUnion
->
getIConst
();
break
;
case
EbtUInt
:
out
<<
constUnion
->
getUConst
();
break
;
case
EbtUInt
:
out
<<
constUnion
->
getUConst
();
break
;
case
EbtBool
:
out
<<
constUnion
->
getBConst
();
break
;
case
EbtBool
:
out
<<
constUnion
->
getBConst
();
break
;
default
:
UNREACHABLE
();
default
:
UNREACHABLE
();
}
}
...
...
src/compiler/intermOut.cpp
View file @
c0f7c619
...
@@ -237,6 +237,9 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node)
...
@@ -237,6 +237,9 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node)
case
EOpConstructIVec3
:
out
<<
"Construct ivec3"
;
break
;
case
EOpConstructIVec3
:
out
<<
"Construct ivec3"
;
break
;
case
EOpConstructIVec4
:
out
<<
"Construct ivec4"
;
break
;
case
EOpConstructIVec4
:
out
<<
"Construct ivec4"
;
break
;
case
EOpConstructUInt
:
out
<<
"Construct uint"
;
break
;
case
EOpConstructUInt
:
out
<<
"Construct uint"
;
break
;
case
EOpConstructUVec2
:
out
<<
"Construct uvec2"
;
break
;
case
EOpConstructUVec3
:
out
<<
"Construct uvec3"
;
break
;
case
EOpConstructUVec4
:
out
<<
"Construct uvec4"
;
break
;
case
EOpConstructMat2
:
out
<<
"Construct mat2"
;
break
;
case
EOpConstructMat2
:
out
<<
"Construct mat2"
;
break
;
case
EOpConstructMat3
:
out
<<
"Construct mat3"
;
break
;
case
EOpConstructMat3
:
out
<<
"Construct mat3"
;
break
;
case
EOpConstructMat4
:
out
<<
"Construct mat4"
;
break
;
case
EOpConstructMat4
:
out
<<
"Construct mat4"
;
break
;
...
...
src/compiler/intermediate.h
View file @
c0f7c619
...
@@ -379,7 +379,7 @@ public:
...
@@ -379,7 +379,7 @@ public:
ConstantUnion
*
getUnionArrayPointer
()
const
{
return
unionArrayPointer
;
}
ConstantUnion
*
getUnionArrayPointer
()
const
{
return
unionArrayPointer
;
}
int
getIConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getIConst
()
:
0
;
}
int
getIConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getIConst
()
:
0
;
}
int
getUConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getUConst
()
:
0
;
}
unsigned
int
getUConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getUConst
()
:
0
;
}
float
getFConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getFConst
()
:
0
.
0
f
;
}
float
getFConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getFConst
()
:
0
.
0
f
;
}
bool
getBConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getBConst
()
:
false
;
}
bool
getBConst
(
int
index
)
const
{
return
unionArrayPointer
?
unionArrayPointer
[
index
].
getBConst
()
:
false
;
}
...
...
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