Edit

kc3-lang/angle/src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.h

Branch :

  • Show log

    Commit

  • Author : Mohan Maiya
    Date : 2021-01-14 08:13:47
    Hash : 9f09435b
    Message : Vulkan: Rename ReplaceClipDistanceVariable files With the addition of EXT_clip_cull_distance extension the files are renamed like so - ReplaceClipDistanceVariable.h -> ReplaceClipCullDistanceVariable.h ReplaceClipDistanceVariable.cpp -> ReplaceClipCullDistanceVariable.cpp Bug: angleproject:5458 Change-Id: I277b2d4b6eea6f2014e10acb251284a159292dbc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2617572 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>

  • src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.h
  • //
    // Copyright 2020 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // ReplaceClipCullDistanceVariable.h: Find any references to gl_ClipDistance or gl_CullDistance and
    // replace it with ANGLEClipDistance or ANGLECullDistance.
    //
    
    #ifndef COMPILER_TRANSLATOR_TREEUTIL_REPLACECLIPCULLDISTANCEVARIABLE_H_
    #define COMPILER_TRANSLATOR_TREEUTIL_REPLACECLIPCULLDISTANCEVARIABLE_H_
    
    #include "GLSLANG/ShaderLang.h"
    #include "common/angleutils.h"
    
    namespace sh
    {
    
    struct InterfaceBlock;
    class TCompiler;
    class TIntermBlock;
    class TSymbolTable;
    class TIntermTyped;
    
    // Replace every gl_ClipDistance assignment with assignment to "ANGLEClipDistance",
    // then at the end of shader re-assign the values of this global variable to gl_ClipDistance.
    // This to solve some complex usages such as user passing gl_ClipDistance as output reference
    // to a function.
    // Furthermore, at the end shader, some disabled gl_ClipDistance[i] can be skipped from the
    // assignment.
    ANGLE_NO_DISCARD bool ReplaceClipDistanceAssignments(TCompiler *compiler,
                                                         TIntermBlock *root,
                                                         TSymbolTable *symbolTable,
                                                         const GLenum shaderType,
                                                         const TIntermTyped *clipDistanceEnableFlags);
    
    ANGLE_NO_DISCARD bool ReplaceCullDistanceAssignments(TCompiler *compiler,
                                                         TIntermBlock *root,
                                                         TSymbolTable *symbolTable,
                                                         const GLenum shaderType);
    }  // namespace sh
    
    #endif