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;
// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 136
#define ANGLE_SH_VERSION 135
typedef enum {
SH_GLES2_SPEC = 0x8B40,
......
......@@ -161,10 +161,8 @@ struct COMPILER_EXPORT Varying : public ShaderVariable
// Decide whether two varyings are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader.
// Invariance needs to match only in ESSL1. Relevant spec sections:
// GLSL ES 3.00.4, sections 4.6.1 and 4.3.9.
// GLSL ES 1.00.17, section 4.6.4.
bool isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const;
// See GLSL ES Spec 3.00.3, sec 4.3.9.
bool isSameVaryingAtLinkTime(const Varying &other) const;
InterpolationType interpolation;
bool isInvariant;
......
......@@ -12,7 +12,6 @@
#include "compiler/preprocessor/SourceLocation.h"
#include "compiler/translator/glslang.h"
#include "compiler/translator/ValidateSwitch.h"
#include "compiler/translator/util.h"
///////////////////////////////////////////////////////////////////////
//
......@@ -970,15 +969,6 @@ bool TParseContext::functionCallLValueErrorCheck(const TFunction *fnCandidate, T
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)
{
const TExtensionBehavior& extbehavior = extensionBehavior();
......
......@@ -110,7 +110,6 @@ struct TParseContext {
bool singleDeclarationErrorCheck(TPublicType &publicType, const TSourceLoc &identifierLocation);
bool layoutLocationErrorCheck(const TSourceLoc& location, const TLayoutQualifier &layoutQualifier);
bool functionCallLValueErrorCheck(const TFunction *fnCandidate, TIntermAggregate *);
void es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation);
const TPragma& pragma() const { return directiveHandler.pragma(); }
const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); }
......
......@@ -303,11 +303,11 @@ bool Varying::operator==(const Varying &other) const
isInvariant == other.isInvariant);
}
bool Varying::isSameVaryingAtLinkTime(const Varying &other, int shaderVersion) const
bool Varying::isSameVaryingAtLinkTime(const Varying &other) const
{
return (ShaderVariable::isSameVariableAtLinkTime(other, false) &&
interpolation == other.interpolation &&
(shaderVersion >= 300 || isInvariant == other.isInvariant));
isInvariant == other.isInvariant);
}
InterfaceBlock::InterfaceBlock()
......
......@@ -1012,16 +1012,6 @@ type_qualifier
$$.setBasic(EbtVoid, $2.qualifier, @2);
$$.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
......
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(
{
case EvqVaryingIn:
case EvqVaryingOut:
case EvqVertexOut:
case EvqSmoothOut:
case EvqFlatOut:
case EvqCentroidOut:
if (mSymbolTable.isVaryingInvariant(std::string(name.c_str())) || type.isInvariant())
{
variable->isInvariant = true;
......
......@@ -211,15 +211,11 @@ TEST(ShaderVariableTest, IsSameVaryingWithDifferentInvariance)
fx.staticUse = true;
fx.isInvariant = false;
// Default to ESSL1 behavior: invariance must match
EXPECT_FALSE(vx.isSameVaryingAtLinkTime(fx, 100));
// ESSL3 behavior: invariance doesn't need to match
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 300));
EXPECT_FALSE(vx.isSameVaryingAtLinkTime(fx));
// invariant varying float vary;
fx.isInvariant = true;
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 100));
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx, 300));
EXPECT_TRUE(vx.isSameVaryingAtLinkTime(fx));
}
// 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