Unify constant floats and constant doubles; they can all be constant doubles.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21921 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
50a8cabbbb
commit
fddf3ce3a1
8 changed files with 72 additions and 105 deletions
|
|
@ -42,22 +42,34 @@ class constUnion {
|
|||
public:
|
||||
|
||||
POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)
|
||||
void setIConst(int i) {iConst = i; type = EbtInt; }
|
||||
void setUConst(unsigned int u) {uConst = u; type = EbtUint; }
|
||||
void setFConst(float f) {fConst = f; type = EbtFloat; }
|
||||
void setDConst(double d) {dConst = d; type = EbtDouble; }
|
||||
void setBConst(bool b) {bConst = b; type = EbtBool; }
|
||||
void setIConst(int i)
|
||||
{
|
||||
iConst = i;
|
||||
type = EbtInt;
|
||||
}
|
||||
|
||||
int getIConst() { return iConst; }
|
||||
unsigned int getUConst() { return uConst; }
|
||||
float getFConst() { return fConst; }
|
||||
double getDConst() { return dConst; }
|
||||
bool getBConst() { return bConst; }
|
||||
int getIConst() const { return iConst; }
|
||||
void setUConst(unsigned int u)
|
||||
{
|
||||
uConst = u;
|
||||
type = EbtUint;
|
||||
}
|
||||
|
||||
void setDConst(double d)
|
||||
{
|
||||
dConst = d;
|
||||
type = EbtDouble;
|
||||
}
|
||||
|
||||
void setBConst(bool b)
|
||||
{
|
||||
bConst = b;
|
||||
type = EbtBool;
|
||||
}
|
||||
|
||||
int getIConst() const { return iConst; }
|
||||
unsigned int getUConst() const { return uConst; }
|
||||
float getFConst() const { return fConst; }
|
||||
double getDConst() const { return dConst; }
|
||||
bool getBConst() const { return bConst; }
|
||||
double getDConst() const { return dConst; }
|
||||
bool getBConst() const { return bConst; }
|
||||
|
||||
bool operator==(const int i) const
|
||||
{
|
||||
|
|
@ -75,14 +87,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool operator==(const float f) const
|
||||
{
|
||||
if (f == fConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator==(const double d) const
|
||||
{
|
||||
if (d == dConst)
|
||||
|
|
@ -114,11 +118,6 @@ public:
|
|||
if (constant.uConst == uConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtFloat:
|
||||
if (constant.fConst == fConst)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case EbtDouble:
|
||||
if (constant.dConst == dConst)
|
||||
|
|
@ -175,11 +174,6 @@ public:
|
|||
if (uConst > constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtFloat:
|
||||
if (fConst > constant.fConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst > constant.dConst)
|
||||
|
|
@ -207,11 +201,6 @@ public:
|
|||
if (uConst < constant.uConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtFloat:
|
||||
if (fConst < constant.fConst)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
case EbtDouble:
|
||||
if (dConst < constant.dConst)
|
||||
|
|
@ -233,7 +222,6 @@ public:
|
|||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst + constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst + constant.uConst); break;
|
||||
case EbtFloat: returnValue.setFConst(fConst + constant.fConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
|
@ -248,7 +236,6 @@ public:
|
|||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst - constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst - constant.uConst); break;
|
||||
case EbtFloat: returnValue.setFConst(fConst - constant.fConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
|
@ -263,7 +250,6 @@ public:
|
|||
switch (type) {
|
||||
case EbtInt: returnValue.setIConst(iConst * constant.iConst); break;
|
||||
case EbtUint: returnValue.setUConst(uConst * constant.uConst); break;
|
||||
case EbtFloat: returnValue.setFConst(fConst * constant.fConst); break;
|
||||
case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
|
||||
default: assert(false && "Default missing");
|
||||
}
|
||||
|
|
@ -414,8 +400,7 @@ private:
|
|||
int iConst; // used for ivec, scalar ints
|
||||
unsigned int uConst; // used for uvec, scalar uints
|
||||
bool bConst; // used for bvec, scalar bools
|
||||
float fConst; // used for vec, mat, scalar floats
|
||||
double dConst; // used for dvec, dmat, scalar doubles
|
||||
double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles
|
||||
} ;
|
||||
|
||||
TBasicType type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue