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
adc33b23
Commit
adc33b23
authored
Jan 08, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Non-functional: Fix HLSL error message, and code formatting.
parent
99892d5a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
Scan.cpp
glslang/MachineIndependent/Scan.cpp
+11
-9
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+6
-3
hlslScanContext.cpp
hlsl/hlslScanContext.cpp
+9
-4
No files found.
glslang/MachineIndependent/Scan.cpp
View file @
adc33b23
...
...
@@ -841,7 +841,8 @@ int TScanContext::tokenizeIdentifier()
case
VOLATILE
:
if
(
parseContext
.
profile
==
EEsProfile
&&
parseContext
.
version
>=
310
)
return
keyword
;
if
(
!
parseContext
.
symbolTable
.
atBuiltInLevel
()
&&
(
parseContext
.
profile
==
EEsProfile
||
(
parseContext
.
version
<
420
&&
!
parseContext
.
extensionTurnedOn
(
E_GL_ARB_shader_image_load_store
))))
if
(
!
parseContext
.
symbolTable
.
atBuiltInLevel
()
&&
(
parseContext
.
profile
==
EEsProfile
||
(
parseContext
.
version
<
420
&&
!
parseContext
.
extensionTurnedOn
(
E_GL_ARB_shader_image_load_store
))))
reservedWord
();
return
keyword
;
...
...
@@ -985,8 +986,8 @@ int TScanContext::tokenizeIdentifier()
case
U64VEC4
:
afterType
=
true
;
if
(
parseContext
.
symbolTable
.
atBuiltInLevel
()
||
(
parseContext
.
extensionTurnedOn
(
E_GL_ARB_gpu_shader_int64
)
&&
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
))
(
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
&&
parseContext
.
extensionTurnedOn
(
E_GL_ARB_gpu_shader_int64
)
))
return
keyword
;
return
identifierOrType
();
...
...
@@ -1001,8 +1002,8 @@ int TScanContext::tokenizeIdentifier()
case
U16VEC4
:
afterType
=
true
;
if
(
parseContext
.
symbolTable
.
atBuiltInLevel
()
||
(
parseContext
.
extensionTurnedOn
(
E_GL_AMD_gpu_shader_int16
)
&&
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
))
(
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
&&
parseContext
.
extensionTurnedOn
(
E_GL_AMD_gpu_shader_int16
)
))
return
keyword
;
return
identifierOrType
();
...
...
@@ -1024,8 +1025,8 @@ int TScanContext::tokenizeIdentifier()
case
F16MAT4X4
:
afterType
=
true
;
if
(
parseContext
.
symbolTable
.
atBuiltInLevel
()
||
(
parseContext
.
extensionTurnedOn
(
E_GL_AMD_gpu_shader_half_float
)
&&
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
))
(
parseContext
.
profile
!=
EEsProfile
&&
parseContext
.
version
>=
450
&&
parseContext
.
extensionTurnedOn
(
E_GL_AMD_gpu_shader_half_float
)
))
return
keyword
;
return
identifierOrType
();
#endif
...
...
@@ -1115,7 +1116,7 @@ int TScanContext::tokenizeIdentifier()
case
SAMPLER3D
:
afterType
=
true
;
if
(
parseContext
.
profile
==
EEsProfile
&&
parseContext
.
version
<
300
)
{
if
(
!
parseContext
.
extensionTurnedOn
(
E_GL_OES_texture_3D
))
if
(
!
parseContext
.
extensionTurnedOn
(
E_GL_OES_texture_3D
))
reservedWord
();
}
return
keyword
;
...
...
@@ -1403,7 +1404,8 @@ int TScanContext::dMat()
int
TScanContext
::
firstGenerationImage
(
bool
inEs310
)
{
if
(
parseContext
.
symbolTable
.
atBuiltInLevel
()
||
(
parseContext
.
profile
!=
EEsProfile
&&
(
parseContext
.
version
>=
420
||
parseContext
.
extensionTurnedOn
(
E_GL_ARB_shader_image_load_store
)))
||
(
parseContext
.
profile
!=
EEsProfile
&&
(
parseContext
.
version
>=
420
||
parseContext
.
extensionTurnedOn
(
E_GL_ARB_shader_image_load_store
)))
||
(
inEs310
&&
parseContext
.
profile
==
EEsProfile
&&
parseContext
.
version
>=
310
))
return
keyword
;
...
...
glslang/MachineIndependent/Versions.cpp
View file @
adc33b23
...
...
@@ -570,7 +570,8 @@ bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExte
//
void
TParseVersions
::
requireExtensions
(
const
TSourceLoc
&
loc
,
int
numExtensions
,
const
char
*
const
extensions
[],
const
char
*
featureDesc
)
{
if
(
checkExtensionsRequested
(
loc
,
numExtensions
,
extensions
,
featureDesc
))
return
;
if
(
checkExtensionsRequested
(
loc
,
numExtensions
,
extensions
,
featureDesc
))
return
;
// If we get this far, give errors explaining what extensions are needed
if
(
numExtensions
==
1
)
...
...
@@ -588,7 +589,8 @@ void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions,
//
void
TParseVersions
::
ppRequireExtensions
(
const
TSourceLoc
&
loc
,
int
numExtensions
,
const
char
*
const
extensions
[],
const
char
*
featureDesc
)
{
if
(
checkExtensionsRequested
(
loc
,
numExtensions
,
extensions
,
featureDesc
))
return
;
if
(
checkExtensionsRequested
(
loc
,
numExtensions
,
extensions
,
featureDesc
))
return
;
// If we get this far, give errors explaining what extensions are needed
if
(
numExtensions
==
1
)
...
...
@@ -626,7 +628,8 @@ bool TParseVersions::extensionTurnedOn(const char* const extension)
bool
TParseVersions
::
extensionsTurnedOn
(
int
numExtensions
,
const
char
*
const
extensions
[])
{
for
(
int
i
=
0
;
i
<
numExtensions
;
++
i
)
{
if
(
extensionTurnedOn
(
extensions
[
i
]))
return
true
;
if
(
extensionTurnedOn
(
extensions
[
i
]))
return
true
;
}
return
false
;
}
...
...
hlsl/hlslScanContext.cpp
View file @
adc33b23
...
...
@@ -565,10 +565,15 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token)
case
EndOfInput
:
return
EHTokNone
;
default
:
char
buf
[
2
];
buf
[
0
]
=
(
char
)
token
;
buf
[
1
]
=
0
;
parseContext
.
error
(
loc
,
"unexpected token"
,
buf
,
""
);
if
(
token
<
PpAtomMaxSingle
)
{
char
buf
[
2
];
buf
[
0
]
=
(
char
)
token
;
buf
[
1
]
=
0
;
parseContext
.
error
(
loc
,
"unexpected token"
,
buf
,
""
);
}
else
if
(
tokenText
[
0
]
!=
0
)
parseContext
.
error
(
loc
,
"unexpected token"
,
tokenText
,
""
);
else
parseContext
.
error
(
loc
,
"unexpected token"
,
""
,
""
);
break
;
}
}
while
(
true
);
...
...
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