Non-functional: missing test result and slight coding change from yesterday's constant folding check in.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24293 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
a4ca22ff1d
commit
b06c378cc9
@ -33,8 +33,8 @@ ERROR: 0:122: '=' : can't use with samplers or structs containing samplers
|
|||||||
ERROR: 0:123: '==' : can't use with samplers or structs containing samplers
|
ERROR: 0:123: '==' : can't use with samplers or structs containing samplers
|
||||||
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
|
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
|
||||||
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
|
ERROR: 0:129: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
|
||||||
ERROR: 0:138: 'imageBuffer' : Reserved word.
|
ERROR: 0:148: 'imageBuffer' : Reserved word.
|
||||||
ERROR: 0:138: '' : syntax error
|
ERROR: 0:148: '' : syntax error
|
||||||
ERROR: 36 compilation errors. No code generated.
|
ERROR: 36 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
@ -292,6 +292,64 @@ ERROR: node is still EOpNull!
|
|||||||
0:135 'p' (lowp float)
|
0:135 'p' (lowp float)
|
||||||
0:135 Constant:
|
0:135 Constant:
|
||||||
0:135 0.389418
|
0:135 0.389418
|
||||||
|
0:136 add second child into first child (lowp float)
|
||||||
|
0:136 'p' (lowp float)
|
||||||
|
0:136 Constant:
|
||||||
|
0:136 5.000000
|
||||||
|
0:137 add second child into first child (lowp float)
|
||||||
|
0:137 'p' (lowp float)
|
||||||
|
0:137 Constant:
|
||||||
|
0:137 13.000000
|
||||||
|
0:138 Sequence
|
||||||
|
0:138 move second child to first child (lowp 3-component vector of float)
|
||||||
|
0:138 'c3' (lowp 3-component vector of float)
|
||||||
|
0:138 Constant:
|
||||||
|
0:138 -15.000000
|
||||||
|
0:138 -2.000000
|
||||||
|
0:138 39.000000
|
||||||
|
0:139 add second child into first child (lowp 3-component vector of float)
|
||||||
|
0:139 'c3' (lowp 3-component vector of float)
|
||||||
|
0:139 Constant:
|
||||||
|
0:139 -1.000000
|
||||||
|
0:139 -2.000000
|
||||||
|
0:139 -3.000000
|
||||||
|
0:140 add second child into first child (lowp 3-component vector of float)
|
||||||
|
0:140 'c3' (lowp 3-component vector of float)
|
||||||
|
0:140 Constant:
|
||||||
|
0:140 1.000000
|
||||||
|
0:140 2.000000
|
||||||
|
0:140 3.000000
|
||||||
|
0:141 Sequence
|
||||||
|
0:141 move second child to first child (lowp 2-component vector of float)
|
||||||
|
0:141 'c2' (lowp 2-component vector of float)
|
||||||
|
0:141 Constant:
|
||||||
|
0:141 1.000000
|
||||||
|
0:141 -3.000000
|
||||||
|
0:142 add second child into first child (lowp 2-component vector of float)
|
||||||
|
0:142 'c2' (lowp 2-component vector of float)
|
||||||
|
0:142 Constant:
|
||||||
|
0:142 1.000000
|
||||||
|
0:142 -3.000000
|
||||||
|
0:143 add second child into first child (lowp 2-component vector of float)
|
||||||
|
0:143 'c2' (lowp 2-component vector of float)
|
||||||
|
0:143 Constant:
|
||||||
|
0:143 3.000000
|
||||||
|
0:143 -8.544004
|
||||||
|
0:144 add second child into first child (lowp 2-component vector of float)
|
||||||
|
0:144 'c2' (lowp 2-component vector of float)
|
||||||
|
0:144 Constant:
|
||||||
|
0:144 0.000000
|
||||||
|
0:144 0.000000
|
||||||
|
0:145 Sequence
|
||||||
|
0:145 move second child to first child (lowp 3X2 matrix of float)
|
||||||
|
0:145 'm32' (lowp 3X2 matrix of float)
|
||||||
|
0:145 Constant:
|
||||||
|
0:145 10.000000
|
||||||
|
0:145 15.000000
|
||||||
|
0:145 14.000000
|
||||||
|
0:145 21.000000
|
||||||
|
0:145 22.000000
|
||||||
|
0:145 33.000000
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? 's2D' (uniform lowp sampler2D)
|
0:? 's2D' (uniform lowp sampler2D)
|
||||||
0:? 's3D' (uniform lowp sampler3D)
|
0:? 's3D' (uniform lowp sampler3D)
|
||||||
|
@ -300,13 +300,17 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, TIntermTyped* constantNod
|
|||||||
TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||||
{
|
{
|
||||||
// First, size the result, which is mostly the same as the argument's size,
|
// First, size the result, which is mostly the same as the argument's size,
|
||||||
// but not always.
|
// but not always, and classify what is componentwise.
|
||||||
|
// Also, eliminate cases that can't be compile-time constant.
|
||||||
int resultSize;
|
int resultSize;
|
||||||
|
bool componentWise = true;
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpDeterminant:
|
case EOpDeterminant:
|
||||||
case EOpAny:
|
case EOpAny:
|
||||||
case EOpAll:
|
case EOpAll:
|
||||||
case EOpLength:
|
case EOpLength:
|
||||||
|
componentWise = false;
|
||||||
resultSize = 1;
|
resultSize = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -318,25 +322,33 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpPackSnorm2x16:
|
case EOpPackSnorm2x16:
|
||||||
case EOpPackUnorm2x16:
|
case EOpPackUnorm2x16:
|
||||||
case EOpPackHalf2x16:
|
case EOpPackHalf2x16:
|
||||||
|
componentWise = false;
|
||||||
resultSize = 1;
|
resultSize = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EOpUnpackSnorm2x16:
|
case EOpUnpackSnorm2x16:
|
||||||
case EOpUnpackUnorm2x16:
|
case EOpUnpackUnorm2x16:
|
||||||
case EOpUnpackHalf2x16:
|
case EOpUnpackHalf2x16:
|
||||||
|
componentWise = false;
|
||||||
resultSize = 2;
|
resultSize = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EOpNormalize:
|
||||||
|
componentWise = false;
|
||||||
|
resultSize = getType().getObjectSize();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
resultSize = getType().getObjectSize();
|
resultSize = getType().getObjectSize();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TConstUnionArray newConstArray(resultSize);
|
|
||||||
|
|
||||||
const TConstUnionArray unionArray = getConstArray();
|
// Set up for processing
|
||||||
|
TConstUnionArray newConstArray(resultSize);
|
||||||
|
const TConstUnionArray& unionArray = getConstArray();
|
||||||
|
int objectSize = getType().getObjectSize();
|
||||||
|
|
||||||
// Process non-component-wise operations
|
// Process non-component-wise operations
|
||||||
int objectSize = getType().getObjectSize();
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpLength:
|
case EOpLength:
|
||||||
case EOpNormalize:
|
case EOpNormalize:
|
||||||
@ -353,10 +365,35 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
||||||
|
|
||||||
|
case EOpPackSnorm2x16:
|
||||||
|
case EOpPackUnorm2x16:
|
||||||
|
case EOpPackHalf2x16:
|
||||||
|
|
||||||
|
case EOpUnpackSnorm2x16:
|
||||||
|
case EOpUnpackUnorm2x16:
|
||||||
|
case EOpUnpackHalf2x16:
|
||||||
|
|
||||||
|
case EOpDeterminant:
|
||||||
|
case EOpMatrixInverse:
|
||||||
|
case EOpTranspose:
|
||||||
|
|
||||||
|
case EOpAny:
|
||||||
|
case EOpAll:
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
assert(componentWise);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Turn off the componentwise loop
|
||||||
|
if (! componentWise)
|
||||||
|
objectSize = 0;
|
||||||
|
|
||||||
|
// Process component-wise operations
|
||||||
for (int i = 0; i < objectSize; i++) {
|
for (int i = 0; i < objectSize; i++) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case EOpNegative:
|
case EOpNegative:
|
||||||
@ -405,11 +442,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
newConstArray[i].setDConst(atan(unionArray[i].getDConst()));
|
newConstArray[i].setDConst(atan(unionArray[i].getDConst()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EOpLength:
|
|
||||||
case EOpNormalize:
|
|
||||||
// handled above as special case
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EOpDPdx:
|
case EOpDPdx:
|
||||||
case EOpDPdy:
|
case EOpDPdy:
|
||||||
case EOpFwidth:
|
case EOpFwidth:
|
||||||
@ -512,20 +544,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
|||||||
case EOpIntBitsToFloat:
|
case EOpIntBitsToFloat:
|
||||||
case EOpUintBitsToFloat:
|
case EOpUintBitsToFloat:
|
||||||
|
|
||||||
case EOpPackSnorm2x16:
|
|
||||||
case EOpUnpackSnorm2x16:
|
|
||||||
case EOpPackUnorm2x16:
|
|
||||||
case EOpUnpackUnorm2x16:
|
|
||||||
case EOpPackHalf2x16:
|
|
||||||
case EOpUnpackHalf2x16:
|
|
||||||
|
|
||||||
case EOpDeterminant:
|
|
||||||
case EOpMatrixInverse:
|
|
||||||
case EOpTranspose:
|
|
||||||
|
|
||||||
case EOpAny:
|
|
||||||
case EOpAll:
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user