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
be467db7
Unverified
Commit
be467db7
authored
Sep 16, 2019
by
John Kessenich
Committed by
GitHub
Sep 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1899 from KhronosGroup/SPIR-V_1.5
Branch to support SPIR-V 1.5 changes
parents
8b8adf79
f766faba
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
34 deletions
+92
-34
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+22
-27
SpvBuilder.h
SPIRV/SpvBuilder.h
+6
-0
SpvPostProcess.cpp
SPIRV/SpvPostProcess.cpp
+2
-2
spirv.hpp
SPIRV/spirv.hpp
+44
-0
StandAlone.cpp
StandAlone/StandAlone.cpp
+6
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-3
localintermediate.h
glslang/MachineIndependent/localintermediate.h
+6
-0
ShaderLang.h
glslang/Public/ShaderLang.h
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
be467db7
...
...
@@ -217,11 +217,6 @@ protected:
bool
isTrivial
(
const
glslang
::
TIntermTyped
*
node
);
spv
::
Id
createShortCircuit
(
glslang
::
TOperator
,
glslang
::
TIntermTyped
&
left
,
glslang
::
TIntermTyped
&
right
);
spv
::
Id
getExtBuiltins
(
const
char
*
name
);
void
addPre13Extension
(
const
char
*
ext
)
{
if
(
builder
.
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
)
builder
.
addExtension
(
ext
);
}
std
::
pair
<
spv
::
Id
,
spv
::
Id
>
getForcedType
(
spv
::
BuiltIn
,
const
glslang
::
TType
&
);
spv
::
Id
translateForcedType
(
spv
::
Id
object
);
spv
::
Id
createCompositeConstruct
(
spv
::
Id
typeId
,
std
::
vector
<
spv
::
Id
>
constituents
);
...
...
@@ -517,7 +512,7 @@ spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glsl
{
#ifndef GLSLANG_WEB
if
(
qualifier
.
isNonUniform
())
{
builder
.
add
Extension
(
"SPV_EXT_descriptor_indexing"
);
builder
.
add
IncorporatedExtension
(
"SPV_EXT_descriptor_indexing"
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityShaderNonUniformEXT
);
return
spv
::
DecorationNonUniformEXT
;
}
else
...
...
@@ -701,7 +696,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
glslangIntermediate
->
getStage
()
==
EShLangTessControl
||
glslangIntermediate
->
getStage
()
==
EShLangTessEvaluation
)
{
builder
.
add
Extension
(
spv
::
E_SPV_EXT_shader_viewport_index_layer
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_EXT_shader_viewport_index_layer
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityShaderViewportIndexLayerEXT
);
}
return
spv
::
BuiltInViewportIndex
;
...
...
@@ -726,23 +721,23 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
glslangIntermediate
->
getStage
()
==
EShLangTessControl
||
glslangIntermediate
->
getStage
()
==
EShLangTessEvaluation
)
{
builder
.
add
Extension
(
spv
::
E_SPV_EXT_shader_viewport_index_layer
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_EXT_shader_viewport_index_layer
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityShaderViewportIndexLayerEXT
);
}
return
spv
::
BuiltInLayer
;
case
glslang
:
:
EbvBaseVertex
:
addPre13Extension
(
spv
::
E_SPV_KHR_shader_draw_parameters
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_shader_draw_parameters
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityDrawParameters
);
return
spv
::
BuiltInBaseVertex
;
case
glslang
:
:
EbvBaseInstance
:
addPre13Extension
(
spv
::
E_SPV_KHR_shader_draw_parameters
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_shader_draw_parameters
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityDrawParameters
);
return
spv
::
BuiltInBaseInstance
;
case
glslang
:
:
EbvDrawId
:
addPre13Extension
(
spv
::
E_SPV_KHR_shader_draw_parameters
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_shader_draw_parameters
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityDrawParameters
);
return
spv
::
BuiltInDrawIndex
;
...
...
@@ -874,12 +869,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return
spv
::
BuiltInBaryCoordPullModelAMD
;
case
glslang
:
:
EbvDeviceIndex
:
addPre13Extension
(
spv
::
E_SPV_KHR_device_group
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_device_group
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityDeviceGroup
);
return
spv
::
BuiltInDeviceIndex
;
case
glslang
:
:
EbvViewIndex
:
addPre13Extension
(
spv
::
E_SPV_KHR_multiview
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_multiview
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityMultiView
);
return
spv
::
BuiltInViewIndex
;
...
...
@@ -1192,7 +1187,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
}
if
(
glslangIntermediate
->
usingStorageBuffer
()
&&
type
.
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
{
addPre13Extension
(
spv
::
E_SPV_KHR_storage_buffer_storage_class
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_storage_buffer_storage_class
,
spv
::
Spv_1_3
);
return
spv
::
StorageClassStorageBuffer
;
}
...
...
@@ -1253,13 +1248,13 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp
// assume a dynamically uniform index
if
(
baseType
.
getBasicType
()
==
glslang
::
EbtSampler
)
{
if
(
baseType
.
getQualifier
().
hasAttachment
())
{
builder
.
add
Extension
(
"SPV_EXT_descriptor_indexing"
);
builder
.
add
IncorporatedExtension
(
"SPV_EXT_descriptor_indexing"
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityInputAttachmentArrayDynamicIndexingEXT
);
}
else
if
(
baseType
.
isImage
()
&&
baseType
.
getSampler
().
isBuffer
())
{
builder
.
add
Extension
(
"SPV_EXT_descriptor_indexing"
);
builder
.
add
IncorporatedExtension
(
"SPV_EXT_descriptor_indexing"
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityStorageTexelBufferArrayDynamicIndexingEXT
);
}
else
if
(
baseType
.
isTexture
()
&&
baseType
.
getSampler
().
isBuffer
())
{
builder
.
add
Extension
(
"SPV_EXT_descriptor_indexing"
);
builder
.
add
IncorporatedExtension
(
"SPV_EXT_descriptor_indexing"
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityUniformTexelBufferArrayDynamicIndexingEXT
);
}
}
...
...
@@ -1404,13 +1399,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
if
(
glslangIntermediate
->
usingPhysicalStorageBuffer
())
{
addressingModel
=
spv
::
AddressingModelPhysicalStorageBuffer64EXT
;
builder
.
add
Extension
(
spv
::
E_SPV_EXT_physical_storage_buffer
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_EXT_physical_storage_buffer
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityPhysicalStorageBufferAddressesEXT
);
};
if
(
glslangIntermediate
->
usingVulkanMemoryModel
())
{
memoryModel
=
spv
::
MemoryModelVulkanKHR
;
builder
.
addCapability
(
spv
::
CapabilityVulkanMemoryModelKHR
);
builder
.
add
Extension
(
spv
::
E_SPV_KHR_vulkan_memory_model
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_vulkan_memory_model
,
spv
::
Spv_1_5
);
}
builder
.
setMemoryModel
(
addressingModel
,
memoryModel
);
...
...
@@ -3242,11 +3237,11 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
switch
(
storageClass
)
{
case
spv
:
:
StorageClassInput
:
case
spv
:
:
StorageClassOutput
:
addPre13Extension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_16bit_storage
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityStorageInputOutput16
);
break
;
case
spv
:
:
StorageClassUniform
:
addPre13Extension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_16bit_storage
,
spv
::
Spv_1_3
);
if
(
node
->
getType
().
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
builder
.
addCapability
(
spv
::
CapabilityStorageUniformBufferBlock16
);
else
...
...
@@ -3254,12 +3249,12 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
break
;
#ifndef GLSLANG_WEB
case
spv
:
:
StorageClassPushConstant
:
addPre13Extension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_16bit_storage
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityStoragePushConstant16
);
break
;
case
spv
:
:
StorageClassStorageBuffer
:
case
spv
:
:
StorageClassPhysicalStorageBufferEXT
:
addPre13Extension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addIncorporatedExtension
(
spv
::
E_SPV_KHR_16bit_storage
,
spv
::
Spv_1_3
);
builder
.
addCapability
(
spv
::
CapabilityStorageUniformBufferBlock16
);
break
;
#endif
...
...
@@ -3274,13 +3269,13 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
if
(
node
->
getType
().
contains8BitInt
())
{
if
(
storageClass
==
spv
::
StorageClassPushConstant
)
{
builder
.
add
Extension
(
spv
::
E_SPV_KHR_8bit_storage
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_8bit_storage
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityStoragePushConstant8
);
}
else
if
(
storageClass
==
spv
::
StorageClassUniform
)
{
builder
.
add
Extension
(
spv
::
E_SPV_KHR_8bit_storage
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_8bit_storage
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityUniformAndStorageBuffer8BitAccess
);
}
else
if
(
storageClass
==
spv
::
StorageClassStorageBuffer
)
{
builder
.
add
Extension
(
spv
::
E_SPV_KHR_8bit_storage
);
builder
.
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_8bit_storage
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityStorageBuffer8BitAccess
);
}
else
{
builder
.
addCapability
(
spv
::
CapabilityInt8
);
...
...
@@ -3537,7 +3532,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
else
{
#ifndef GLSLANG_WEB
if
(
!
lastBufferBlockMember
)
{
builder
.
add
Extension
(
"SPV_EXT_descriptor_indexing"
);
builder
.
add
IncorporatedExtension
(
"SPV_EXT_descriptor_indexing"
,
spv
::
Spv_1_5
);
builder
.
addCapability
(
spv
::
CapabilityRuntimeDescriptorArrayEXT
);
}
spvType
=
builder
.
makeRuntimeArray
(
spvType
);
...
...
SPIRV/SpvBuilder.h
View file @
be467db7
...
...
@@ -67,6 +67,7 @@ typedef enum {
Spv_1_2
=
(
1
<<
16
)
|
(
2
<<
8
),
Spv_1_3
=
(
1
<<
16
)
|
(
3
<<
8
),
Spv_1_4
=
(
1
<<
16
)
|
(
4
<<
8
),
Spv_1_5
=
(
1
<<
16
)
|
(
5
<<
8
),
}
SpvVersion
;
class
Builder
{
...
...
@@ -105,6 +106,11 @@ public:
void
addModuleProcessed
(
const
std
::
string
&
p
)
{
moduleProcesses
.
push_back
(
p
.
c_str
());
}
void
setEmitOpLines
()
{
emitOpLines
=
true
;
}
void
addExtension
(
const
char
*
ext
)
{
extensions
.
insert
(
ext
);
}
void
addIncorporatedExtension
(
const
char
*
ext
,
SpvVersion
incorporatedVersion
)
{
if
(
getSpvVersion
()
<
static_cast
<
unsigned
>
(
incorporatedVersion
))
addExtension
(
ext
);
}
void
addInclude
(
const
std
::
string
&
name
,
const
std
::
string
&
text
)
{
spv
::
Id
incId
=
getStringId
(
name
);
...
...
SPIRV/SpvPostProcess.cpp
View file @
be467db7
...
...
@@ -363,12 +363,12 @@ void Builder::postProcess()
Instruction
*
type
=
groupedTypes
[
OpTypePointer
][
t
];
if
(
type
->
getImmediateOperand
(
0
)
==
(
unsigned
)
StorageClassPhysicalStorageBufferEXT
)
{
if
(
containsType
(
type
->
getIdOperand
(
1
),
OpTypeInt
,
8
))
{
add
Extension
(
spv
::
E_SPV_KHR_8bit_storage
);
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_8bit_storage
,
spv
::
Spv_1_5
);
addCapability
(
spv
::
CapabilityStorageBuffer8BitAccess
);
}
if
(
containsType
(
type
->
getIdOperand
(
1
),
OpTypeInt
,
16
)
||
containsType
(
type
->
getIdOperand
(
1
),
OpTypeFloat
,
16
))
{
add
Extension
(
spv
::
E_SPV_KHR_16bit_storage
);
add
IncorporatedExtension
(
spv
::
E_SPV_KHR_16bit_storage
,
spv
::
Spv_1_3
);
addCapability
(
spv
::
CapabilityStorageBuffer16BitAccess
);
}
}
...
...
SPIRV/spirv.hpp
View file @
be467db7
...
...
@@ -91,6 +91,7 @@ enum AddressingModel {
AddressingModelLogical
=
0
,
AddressingModelPhysical32
=
1
,
AddressingModelPhysical64
=
2
,
AddressingModelPhysicalStorageBuffer64
=
5348
,
AddressingModelPhysicalStorageBuffer64EXT
=
5348
,
AddressingModelMax
=
0x7fffffff
,
};
...
...
@@ -99,6 +100,7 @@ enum MemoryModel {
MemoryModelSimple
=
0
,
MemoryModelGLSL450
=
1
,
MemoryModelOpenCL
=
2
,
MemoryModelVulkan
=
3
,
MemoryModelVulkanKHR
=
3
,
MemoryModelMax
=
0x7fffffff
,
};
...
...
@@ -183,6 +185,7 @@ enum StorageClass {
StorageClassHitAttributeNV
=
5339
,
StorageClassIncomingRayPayloadNV
=
5342
,
StorageClassShaderRecordBufferNV
=
5343
,
StorageClassPhysicalStorageBuffer
=
5349
,
StorageClassPhysicalStorageBufferEXT
=
5349
,
StorageClassMax
=
0x7fffffff
,
};
...
...
@@ -311,9 +314,13 @@ enum ImageOperandsShift {
ImageOperandsConstOffsetsShift
=
5
,
ImageOperandsSampleShift
=
6
,
ImageOperandsMinLodShift
=
7
,
ImageOperandsMakeTexelAvailableShift
=
8
,
ImageOperandsMakeTexelAvailableKHRShift
=
8
,
ImageOperandsMakeTexelVisibleShift
=
9
,
ImageOperandsMakeTexelVisibleKHRShift
=
9
,
ImageOperandsNonPrivateTexelShift
=
10
,
ImageOperandsNonPrivateTexelKHRShift
=
10
,
ImageOperandsVolatileTexelShift
=
11
,
ImageOperandsVolatileTexelKHRShift
=
11
,
ImageOperandsSignExtendShift
=
12
,
ImageOperandsZeroExtendShift
=
13
,
...
...
@@ -330,9 +337,13 @@ enum ImageOperandsMask {
ImageOperandsConstOffsetsMask
=
0x00000020
,
ImageOperandsSampleMask
=
0x00000040
,
ImageOperandsMinLodMask
=
0x00000080
,
ImageOperandsMakeTexelAvailableMask
=
0x00000100
,
ImageOperandsMakeTexelAvailableKHRMask
=
0x00000100
,
ImageOperandsMakeTexelVisibleMask
=
0x00000200
,
ImageOperandsMakeTexelVisibleKHRMask
=
0x00000200
,
ImageOperandsNonPrivateTexelMask
=
0x00000400
,
ImageOperandsNonPrivateTexelKHRMask
=
0x00000400
,
ImageOperandsVolatileTexelMask
=
0x00000800
,
ImageOperandsVolatileTexelKHRMask
=
0x00000800
,
ImageOperandsSignExtendMask
=
0x00001000
,
ImageOperandsZeroExtendMask
=
0x00002000
,
...
...
@@ -448,8 +459,11 @@ enum Decoration {
DecorationPerViewNV
=
5272
,
DecorationPerTaskNV
=
5273
,
DecorationPerVertexNV
=
5285
,
DecorationNonUniform
=
5300
,
DecorationNonUniformEXT
=
5300
,
DecorationRestrictPointer
=
5355
,
DecorationRestrictPointerEXT
=
5355
,
DecorationAliasedPointer
=
5356
,
DecorationAliasedPointerEXT
=
5356
,
DecorationCounterBuffer
=
5634
,
DecorationHlslCounterBufferGOOGLE
=
5634
,
...
...
@@ -630,8 +644,11 @@ enum MemorySemanticsShift {
MemorySemanticsCrossWorkgroupMemoryShift
=
9
,
MemorySemanticsAtomicCounterMemoryShift
=
10
,
MemorySemanticsImageMemoryShift
=
11
,
MemorySemanticsOutputMemoryShift
=
12
,
MemorySemanticsOutputMemoryKHRShift
=
12
,
MemorySemanticsMakeAvailableShift
=
13
,
MemorySemanticsMakeAvailableKHRShift
=
13
,
MemorySemanticsMakeVisibleShift
=
14
,
MemorySemanticsMakeVisibleKHRShift
=
14
,
MemorySemanticsVolatileShift
=
15
,
MemorySemanticsMax
=
0x7fffffff
,
...
...
@@ -649,8 +666,11 @@ enum MemorySemanticsMask {
MemorySemanticsCrossWorkgroupMemoryMask
=
0x00000200
,
MemorySemanticsAtomicCounterMemoryMask
=
0x00000400
,
MemorySemanticsImageMemoryMask
=
0x00000800
,
MemorySemanticsOutputMemoryMask
=
0x00001000
,
MemorySemanticsOutputMemoryKHRMask
=
0x00001000
,
MemorySemanticsMakeAvailableMask
=
0x00002000
,
MemorySemanticsMakeAvailableKHRMask
=
0x00002000
,
MemorySemanticsMakeVisibleMask
=
0x00004000
,
MemorySemanticsMakeVisibleKHRMask
=
0x00004000
,
MemorySemanticsVolatileMask
=
0x00008000
,
};
...
...
@@ -659,8 +679,11 @@ enum MemoryAccessShift {
MemoryAccessVolatileShift
=
0
,
MemoryAccessAlignedShift
=
1
,
MemoryAccessNontemporalShift
=
2
,
MemoryAccessMakePointerAvailableShift
=
3
,
MemoryAccessMakePointerAvailableKHRShift
=
3
,
MemoryAccessMakePointerVisibleShift
=
4
,
MemoryAccessMakePointerVisibleKHRShift
=
4
,
MemoryAccessNonPrivatePointerShift
=
5
,
MemoryAccessNonPrivatePointerKHRShift
=
5
,
MemoryAccessMax
=
0x7fffffff
,
};
...
...
@@ -670,8 +693,11 @@ enum MemoryAccessMask {
MemoryAccessVolatileMask
=
0x00000001
,
MemoryAccessAlignedMask
=
0x00000002
,
MemoryAccessNontemporalMask
=
0x00000004
,
MemoryAccessMakePointerAvailableMask
=
0x00000008
,
MemoryAccessMakePointerAvailableKHRMask
=
0x00000008
,
MemoryAccessMakePointerVisibleMask
=
0x00000010
,
MemoryAccessMakePointerVisibleKHRMask
=
0x00000010
,
MemoryAccessNonPrivatePointerMask
=
0x00000020
,
MemoryAccessNonPrivatePointerKHRMask
=
0x00000020
,
};
...
...
@@ -681,6 +707,7 @@ enum Scope {
ScopeWorkgroup
=
2
,
ScopeSubgroup
=
3
,
ScopeInvocation
=
4
,
ScopeQueueFamily
=
5
,
ScopeQueueFamilyKHR
=
5
,
ScopeMax
=
0x7fffffff
,
};
...
...
@@ -781,6 +808,8 @@ enum Capability {
CapabilityGroupNonUniformShuffleRelative
=
66
,
CapabilityGroupNonUniformClustered
=
67
,
CapabilityGroupNonUniformQuad
=
68
,
CapabilityShaderLayer
=
69
,
CapabilityShaderViewportIndex
=
70
,
CapabilitySubgroupBallotKHR
=
4423
,
CapabilityDrawParameters
=
4427
,
CapabilitySubgroupVoteKHR
=
4431
,
...
...
@@ -825,21 +854,36 @@ enum Capability {
CapabilityFragmentDensityEXT
=
5291
,
CapabilityShadingRateNV
=
5291
,
CapabilityGroupNonUniformPartitionedNV
=
5297
,
CapabilityShaderNonUniform
=
5301
,
CapabilityShaderNonUniformEXT
=
5301
,
CapabilityRuntimeDescriptorArray
=
5302
,
CapabilityRuntimeDescriptorArrayEXT
=
5302
,
CapabilityInputAttachmentArrayDynamicIndexing
=
5303
,
CapabilityInputAttachmentArrayDynamicIndexingEXT
=
5303
,
CapabilityUniformTexelBufferArrayDynamicIndexing
=
5304
,
CapabilityUniformTexelBufferArrayDynamicIndexingEXT
=
5304
,
CapabilityStorageTexelBufferArrayDynamicIndexing
=
5305
,
CapabilityStorageTexelBufferArrayDynamicIndexingEXT
=
5305
,
CapabilityUniformBufferArrayNonUniformIndexing
=
5306
,
CapabilityUniformBufferArrayNonUniformIndexingEXT
=
5306
,
CapabilitySampledImageArrayNonUniformIndexing
=
5307
,
CapabilitySampledImageArrayNonUniformIndexingEXT
=
5307
,
CapabilityStorageBufferArrayNonUniformIndexing
=
5308
,
CapabilityStorageBufferArrayNonUniformIndexingEXT
=
5308
,
CapabilityStorageImageArrayNonUniformIndexing
=
5309
,
CapabilityStorageImageArrayNonUniformIndexingEXT
=
5309
,
CapabilityInputAttachmentArrayNonUniformIndexing
=
5310
,
CapabilityInputAttachmentArrayNonUniformIndexingEXT
=
5310
,
CapabilityUniformTexelBufferArrayNonUniformIndexing
=
5311
,
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT
=
5311
,
CapabilityStorageTexelBufferArrayNonUniformIndexing
=
5312
,
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT
=
5312
,
CapabilityRayTracingNV
=
5340
,
CapabilityVulkanMemoryModel
=
5345
,
CapabilityVulkanMemoryModelKHR
=
5345
,
CapabilityVulkanMemoryModelDeviceScope
=
5346
,
CapabilityVulkanMemoryModelDeviceScopeKHR
=
5346
,
CapabilityPhysicalStorageBufferAddresses
=
5347
,
CapabilityPhysicalStorageBufferAddressesEXT
=
5347
,
CapabilityComputeDerivativeGroupLinearNV
=
5350
,
CapabilityCooperativeMatrixNV
=
5357
,
...
...
StandAlone/StandAlone.cpp
View file @
be467db7
...
...
@@ -615,8 +615,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
}
else
if
(
strcmp
(
argv
[
1
],
"spirv1.4"
)
==
0
)
{
TargetLanguage
=
glslang
::
EShTargetSpv
;
TargetVersion
=
glslang
::
EShTargetSpv_1_4
;
}
else
if
(
strcmp
(
argv
[
1
],
"spirv1.5"
)
==
0
)
{
TargetLanguage
=
glslang
::
EShTargetSpv
;
TargetVersion
=
glslang
::
EShTargetSpv_1_5
;
}
else
Error
(
"--target-env expected one of: vulkan1.0, vulkan1.1, opengl, spirv1.0, spirv1.1, spirv1.2, or spirv1.3"
);
Error
(
"--target-env expected one of: vulkan1.0, vulkan1.1, opengl,
\n
"
"spirv1.0, spirv1.1, spirv1.2, spirv1.3, spirv1.4, or spirv1.5"
);
}
bumpArg
();
}
else
if
(
lowerword
==
"variable-name"
||
// synonyms
...
...
@@ -1618,7 +1622,7 @@ void usage()
" --stdin read from stdin instead of from a file;
\n
"
" requires providing the shader stage using -S
\n
"
" --target-env {vulkan1.0 | vulkan1.1 | opengl |
\n
"
" spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3}
\n
"
" spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3
| spirv1.4 | spirv1.5
}
\n
"
" set execution environment that emitted code
\n
"
" will execute in (versus source language
\n
"
" semantics selected by --client) defaults:
\n
"
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
be467db7
...
...
@@ -2155,9 +2155,11 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
break
;
case
EOpSubgroupBroadcast
:
// <id> must be an integral constant expression.
if
((
*
argp
)[
1
]
->
getAsConstantUnion
()
==
nullptr
)
error
(
loc
,
"argument must be compile-time constant"
,
"id"
,
""
);
if
(
spvVersion
.
spv
<
EShTargetSpv_1_5
)
{
// <id> must be an integral constant expression.
if
((
*
argp
)[
1
]
->
getAsConstantUnion
()
==
nullptr
)
error
(
loc
,
"argument must be compile-time constant"
,
"id"
,
""
);
}
break
;
case
EOpBarrier
:
...
...
glslang/MachineIndependent/localintermediate.h
View file @
be467db7
...
...
@@ -311,6 +311,12 @@ public:
case
EShTargetSpv_1_3
:
processes
.
addProcess
(
"target-env spirv1.3"
);
break
;
case
EShTargetSpv_1_4
:
processes
.
addProcess
(
"target-env spirv1.4"
);
break
;
case
EShTargetSpv_1_5
:
processes
.
addProcess
(
"target-env spirv1.5"
);
break
;
default
:
processes
.
addProcess
(
"target-env spirvUnknown"
);
break
;
...
...
glslang/Public/ShaderLang.h
View file @
be467db7
...
...
@@ -156,6 +156,7 @@ typedef enum {
EShTargetSpv_1_2
=
(
1
<<
16
)
|
(
2
<<
8
),
// SPIR-V 1.2
EShTargetSpv_1_3
=
(
1
<<
16
)
|
(
3
<<
8
),
// SPIR-V 1.3
EShTargetSpv_1_4
=
(
1
<<
16
)
|
(
4
<<
8
),
// SPIR-V 1.4
EShTargetSpv_1_5
=
(
1
<<
16
)
|
(
5
<<
8
),
// SPIR-V 1.5
}
EShTargetLanguageVersion
;
struct
TInputLanguage
{
...
...
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