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

@ -135,6 +135,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isYuv() const { return yuv; }
#endif
void setCombined(bool c) { combined = c; }
void setBasicType(TBasicType t) { type = t; };
TBasicType getBasicType() const { return type; };
bool isShadow() const { return shadow; }
bool isArrayed() const { return arrayed; }
@ -2184,7 +2186,8 @@ public:
const TTypeList* getStruct() const { assert(isStruct()); return structure; }
void setStruct(TTypeList* s) { assert(isStruct()); structure = s; }
TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads
void setBasicType(const TBasicType& t) { basicType = t; }
int computeNumComponents() const
{
int components = 0;

View file

@ -1185,6 +1185,7 @@ public:
virtual void traverse(TIntermTraverser*);
TOperator getFlowOp() const { return flowOp; }
TIntermTyped* getExpression() const { return expression; }
void setExpression(TIntermTyped* pExpression) { expression = pExpression; }
protected:
TOperator flowOp;
TIntermTyped* expression;