2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-12-18 05:58:44 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2013-02-14 03:26:24 +04:00
|
|
|
#ifndef GLCONTEXT_TYPES_H_
|
|
|
|
#define GLCONTEXT_TYPES_H_
|
2012-12-18 05:58:44 +04:00
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
#include "GLTypes.h"
|
2024-01-04 21:38:52 +03:00
|
|
|
#include "mozilla/DefineEnum.h"
|
2015-09-24 22:21:05 +03:00
|
|
|
#include "mozilla/TypedEnumBits.h"
|
2012-12-18 05:58:44 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
class GLContext;
|
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class GLContextType { Unknown, WGL, CGL, GLX, EGL, EAGL };
|
2013-09-04 16:14:52 +04:00
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class OriginPos : uint8_t { TopLeft, BottomLeft };
|
2014-11-18 04:02:19 +03:00
|
|
|
|
2019-11-11 16:09:32 +03:00
|
|
|
enum class CreateContextFlags : uint16_t {
|
2015-09-24 22:21:05 +03:00
|
|
|
NONE = 0,
|
|
|
|
REQUIRE_COMPAT_PROFILE = 1 << 0,
|
|
|
|
// Force the use of hardware backed GL, don't allow software implementations.
|
2023-04-04 00:25:41 +03:00
|
|
|
FORBID_SOFTWARE = 1 << 1,
|
2015-09-24 22:21:05 +03:00
|
|
|
/* Don't force discrete GPU to be used (if applicable) */
|
|
|
|
ALLOW_OFFLINE_RENDERER = 1 << 2,
|
2015-11-27 22:02:52 +03:00
|
|
|
// Ask for ES3 if possible
|
|
|
|
PREFER_ES3 = 1 << 3,
|
2016-06-07 02:27:43 +03:00
|
|
|
|
|
|
|
NO_VALIDATION = 1 << 4,
|
2017-03-09 23:30:01 +03:00
|
|
|
PREFER_ROBUSTNESS = 1 << 5,
|
2018-06-23 02:47:02 +03:00
|
|
|
HIGH_POWER = 1 << 6,
|
2018-09-27 08:31:30 +03:00
|
|
|
PROVOKING_VERTEX_DONT_CARE = 1 << 7,
|
2019-11-11 16:09:32 +03:00
|
|
|
PREFER_EXACT_VERSION = 1 << 8,
|
2019-11-20 00:49:01 +03:00
|
|
|
PREFER_MULTITHREADED = 1 << 9,
|
2023-04-04 00:25:41 +03:00
|
|
|
|
|
|
|
FORBID_HARDWARE = 1 << 10,
|
2015-09-24 22:21:05 +03:00
|
|
|
};
|
|
|
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags)
|
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
struct GLContextCreateDesc {
|
|
|
|
CreateContextFlags flags = CreateContextFlags::NONE;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GLContextDesc final : public GLContextCreateDesc {
|
|
|
|
bool isOffscreen = false;
|
|
|
|
};
|
|
|
|
|
2024-01-04 21:38:52 +03:00
|
|
|
// -
|
|
|
|
|
|
|
|
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(GLVendor, uint8_t,
|
|
|
|
(Intel, NVIDIA, ATI, Qualcomm, Imagination,
|
|
|
|
Nouveau, Vivante, VMware, ARM, Other));
|
|
|
|
|
2013-02-14 03:26:24 +04:00
|
|
|
} /* namespace gl */
|
|
|
|
} /* namespace mozilla */
|
|
|
|
|
|
|
|
#endif /* GLCONTEXT_TYPES_H_ */
|