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
b5b5f918
Commit
b5b5f918
authored
Mar 02, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Non-functional: Make the vulkan version number meaning be only 0 or not 0.
parent
e58d58b7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+5
-5
Scan.cpp
glslang/MachineIndependent/Scan.cpp
+2
-2
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+3
-3
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+1
-1
Versions.h
glslang/MachineIndependent/Versions.h
+1
-1
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+1
-1
No files found.
glslang/MachineIndependent/Initialize.cpp
View file @
b5b5f918
...
@@ -3195,7 +3195,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3195,7 +3195,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
}
// GL_AMD_shader_fragment_mask
// GL_AMD_shader_fragment_mask
if
(
profile
!=
EEsProfile
&&
version
>=
450
&&
spvVersion
.
vulkan
>
=
10
0
)
{
if
(
profile
!=
EEsProfile
&&
version
>=
450
&&
spvVersion
.
vulkan
>
0
)
{
stageBuiltins
[
EShLangFragment
].
append
(
stageBuiltins
[
EShLangFragment
].
append
(
"uint fragmentMaskFetchAMD(subpassInputMS);"
"uint fragmentMaskFetchAMD(subpassInputMS);"
"uint fragmentMaskFetchAMD(isubpassInputMS);"
"uint fragmentMaskFetchAMD(isubpassInputMS);"
...
@@ -3494,7 +3494,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3494,7 +3494,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins
[
EShLangVertex
].
append
(
stageBuiltins
[
EShLangVertex
].
append
(
"int gl_InstanceID;"
// needs qualifier fixed later
"int gl_InstanceID;"
// needs qualifier fixed later
);
);
if
(
spvVersion
.
vulkan
>
=
10
0
&&
version
>=
140
)
if
(
spvVersion
.
vulkan
>
0
&&
version
>=
140
)
stageBuiltins
[
EShLangVertex
].
append
(
stageBuiltins
[
EShLangVertex
].
append
(
"in int gl_VertexIndex;"
"in int gl_VertexIndex;"
"in int gl_InstanceIndex;"
"in int gl_InstanceIndex;"
...
@@ -3544,7 +3544,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3544,7 +3544,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in highp int gl_VertexID;"
// needs qualifier fixed later
"in highp int gl_VertexID;"
// needs qualifier fixed later
"in highp int gl_InstanceID;"
// needs qualifier fixed later
"in highp int gl_InstanceID;"
// needs qualifier fixed later
);
);
if
(
spvVersion
.
vulkan
>
=
10
0
)
if
(
spvVersion
.
vulkan
>
0
)
stageBuiltins
[
EShLangVertex
].
append
(
stageBuiltins
[
EShLangVertex
].
append
(
"in highp int gl_VertexIndex;"
"in highp int gl_VertexIndex;"
"in highp int gl_InstanceIndex;"
"in highp int gl_InstanceIndex;"
...
@@ -5569,7 +5569,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
...
@@ -5569,7 +5569,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable
(
"gl_SubGroupLeMaskARB"
,
EbvSubGroupLeMask
,
symbolTable
);
BuiltInVariable
(
"gl_SubGroupLeMaskARB"
,
EbvSubGroupLeMask
,
symbolTable
);
BuiltInVariable
(
"gl_SubGroupLtMaskARB"
,
EbvSubGroupLtMask
,
symbolTable
);
BuiltInVariable
(
"gl_SubGroupLtMaskARB"
,
EbvSubGroupLtMask
,
symbolTable
);
if
(
spvVersion
.
vulkan
>
=
10
0
)
if
(
spvVersion
.
vulkan
>
0
)
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier
(
"gl_SubGroupSizeARB"
,
EvqVaryingIn
,
EbvSubGroupSize
,
symbolTable
);
SpecialQualifier
(
"gl_SubGroupSizeARB"
,
EvqVaryingIn
,
EbvSubGroupSize
,
symbolTable
);
...
@@ -5670,7 +5670,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
...
@@ -5670,7 +5670,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
SpecialQualifier
(
"gl_InstanceID"
,
EvqInstanceId
,
EbvInstanceId
,
symbolTable
);
SpecialQualifier
(
"gl_InstanceID"
,
EvqInstanceId
,
EbvInstanceId
,
symbolTable
);
}
}
if
(
spvVersion
.
vulkan
>
=
10
0
)
{
if
(
spvVersion
.
vulkan
>
0
)
{
BuiltInVariable
(
"gl_VertexIndex"
,
EbvVertexIndex
,
symbolTable
);
BuiltInVariable
(
"gl_VertexIndex"
,
EbvVertexIndex
,
symbolTable
);
BuiltInVariable
(
"gl_InstanceIndex"
,
EbvInstanceIndex
,
symbolTable
);
BuiltInVariable
(
"gl_InstanceIndex"
,
EbvInstanceIndex
,
symbolTable
);
}
}
...
...
glslang/MachineIndependent/Scan.cpp
View file @
b5b5f918
...
@@ -1244,7 +1244,7 @@ int TScanContext::tokenizeIdentifier()
...
@@ -1244,7 +1244,7 @@ int TScanContext::tokenizeIdentifier()
case
TEXTURE1DARRAY
:
case
TEXTURE1DARRAY
:
case
SAMPLER
:
case
SAMPLER
:
case
SAMPLERSHADOW
:
case
SAMPLERSHADOW
:
if
(
parseContext
.
spvVersion
.
vulkan
>
=
10
0
)
if
(
parseContext
.
spvVersion
.
vulkan
>
0
)
return
keyword
;
return
keyword
;
else
else
return
identifierOrType
();
return
identifierOrType
();
...
@@ -1255,7 +1255,7 @@ int TScanContext::tokenizeIdentifier()
...
@@ -1255,7 +1255,7 @@ int TScanContext::tokenizeIdentifier()
case
ISUBPASSINPUTMS
:
case
ISUBPASSINPUTMS
:
case
USUBPASSINPUT
:
case
USUBPASSINPUT
:
case
USUBPASSINPUTMS
:
case
USUBPASSINPUTMS
:
if
(
parseContext
.
spvVersion
.
vulkan
>
=
10
0
)
if
(
parseContext
.
spvVersion
.
vulkan
>
0
)
return
keyword
;
return
keyword
;
else
else
return
identifierOrType
();
return
identifierOrType
();
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
b5b5f918
...
@@ -578,7 +578,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
...
@@ -578,7 +578,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
if
(
spvVersion
.
spv
!=
0
)
{
if
(
spvVersion
.
spv
!=
0
)
{
switch
(
profile
)
{
switch
(
profile
)
{
case
EEsProfile
:
case
EEsProfile
:
if
(
spvVersion
.
vulkan
>
=
10
0
&&
version
<
310
)
{
if
(
spvVersion
.
vulkan
>
0
&&
version
<
310
)
{
correct
=
false
;
correct
=
false
;
infoSink
.
info
.
message
(
EPrefixError
,
"#version: ES shaders for Vulkan SPIR-V require version 310 or higher"
);
infoSink
.
info
.
message
(
EPrefixError
,
"#version: ES shaders for Vulkan SPIR-V require version 310 or higher"
);
version
=
310
;
version
=
310
;
...
@@ -593,7 +593,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
...
@@ -593,7 +593,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
infoSink
.
info
.
message
(
EPrefixError
,
"#version: compilation for SPIR-V does not support the compatibility profile"
);
infoSink
.
info
.
message
(
EPrefixError
,
"#version: compilation for SPIR-V does not support the compatibility profile"
);
break
;
break
;
default:
default:
if
(
spvVersion
.
vulkan
>
=
10
0
&&
version
<
140
)
{
if
(
spvVersion
.
vulkan
>
0
&&
version
<
140
)
{
correct
=
false
;
correct
=
false
;
infoSink
.
info
.
message
(
EPrefixError
,
"#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher"
);
infoSink
.
info
.
message
(
EPrefixError
,
"#version: Desktop shaders for Vulkan SPIR-V require version 140 or higher"
);
version
=
140
;
version
=
140
;
...
@@ -814,7 +814,7 @@ bool ProcessDeferred(
...
@@ -814,7 +814,7 @@ bool ProcessDeferred(
intermediate
.
setProfile
(
profile
);
intermediate
.
setProfile
(
profile
);
intermediate
.
setSpv
(
spvVersion
);
intermediate
.
setSpv
(
spvVersion
);
RecordProcesses
(
intermediate
,
messages
,
sourceEntryPointName
);
RecordProcesses
(
intermediate
,
messages
,
sourceEntryPointName
);
if
(
spvVersion
.
vulkan
>
=
10
0
)
if
(
spvVersion
.
vulkan
>
0
)
intermediate
.
setOriginUpperLeft
();
intermediate
.
setOriginUpperLeft
();
if
((
messages
&
EShMsgHlslOffsets
)
||
source
==
EShSourceHlsl
)
if
((
messages
&
EShMsgHlslOffsets
)
||
source
==
EShSourceHlsl
)
intermediate
.
setHlslOffsets
();
intermediate
.
setHlslOffsets
();
...
...
glslang/MachineIndependent/Versions.cpp
View file @
b5b5f918
...
@@ -802,7 +802,7 @@ void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
...
@@ -802,7 +802,7 @@ void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
// Call for any operation removed because Vulkan SPIR-V is being generated.
// Call for any operation removed because Vulkan SPIR-V is being generated.
void
TParseVersions
::
vulkanRemoved
(
const
TSourceLoc
&
loc
,
const
char
*
op
)
void
TParseVersions
::
vulkanRemoved
(
const
TSourceLoc
&
loc
,
const
char
*
op
)
{
{
if
(
spvVersion
.
vulkan
>
=
10
0
)
if
(
spvVersion
.
vulkan
>
0
)
error
(
loc
,
"not allowed when using GLSL for Vulkan"
,
op
,
""
);
error
(
loc
,
"not allowed when using GLSL for Vulkan"
,
op
,
""
);
}
}
...
...
glslang/MachineIndependent/Versions.h
View file @
b5b5f918
...
@@ -83,7 +83,7 @@ struct SpvVersion {
...
@@ -83,7 +83,7 @@ struct SpvVersion {
SpvVersion
()
:
spv
(
0
),
vulkanGlsl
(
0
),
vulkan
(
0
),
openGl
(
0
)
{}
SpvVersion
()
:
spv
(
0
),
vulkanGlsl
(
0
),
vulkan
(
0
),
openGl
(
0
)
{}
unsigned
int
spv
;
// the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header
unsigned
int
spv
;
// the version of SPIR-V to target, as defined by "word 1" of the SPIR-V binary header
int
vulkanGlsl
;
// the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX"
int
vulkanGlsl
;
// the version of GLSL semantics for Vulkan, from GL_KHR_vulkan_glsl, for "#define VULKAN XXX"
int
vulkan
;
// the version of Vulkan, for which SPIR-V execution environment rules to use
(100 means 1.0)
int
vulkan
;
// the version of Vulkan, for which SPIR-V execution environment rules to use
int
openGl
;
// the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX"
int
openGl
;
// the version of GLSL semantics for OpenGL, from GL_ARB_gl_spirv, for "#define GL_SPIRV XXX"
};
};
...
...
glslang/MachineIndependent/localintermediate.h
View file @
b5b5f918
...
@@ -378,7 +378,7 @@ public:
...
@@ -378,7 +378,7 @@ public:
processes
.
addProcess
(
"client opengl100"
);
processes
.
addProcess
(
"client opengl100"
);
// target-environment processes
// target-environment processes
if
(
spvVersion
.
vulkan
==
10
0
)
if
(
spvVersion
.
vulkan
>
0
)
processes
.
addProcess
(
"target-env vulkan1.0"
);
processes
.
addProcess
(
"target-env vulkan1.0"
);
else
if
(
spvVersion
.
vulkan
>
0
)
else
if
(
spvVersion
.
vulkan
>
0
)
processes
.
addProcess
(
"target-env vulkanUnknown"
);
processes
.
addProcess
(
"target-env vulkanUnknown"
);
...
...
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