Commit b69e8f3a by Roy

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.
parent e8e138b9
......@@ -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;
......
......@@ -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;
......
......@@ -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.
......
......@@ -486,6 +486,8 @@ public:
environment.target.version = version;
}
void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; };
#ifdef ENABLE_HLSL
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; }
......@@ -772,7 +774,7 @@ public:
TProgram();
virtual ~TProgram();
void addShader(TShader* shader) { stages[shader->stage].push_back(shader); }
std::list<TShader*>& getShaders(EShLanguage stage) { return stages[stage]; };
// Link Validation interface
bool link(EShMessages);
const char* getInfoLog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment