Adjusting code interface

glslang/include/intermediate.h -> Add a new interface to set TIntermBranch's expression.

glslang/include/Types.h -> Add interface to set Type's basicType and add interface to get basicType form a TSampler.

glslang/MachineIndependent/intermediate.cpp -> Part of the code in createConversion been encapsulating as a new function called buildConvertOp

glslang/MachineIndependent/localintermediate.h -> Export createConversion and
buildConvertOp as a public function

glslang/Public/ShaderLang.h -> Add interface to get shader object and shader source.
This commit is contained in:
Roy 2019-09-02 15:01:06 +08:00
parent e8e138b9e0
commit b69e8f3aca
5 changed files with 246 additions and 229 deletions

View file

@ -693,9 +693,9 @@ public:
bool getPixelCenterInteger() const { return pixelCenterInteger; }
void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); }
unsigned int getBlendEquations() const { return blendEquations; }
bool setXfbBufferStride(int buffer, unsigned stride)
bool setXfbBufferStride(int buffer, unsigned stride, bool force = false)
{
if (xfbBuffers[buffer].stride != TQualifier::layoutXfbStrideEnd)
if (xfbBuffers[buffer].stride != TQualifier::layoutXfbStrideEnd && force == false)
return xfbBuffers[buffer].stride == stride;
xfbBuffers[buffer].stride = stride;
return true;
@ -776,6 +776,9 @@ public:
void merge(TInfoSink&, TIntermediate&);
void finalCheck(TInfoSink&, bool keepUncalled);
bool buildConvertOp(TBasicType dst, TBasicType src, TOperator& convertOp) const;
TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
void addIoAccessed(const TString& name) { ioAccessed.insert(name); }
bool inIoAccessed(const TString& name) const { return ioAccessed.find(name) != ioAccessed.end(); }
@ -866,7 +869,6 @@ protected:
bool specConstantPropagates(const TIntermTyped&, const TIntermTyped&);
void performTextureUpgradeAndSamplerRemovalTransformation(TIntermNode* root);
bool isConversionAllowed(TOperator op, TIntermTyped* node) const;
TIntermTyped* createConversion(TBasicType convertTo, TIntermTyped* node) const;
std::tuple<TBasicType, TBasicType> getConversionDestinatonType(TBasicType type0, TBasicType type1, TOperator op) const;
// JohnK: I think this function should go away.