зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1492723 - Use EGL_MOZ_context_create_provoking_vertex_dont_care. r=mattwoodrow
MozReview-Commit-ID: It8fOzqiFIe --HG-- extra : rebase_source : 805c8e59427cd50e999b08dec44148a3349b24c6 extra : amend_source : c2a816122bb819d5e83a9156e645d42222099361
This commit is contained in:
Родитель
37ff242926
Коммит
59134a4f16
|
@ -534,6 +534,8 @@ GLContextEGL::HoldSurface(gfxASurface* aSurf) {
|
|||
mThebesSurface = aSurf;
|
||||
}
|
||||
|
||||
#define LOCAL_EGL_CONTEXT_PROVOKING_VERTEX_DONT_CARE_MOZ 0x6000
|
||||
|
||||
already_AddRefed<GLContextEGL>
|
||||
GLContextEGL::CreateGLContext(CreateContextFlags flags,
|
||||
const SurfaceCaps& caps,
|
||||
|
@ -567,6 +569,13 @@ GLContextEGL::CreateGLContext(CreateContextFlags flags,
|
|||
required_attribs.push_back(LOCAL_EGL_TRUE);
|
||||
}
|
||||
|
||||
if (flags & CreateContextFlags::PROVOKING_VERTEX_DONT_CARE &&
|
||||
egl->IsExtensionSupported(GLLibraryEGL::MOZ_create_context_provoking_vertex_dont_care))
|
||||
{
|
||||
required_attribs.push_back(LOCAL_EGL_CONTEXT_PROVOKING_VERTEX_DONT_CARE_MOZ);
|
||||
required_attribs.push_back(LOCAL_EGL_TRUE);
|
||||
}
|
||||
|
||||
std::vector<EGLint> robustness_attribs;
|
||||
std::vector<EGLint> rbab_attribs; // RBAB: Robust Buffer Access Behavior
|
||||
if (flags & CreateContextFlags::PREFER_ROBUSTNESS) {
|
||||
|
|
|
@ -59,6 +59,8 @@ enum class CreateContextFlags : uint8_t {
|
|||
PREFER_ROBUSTNESS = 1 << 5,
|
||||
|
||||
HIGH_POWER = 1 << 6,
|
||||
|
||||
PROVOKING_VERTEX_DONT_CARE = 1 << 7,
|
||||
};
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags)
|
||||
|
||||
|
|
|
@ -69,7 +69,8 @@ static const char* sEGLExtensionNames[] = {
|
|||
"EGL_ANGLE_device_creation",
|
||||
"EGL_ANGLE_device_creation_d3d11",
|
||||
"EGL_KHR_surfaceless_context",
|
||||
"EGL_KHR_create_context_no_error"
|
||||
"EGL_KHR_create_context_no_error",
|
||||
"EGL_MOZ_create_context_provoking_vertex_dont_care"
|
||||
};
|
||||
|
||||
#if defined(ANDROID)
|
||||
|
|
|
@ -97,6 +97,7 @@ public:
|
|||
ANGLE_device_creation_d3d11,
|
||||
KHR_surfaceless_context,
|
||||
KHR_create_context_no_error,
|
||||
MOZ_create_context_provoking_vertex_dont_care,
|
||||
Extensions_Max
|
||||
};
|
||||
|
||||
|
|
|
@ -809,6 +809,12 @@ CreateGLContextANGLE()
|
|||
auto* egl = gl::GLLibraryEGL::Get();
|
||||
auto flags = gl::CreateContextFlags::PREFER_ES3;
|
||||
|
||||
if (egl->IsExtensionSupported(
|
||||
gl::GLLibraryEGL::MOZ_create_context_provoking_vertex_dont_care))
|
||||
{
|
||||
flags |= gl::CreateContextFlags::PROVOKING_VERTEX_DONT_CARE;
|
||||
}
|
||||
|
||||
// Create GLContext with dummy EGLSurface, the EGLSurface is not used.
|
||||
// Instread we override it with EGLSurface of SwapChain's back buffer.
|
||||
RefPtr<gl::GLContext> gl = gl::GLContextProviderEGL::CreateHeadless(flags, &discardFailureId);
|
||||
|
|
Загрузка…
Ссылка в новой задаче