diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index b2cafbf2..a14eb00c 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -165,6 +165,18 @@ Id Builder::makeIntegerType(int width, bool hasSign) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // deal with capabilities + switch (width) { + case 16: + addCapability(CapabilityInt16); + break; + case 64: + addCapability(CapabilityInt64); + break; + default: + break; + } + return type->getResultId(); } @@ -185,6 +197,18 @@ Id Builder::makeFloatType(int width) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // deal with capabilities + switch (width) { + case 16: + addCapability(CapabilityFloat16); + break; + case 64: + addCapability(CapabilityFloat64); + break; + default: + break; + } + return type->getResultId(); } diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 1dcfbd30..e43527c1 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -10,6 +10,7 @@ Linked fragment stage: // Id's are bound by 1104 Capability Shader + Capability Float64 Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/Test/baseResults/spv.double.comp.out b/Test/baseResults/spv.double.comp.out index e78065dc..52ed78c5 100755 --- a/Test/baseResults/spv.double.comp.out +++ b/Test/baseResults/spv.double.comp.out @@ -10,6 +10,7 @@ Linked compute stage: // Id's are bound by 62 Capability Shader + Capability Float64 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint GLCompute 4 "main" 26 33