SPV capabilities: Add int16, int64, float16, and float64.

This commit is contained in:
John Kessenich 2016-02-14 17:11:15 -07:00
parent 103bef9d74
commit 3c52207e8a
3 changed files with 26 additions and 0 deletions

View File

@ -165,6 +165,18 @@ Id Builder::makeIntegerType(int width, bool hasSign)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(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<Instruction>(type));
module.mapInstruction(type);
// deal with capabilities
switch (width) {
case 16:
addCapability(CapabilityFloat16);
break;
case 64:
addCapability(CapabilityFloat64);
break;
default:
break;
}
return type->getResultId();
}

View File

@ -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

View File

@ -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