Commit eb84fe06 by Nicolas Capens

Disable OpenGL ES 3.0 in Chromium builds.

Change-Id: I6077e9f439dc20217e9e7fb6c6f98f969e7d0b51 Reviewed-on: https://swiftshader-review.googlesource.com/8790Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 5cdb91a4
...@@ -23,6 +23,7 @@ config("swiftshader_config") { ...@@ -23,6 +23,7 @@ config("swiftshader_config") {
"/EHsc", "/EHsc",
"/nologo", "/nologo",
"/Gd", # Default calling convention "/Gd", # Default calling convention
"/DSTRICT_CONFORMANCE", # Disables OpenGL ES 3.0
] ]
if (is_debug) { if (is_debug) {
...@@ -38,6 +39,7 @@ config("swiftshader_config") { ...@@ -38,6 +39,7 @@ config("swiftshader_config") {
"-fno-operator-names", "-fno-operator-names",
"-D__STDC_CONSTANT_MACROS", "-D__STDC_CONSTANT_MACROS",
"-D__STDC_LIMIT_MACROS", "-D__STDC_LIMIT_MACROS",
"-DSTRICT_CONFORMANCE", # Disables OpenGL ES 3.0
] ]
if (is_debug) { if (is_debug) {
......
...@@ -34,10 +34,13 @@ using namespace std; ...@@ -34,10 +34,13 @@ using namespace std;
namespace egl namespace egl
{ {
#ifdef __ANDROID__ // OpenGL ES 3.0 support is not conformant yet, but can be used for testing purposes. Expose it as conformant configs
const bool android = true; // if strict conformance advertisement isn't required. If strict conformance advertisement is required, expose them
// as non-conformant configs, but only when EGL_CONFIG_CAVEAT is EGL_NON_CONFORMANT_CONFIG or EGL_DONT_CARE.
#if defined(__ANDROID__) || defined(STRICT_CONFORMANCE)
const bool strictConformance = true;
#else #else
const bool android = false; const bool strictConformance = false;
#endif #endif
Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, sw::Format renderTargetFormat, sw::Format depthStencilFormat, EGLint multiSample, bool conformant) Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, sw::Format renderTargetFormat, sw::Format depthStencilFormat, EGLint multiSample, bool conformant)
...@@ -124,9 +127,9 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -124,9 +127,9 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
mBufferSize = mRedSize + mGreenSize + mBlueSize + mLuminanceSize + mAlphaSize; mBufferSize = mRedSize + mGreenSize + mBlueSize + mLuminanceSize + mAlphaSize;
mAlphaMaskSize = 0; mAlphaMaskSize = 0;
mColorBufferType = EGL_RGB_BUFFER; mColorBufferType = EGL_RGB_BUFFER;
mConfigCaveat = (conformant || !android) ? EGL_NONE : EGL_NON_CONFORMANT_CONFIG; mConfigCaveat = (conformant || !strictConformance) ? EGL_NONE : EGL_NON_CONFORMANT_CONFIG;
mConfigID = 0; mConfigID = 0;
mConformant = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | (android ? 0 : EGL_OPENGL_ES3_BIT); // Do not advertize OpenGL ES 3.0 conformance on Android mConformant = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | (strictConformance ? 0 : EGL_OPENGL_ES3_BIT);
switch(depthStencilFormat) switch(depthStencilFormat)
{ {
...@@ -183,7 +186,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -183,7 +186,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
mMinSwapInterval = minInterval; mMinSwapInterval = minInterval;
mNativeRenderable = EGL_FALSE; mNativeRenderable = EGL_FALSE;
mNativeVisualType = 0; mNativeVisualType = 0;
mRenderableType = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | ((conformant && android) ? 0 : EGL_OPENGL_ES3_BIT); // Only advertise non-conformant configs as OpenGL ES 3.0 renderable on Android mRenderableType = EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | ((conformant && strictConformance) ? 0 : EGL_OPENGL_ES3_BIT);
mSampleBuffers = (multiSample > 0) ? 1 : 0; mSampleBuffers = (multiSample > 0) ? 1 : 0;
mSamples = multiSample; mSamples = multiSample;
mSurfaceType = EGL_PBUFFER_BIT | EGL_WINDOW_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT; mSurfaceType = EGL_PBUFFER_BIT | EGL_WINDOW_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT;
...@@ -336,10 +339,11 @@ void ConfigSet::add(sw::Format displayFormat, EGLint minSwapInterval, EGLint max ...@@ -336,10 +339,11 @@ void ConfigSet::add(sw::Format displayFormat, EGLint minSwapInterval, EGLint max
Config conformantConfig(displayFormat, minSwapInterval, maxSwapInterval, renderTargetFormat, depthStencilFormat, multiSample, true); Config conformantConfig(displayFormat, minSwapInterval, maxSwapInterval, renderTargetFormat, depthStencilFormat, multiSample, true);
mSet.insert(conformantConfig); mSet.insert(conformantConfig);
#ifdef __ANDROID__ if(strictConformance) // When strict conformance is required, add non-conformant configs explicitly as such.
{
Config nonConformantConfig(displayFormat, minSwapInterval, maxSwapInterval, renderTargetFormat, depthStencilFormat, multiSample, false); Config nonConformantConfig(displayFormat, minSwapInterval, maxSwapInterval, renderTargetFormat, depthStencilFormat, multiSample, false);
mSet.insert(nonConformantConfig); mSet.insert(nonConformantConfig);
#endif }
} }
size_t ConfigSet::size() const size_t ConfigSet::size() 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