Edit

kc3-lang/angle/src/compiler/translator/AtomicCounterFunctionHLSL.h

Branch :

  • Show log

    Commit

  • Author : Brandon Jones
    Date : 2018-10-23 14:36:47
    Hash : 4a22f4b0
    Message : ES31: Add atomic_uint support to HLSL translator This is the first commit in a series to enable atomic counter buffers. Adds support for atomic counters to the GLSL->HLSL translator using RWByteAddressBuffer. Bug: angleproject:1729 Test: angle_end2end_tests Change-Id: I3b7e08f9256dc9bdbcc02ad8910040f2bc14aeac Reviewed-on: https://chromium-review.googlesource.com/c/1291329 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

  • src/compiler/translator/AtomicCounterFunctionHLSL.h
  • //
    // Copyright (c) 2018 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.
    //
    // AtomicCounterFunctionHLSL: Class for writing implementation of atomic counter functions into HLSL
    // output.
    //
    
    #ifndef COMPILER_TRANSLATOR_ATOMICCOUNTERFUNCTIONHLSL_H_
    #define COMPILER_TRANSLATOR_ATOMICCOUNTERFUNCTIONHLSL_H_
    
    #include <map>
    
    #include "compiler/translator/Common.h"
    #include "compiler/translator/ImmutableString.h"
    
    namespace sh
    {
    
    class TInfoSinkBase;
    struct TLayoutQualifier;
    
    class AtomicCounterFunctionHLSL final : angle::NonCopyable
    {
      public:
        ImmutableString useAtomicCounterFunction(const ImmutableString &name);
    
        void atomicCounterFunctionHeader(TInfoSinkBase &out);
    
      private:
        enum class AtomicCounterFunction
        {
            LOAD,
            INCREMENT,
            DECREMENT,
            INVALID
        };
    
        std::map<ImmutableString, AtomicCounterFunction> mAtomicCounterFunctions;
    };
    
    ImmutableString getAtomicCounterNameForBinding(int binding);
    
    }  // namespace sh
    
    #endif  // COMPILER_TRANSLATOR_ATOMICCOUNTERFUNCTIONHLSL_H_