HLSL: implement [unroll] and [loop] attributes
This adds infrastructure suitable for any front end to create SPIR-V loop control flags. The only current front end doing so is HLSL. [unroll] turns into spv::LoopControlUnrollMask [loop] turns into spv::LoopControlDontUnrollMask no specification means spv::LoopControlMaskNone
This commit is contained in:
@@ -80,6 +80,8 @@ namespace glslang {
|
||||
return EatPatchConstantFunc;
|
||||
else if (lowername == "unroll")
|
||||
return EatUnroll;
|
||||
else if (lowername == "loop")
|
||||
return EatLoop;
|
||||
else
|
||||
return EatNone;
|
||||
}
|
||||
@@ -107,4 +109,10 @@ namespace glslang {
|
||||
return (entry == attributes.end()) ? nullptr : entry->second;
|
||||
}
|
||||
|
||||
// True if entry exists in map (even if value is nullptr)
|
||||
bool TAttributeMap::contains(TAttributeType attr) const
|
||||
{
|
||||
return attributes.find(attr) != attributes.end();
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
Reference in New Issue
Block a user