Commit 638c7277 by Geoff Lang Committed by Commit Bot

Implement EGL_KHR_surfaceless_context for D3D, GL and NULL backends.

Skip all config attributes that have the value of EGL_DONT_CARE. From the EGL 1.5 spec: "If EGL_DONT_CARE is specified as an attribute value, then the attribute will not be checked.". BUG=angleproject:1651 Change-Id: I30c95a1970543fb6f1d4b02d2babf3df61cad543 Reviewed-on: https://chromium-review.googlesource.com/533937Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent e72595b4
......@@ -218,6 +218,11 @@ std::vector<const Config*> ConfigSet::filter(const AttributeMap &attributeMap) c
EGLAttrib attributeKey = attribIter->first;
EGLAttrib attributeValue = attribIter->second;
if (attributeValue == EGL_DONT_CARE)
{
continue;
}
switch (attributeKey)
{
case EGL_BUFFER_SIZE: match = config.bufferSize >= attributeValue; break;
......
......@@ -1145,6 +1145,9 @@ void Renderer11::generateDisplayExtensions(egl::DisplayExtensions *outExtensions
// getSyncValues requires direct composition.
outExtensions->getSyncValues = outExtensions->directComposition;
// D3D11 can be used without a swap chain
outExtensions->surfacelessContext = true;
}
gl::Error Renderer11::flush()
......
......@@ -566,6 +566,9 @@ void Renderer9::generateDisplayExtensions(egl::DisplayExtensions *outExtensions)
// Contexts are virtualized so textures can be shared globally
outExtensions->displayTextureShareGroup = true;
// D3D9 can be used without an output surface
outExtensions->surfacelessContext = true;
}
void Renderer9::startScene()
......
......@@ -776,6 +776,8 @@ void DisplayGLX::generateExtensions(egl::DisplayExtensions *outExtensions) const
// Contexts are virtualized so textures can be shared globally
outExtensions->displayTextureShareGroup = true;
outExtensions->surfacelessContext = true;
}
void DisplayGLX::generateCaps(egl::Caps *outCaps) const
......@@ -783,6 +785,13 @@ void DisplayGLX::generateCaps(egl::Caps *outCaps) const
outCaps->textureNPOT = true;
}
egl::Error DisplayGLX::makeCurrentSurfaceless(gl::Context *context)
{
// Nothing to do because GLX always uses the same context and the previous surface can be left
// current.
return egl::NoError();
}
int DisplayGLX::getGLXFBConfigAttrib(glx::FBConfig config, int attrib) const
{
int result;
......
......@@ -97,6 +97,8 @@ class DisplayGLX : public DisplayGL
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
void generateCaps(egl::Caps *outCaps) const override;
egl::Error makeCurrentSurfaceless(gl::Context *context) override;
int getGLXFBConfigAttrib(glx::FBConfig config, int attrib) const;
egl::Error createContextAttribs(glx::FBConfig,
const Optional<gl::Version> &version,
......
......@@ -617,6 +617,8 @@ void DisplayWGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
// Contexts are virtualized so textures can be shared globally
outExtensions->displayTextureShareGroup = true;
outExtensions->surfacelessContext = true;
}
void DisplayWGL::generateCaps(egl::Caps *outCaps) const
......@@ -624,6 +626,13 @@ void DisplayWGL::generateCaps(egl::Caps *outCaps) const
outCaps->textureNPOT = true;
}
egl::Error DisplayWGL::makeCurrentSurfaceless(gl::Context *context)
{
// Nothing to do because WGL always uses the same context and the previous surface can be left
// current.
return egl::NoError();
}
egl::Error DisplayWGL::waitClient() const
{
// Unimplemented as this is not needed for WGL
......
......@@ -72,6 +72,8 @@ class DisplayWGL : public DisplayGL
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
void generateCaps(egl::Caps *outCaps) const override;
egl::Error makeCurrentSurfaceless(gl::Context *context) override;
HGLRC initializeContextAttribs(const egl::AttributeMap &eglAttributes) const;
HGLRC createContextAttribs(const gl::Version &version, int profileMask) const;
......
......@@ -203,6 +203,7 @@ void DisplayNULL::generateExtensions(egl::DisplayExtensions *outExtensions) cons
outExtensions->createContextWebGLCompatibility = true;
outExtensions->createContextBindGeneratesResource = true;
outExtensions->swapBuffersWithDamage = true;
outExtensions->surfacelessContext = true;
}
void DisplayNULL::generateCaps(egl::Caps *outCaps) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment