Externals: Update glslang to upstream commit 32d3ec3

This commit is contained in:
Stenzek
2018-06-02 07:26:43 +00:00
parent 160d16f1b3
commit bc96557ec4
149 changed files with 47830 additions and 13886 deletions

View File

@ -40,46 +40,14 @@
namespace glslangtest {
// Initializes glslang on creation, and destroys it on completion.
// And provides .Acquire() as a way to reinitialize glslang if semantics change.
// This object is expected to be a singleton, so that internal glslang state
// can be correctly handled.
//
// TODO(antiagainst): It's a known bug that some of the internal states need to
// be reset if semantics change:
// https://github.com/KhronosGroup/glslang/issues/166
// Therefore, the following mechanism is needed. Remove this once the above bug
// gets fixed.
class GlslangInitializer {
public:
GlslangInitializer() : lastMessages(EShMsgCascadingErrors)
{
glslang::InitializeProcess();
}
GlslangInitializer() { glslang::InitializeProcess(); }
~GlslangInitializer() { glslang::FinalizeProcess(); }
// A token indicates that the glslang is reinitialized (if necessary) to the
// required semantics. And that won't change until the token is destroyed.
class InitializationToken {
};
// Re-initializes glsl state iff the previous messages and the current
// messages are incompatible. We assume external synchronization, i.e.
// there is at most one acquired token at any one time.
InitializationToken acquire(EShMessages new_messages)
{
if ((lastMessages ^ new_messages) &
(EShMsgVulkanRules | EShMsgSpvRules | EShMsgReadHlsl)) {
glslang::FinalizeProcess();
glslang::InitializeProcess();
}
lastMessages = new_messages;
return InitializationToken();
}
private:
EShMessages lastMessages;
};
} // namespace glslangtest