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
ae79697d
Commit
ae79697d
authored
Apr 08, 2017
by
John Kessenich
Committed by
GitHub
Apr 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #827 from amdrexu/feature4
Implement the extension SPV_KHR_16bit_storage
parents
a09eefd8
f89ad980
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
0 deletions
+31
-0
GLSL.ext.KHR.h
SPIRV/GLSL.ext.KHR.h
+1
-0
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+18
-0
doc.cpp
SPIRV/doc.cpp
+5
-0
spv.float16.frag.out
Test/baseResults/spv.float16.frag.out
+4
-0
spv.shaderBallotAMD.comp.out
Test/baseResults/spv.shaderBallotAMD.comp.out
+3
-0
No files found.
SPIRV/GLSL.ext.KHR.h
View file @
ae79697d
...
@@ -39,5 +39,6 @@ static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vo
...
@@ -39,5 +39,6 @@ static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vo
static
const
char
*
const
E_SPV_KHR_device_group
=
"SPV_KHR_device_group"
;
static
const
char
*
const
E_SPV_KHR_device_group
=
"SPV_KHR_device_group"
;
static
const
char
*
const
E_SPV_KHR_multiview
=
"SPV_KHR_multiview"
;
static
const
char
*
const
E_SPV_KHR_multiview
=
"SPV_KHR_multiview"
;
static
const
char
*
const
E_SPV_KHR_shader_draw_parameters
=
"SPV_KHR_shader_draw_parameters"
;
static
const
char
*
const
E_SPV_KHR_shader_draw_parameters
=
"SPV_KHR_shader_draw_parameters"
;
static
const
char
*
const
E_SPV_KHR_16bit_storage
=
"SPV_KHR_16bit_storage"
;
#endif // #ifndef GLSLextKHR_H
#endif // #ifndef GLSLextKHR_H
SPIRV/GlslangToSpv.cpp
View file @
ae79697d
...
@@ -2074,6 +2074,24 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
...
@@ -2074,6 +2074,24 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
spv
::
StorageClass
storageClass
=
TranslateStorageClass
(
node
->
getType
());
spv
::
StorageClass
storageClass
=
TranslateStorageClass
(
node
->
getType
());
spv
::
Id
spvType
=
convertGlslangToSpvType
(
node
->
getType
());
spv
::
Id
spvType
=
convertGlslangToSpvType
(
node
->
getType
());
#ifdef AMD_EXTENSIONS
const
bool
contains16BitType
=
node
->
getType
().
containsBasicType
(
glslang
::
EbtFloat16
);
if
(
contains16BitType
)
{
if
(
storageClass
==
spv
::
StorageClassInput
||
storageClass
==
spv
::
StorageClassOutput
)
{
builder
.
addExtension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addCapability
(
spv
::
CapabilityStorageInputOutput16
);
}
else
if
(
storageClass
==
spv
::
StorageClassPushConstant
)
{
builder
.
addExtension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addCapability
(
spv
::
CapabilityStoragePushConstant16
);
}
else
if
(
storageClass
==
spv
::
StorageClassUniform
)
{
builder
.
addExtension
(
spv
::
E_SPV_KHR_16bit_storage
);
builder
.
addCapability
(
spv
::
CapabilityStorageUniform16
);
if
(
node
->
getType
().
getQualifier
().
storage
==
glslang
::
EvqBuffer
)
builder
.
addCapability
(
spv
::
CapabilityStorageUniformBufferBlock16
);
}
}
#endif
const
char
*
name
=
node
->
getName
().
c_str
();
const
char
*
name
=
node
->
getName
().
c_str
();
if
(
glslang
::
IsAnonymous
(
name
))
if
(
glslang
::
IsAnonymous
(
name
))
name
=
""
;
name
=
""
;
...
...
SPIRV/doc.cpp
View file @
ae79697d
...
@@ -833,6 +833,11 @@ const char* CapabilityString(int info)
...
@@ -833,6 +833,11 @@ const char* CapabilityString(int info)
case
4437
:
return
"DeviceGroup"
;
case
4437
:
return
"DeviceGroup"
;
case
4439
:
return
"MultiView"
;
case
4439
:
return
"MultiView"
;
case
4433
:
return
"StorageUniformBufferBlock16"
;
case
4434
:
return
"StorageUniform16"
;
case
4435
:
return
"StoragePushConstant16"
;
case
4436
:
return
"StorageInputOutput16"
;
#ifdef NV_EXTENSIONS
#ifdef NV_EXTENSIONS
case
5251
:
return
"GeometryShaderPassthroughNV"
;
case
5251
:
return
"GeometryShaderPassthroughNV"
;
case
5254
:
return
"ShaderViewportIndexLayerNV"
;
case
5254
:
return
"ShaderViewportIndexLayerNV"
;
...
...
Test/baseResults/spv.float16.frag.out
View file @
ae79697d
...
@@ -11,7 +11,11 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -11,7 +11,11 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Capability Int64
Capability Int64
Capability DerivativeControl
Capability DerivativeControl
Capability InterpolationFunction
Capability InterpolationFunction
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Capability StorageInputOutput16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 465
EntryPoint Fragment 4 "main" 465
...
...
Test/baseResults/spv.shaderBallotAMD.comp.out
View file @
ae79697d
...
@@ -10,8 +10,11 @@ Warning, version 450 is not yet complete; most version-specific features are pre
...
@@ -10,8 +10,11 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Capability Float64
Capability Float64
Capability Int64
Capability Int64
Capability Groups
Capability Groups
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_shader_ballot"
Extension "SPV_AMD_shader_ballot"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main"
EntryPoint GLCompute 4 "main"
...
...
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