SPV capabilities: Add int16, int64, float16, and float64.
This commit is contained in:
parent
103bef9d74
commit
3c52207e8a
@ -165,6 +165,18 @@ Id Builder::makeIntegerType(int width, bool hasSign)
|
|||||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||||
module.mapInstruction(type);
|
module.mapInstruction(type);
|
||||||
|
|
||||||
|
// deal with capabilities
|
||||||
|
switch (width) {
|
||||||
|
case 16:
|
||||||
|
addCapability(CapabilityInt16);
|
||||||
|
break;
|
||||||
|
case 64:
|
||||||
|
addCapability(CapabilityInt64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,6 +197,18 @@ Id Builder::makeFloatType(int width)
|
|||||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||||
module.mapInstruction(type);
|
module.mapInstruction(type);
|
||||||
|
|
||||||
|
// deal with capabilities
|
||||||
|
switch (width) {
|
||||||
|
case 16:
|
||||||
|
addCapability(CapabilityFloat16);
|
||||||
|
break;
|
||||||
|
case 64:
|
||||||
|
addCapability(CapabilityFloat64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ Linked fragment stage:
|
|||||||
// Id's are bound by 1104
|
// Id's are bound by 1104
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
|
Capability Float64
|
||||||
Capability ClipDistance
|
Capability ClipDistance
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
|
@ -10,6 +10,7 @@ Linked compute stage:
|
|||||||
// Id's are bound by 62
|
// Id's are bound by 62
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
|
Capability Float64
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint GLCompute 4 "main" 26 33
|
EntryPoint GLCompute 4 "main" 26 33
|
||||||
|
Loading…
x
Reference in New Issue
Block a user