Edit

kc3-lang/angle/util/EGLPlatformParameters.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2021-02-01 17:18:18
    Hash : a8a2a71b
    Message : Vulkan: Support y-flip with no driver support. We can reuse the surface rotation matrix code to do the y-flip. This requires the SPIR-V transformation support. Because not all rotations are encoded into the table we can only support rotation with the driver support for y-flip (currently). Includes some very minimal regression testing. This work is targeted towards supporting vk-portability implementations which are not as up-to-date with Vulkan features. Bug: angleproject:5596 Change-Id: I270fa1efc03267551d28df33ddac9972e1343d60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665892 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>

  • util/EGLPlatformParameters.h
  • //
    // Copyright 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.
    //
    // EGLPlatformParameters: Basic description of an EGL device.
    
    #ifndef UTIL_EGLPLATFORMPARAMETERS_H_
    #define UTIL_EGLPLATFORMPARAMETERS_H_
    
    #include "util/util_gl.h"
    
    #include <tuple>
    
    namespace angle
    {
    struct PlatformMethods;
    
    // The GLES driver type determines what shared object we use to load the GLES entry points.
    // AngleEGL loads from ANGLE's version of libEGL, libGLESv2, and libGLESv1_CM.
    // SystemEGL uses the system copies of libEGL, libGLESv2, and libGLESv1_CM.
    // SystemWGL loads Windows GL with the GLES compatiblity extensions. See util/WGLWindow.h.
    enum class GLESDriverType
    {
        AngleEGL,
        SystemEGL,
        SystemWGL,
    };
    }  // namespace angle
    
    struct EGLPlatformParameters
    {
        EGLPlatformParameters() = default;
    
        explicit EGLPlatformParameters(EGLint renderer) : renderer(renderer) {}
    
        EGLPlatformParameters(EGLint renderer,
                              EGLint majorVersion,
                              EGLint minorVersion,
                              EGLint deviceType)
            : renderer(renderer),
              majorVersion(majorVersion),
              minorVersion(minorVersion),
              deviceType(deviceType)
        {}
    
        EGLPlatformParameters(EGLint renderer,
                              EGLint majorVersion,
                              EGLint minorVersion,
                              EGLint deviceType,
                              EGLint presentPath)
            : renderer(renderer),
              majorVersion(majorVersion),
              minorVersion(minorVersion),
              deviceType(deviceType),
              presentPath(presentPath)
        {}
    
        auto tie() const
        {
            return std::tie(renderer, majorVersion, minorVersion, deviceType, presentPath,
                            debugLayersEnabled, contextVirtualization, transformFeedbackFeature,
                            allocateNonZeroMemoryFeature, emulateCopyTexImage2DFromRenderbuffers,
                            shaderStencilOutputFeature, genMultipleMipsPerPassFeature, platformMethods,
                            robustness, emulatedPrerotation, asyncCommandQueueFeatureVulkan,
                            hasExplicitMemBarrierFeatureMtl, hasCheapRenderPassFeatureMtl,
                            forceBufferGPUStorageFeatureMtl, supportsVulkanViewportFlip);
        }
    
        EGLint renderer                               = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;
        EGLint majorVersion                           = EGL_DONT_CARE;
        EGLint minorVersion                           = EGL_DONT_CARE;
        EGLint deviceType                             = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;
        EGLint presentPath                            = EGL_DONT_CARE;
        EGLint debugLayersEnabled                     = EGL_DONT_CARE;
        EGLint contextVirtualization                  = EGL_DONT_CARE;
        EGLint robustness                             = EGL_DONT_CARE;
        EGLint transformFeedbackFeature               = EGL_DONT_CARE;
        EGLint allocateNonZeroMemoryFeature           = EGL_DONT_CARE;
        EGLint emulateCopyTexImage2DFromRenderbuffers = EGL_DONT_CARE;
        EGLint shaderStencilOutputFeature             = EGL_DONT_CARE;
        EGLint genMultipleMipsPerPassFeature          = EGL_DONT_CARE;
        uint32_t emulatedPrerotation                  = 0;  // Can be 0, 90, 180 or 270
        EGLint asyncCommandQueueFeatureVulkan         = EGL_DONT_CARE;
        EGLint hasExplicitMemBarrierFeatureMtl        = EGL_DONT_CARE;
        EGLint hasCheapRenderPassFeatureMtl           = EGL_DONT_CARE;
        EGLint forceBufferGPUStorageFeatureMtl        = EGL_DONT_CARE;
        EGLint supportsVulkanViewportFlip             = EGL_DONT_CARE;
        angle::PlatformMethods *platformMethods       = nullptr;
    };
    
    inline bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
    {
        return a.tie() < b.tie();
    }
    
    inline bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
    {
        return a.tie() == b.tie();
    }
    
    inline bool operator!=(const EGLPlatformParameters &a, const EGLPlatformParameters &b)
    {
        return a.tie() != b.tie();
    }
    
    #endif  // UTIL_EGLPLATFORMPARAMETERS_H_