Edit

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

Branch :

  • Show log

    Commit

  • Author : Enrico Galli
    Date : 2018-12-13 14:07:52
    Hash : ee7ffd9e
    Message : ES31: Enabling skipped deqp atomic counter tests on D3D11 Enabling deqp tests previously skipped due to lack of atomic counters. Fixing bug found in translator found by new tests. * Switching atomicCounterDecrement from pre to post decrement * Added 4 byte alignment check to atomic_uint offset * Added workaround for NVIDIA D3D bug * Added globallycoherent to atomic counters Bug: angleproject:1729 Change-Id: If62ea003826fbe2df0834b905ff3ad7b76328399 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1480867 Commit-Queue: Enrico Galli <enrico.galli@intel.com> 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:
        AtomicCounterFunctionHLSL(bool forceResolution);
    
        ImmutableString useAtomicCounterFunction(const ImmutableString &name);
    
        void atomicCounterFunctionHeader(TInfoSinkBase &out);
    
      private:
        enum class AtomicCounterFunction
        {
            LOAD,
            INCREMENT,
            DECREMENT,
            INVALID
        };
    
        std::map<ImmutableString, AtomicCounterFunction> mAtomicCounterFunctions;
        bool mForceResolution;
    };
    
    ImmutableString getAtomicCounterNameForBinding(int binding);
    
    }  // namespace sh
    
    #endif  // COMPILER_TRANSLATOR_ATOMICCOUNTERFUNCTIONHLSL_H_