Changeset 273189 in webkit


Ignore:
Timestamp:
Feb 19, 2021 7:06:00 PM (3 years ago)
Author:
Chris Dumez
Message:

Unreviewed, reverting r273188.

Broke the build: Is missing a cpp file

Reverted changeset:

"Fix a number of functional regressions caused by enabling the
Metal ANGLE backend by default."
https://bugs.webkit.org/show_bug.cgi?id=220895
https://commits.webkit.org/r273188

Location:
trunk/Source/ThirdParty/ANGLE
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj

    r273188 r273189  
    11811181                A3D3291823CFCB7700375657 /* RemoveInactiveInterfaceVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3D3291223CFCB7600375657 /* RemoveInactiveInterfaceVariables.cpp */; };
    11821182                A3D3291923CFCB7700375657 /* RemoveInactiveInterfaceVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = A3D3291323CFCB7600375657 /* RemoveInactiveInterfaceVariables.h */; };
    1183                 FF2D2F5425C8B14A002FB699 /* FixTypeConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = FF2D2F5225C8B14A002FB699 /* FixTypeConstructors.h */; };
    1184                 FF2D2F5525C8B14A002FB699 /* FixTypeConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = FF2D2F5225C8B14A002FB699 /* FixTypeConstructors.h */; };
    1185                 FF2D2F5625C8B14A002FB699 /* FixTypeConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FF2D2F5325C8B14A002FB699 /* FixTypeConstructors.cpp */; };
    11861183                FF81FED025818D6800894E24 /* mtl_glslang_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = FF81FE8025818D6800894E24 /* mtl_glslang_utils.h */; };
    11871184                FF81FED125818D6800894E24 /* ProgramMtl.h in Headers */ = {isa = PBXBuildFile; fileRef = FF81FE8125818D6800894E24 /* ProgramMtl.h */; };
     
    13191316                FF81FFA32581AD0400894E24 /* gen_mipmap.metal in Sources */ = {isa = PBXBuildFile; fileRef = FF81FEB225818D6800894E24 /* gen_mipmap.metal */; };
    13201317                FF81FFA42581AD0400894E24 /* gen_indices.metal in Sources */ = {isa = PBXBuildFile; fileRef = FF81FEB325818D6800894E24 /* gen_indices.metal */; };
    1321                 FFA0C2C725CB6A7700105306 /* NameEmbeddedUniformStructsMetal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFA0C2C525CB6A7600105306 /* NameEmbeddedUniformStructsMetal.cpp */; };
    1322                 FFA0C2C825CB6A7700105306 /* NameEmbeddedUniformStructsMetal.h in Headers */ = {isa = PBXBuildFile; fileRef = FFA0C2C625CB6A7700105306 /* NameEmbeddedUniformStructsMetal.h */; };
    13231318/* End PBXBuildFile section */
    13241319
     
    21712166                FB39D0D11200F0E300088E69 /* libANGLE.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libANGLE.a; sourceTree = BUILT_PRODUCTS_DIR; };
    21722167                FB39D2BF1200F3E600088E69 /* ShaderLang.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ShaderLang.h; sourceTree = "<group>"; };
    2173                 FF2D2F5225C8B14A002FB699 /* FixTypeConstructors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FixTypeConstructors.h; sourceTree = "<group>"; };
    2174                 FF2D2F5325C8B14A002FB699 /* FixTypeConstructors.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FixTypeConstructors.cpp; sourceTree = "<group>"; };
    21752168                FF81FE8025818D6800894E24 /* mtl_glslang_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mtl_glslang_utils.h; sourceTree = "<group>"; };
    21762169                FF81FE8125818D6800894E24 /* ProgramMtl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgramMtl.h; sourceTree = "<group>"; };
     
    23102303                FF81FF992581A3C100894E24 /* IntermRebuild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntermRebuild.cpp; sourceTree = "<group>"; };
    23112304                FF81FF9A2581A3C200894E24 /* IntermRebuild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntermRebuild.h; sourceTree = "<group>"; };
    2312                 FFA0C2C525CB6A7600105306 /* NameEmbeddedUniformStructsMetal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameEmbeddedUniformStructsMetal.cpp; sourceTree = "<group>"; };
    2313                 FFA0C2C625CB6A7700105306 /* NameEmbeddedUniformStructsMetal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NameEmbeddedUniformStructsMetal.h; sourceTree = "<group>"; };
    23142305/* End PBXFileReference section */
    23152306
     
    35833574                                FF81FF522581919700894E24 /* EmitMetal.h */,
    35843575                                FF81FF282581919700894E24 /* EnvironmentVariable.h */,
    3585                                 FF2D2F5325C8B14A002FB699 /* FixTypeConstructors.cpp */,
    3586                                 FF2D2F5225C8B14A002FB699 /* FixTypeConstructors.h */,
    35873576                                FF81FF482581919700894E24 /* HoistConstants.cpp */,
    35883577                                FF81FF4C2581919700894E24 /* HoistConstants.h */,
     
    35993588                                FF81FF212581919700894E24 /* Name.cpp */,
    36003589                                FF81FF242581919700894E24 /* Name.h */,
    3601                                 FFA0C2C525CB6A7600105306 /* NameEmbeddedUniformStructsMetal.cpp */,
    3602                                 FFA0C2C625CB6A7700105306 /* NameEmbeddedUniformStructsMetal.h */,
    36033590                                FF81FF372581919700894E24 /* Pipeline.cpp */,
    36043591                                FF81FF492581919700894E24 /* Pipeline.h */,
     
    37513738                                31CDFFB6249184A100486F27 /* FindSymbolNode.h in Headers */,
    37523739                                31CDFF682491848C00486F27 /* FixedVector.h in Headers */,
    3753                                 FF2D2F5525C8B14A002FB699 /* FixTypeConstructors.h in Headers */,
    37543740                                A3C49C16255DF866005E8DF7 /* FlagSamplersWithTexelFetch.h in Headers */,
    37553741                                31CDFFC0249184A700486F27 /* FlagStd140Structs.h in Headers */,
     
    41844170                                5C55D6FB22826CB300B5BA2C /* FindSymbolNode.h in Headers */,
    41854171                                5C55D7282282747700B5BA2C /* FixedVector.h in Headers */,
    4186                                 FF2D2F5425C8B14A002FB699 /* FixTypeConstructors.h in Headers */,
    41874172                                A3C49C12255DF865005E8DF7 /* FlagSamplersWithTexelFetch.h in Headers */,
    41884173                                5C9FFF4F19102A000025B8FA /* FlagStd140Structs.h in Headers */,
     
    42904275                                FF81FF5E2581919700894E24 /* Name.h in Headers */,
    42914276                                5C55D66922826B9F00B5BA2C /* NameEmbeddedUniformStructs.h in Headers */,
    4292                                 FFA0C2C825CB6A7700105306 /* NameEmbeddedUniformStructsMetal.h in Headers */,
    42934277                                A303070B2305F6B5002DA972 /* no_destructor.h in Headers */,
    42944278                                5C55D70722826CB300B5BA2C /* NodeSearch.h in Headers */,
     
    47634747                                5C55D6FD22826CB300B5BA2C /* FindMain.cpp in Sources */,
    47644748                                5C55D70322826CB300B5BA2C /* FindSymbolNode.cpp in Sources */,
    4765                                 FF2D2F5625C8B14A002FB699 /* FixTypeConstructors.cpp in Sources */,
    47664749                                A3C49C0B255DF85F005E8DF7 /* FlagSamplersWithTexelFetch.cpp in Sources */,
    47674750                                5C9FFF4E19102A000025B8FA /* FlagStd140Structs.cpp in Sources */,
     
    48464829                                FF81FF5B2581919700894E24 /* Name.cpp in Sources */,
    48474830                                5C55D6B622826BC800B5BA2C /* NameEmbeddedUniformStructs.cpp in Sources */,
    4848                                 FFA0C2C725CB6A7700105306 /* NameEmbeddedUniformStructsMetal.cpp in Sources */,
    48494831                                315EBDBF1FCE44BF00AC7A89 /* null_functions.cpp in Sources */,
    48504832                                5CCD59692284F7960018F2D8 /* Observer.cpp in Sources */,
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r273188 r273189  
     12021-02-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, reverting r273188.
     4
     5        Broke the build: Is missing a cpp file
     6
     7        Reverted changeset:
     8
     9        "Fix a number of functional regressions caused by enabling the
     10        Metal ANGLE backend by default."
     11        https://bugs.webkit.org/show_bug.cgi?id=220895
     12        https://commits.webkit.org/r273188
     13
    1142021-02-19  Kyle Piddington  <kpiddington@apple.com>
    215
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect.cpp

    r273188 r273189  
    2828#include "compiler/translator/TranslatorMetalDirect/SeparateCompoundExpressions.h"
    2929#include "compiler/translator/TranslatorMetalDirect/SeparateCompoundStructDeclarations.h"
    30 #include "compiler/translator/TranslatorMetalDirect/FixTypeConstructors.h"
    3130#include "compiler/translator/TranslatorMetalDirect/SymbolEnv.h"
    3231#include "compiler/translator/TranslatorMetalDirect/ToposortStructs.h"
     
    3433#include "compiler/translator/TranslatorMetalUtils.h"
    3534#include "compiler/translator/tree_ops/InitializeVariables.h"
    36 #include "compiler/translator/TranslatorMetalDirect/NameEmbeddedUniformStructsMetal.h"
     35#include "compiler/translator/tree_ops/NameEmbeddedUniformStructs.h"
    3736#include "compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.h"
    3837#include "compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.h"
     
    602601    root.insertChildNodes(FindMainIndex(&root),
    603602                          TIntermSequence{new TIntermDeclaration{BuiltInVariable::gl_FragDepth()}});
    604 }
    605 
    606 void AddFragDepthEXTDeclaration(TCompiler &compiler, TIntermBlock &root, TSymbolTable &symbolTable)
    607 {   
    608     const TIntermSymbol *glFragDepthExt = FindSymbolNode(&root, ImmutableString("gl_FragDepthEXT"));
    609     ASSERT(glFragDepthExt);
    610 
    611     // Replace gl_FragData with our globally defined fragdata.
    612     if (!ReplaceVariable(&compiler, &root, &(glFragDepthExt->variable()), BuiltInVariable::gl_FragDepth()))
    613     {
    614         return;
    615     }
    616     AddFragDepthDeclaration(root, symbolTable);
    617603}
    618604
     
    954940    if (aggregateTypesUsedForUniforms > 0)
    955941    {
    956         if (!NameEmbeddedStructUniformsMetal(this, &root, &symbolTable))
     942        if (!NameEmbeddedStructUniforms(this, &root, &symbolTable))
    957943        {
    958944            return false;
     
    11201106        bool usesFragData  = false;
    11211107        bool usesFragDepth = false;
    1122         bool usesFragDepthEXT = false;
    11231108        for (const ShaderVariable &outputVarying : mOutputVariables)
    11241109        {
     
    11371122                    usesFragDepth = true;
    11381123                }
    1139                 else if (outputVarying.name == "gl_FragDepthEXT")
    1140                 {
    1141                     usesFragDepthEXT = true;
    1142                 }
    11431124            }
    11441125        }
     
    11611142            }
    11621143        }
    1163         if(usesFragDepthEXT)
    1164         {
    1165             AddFragDepthEXTDeclaration(*this, root, symbolTable);
    1166         }
    1167         else if (usesFragDepth)
     1144
     1145        if (usesFragDepth)
    11681146        {
    11691147            AddFragDepthDeclaration(root, symbolTable);
     
    12431221            DeclareRightBeforeMain(root, kgl_VertexIndexMetal);
    12441222        }
    1245         else if (FindSymbolNode(&root, BuiltInVariable::gl_VertexID()->name()))
    1246         {
    1247             if (!ReplaceVariable(this, &root, BuiltInVariable::gl_VertexID(),
    1248                                  &kgl_VertexIndexMetal))
    1249             {
    1250                 return false;
    1251             }
    1252             DeclareRightBeforeMain(root, kgl_VertexIndexMetal);
    1253         }
    12541223
    12551224#if 0
     
    13511320    }
    13521321
    1353     if (!ReduceInterfaceBlocks(*this, root, idGen))
     1322    if (!ReduceInterfaceBlocks(*this, root))
    13541323    {
    13551324        return false;
     
    14091378        return false;
    14101379    }
    1411     if(!FixTypeConstructors(*this, symbolEnv, root))
    1412     {
    1413         return false;
    1414     }
    14151380
    14161381    if (!ToposortStructs(*this, symbolEnv, root, ppc))
     
    14181383        return false;
    14191384    }
    1420  
     1385
    14211386    if (!EmitMetal(*this, root, idGen, pipelineStructs, invariants, symbolEnv, ppc))
    14221387    {
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/EmitMetal.cpp

    r273188 r273189  
    356356            if ((argType0->isVector() && argType1->isVector()) ||
    357357                (argType0->getStruct() && argType1->getStruct()) ||
    358                 (argType0->isArray() && argType1->isArray()) ||
    359                 (argType0->isMatrix() && argType1->isMatrix()))
     358                (argType0->isArray() && argType1->isArray()))
    360359
    361360            {
     
    367366        case TOperator::EOpNotEqual:
    368367            if ((argType0->isVector() && argType1->isVector()) ||
    369                 (argType0->isArray() && argType1->isArray())||
    370                 (argType0->isMatrix() && argType1->isMatrix()))
     368                (argType0->isArray() && argType1->isArray()))
    371369            {
    372370                return "ANGLE_notEqual";
     
    936934
    937935    const bool isInvariant =
    938         (decl.isField() ? mInvariants.contains(decl.field()) : mInvariants.contains(decl.variable())) && (qualifier == TQualifier::EvqPosition || qualifier == TQualifier::EvqFragCoord);
     936        decl.isField() ? mInvariants.contains(decl.field()) : mInvariants.contains(decl.variable());
    939937
    940938    if (isInvariant)
     
    15501548        case TOperator::EOpIndexIndirect:
    15511549        {
    1552             TType leftType = leftNode.getType();
    15531550            groupedTraverse(leftNode);
    15541551            mOut << "[";
    1555             {
    1556                 mOut << "ANGLE_int_clamp(";
    1557                 groupedTraverse(rightNode);
    1558                 mOut << ", 0, ";
    1559                 if(leftType.isUnsizedArray())
    1560                 {
    1561                     groupedTraverse(leftNode);
    1562                     mOut << ".size()";
    1563                 }
    1564                 else
    1565                 {
    1566                     int maxSize;
    1567                     if (leftType.isArray())
    1568                     {
    1569                         maxSize = static_cast<int>(leftType.getOutermostArraySize()) - 1;
    1570                     }
    1571                     else
    1572                     {
    1573                         maxSize = leftType.getNominalSize() - 1;
    1574                     }
    1575                     mOut << maxSize;
    1576                 }
    1577                 mOut << ")";
    1578 
    1579             }
     1552            rightNode.traverse(this);
    15801553            mOut << "]";
    15811554        }
     
    18961869    putAngle("texture2DLod");
    18971870    putAngle("texture2DProj");
    1898     putAngle("texture2DRect");
    18991871    putAngle("texture2DProjLod");
    1900     putAngle("texture2DRectProj");
    19011872    putAngle("texture3D");
    19021873    putAngle("texture3DLod");
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/Pipeline.cpp

    r273188 r273189  
    299299
    300300    const bool cond = type.getBasicType() == BT && !type.isArray() &&
    301                       CompareBy(Cmp, type.getNominalSize(), MatchDim) && type.getQualifier() != TQualifier::EvqFragDepth;
    302 
     301                      CompareBy(Cmp, type.getNominalSize(), MatchDim);
    303302
    304303    if (cond)
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ProgramPrelude.cpp

    r273188 r273189  
    3434    {
    3535        ALWAYS_INLINE();
    36         int_clamp();
     36
    3737        if (ppc.hasStructEq)
    3838        {
     
    110110    void matmulAssign();
    111111    void atan();
    112     void int_clamp();
    113112    void addMatrixScalarAssign();
    114113    void subMatrixScalarAssign();
     
    131130    void notEqualVector();
    132131    void notEqualStruct();
    133     void notEqualMatrix();
    134132    void equalArray();
    135133    void notEqualArray();
     
    171169    void texture2DProj();
    172170    void texture2DProjLod();
    173     void texture2DRect();
    174     void texture2DRectProj();
    175171    void texture3DLod();
    176172    void texture3DProj();
     
    645641                        include_metal_common())
    646642
    647 PROGRAM_PRELUDE_DECLARE(int_clamp,
    648                         R"(
    649 ANGLE_ALWAYS_INLINE int ANGLE_int_clamp(int value, int minValue, int maxValue)
    650 {
    651     return ((value < minValue) ?  minValue : ((value > maxValue) ? maxValue : value));
    652 };
    653 )")
    654 
    655643PROGRAM_PRELUDE_DECLARE(atan,
    656644                        R"(
     
    10671055                        equalVector())
    10681056
    1069 
    10701057PROGRAM_PRELUDE_DECLARE(notEqualVector,
    10711058                        R"(
     
    10771064)",
    10781065                        equalVector())
    1079 
    1080 PROGRAM_PRELUDE_DECLARE(notEqualMatrix,
    1081                         R"(
    1082 template <typename T, int C, int R>
    1083 ANGLE_ALWAYS_INLINE bool ANGLE_notEqual(metal::matrix<T, C, R> u, metal::matrix<T, C, R> v)
    1084 {
    1085     return !ANGLE_equal(u, v);
    1086 }
    1087 )",
    1088                         equalMatrix())
    1089 
    10901066
    10911067PROGRAM_PRELUDE_DECLARE(notEqualStruct,
     
    17771753                        textureEnv())
    17781754
    1779 PROGRAM_PRELUDE_DECLARE(texture2DRect,
    1780                         R"(
    1781 #define ANGLE_texture2DRect(env, ...) ANGLE_texture2DRect_impl(*env.texture, *env.sampler, __VA_ARGS__)
    1782 
    1783 template <typename Texture>
    1784 ANGLE_ALWAYS_INLINE auto ANGLE_texture2DRect_impl(
    1785     thread Texture &texture,
    1786     thread metal::sampler const &sampler,
    1787     thread metal::float2 const &coord)
    1788 {
    1789     return texture.sample(sampler, coord);
    1790 }
    1791 )",
    1792                         textureEnv())
    1793 
    1794 
    17951755PROGRAM_PRELUDE_DECLARE(texture2DLod,
    17961756                        R"(
     
    18351795                        textureEnv())
    18361796
    1837 PROGRAM_PRELUDE_DECLARE(texture2DRectProj,
    1838                         R"(
    1839 #define ANGLE_texture2DRectProj(env, ...) ANGLE_texture2DRectProj_impl(*env.texture, *env.sampler, __VA_ARGS__)
    1840                        
    1841 template <typename Texture>
    1842 ANGLE_ALWAYS_INLINE auto ANGLE_texture2DRectProj_impl(
    1843     thread Texture &texture,
    1844     thread metal::sampler const &sampler,
    1845     thread metal::float3 const &coord)
    1846 {
    1847     return texture.sample(sampler, coord.xy/coord.z);
    1848 }
    1849 
    1850 template <typename Texture>
    1851 ANGLE_ALWAYS_INLINE auto ANGLE_texture2DRectProj_impl(
    1852     thread Texture &texture,
    1853     thread metal::sampler const &sampler,
    1854     thread metal::float4 const &coord)
    1855 {
    1856     return texture.sample(sampler, coord.xy/coord.w);
    1857 }
    1858 )",
    1859                         textureEnv())
    1860 
    18611797PROGRAM_PRELUDE_DECLARE(texture2DProjLod,
    18621798                        R"(
     
    18841820)",
    18851821                        textureEnv())
    1886 
    18871822
    18881823PROGRAM_PRELUDE_DECLARE(texture3DLod,
     
    30602995    putBuiltIn("texture2DLod", EMIT_METHOD(texture2DLod));
    30612996    putBuiltIn("texture2DProj", EMIT_METHOD(texture2DProj));
    3062     putBuiltIn("texture2DRect", EMIT_METHOD(texture2DRect));
    3063     putBuiltIn("texture2DRectProj", EMIT_METHOD(texture2DRectProj));
    30642997    putBuiltIn("texture3DLod", EMIT_METHOD(texture3DLod));
    30652998    putBuiltIn("texture3DProj", EMIT_METHOD(texture3DProj));
     
    33933326                equalArray();
    33943327            }
    3395             if(argType0->isMatrix() && argType1->isMatrix())
    3396             {
    3397                 equalMatrix();
    3398             }
    33993328            break;
    34003329
     
    34123341            {
    34133342                notEqualArray();
    3414             }
    3415             if(argType0->isMatrix() && argType1->isMatrix())
    3416             {
    3417                 notEqualMatrix();
    34183343            }
    34193344            break;
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp

    r273188 r273189  
    88#include <unordered_map>
    99
    10 #include "compiler/translator/TranslatorMetalDirect.h"
    1110#include "compiler/translator/TranslatorMetalDirect/AstHelpers.h"
    1211#include "compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.h"
     
    2120{
    2221
    23 
    2422class Reducer : public TIntermRebuild
    2523{
    26     std::unordered_map<const TInterfaceBlock *,  const TVariable *>
     24    std::unordered_map<const TInterfaceBlock *, std::map<ImmutableString, const TVariable *>>
    2725        mLiftedMap;
    2826    std::unordered_map<const TVariable *, const TVariable *> mInstanceMap;
    29     IdGen &mIdGen;
    3027
    31 public:
    32     Reducer(TCompiler &compiler, IdGen &idGen)
    33         : TIntermRebuild(compiler, true, false),
    34           mIdGen(idGen)
    35     {
    36 
    37     }
     28  public:
     29    Reducer(TCompiler &compiler) : TIntermRebuild(compiler, true, false) {}
    3830
    3931    PreResult visitDeclarationPre(TIntermDeclaration &declNode) override
     
    5143                if (symbolType == SymbolType::Empty)
    5244                {
    53                     //Create instance variable
    54                     auto &structure =
    55                         *new TStructure(&mSymbolTable, interfaceBlock->name(),
    56                                         &interfaceBlock->fields(), interfaceBlock->symbolType());
    57                     auto &structVar = CreateStructTypeVariable(mSymbolTable, structure);
     45                    auto &nameToVar = mLiftedMap[interfaceBlock];
     46                    std::vector<TIntermNode *> replacements;
     47                    for (TField *field : interfaceBlock->fields())
     48                    {
     49                        auto &liftedType = CloneType(*field->type());
     50                        ASSERT(liftedType.getQualifier() == TQualifier::EvqUniform ||
     51                               liftedType.getQualifier() == TQualifier::EvqGlobal);
     52                        liftedType.setQualifier(TQualifier::EvqUniform);
     53                        auto *liftedVar = new TVariable(&mSymbolTable, field->name(), &liftedType,
     54                                                        field->symbolType());
    5855
    59                     auto &instanceVar =
    60                         CreateInstanceVariable(mSymbolTable, structure, mIdGen.createNewName(interfaceBlock->name()),
    61                                                TQualifier::EvqBuffer, &type.getArraySizes());
    62                     mLiftedMap[interfaceBlock] = &instanceVar;
     56                        nameToVar[field->name()] = liftedVar;
    6357
    64                     TIntermNode *replacements[] = {
    65                         new TIntermDeclaration{new TIntermSymbol(&structVar)},
    66                         new TIntermDeclaration{new TIntermSymbol(&instanceVar)}};
    67                     return PreResult::Multi(std::begin(replacements), std::end(replacements));
     58                        replacements.push_back(
     59                            new TIntermDeclaration{new TIntermSymbol(liftedVar)});
     60                    }
     61                    return PreResult::Multi(std::move(replacements));
    6862                }
    6963                else
     
    7771                    auto &instanceVar =
    7872                        CreateInstanceVariable(mSymbolTable, structure, Name(var),
    79                                                TQualifier::EvqBuffer, &type.getArraySizes());
     73                                               TQualifier::EvqUniform, &type.getArraySizes());
    8074
    8175                    mInstanceMap[&var] = &instanceVar;
     
    107101            if (it != mLiftedMap.end())
    108102            {
    109                 return AccessField(*(it->second), var.name());
     103                auto *liftedVar = it->second[var.name()];
     104                ASSERT(liftedVar);
     105                return *new TIntermSymbol(liftedVar);
    110106            }
    111107        }
     
    118114////////////////////////////////////////////////////////////////////////////////
    119115
    120 bool sh::ReduceInterfaceBlocks(TCompiler &compiler, TIntermBlock &root, IdGen & idGen)
     116bool sh::ReduceInterfaceBlocks(TCompiler &compiler, TIntermBlock &root)
    121117{
    122     Reducer reducer(compiler, idGen);
     118    Reducer reducer(compiler);
    123119    if (!reducer.rebuildRoot(root))
    124120    {
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.h

    r273188 r273189  
    2929//  struct Foo { int x; }; uniform Foo x;
    3030//
    31 ANGLE_NO_DISCARD bool ReduceInterfaceBlocks(TCompiler &compiler, TIntermBlock &root, IdGen & idGen);
     31ANGLE_NO_DISCARD bool ReduceInterfaceBlocks(TCompiler &compiler, TIntermBlock &root);
    3232
    3333}  // namespace sh
  • trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/SeparateCompoundStructDeclarations.cpp

    r273188 r273189  
    2121{
    2222  public:
    23     std::unordered_map<int, TIntermSymbol *> replacementMap;
    2423    Separator(TSymbolTable &symbolTable) : TIntermTraverser(false, false, true, &symbolTable) {}
    2524
     
    4645
    4746                TIntermSequence replacements;
    48                 TIntermSymbol * instanceSymbol = new TIntermSymbol(instanceVar);
    4947                replacements.push_back(new TIntermSymbol(structVar));
    50                 replacements.push_back(instanceSymbol);
    51                 replacementMap[symbolNode->uniqueId().get()] = instanceSymbol;
     48                replacements.push_back(new TIntermSymbol(instanceVar));
    5249                mMultiReplacements.push_back(
    5350                    NodeReplaceWithMultipleEntry(declNode, symbolNode, std::move(replacements)));
     
    5653
    5754        return false;
    58     }
    59    
    60     void visitSymbol(TIntermSymbol *decl) override
    61     {
    62         auto symbol = replacementMap.find(decl->uniqueId().get());
    63         if(symbol != replacementMap.end())
    64         {
    65             queueReplacement(symbol->second->deepCopy(), OriginalNode::IS_DROPPED);
    66         }
    6755    }
    6856};
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/load_functions_table_autogen.cpp

    r273188 r273189  
    22// Generated by gen_load_functions_table.py using data from load_functions_data.json
    33//
    4 // Copyright 2021 The ANGLE Project Authors. All rights reserved.
     4// Copyright 2020 The ANGLE Project Authors. All rights reserved.
    55// Use of this source code is governed by a BSD-style license that can be
    66// found in the LICENSE file.
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm

    r273188 r273189  
    659659    size_t convertedOffset             = 0;
    660660    gl::DrawElementsType convertedType = type;
     661    size_t convertedCount              = (size_t)count;
     662
    661663    ANGLE_TRY(mVertexArray->getIndexBuffer(context, type, mode, count, indices, &idxBuffer,
    662                                            &convertedOffset, &convertedType));
     664                                           &convertedOffset, &convertedType, &convertedCount));
    663665
    664666    ASSERT(idxBuffer);
    665667    ASSERT((convertedOffset % mtl::kIndexBufferOffsetAlignment) == 0);
    666     uint32_t convertedCounti32 = (uint32_t)count;
     668    uint32_t convertedCounti32 = (uint32_t)convertedCount;
    667669    if (mState.isTransformFeedbackActiveUnpaused())
    668670    {
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.h

    r273188 r273189  
    103103    ContextMtl *contextMTL;
    104104    IOSurfaceRef mIOSurface;
    105     GLint mGLInternalFormat;
    106105    mtl::TextureRef mIOSurfaceTexture;
    107106    mtl::TextureRef mIOSurfaceTextureView;
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.mm

    r273188 r273189  
    261261    mFormat         = display->getPixelFormat(kIOSurfaceFormats[mFormatIndex].pixelFormat);
    262262    mInternalFormat = display->getPixelFormat(kIOSurfaceFormats[mFormatIndex].internalPixelFormat);
    263     mGLInternalFormat = kIOSurfaceFormats[mFormatIndex].internalFormat;
    264263}
    265264
     
    432431        mTemporarySurfaceRef->createViewWithDifferentFormat(MTLPixelFormatBGRA8Unorm);
    433432    mRenderTarget.set(mIOSurfaceTexture, mtl::kZeroNativeMipLevel, 0, mInternalFormat);
    434 
    435     if (mGLInternalFormat == GL_RGB)
    436     {
    437         // Disable subsequent rendering to alpha channel.
    438         // TODO: Investigate if this allows the higher level alpha masks can
    439         // be disabled once this backend is live.
    440         mIOSurfaceTexture->setColorWritableMask(MTLColorWriteMaskAll & (~MTLColorWriteMaskAlpha));
    441     }
    442 
    443433    mIOSurfaceTextureCreated = true;
    444434    return angle::Result::Continue;
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm

    r273188 r273189  
    111111        // we need to initialize their content.
    112112        bool emulatedChannels = mtl::IsFormatEmulated(mFormat);
    113         bool isDepthStencil = mFormat.hasDepthOrStencilBits();
    114113        if (emulatedChannels)
    115114        {
     
    132131            }
    133132        }  // if (emulatedChannels)
    134         if(isDepthStencil)
    135         {
    136             gl::ImageIndex index;
    137 
    138             if (actualSamples > 1)
    139             {
    140                 index = gl::ImageIndex::Make2DMultisample();
    141             }
    142             else
    143             {
    144                 index = gl::ImageIndex::Make2D(0);
    145             }
    146             ANGLE_TRY(mtl::InitializeDepthStencilTextureContentsGPU(context, mTexture, mFormat, mtl::ImageNativeIndex(index, 0)));
    147             if (mImplicitMSTexture)
    148             {
    149                 ANGLE_TRY(mtl::InitializeDepthStencilTextureContentsGPU(context, mImplicitMSTexture, mFormat,
    150                                                          mtl::ImageNativeIndex(gl::ImageIndex::Make2DMultisample(), 0)));
    151             }
    152         }
    153133    }
    154134
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.h

    r273188 r273189  
    5959                                 mtl::BufferRef *idxBufferOut,
    6060                                 size_t *idxBufferOffsetOut,
    61                                  gl::DrawElementsType *indexTypeOut);
     61                                 gl::DrawElementsType *indexTypeOut,
     62                                 size_t *indexBufferCountOut);
    6263
    6364    // Use to emulate instanced draw for instance <instanceId>.
     
    8990                                     size_t offset,
    9091                                     mtl::BufferRef *idxBufferOut,
    91                                      size_t *idxBufferOffsetOut);
     92                                     size_t *idxBufferOffsetOut,
     93                                     size_t *indexBufferCountOut);
    9294    angle::Result streamIndexBufferFromClient(const gl::Context *glContext,
    9395                                              gl::DrawElementsType indexType,
     
    9698                                              const void *sourcePointer,
    9799                                              mtl::BufferRef *idxBufferOut,
    98                                               size_t *idxBufferOffsetOut);
     100                                              size_t *idxBufferOffsetOut,
     101                                              size_t *idxBufferCountOut);
    99102
    100103    angle::Result convertIndexBufferGPU(const gl::Context *glContext,
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/VertexArrayMtl.mm

    r273188 r273189  
    8383                              bool primitiveRestartEnabled,
    8484                              mtl::BufferRef *bufferOut,
    85                               size_t *bufferOffsetOut)
     85                              size_t *bufferOffsetOut,
     86                              size_t *indexCountOut)
    8687{
    8788    dynamicBuffer->releaseInFlightBuffers(contextMtl);
     
    124125        memcpy(dst, sourcePointer, amount);
    125126    }
     127    *indexCountOut = indexCount;
    126128    ANGLE_TRY(dynamicBuffer->commit(contextMtl));
    127129
     
    702704                                             mtl::BufferRef *idxBufferOut,
    703705                                             size_t *idxBufferOffsetOut,
    704                                              gl::DrawElementsType *indexTypeOut)
     706                                             gl::DrawElementsType *indexTypeOut,
     707                                             size_t *indexBufferCountOut)
    705708{
    706709    const gl::Buffer *glElementArrayBuffer = getState().getElementArrayBuffer();
     
    710713    {
    711714        ANGLE_TRY(streamIndexBufferFromClient(context, type, mode, count, indices, idxBufferOut,
    712                                               idxBufferOffsetOut));
     715                                              idxBufferOffsetOut, indexBufferCountOut));
    713716    }
    714717    else
     
    719722        {
    720723            ANGLE_TRY(convertIndexBuffer(context, type, mode, convertedOffset, idxBufferOut,
    721                                          idxBufferOffsetOut));
     724                                         idxBufferOffsetOut, indexBufferCountOut));
    722725        }
    723726        else
     
    727730            *idxBufferOut        = bufferMtl->getCurrentBuffer();
    728731            *idxBufferOffsetOut  = convertedOffset;
    729            
     732            *indexBufferCountOut = count;
    730733        }
    731734    }
     
    746749                                                 size_t offset,
    747750                                                 mtl::BufferRef *idxBufferOut,
    748                                                  size_t *idxBufferOffsetOut)
     751                                                 size_t *idxBufferOffsetOut,
     752                                                 size_t *indexBufferCountOut)
    749753{
    750754    size_t offsetModulo = offset % mtl::kIndexBufferOffsetAlignment;
     
    782786                                  idxBuffer->getClientShadowCopyData(contextMtl) + offsetModulo,
    783787                                  indexType, indexCount, mode, glState.isPrimitiveRestartEnabled(),
    784                                   &conversion->convertedBuffer, &conversion->convertedOffset));
     788                                  &conversion->convertedBuffer, &conversion->convertedOffset,
     789                                  indexBufferCountOut));
    785790    }
    786791    else
     
    835840                                                          const void *sourcePointer,
    836841                                                          mtl::BufferRef *idxBufferOut,
    837                                                           size_t *idxBufferOffsetOut)
     842                                                          size_t *idxBufferOffsetOut,
     843                                                          size_t *idxBufferCountOut)
    838844{
    839845    ASSERT(getState().getElementArrayBuffer() == nullptr);
     
    843849    ANGLE_TRY(StreamIndexData(contextMtl, &mDynamicIndexData, srcData, indexType, indexCount, mode,
    844850                              context->getState().isPrimitiveRestartEnabled(), idxBufferOut,
    845                               idxBufferOffsetOut));
     851                              idxBufferOffsetOut, idxBufferCountOut));
    846852
    847853    return angle::Result::Continue;
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_utils.mm

    r273188 r273189  
    306306    ContextMtl *contextMtl           = mtl::GetImpl(context);
    307307    const angle::Format &angleFormat = textureObjFormat.actualAngleFormat();
    308     RenderTargetMtl rtMTL;
     308
     309    mtl::RenderPassDesc rpDesc;
    309310
    310311    uint32_t layer = index.hasLayer() ? index.getLayerIndex() : 0;
    311     rtMTL.set(texture, level, layer, textureObjFormat);
    312     mtl::RenderPassDesc rpDesc;
    313     rtMTL.toRenderPassAttachmentDesc(&rpDesc.depthAttachment);
     312
    314313    rpDesc.sampleCount = texture->samples();
    315314    if (angleFormat.depthBits)
    316315    {
     316        rpDesc.depthAttachment.renderTarget->texture      = texture;
     317        rpDesc.depthAttachment.renderTarget->level        = level;
     318        rpDesc.depthAttachment.renderTarget->sliceOrDepth = layer;
    317319        rpDesc.depthAttachment.loadAction   = MTLLoadActionClear;
    318320        rpDesc.depthAttachment.clearDepth   = 1.0;
     
    320322    if (angleFormat.stencilBits)
    321323    {
     324        rpDesc.stencilAttachment.renderTarget->texture      = texture;
     325        rpDesc.stencilAttachment.renderTarget->level        = level;
     326        rpDesc.stencilAttachment.renderTarget->sliceOrDepth = layer;
    322327        rpDesc.stencilAttachment.loadAction   = MTLLoadActionClear;
    323328    }
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/shaders/blit.metal

    r273188 r273189  
    3333    int srcLevel;  // Source texture level.
    3434    int srcLayer;  // Source texture layer.
    35     int srcLevel2;  // Source texture level.
    36     int srcLayer2;  // Source texture layer.
     35
    3736    bool dstFlipViewportX;
    3837    bool dstFlipViewportY;
    3938    bool dstLuminance;  // destination texture is luminance. Unused by depth & stencil blitting.
    40     uint8_t padding[9];
    4139};
    4240
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/shaders/mtl_default_shaders_src_autogen.inc

    r273188 r273189  
    320320    int srcLevel;
    321321    int srcLayer;
    322     int srcLevel2;
    323     int srcLayer2;
     322
    324323    bool dstFlipViewportX;
    325324    bool dstFlipViewportY;
Note: See TracChangeset for help on using the changeset viewer.