mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
Generate Int8, Int16 and Float16 capabilities for constants
Fixes #2905
This commit is contained in:
parent
f1d286fcc2
commit
b7968b7dbc
@ -9078,15 +9078,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case glslang::EbtInt8:
|
||||
builder.addCapability(spv::CapabilityInt8);
|
||||
spvConsts.push_back(builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const()));
|
||||
break;
|
||||
case glslang::EbtUint8:
|
||||
builder.addCapability(spv::CapabilityInt8);
|
||||
spvConsts.push_back(builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const()));
|
||||
break;
|
||||
case glslang::EbtInt16:
|
||||
builder.addCapability(spv::CapabilityInt16);
|
||||
spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const()));
|
||||
break;
|
||||
case glslang::EbtUint16:
|
||||
builder.addCapability(spv::CapabilityInt16);
|
||||
spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const()));
|
||||
break;
|
||||
case glslang::EbtInt64:
|
||||
@ -9099,6 +9103,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
spvConsts.push_back(builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst()));
|
||||
break;
|
||||
case glslang::EbtFloat16:
|
||||
builder.addCapability(spv::CapabilityFloat16);
|
||||
spvConsts.push_back(builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
|
||||
break;
|
||||
#endif
|
||||
@ -9127,15 +9132,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
break;
|
||||
#ifndef GLSLANG_WEB
|
||||
case glslang::EbtInt8:
|
||||
builder.addCapability(spv::CapabilityInt8);
|
||||
scalar = builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const(), specConstant);
|
||||
break;
|
||||
case glslang::EbtUint8:
|
||||
builder.addCapability(spv::CapabilityInt8);
|
||||
scalar = builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const(), specConstant);
|
||||
break;
|
||||
case glslang::EbtInt16:
|
||||
builder.addCapability(spv::CapabilityInt16);
|
||||
scalar = builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const(), specConstant);
|
||||
break;
|
||||
case glslang::EbtUint16:
|
||||
builder.addCapability(spv::CapabilityInt16);
|
||||
scalar = builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const(), specConstant);
|
||||
break;
|
||||
case glslang::EbtInt64:
|
||||
@ -9148,6 +9157,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant);
|
||||
break;
|
||||
case glslang::EbtFloat16:
|
||||
builder.addCapability(spv::CapabilityFloat16);
|
||||
scalar = builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
|
||||
break;
|
||||
case glslang::EbtReference:
|
||||
|
@ -1,12 +1,14 @@
|
||||
spv.constConstruct.vert
|
||||
Validation failed
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 8000a
|
||||
// Id's are bound by 150
|
||||
|
||||
Capability Shader
|
||||
Capability Float16
|
||||
Capability Float64
|
||||
Capability Int64
|
||||
Capability Int16
|
||||
Capability Int8
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
|
Loading…
Reference in New Issue
Block a user