From 0a7aebadfbb3534284546aa3ca8612314c08f136 Mon Sep 17 00:00:00 2001 From: Miguel Costa Date: Tue, 26 Jun 2018 16:56:45 +0200 Subject: Update ANGLE to chromium/3280 Change-Id: I0802c0d7486f772d361f87a544d6c5af937f4ca1 Reviewed-by: Friedemann Kleint --- .../angle/src/compiler/translator/UniformHLSL.h | 85 ++++++++++++++++------ 1 file changed, 61 insertions(+), 24 deletions(-) (limited to 'src/3rdparty/angle/src/compiler/translator/UniformHLSL.h') diff --git a/src/3rdparty/angle/src/compiler/translator/UniformHLSL.h b/src/3rdparty/angle/src/compiler/translator/UniformHLSL.h index 0f51f349bb..8784e50533 100644 --- a/src/3rdparty/angle/src/compiler/translator/UniformHLSL.h +++ b/src/3rdparty/angle/src/compiler/translator/UniformHLSL.h @@ -4,7 +4,7 @@ // found in the LICENSE file. // // UniformHLSL.h: -// Methods for GLSL to HLSL translation for uniforms and interface blocks. +// Methods for GLSL to HLSL translation for uniforms and uniform blocks. // #ifndef COMPILER_TRANSLATOR_UNIFORMHLSL_H_ @@ -16,29 +16,35 @@ namespace sh { class StructureHLSL; +class TSymbolTable; class UniformHLSL : angle::NonCopyable { public: - UniformHLSL(StructureHLSL *structureHLSL, ShShaderOutput outputType, const std::vector &uniforms); + UniformHLSL(sh::GLenum shaderType, + StructureHLSL *structureHLSL, + ShShaderOutput outputType, + const std::vector &uniforms); void reserveUniformRegisters(unsigned int registerCount); - void reserveInterfaceBlockRegisters(unsigned int registerCount); - void outputHLSLSamplerUniformGroup(TInfoSinkBase &out, - const HLSLTextureSamplerGroup textureGroup, - const TVector &group, - unsigned int *groupTextureRegisterIndex); + void reserveUniformBlockRegisters(unsigned int registerCount); void uniformsHeader(TInfoSinkBase &out, ShShaderOutput outputType, - const ReferencedSymbols &referencedUniforms); - TString interfaceBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks); + const ReferencedSymbols &referencedUniforms, + TSymbolTable *symbolTable); + + // Must be called after uniformsHeader + void samplerMetadataUniforms(TInfoSinkBase &out, const char *reg); + + TString uniformBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks); // Used for direct index references - static TString interfaceBlockInstanceString(const TInterfaceBlock& interfaceBlock, unsigned int arrayIndex); + static TString uniformBlockInstanceString(const TInterfaceBlock &interfaceBlock, + unsigned int arrayIndex); - const std::map &getInterfaceBlockRegisterMap() const + const std::map &getUniformBlockRegisterMap() const { - return mInterfaceBlockRegisterMap; + return mUniformBlockRegisterMap; } const std::map &getUniformRegisterMap() const { @@ -46,28 +52,59 @@ class UniformHLSL : angle::NonCopyable } private: - TString interfaceBlockString(const TInterfaceBlock &interfaceBlock, unsigned int registerIndex, unsigned int arrayIndex); - TString interfaceBlockMembersString(const TInterfaceBlock &interfaceBlock, TLayoutBlockStorage blockStorage); - TString interfaceBlockStructString(const TInterfaceBlock &interfaceBlock); + TString uniformBlockString(const TInterfaceBlock &interfaceBlock, + unsigned int registerIndex, + unsigned int arrayIndex); + TString uniformBlockMembersString(const TInterfaceBlock &interfaceBlock, + TLayoutBlockStorage blockStorage); + TString uniformBlockStructString(const TInterfaceBlock &interfaceBlock); const Uniform *findUniformByName(const TString &name) const; + void outputHLSL4_0_FL9_3Sampler(TInfoSinkBase &out, + const TType &type, + const TName &name, + const unsigned int registerIndex); + void outputHLSL4_1_FL11Texture(TInfoSinkBase &out, + const TType &type, + const TName &name, + const unsigned int registerIndex); + void outputHLSL4_1_FL11RWTexture(TInfoSinkBase &out, + const TType &type, + const TName &name, + const unsigned int registerIndex); + void outputUniform(TInfoSinkBase &out, + const TType &type, + const TName &name, + const unsigned int registerIndex); + // Returns the uniform's register index - unsigned int declareUniformAndAssignRegister(const TType &type, - const TString &name, - unsigned int *registerCount); - unsigned int declareUniformAndAssignRegister(const TType &type, const TString &name); + unsigned int assignUniformRegister(const TType &type, + const TString &name, + unsigned int *outRegisterCount); + unsigned int assignSamplerInStructUniformRegister(const TType &type, + const TString &name, + unsigned int *outRegisterCount); + + void outputHLSLSamplerUniformGroup( + TInfoSinkBase &out, + const HLSLTextureGroup textureGroup, + const TVector &group, + const TMap &samplerInStructSymbolsToAPINames, + unsigned int *groupTextureRegisterIndex); unsigned int mUniformRegister; - unsigned int mInterfaceBlockRegister; - unsigned int mSamplerRegister; + unsigned int mUniformBlockRegister; + unsigned int mTextureRegister; + unsigned int mRWTextureRegister; + unsigned int mSamplerCount; + sh::GLenum mShaderType; StructureHLSL *mStructureHLSL; ShShaderOutput mOutputType; const std::vector &mUniforms; - std::map mInterfaceBlockRegisterMap; + std::map mUniformBlockRegisterMap; std::map mUniformRegisterMap; }; - } -#endif // COMPILER_TRANSLATOR_UNIFORMHLSL_H_ +#endif // COMPILER_TRANSLATOR_UNIFORMHLSL_H_ -- cgit v1.2.3