Commit 9e64edce by Jamie Madill

Revert "Add support for parsing ESSL3 invariant qualifiers"

Build breaks in GPU FYI bots. BUG=angleproject:987 This reverts commit 40088793. Change-Id: Ia88ad302c403c65516c050eb7741316b5097bcfb Reviewed-on: https://chromium-review.googlesource.com/269847Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 40088793
...@@ -48,7 +48,7 @@ typedef unsigned int GLenum; ...@@ -48,7 +48,7 @@ typedef unsigned int GLenum;
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 136 #define ANGLE_SH_VERSION 135
typedef enum { typedef enum {
SH_GLES2_SPEC = 0x8B40, SH_GLES2_SPEC = 0x8B40,
......
...@@ -161,10 +161,8 @@ struct COMPILER_EXPORT Varying : public ShaderVariable ...@@ -161,10 +161,8 @@ struct COMPILER_EXPORT Varying : public ShaderVariable
// Decide whether two varyings are the same at shader link time, // Decide whether two varyings are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader. // assuming one from vertex shader and the other from fragment shader.
// Invariance needs to match only in ESSL1. Relevant spec sections: // See GLSL ES Spec 3.00.3, sec 4.3.9.
// GLSL ES 3.00.4, sections 4.6.1 and 4.3.9. bool isSameVaryingAtLinkTime(const Varying &other) const;
// GLSL ES 1.00.17, section 4.6.4.
bool isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const;
InterpolationType interpolation; InterpolationType interpolation;
bool isInvariant; bool isInvariant;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "compiler/preprocessor/SourceLocation.h" #include "compiler/preprocessor/SourceLocation.h"
#include "compiler/translator/glslang.h" #include "compiler/translator/glslang.h"
#include "compiler/translator/ValidateSwitch.h" #include "compiler/translator/ValidateSwitch.h"
#include "compiler/translator/util.h"
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
...@@ -970,15 +969,6 @@ bool TParseContext::functionCallLValueErrorCheck(const TFunction *fnCandidate, T ...@@ -970,15 +969,6 @@ bool TParseContext::functionCallLValueErrorCheck(const TFunction *fnCandidate, T
return false; return false;
} }
void TParseContext::es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation)
{
if (!sh::IsVaryingOut(qualifier) && qualifier != EvqFragmentOut)
{
error(invariantLocation, "Only out variables can be invariant.", "invariant");
recover();
}
}
bool TParseContext::supportsExtension(const char* extension) bool TParseContext::supportsExtension(const char* extension)
{ {
const TExtensionBehavior& extbehavior = extensionBehavior(); const TExtensionBehavior& extbehavior = extensionBehavior();
......
...@@ -110,7 +110,6 @@ struct TParseContext { ...@@ -110,7 +110,6 @@ struct TParseContext {
bool singleDeclarationErrorCheck(TPublicType &publicType, const TSourceLoc &identifierLocation); bool singleDeclarationErrorCheck(TPublicType &publicType, const TSourceLoc &identifierLocation);
bool layoutLocationErrorCheck(const TSourceLoc& location, const TLayoutQualifier &layoutQualifier); bool layoutLocationErrorCheck(const TSourceLoc& location, const TLayoutQualifier &layoutQualifier);
bool functionCallLValueErrorCheck(const TFunction *fnCandidate, TIntermAggregate *); bool functionCallLValueErrorCheck(const TFunction *fnCandidate, TIntermAggregate *);
void es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation);
const TPragma& pragma() const { return directiveHandler.pragma(); } const TPragma& pragma() const { return directiveHandler.pragma(); }
const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); } const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); }
......
...@@ -303,11 +303,11 @@ bool Varying::operator==(const Varying &other) const ...@@ -303,11 +303,11 @@ bool Varying::operator==(const Varying &other) const
isInvariant == other.isInvariant); isInvariant == other.isInvariant);
} }
bool Varying::isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const bool Varying::isSameVaryingAtLinkTime(const Varying &other) const
{ {
return (ShaderVariable::isSameVariableAtLinkTime(other, false) && return (ShaderVariable::isSameVariableAtLinkTime(other, false) &&
interpolation == other.interpolation && interpolation == other.interpolation &&
(shaderVersion >= 300 || isInvariant == other.isInvariant)); isInvariant == other.isInvariant);
} }
InterfaceBlock::InterfaceBlock() InterfaceBlock::InterfaceBlock()
......
...@@ -1012,16 +1012,6 @@ type_qualifier ...@@ -1012,16 +1012,6 @@ type_qualifier
$$.setBasic(EbtVoid, $2.qualifier, @2); $$.setBasic(EbtVoid, $2.qualifier, @2);
$$.layoutQualifier = $1; $$.layoutQualifier = $1;
} }
| INVARIANT storage_qualifier {
context->es3InvariantErrorCheck($2.qualifier, @1);
$$.setBasic(EbtVoid, $2.qualifier, @2);
$$.invariant = true;
}
| INVARIANT interpolation_qualifier storage_qualifier {
context->es3InvariantErrorCheck($3.qualifier, @1);
$$ = context->joinInterpolationQualifiers(@2, $2.qualifier, @3, $3.qualifier);
$$.invariant = true;
}
; ;
storage_qualifier storage_qualifier
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -299,10 +299,6 @@ void GetVariableTraverser::setTypeSpecificInfo( ...@@ -299,10 +299,6 @@ void GetVariableTraverser::setTypeSpecificInfo(
{ {
case EvqVaryingIn: case EvqVaryingIn:
case EvqVaryingOut: case EvqVaryingOut:
case EvqVertexOut:
case EvqSmoothOut:
case EvqFlatOut:
case EvqCentroidOut:
if (mSymbolTable.isVaryingInvariant(std::string(name.c_str())) || type.isInvariant()) if (mSymbolTable.isVaryingInvariant(std::string(name.c_str())) || type.isInvariant())
{ {
variable->isInvariant = true; variable->isInvariant = true;
......
...@@ -211,15 +211,11 @@ TEST(ShaderVariableTest, IsSameVaryingWithDifferentInvariance) ...@@ -211,15 +211,11 @@ TEST(ShaderVariableTest, IsSameVaryingWithDifferentInvariance)
fx.staticUse = true; fx.staticUse = true;
fx.isInvariant = false; fx.isInvariant = false;
// Default to ESSL1 behavior: invariance must match EXPECT_FALSE(vx.isSameVaryingAtLinkTime(fx));
EXPECT_FALSE(vx.isSameVaryingAtLinkTime(fx, 100));
// ESSL3 behavior: invariance doesn't need to match
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 300));
// invariant varying float vary; // invariant varying float vary;
fx.isInvariant = true; fx.isInvariant = true;
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 100)); EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx));
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 300));
} }
// Test that using invariant varyings doesn't trigger a double delete. // Test that using invariant varyings doesn't trigger a double delete.
......
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