diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp b/src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp index 3c1db011b6..52588e4626 100644 --- a/src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp +++ b/src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp @@ -9,16 +9,46 @@ #include "compiler/translator/InitializeParseContext.h" #include "compiler/translator/OutputHLSL.h" -TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec, ShShaderOutput output) - : TCompiler(type, spec), mOutputType(output) +TranslatorHLSL::TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output) + : TCompiler(type, spec, output) { } void TranslatorHLSL::translate(TIntermNode *root) { TParseContext& parseContext = *GetGlobalParseContext(); - sh::OutputHLSL outputHLSL(parseContext, getResources(), mOutputType); + sh::OutputHLSL outputHLSL(parseContext, getResources(), getOutputType()); outputHLSL.output(); - mActiveUniforms = outputHLSL.getUniforms(); + + attributes = outputHLSL.getAttributes(); + outputVariables = outputHLSL.getOutputVariables(); + uniforms = outputHLSL.getUniforms(); + varyings = outputHLSL.getVaryings(); + interfaceBlocks = outputHLSL.getInterfaceBlocks(); + + mInterfaceBlockRegisterMap = outputHLSL.getInterfaceBlockRegisterMap(); + mUniformRegisterMap = outputHLSL.getUniformRegisterMap(); +} + +bool TranslatorHLSL::hasInterfaceBlock(const std::string &interfaceBlockName) const +{ + return (mInterfaceBlockRegisterMap.count(interfaceBlockName) > 0); +} + +unsigned int TranslatorHLSL::getInterfaceBlockRegister(const std::string &interfaceBlockName) const +{ + ASSERT(hasInterfaceBlock(interfaceBlockName)); + return mInterfaceBlockRegisterMap.find(interfaceBlockName)->second; +} + +bool TranslatorHLSL::hasUniform(const std::string &uniformName) const +{ + return (mUniformRegisterMap.count(uniformName) > 0); +} + +unsigned int TranslatorHLSL::getUniformRegister(const std::string &uniformName) const +{ + ASSERT(hasUniform(uniformName)); + return mUniformRegisterMap.find(uniformName)->second; } |