Commit aed9f94e by Austin Kinross Committed by Shannon Woods

Limit D3D11 Feature Level 9 to GL ES 2.0, and say it's not conformant

Change-Id: I2ce88217c9b78e83bac6df5975d9edfbbf90e557 Reviewed-on: https://chromium-review.googlesource.com/225251Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent e0902644
......@@ -83,7 +83,7 @@ Config::Config(rx::ConfigDesc desc, EGLint minInterval, EGLint maxInterval, EGLi
mColorBufferType = EGL_RGB_BUFFER;
mConfigCaveat = (desc.fastConfig) ? EGL_NONE : EGL_SLOW_CONFIG;
mConfigID = 0;
mConformant = EGL_OPENGL_ES2_BIT;
mConformant = 0;
switch (desc.depthStencilFormat)
{
......@@ -130,6 +130,11 @@ Config::Config(rx::ConfigDesc desc, EGLint minInterval, EGLint maxInterval, EGLi
mTransparentGreenValue = 0;
mTransparentBlueValue = 0;
if (desc.es2Conformant)
{
mConformant = EGL_OPENGL_ES2_BIT;
}
if (desc.es3Capable)
{
mRenderableType |= EGL_OPENGL_ES3_BIT_KHR;
......
......@@ -418,6 +418,8 @@ Error Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle, cons
Error Display::createContext(EGLConfig configHandle, EGLint clientVersion, const gl::Context *shareContext, bool notifyResets,
bool robustAccess, EGLContext *outContext)
{
const Config *configuration = mConfigSet.get(configHandle);
if (!mRenderer)
{
*outContext = EGL_NO_CONTEXT;
......@@ -432,8 +434,7 @@ Error Display::createContext(EGLConfig configHandle, EGLint clientVersion, const
}
}
//TODO(jmadill): shader model is not cross-platform
if (clientVersion > 2 && mRenderer->getMajorShaderModel() < 4)
if (clientVersion == 3 && !(configuration->mConformant & EGL_OPENGL_ES3_BIT_KHR))
{
return Error(EGL_BAD_CONFIG);
}
......
......@@ -62,6 +62,7 @@ struct ConfigDesc
GLenum depthStencilFormat;
GLint multiSample;
bool fastConfig;
bool es2Conformant;
bool es3Capable;
};
......
......@@ -450,7 +450,11 @@ int Renderer11::generateConfigs(ConfigDesc **configDescList)
newConfig.depthStencilFormat = depthStencilFormatInfo.internalFormat;
newConfig.multiSample = 0; // FIXME: enumerate multi-sampling
newConfig.fastConfig = true; // Assume all DX11 format conversions to be fast
newConfig.es3Capable = true;
// Before we check mFeatureLevel, we need to ensure that the D3D device has been created.
ASSERT(mDevice != NULL);
newConfig.es2Conformant = (mFeatureLevel >= D3D_FEATURE_LEVEL_10_0);
newConfig.es3Capable = (mFeatureLevel >= D3D_FEATURE_LEVEL_10_0);
(*configDescList)[numConfigs++] = newConfig;
}
......
......@@ -447,6 +447,7 @@ int Renderer9::generateConfigs(ConfigDesc **configDescList)
newConfig.depthStencilFormat = depthStencilFormatInfo.internalFormat;
newConfig.multiSample = 0; // FIXME: enumerate multi-sampling
newConfig.fastConfig = (currentDisplayMode.Format == RenderTargetFormats[formatIndex]);
newConfig.es2Conformant = true;
newConfig.es3Capable = false;
(*configDescList)[numConfigs++] = newConfig;
......
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