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
96d8042a
Commit
96d8042a
authored
Jul 22, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #31 from google/explicit-extension-directive
Only output explicit extension directives in preprocessing.
parents
12a38337
1d2996db
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
5 deletions
+11
-5
preprocessor.extensions.vert.out
Test/baseResults/preprocessor.extensions.vert.out
+1
-1
preprocessor.extensions.vert
Test/preprocessor.extensions.vert
+1
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+7
-0
ParseHelper.h
glslang/MachineIndependent/ParseHelper.h
+1
-0
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+0
-3
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+1
-0
No files found.
Test/baseResults/preprocessor.extensions.vert.out
View file @
96d8042a
#version 310 es
#extension GL_
OES_texture_3D
: enable
#extension GL_
EXT_geometry_shader
: enable
#extension GL_EXT_frag_depth : disable
#extension GL_EXT_gpu_shader5 : require
#extension GL_EXT_shader_texture_image_samples : warn
...
...
Test/preprocessor.extensions.vert
View file @
96d8042a
#version 310 es
#extension GL_
OES_texture_3D
: enable
#extension GL_
EXT_geometry_shader
: enable
#extension GL_EXT_frag_depth: disable
#extension GL_EXT_gpu_shader5: require
#extension GL_EXT_shader_texture_image_samples: warn
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
96d8042a
...
...
@@ -5352,4 +5352,11 @@ void TParseContext::notifyLineDirective(int curLineNo, int newLineNo, bool hasSo
}
}
void
TParseContext
::
notifyExtensionDirective
(
int
line
,
const
char
*
extension
,
const
char
*
behavior
)
{
if
(
extensionCallback
)
{
extensionCallback
(
line
,
extension
,
behavior
);
}
}
}
// end namespace glslang
glslang/MachineIndependent/ParseHelper.h
View file @
96d8042a
...
...
@@ -222,6 +222,7 @@ public:
void
notifyVersion
(
int
line
,
int
version
,
const
char
*
type_string
);
void
notifyErrorDirective
(
int
line
,
const
char
*
error_message
);
void
notifyLineDirective
(
int
curLineNo
,
int
newLineNo
,
bool
hasSource
,
int
sourceNum
);
void
notifyExtensionDirective
(
int
line
,
const
char
*
extension
,
const
char
*
behavior
);
// The following are implemented in Versions.cpp to localize version/profile/stage/extensions control
void
initializeExtensionBehavior
();
...
...
glslang/MachineIndependent/Versions.cpp
View file @
96d8042a
...
...
@@ -475,9 +475,6 @@ bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const exte
//
void
TParseContext
::
updateExtensionBehavior
(
int
line
,
const
char
*
extension
,
const
char
*
behaviorString
)
{
if
(
extensionCallback
)
extensionCallback
(
line
,
extension
,
behaviorString
);
// Translate from text string of extension's behavior to an enum.
TExtensionBehavior
behavior
=
EBhDisable
;
if
(
!
strcmp
(
"require"
,
behaviorString
))
...
...
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
96d8042a
...
...
@@ -773,6 +773,7 @@ int TPpContext::CPPextension(TPpToken* ppToken)
}
parseContext
.
updateExtensionBehavior
(
line
,
extensionName
,
ppToken
->
name
);
parseContext
.
notifyExtensionDirective
(
line
,
extensionName
,
ppToken
->
name
);
token
=
scanToken
(
ppToken
);
if
(
token
==
'\n'
)
...
...
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