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
afe0c66f
Commit
afe0c66f
authored
Sep 10, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Fix #1487: Only declare AMD int16/half_float extensions when needed.
parent
546b7885
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
21 deletions
+19
-21
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+0
-12
SpvPostProcess.cpp
SPIRV/SpvPostProcess.cpp
+19
-0
spv.16bitstorage-int.frag.out
Test/baseResults/spv.16bitstorage-int.frag.out
+0
-1
spv.16bitstorage-uint.frag.out
Test/baseResults/spv.16bitstorage-uint.frag.out
+0
-1
spv.16bitstorage.frag.out
Test/baseResults/spv.16bitstorage.frag.out
+0
-1
spv.float16Fetch.frag.out
Test/baseResults/spv.float16Fetch.frag.out
+0
-1
spv.int16.amd.frag.out
Test/baseResults/spv.int16.amd.frag.out
+0
-1
spv.int16.frag.out
Test/baseResults/spv.int16.frag.out
+0
-2
spv.shaderBallotAMD.comp.out
Test/baseResults/spv.shaderBallotAMD.comp.out
+0
-2
No files found.
SPIRV/GlslangToSpv.cpp
100644 → 100755
View file @
afe0c66f
...
@@ -2729,10 +2729,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
...
@@ -2729,10 +2729,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType
=
builder
.
makeFloatType
(
64
);
spvType
=
builder
.
makeFloatType
(
64
);
break
;
break
;
case
glslang
:
:
EbtFloat16
:
case
glslang
:
:
EbtFloat16
:
#if AMD_EXTENSIONS
if
(
builder
.
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
)
builder
.
addExtension
(
spv
::
E_SPV_AMD_gpu_shader_half_float
);
#endif
spvType
=
builder
.
makeFloatType
(
16
);
spvType
=
builder
.
makeFloatType
(
16
);
break
;
break
;
case
glslang
:
:
EbtBool
:
case
glslang
:
:
EbtBool
:
...
@@ -2750,17 +2746,9 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
...
@@ -2750,17 +2746,9 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType
=
builder
.
makeUintType
(
8
);
spvType
=
builder
.
makeUintType
(
8
);
break
;
break
;
case
glslang
:
:
EbtInt16
:
case
glslang
:
:
EbtInt16
:
#ifdef AMD_EXTENSIONS
if
(
builder
.
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
)
builder
.
addExtension
(
spv
::
E_SPV_AMD_gpu_shader_int16
);
#endif
spvType
=
builder
.
makeIntType
(
16
);
spvType
=
builder
.
makeIntType
(
16
);
break
;
break
;
case
glslang
:
:
EbtUint16
:
case
glslang
:
:
EbtUint16
:
#ifdef AMD_EXTENSIONS
if
(
builder
.
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
)
builder
.
addExtension
(
spv
::
E_SPV_AMD_gpu_shader_int16
);
#endif
spvType
=
builder
.
makeUintType
(
16
);
spvType
=
builder
.
makeUintType
(
16
);
break
;
break
;
case
glslang
:
:
EbtInt
:
case
glslang
:
:
EbtInt
:
...
...
SPIRV/SpvPostProcess.cpp
100644 → 100755
View file @
afe0c66f
...
@@ -120,6 +120,25 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
...
@@ -120,6 +120,25 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
case
OpSConvert
:
case
OpSConvert
:
case
OpUConvert
:
case
OpUConvert
:
break
;
break
;
case
OpExtInst
:
switch
(
inst
.
getImmediateOperand
(
1
))
{
#if AMD_EXTENSIONS
case
GLSLstd450Frexp
:
case
GLSLstd450FrexpStruct
:
if
(
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
&&
containsType
(
typeId
,
OpTypeInt
,
16
))
addExtension
(
spv
::
E_SPV_AMD_gpu_shader_int16
);
break
;
case
GLSLstd450InterpolateAtCentroid
:
case
GLSLstd450InterpolateAtSample
:
case
GLSLstd450InterpolateAtOffset
:
if
(
getSpvVersion
()
<
glslang
::
EShTargetSpv_1_3
&&
containsType
(
typeId
,
OpTypeFloat
,
16
))
addExtension
(
spv
::
E_SPV_AMD_gpu_shader_half_float
);
break
;
#endif
default
:
break
;
}
break
;
default
:
default
:
if
(
basicTypeOp
==
OpTypeFloat
&&
width
==
16
)
if
(
basicTypeOp
==
OpTypeFloat
&&
width
==
16
)
addCapability
(
CapabilityFloat16
);
addCapability
(
CapabilityFloat16
);
...
...
Test/baseResults/spv.16bitstorage-int.frag.out
View file @
afe0c66f
...
@@ -6,7 +6,6 @@ spv.16bitstorage-int.frag
...
@@ -6,7 +6,6 @@ spv.16bitstorage-int.frag
Capability Shader
Capability Shader
Capability StorageUniformBufferBlock16
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Capability StorageUniform16
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/spv.16bitstorage-uint.frag.out
View file @
afe0c66f
...
@@ -6,7 +6,6 @@ spv.16bitstorage-uint.frag
...
@@ -6,7 +6,6 @@ spv.16bitstorage-uint.frag
Capability Shader
Capability Shader
Capability StorageUniformBufferBlock16
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Capability StorageUniform16
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/spv.16bitstorage.frag.out
View file @
afe0c66f
...
@@ -6,7 +6,6 @@ spv.16bitstorage.frag
...
@@ -6,7 +6,6 @@ spv.16bitstorage.frag
Capability Shader
Capability Shader
Capability StorageUniformBufferBlock16
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Capability StorageUniform16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/spv.float16Fetch.frag.out
View file @
afe0c66f
...
@@ -27,7 +27,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -27,7 +27,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Capability StorageInputOutput16
Capability StorageInputOutput16
Capability Float16ImageAMD
Capability Float16ImageAMD
Capability ImageGatherBiasLodAMD
Capability ImageGatherBiasLodAMD
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_half_float_fetch"
Extension "SPV_AMD_gpu_shader_half_float_fetch"
Extension "SPV_AMD_texture_gather_bias_lod"
Extension "SPV_AMD_texture_gather_bias_lod"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
...
...
Test/baseResults/spv.int16.amd.frag.out
View file @
afe0c66f
...
@@ -14,7 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -14,7 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Capability Int16
Capability Int16
Capability StorageUniform16
Capability StorageUniform16
Capability StorageInputOutput16
Capability StorageInputOutput16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
...
...
Test/baseResults/spv.int16.frag.out
View file @
afe0c66f
...
@@ -14,8 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -14,8 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Capability Int16
Capability Int16
Capability Int8
Capability Int8
Capability StorageUniform16
Capability StorageUniform16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/spv.shaderBallotAMD.comp.out
View file @
afe0c66f
...
@@ -14,8 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -14,8 +14,6 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Capability Groups
Capability Groups
Capability Int16
Capability Int16
Capability StorageUniformBufferBlock16
Capability StorageUniformBufferBlock16
Extension "SPV_AMD_gpu_shader_half_float"
Extension "SPV_AMD_gpu_shader_int16"
Extension "SPV_AMD_shader_ballot"
Extension "SPV_AMD_shader_ballot"
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_16bit_storage"
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
...
...
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