tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

RewriteRepeatedAssignToSwizzled.h (1190B)


      1 //
      2 // Copyright 2018 The ANGLE Project Authors. All rights reserved.
      3 // Use of this source code is governed by a BSD-style license that can be
      4 // found in the LICENSE file.
      5 //
      6 // RewriteRepeatedAssignToSwizzled.h: Rewrite expressions that assign an assignment to a swizzled
      7 // vector, like:
      8 //     v.x = z = expression;
      9 // to:
     10 //     z = expression;
     11 //     v.x = z;
     12 //
     13 // Note that this doesn't handle some corner cases: expressions nested inside other expressions,
     14 // inside loop headers, or inside if conditions.
     15 
     16 #ifndef COMPILER_TRANSLATOR_TREEOPS_GL_REWRITEREPEATEDASSIGNTOSWIZZLED_H_
     17 #define COMPILER_TRANSLATOR_TREEOPS_GL_REWRITEREPEATEDASSIGNTOSWIZZLED_H_
     18 
     19 #include "common/angleutils.h"
     20 
     21 namespace sh
     22 {
     23 
     24 class TCompiler;
     25 class TIntermBlock;
     26 
     27 #ifdef ANGLE_ENABLE_GLSL
     28 [[nodiscard]] bool RewriteRepeatedAssignToSwizzled(TCompiler *compiler, TIntermBlock *root);
     29 #else
     30 [[nodiscard]] ANGLE_INLINE bool RewriteRepeatedAssignToSwizzled(TCompiler *compiler,
     31                                                                TIntermBlock *root)
     32 {
     33    UNREACHABLE();
     34    return false;
     35 }
     36 #endif
     37 
     38 }  // namespace sh
     39 
     40 #endif  // COMPILER_TRANSLATOR_TREEOPS_GL_REWRITEREPEATEDASSIGNTOSWIZZLED_H_