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
9c2f1c7b
Commit
9c2f1c7b
authored
Apr 03, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:KhronosGroup/glslang
parents
f0bcb0aa
79845ad8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
16 deletions
+20
-16
CMakeLists.txt
CMakeLists.txt
+1
-1
README.md
README.md
+2
-2
SPVRemapper.cpp
SPIRV/SPVRemapper.cpp
+1
-1
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+11
-7
InfoSink.h
glslang/Include/InfoSink.h
+1
-1
PoolAlloc.h
glslang/Include/PoolAlloc.h
+3
-3
ossource.cpp
glslang/OSDependent/Unix/ossource.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
9c2f1c7b
...
@@ -13,7 +13,7 @@ elseif(UNIX)
...
@@ -13,7 +13,7 @@ elseif(UNIX)
add_definitions
(
-fPIC
)
add_definitions
(
-fPIC
)
add_definitions
(
-DGLSLANG_OSINCLUDE_UNIX
)
add_definitions
(
-DGLSLANG_OSINCLUDE_UNIX
)
else
(
WIN32
)
else
(
WIN32
)
message
(
"unkown platform"
)
message
(
"unk
n
own platform"
)
endif
(
WIN32
)
endif
(
WIN32
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
...
...
README.md
View file @
9c2f1c7b
...
@@ -103,7 +103,7 @@ class TProgram
...
@@ -103,7 +103,7 @@ class TProgram
See
`ShaderLang.h`
and the usage of it in
`StandAlone/StandAlone.cpp`
for more
See
`ShaderLang.h`
and the usage of it in
`StandAlone/StandAlone.cpp`
for more
details.
details.
### C Functional Interface (or
gi
nal)
### C Functional Interface (or
ig
nal)
This interface is in roughly the first 2/3 of
`ShaderLang.h`
, and referred to
This interface is in roughly the first 2/3 of
`ShaderLang.h`
, and referred to
as the
`Sh*()`
interface, as all the entry points start
`Sh`
.
as the
`Sh*()`
interface, as all the entry points start
`Sh`
.
...
@@ -118,7 +118,7 @@ ShCompile(shader, compiler) -> compiler(AST) -> <back end>
...
@@ -118,7 +118,7 @@ ShCompile(shader, compiler) -> compiler(AST) -> <back end>
```
```
In practice,
`ShCompile()`
takes shader strings, default version, and
In practice,
`ShCompile()`
takes shader strings, default version, and
warning/error and other options for controling compilation.
warning/error and other options for control
l
ing compilation.
Testing
Testing
-------
-------
...
...
SPIRV/SPVRemapper.cpp
View file @
9c2f1c7b
...
@@ -573,7 +573,7 @@ namespace spv {
...
@@ -573,7 +573,7 @@ namespace spv {
op_fn_nop
);
op_fn_nop
);
// Window size for context-sensitive canonicalization values
// Window size for context-sensitive canonicalization values
// Emp
e
rical best size from a single data set. TODO: Would be a good tunable.
// Emp
i
rical best size from a single data set. TODO: Would be a good tunable.
// We essentially perform a little convolution around each instruction,
// We essentially perform a little convolution around each instruction,
// to capture the flavor of nearby code, to hopefully match to similar
// to capture the flavor of nearby code, to hopefully match to similar
// code in other modules.
// code in other modules.
...
...
SPIRV/SpvBuilder.cpp
View file @
9c2f1c7b
...
@@ -1067,7 +1067,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
...
@@ -1067,7 +1067,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index)
// Generate code for spec constants if in spec constant operation
// Generate code for spec constants if in spec constant operation
// generation mode.
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
{
composite
},
{
index
}
);
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
std
::
vector
<
Id
>
(
1
,
composite
),
std
::
vector
<
Id
>
(
1
,
index
)
);
}
}
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
extract
->
addIdOperand
(
composite
);
extract
->
addIdOperand
(
composite
);
...
@@ -1082,7 +1082,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector<unsigned
...
@@ -1082,7 +1082,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector<unsigned
// Generate code for spec constants if in spec constant operation
// Generate code for spec constants if in spec constant operation
// generation mode.
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
{
composite
}
,
indexes
);
return
createSpecConstantOp
(
OpCompositeExtract
,
typeId
,
std
::
vector
<
Id
>
(
1
,
composite
)
,
indexes
);
}
}
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
Instruction
*
extract
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpCompositeExtract
);
extract
->
addIdOperand
(
composite
);
extract
->
addIdOperand
(
composite
);
...
@@ -1184,7 +1184,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand)
...
@@ -1184,7 +1184,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand)
// Generate code for spec constants if in spec constant operation
// Generate code for spec constants if in spec constant operation
// generation mode.
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
createSpecConstantOp
(
opCode
,
typeId
,
{
operand
},
{}
);
return
createSpecConstantOp
(
opCode
,
typeId
,
std
::
vector
<
Id
>
(
1
,
operand
),
std
::
vector
<
Id
>
()
);
}
}
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
op
->
addIdOperand
(
operand
);
op
->
addIdOperand
(
operand
);
...
@@ -1198,7 +1198,9 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right)
...
@@ -1198,7 +1198,9 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right)
// Generate code for spec constants if in spec constant operation
// Generate code for spec constants if in spec constant operation
// generation mode.
// generation mode.
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
createSpecConstantOp
(
opCode
,
typeId
,
{
left
,
right
},
{});
std
::
vector
<
Id
>
operands
(
2
);
operands
[
0
]
=
left
;
operands
[
1
]
=
right
;
return
createSpecConstantOp
(
opCode
,
typeId
,
operands
,
std
::
vector
<
Id
>
());
}
}
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
Instruction
*
op
=
new
Instruction
(
getUniqueId
(),
typeId
,
opCode
);
op
->
addIdOperand
(
left
);
op
->
addIdOperand
(
left
);
...
@@ -1261,7 +1263,9 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std:
...
@@ -1261,7 +1263,9 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std:
return
setPrecision
(
createCompositeExtract
(
source
,
typeId
,
channels
.
front
()),
precision
);
return
setPrecision
(
createCompositeExtract
(
source
,
typeId
,
channels
.
front
()),
precision
);
if
(
generatingOpCodeForSpecConst
)
{
if
(
generatingOpCodeForSpecConst
)
{
return
setPrecision
(
createSpecConstantOp
(
OpVectorShuffle
,
typeId
,
{
source
,
source
},
channels
),
precision
);
std
::
vector
<
Id
>
operands
(
2
);
operands
[
0
]
=
operands
[
1
]
=
source
;
return
setPrecision
(
createSpecConstantOp
(
OpVectorShuffle
,
typeId
,
operands
,
channels
),
precision
);
}
}
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
Instruction
*
swizzle
=
new
Instruction
(
getUniqueId
(),
typeId
,
OpVectorShuffle
);
assert
(
isVector
(
source
));
assert
(
isVector
(
source
));
...
@@ -2209,7 +2213,7 @@ void Builder::eliminateDeadDecorations() {
...
@@ -2209,7 +2213,7 @@ void Builder::eliminateDeadDecorations() {
}
}
}
}
decorations
.
erase
(
std
::
remove_if
(
decorations
.
begin
(),
decorations
.
end
(),
decorations
.
erase
(
std
::
remove_if
(
decorations
.
begin
(),
decorations
.
end
(),
[
&
unreachable_definitions
](
std
::
unique_ptr
<
Instruction
>&
I
)
{
[
&
unreachable_definitions
](
std
::
unique_ptr
<
Instruction
>&
I
)
->
bool
{
Instruction
*
inst
=
I
.
get
();
Instruction
*
inst
=
I
.
get
();
Id
decoration_id
=
inst
->
getIdOperand
(
0
);
Id
decoration_id
=
inst
->
getIdOperand
(
0
);
return
unreachable_definitions
.
count
(
decoration_id
)
!=
0
;
return
unreachable_definitions
.
count
(
decoration_id
)
!=
0
;
...
@@ -2319,7 +2323,7 @@ void Builder::simplifyAccessChainSwizzle()
...
@@ -2319,7 +2323,7 @@ void Builder::simplifyAccessChainSwizzle()
// To the extent any swizzling can become part of the chain
// To the extent any swizzling can become part of the chain
// of accesses instead of a post operation, make it so.
// of accesses instead of a post operation, make it so.
// If 'dynamic' is true, include transfering a non-static component index,
// If 'dynamic' is true, include transfer
r
ing a non-static component index,
// otherwise, only transfer static indexes.
// otherwise, only transfer static indexes.
//
//
// Also, Boolean vectors are likely to be special. While
// Also, Boolean vectors are likely to be special. While
...
...
glslang/Include/InfoSink.h
View file @
9c2f1c7b
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
case
EPrefixInternalError
:
append
(
"INTERNAL ERROR: "
);
break
;
case
EPrefixInternalError
:
append
(
"INTERNAL ERROR: "
);
break
;
case
EPrefixUnimplemented
:
append
(
"UNIMPLEMENTED: "
);
break
;
case
EPrefixUnimplemented
:
append
(
"UNIMPLEMENTED: "
);
break
;
case
EPrefixNote
:
append
(
"NOTE: "
);
break
;
case
EPrefixNote
:
append
(
"NOTE: "
);
break
;
default
:
append
(
"UNKOWN ERROR: "
);
break
;
default
:
append
(
"UNK
N
OWN ERROR: "
);
break
;
}
}
}
}
void
location
(
const
TSourceLoc
&
loc
)
{
void
location
(
const
TSourceLoc
&
loc
)
{
...
...
glslang/Include/PoolAlloc.h
View file @
9c2f1c7b
...
@@ -95,7 +95,7 @@ public:
...
@@ -95,7 +95,7 @@ public:
void
checkAllocList
()
const
;
void
checkAllocList
()
const
;
// Return total size needed to accomodate user buffer of 'size',
// Return total size needed to accom
m
odate user buffer of 'size',
// plus our tracking data.
// plus our tracking data.
inline
static
size_t
allocationSize
(
size_t
size
)
{
inline
static
size_t
allocationSize
(
size_t
size
)
{
return
size
+
2
*
guardBlockSize
+
headerSize
();
return
size
+
2
*
guardBlockSize
+
headerSize
();
...
@@ -241,8 +241,8 @@ protected:
...
@@ -241,8 +241,8 @@ protected:
int
numCalls
;
// just an interesting statistic
int
numCalls
;
// just an interesting statistic
size_t
totalBytes
;
// just an interesting statistic
size_t
totalBytes
;
// just an interesting statistic
private:
private:
TPoolAllocator
&
operator
=
(
const
TPoolAllocator
&
);
// dont allow assignment operator
TPoolAllocator
&
operator
=
(
const
TPoolAllocator
&
);
// don
'
t allow assignment operator
TPoolAllocator
(
const
TPoolAllocator
&
);
// dont allow default copy constructor
TPoolAllocator
(
const
TPoolAllocator
&
);
// don
'
t allow default copy constructor
};
};
...
...
glslang/OSDependent/Unix/ossource.cpp
View file @
9c2f1c7b
...
@@ -61,7 +61,7 @@ static void DetachThreadLinux(void *)
...
@@ -61,7 +61,7 @@ static void DetachThreadLinux(void *)
//
//
// Registers cleanup handler, sets cancel type and state, and ex
c
ecutes the thread specific
// Registers cleanup handler, sets cancel type and state, and executes the thread specific
// cleanup handler. This function will be called in the Standalone.cpp for regression
// cleanup handler. This function will be called in the Standalone.cpp for regression
// testing. When OpenGL applications are run with the driver code, Linux OS does the
// testing. When OpenGL applications are run with the driver code, Linux OS does the
// thread cleanup.
// thread cleanup.
...
...
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