angle/util/EGLPlatformParameters.h

82 строки
2.5 KiB
C
Исходник Обычный вид История

//
// 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;
} // 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,
platformMethods);
}
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;
Vulkan: Fix setupDraw when VK_EXT_transform_feedback is not enabled There's no dirty bit handler if VK_EXT_transform_feedback disabled, but we're setting that dirty bit in syncState. This results in calling a null method pointer. Skip the invalidate if the extension is not enabled. gl::LogMessage::~LogMessage() at ./../../third_party/angle/src/common/debug.cpp:0 rx::ContextVk::setupDraw(gl::Context const*, gl::PrimitiveMode, int, int, int, gl::DrawElementsType, void const*, angle::BitSetT<11ul, unsigned long, unsigned long>, rx::vk::priv::SecondaryCommandBuffer**) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:844 rx::ContextVk::drawArrays(gl::Context const*, gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp:1698 gl::Context::drawArrays(gl::PrimitiveMode, int, int) at ./../../third_party/angle/src/libANGLE/Context.inl.h:112 gl::DrawArrays(unsigned int, int, int) at ./../../third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp:926 (anonymous namespace)::AttributeLayoutNonIndexed::Draw(int, unsigned int, unsigned short const*) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:431 (anonymous namespace)::AttributeLayoutTest::Run(bool) at ./../../third_party/angle/src/tests/gl_tests/AttributeLayoutTest.cpp:305 [This stack is from the added assert; calling a null function pointer crashes without producing a useful stack trace.] Bug: angleproject:4326 Change-Id: I036ae322bddc4865229fa3fe7ea72a4344b99f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2011408 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-01-21 04:33:23 +03:00
EGLint transformFeedbackFeature = 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_