Add more spew and try to fix implicit color-buffer-half-float.
draft
Add more spew and try to fix implicit color-buffer-half-float.
--- a/dom/canvas/WebGLExtensionTextureHalfFloat.cpp
+++ b/dom/canvas/WebGLExtensionTextureHalfFloat.cpp
@@ -37,27 +37,27 @@ WebGLExtensionTextureHalfFloat::WebGLExt
if (!gl->IsSupported(gl::GLFeature::texture_half_float)) {
MOZ_ASSERT(gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float));
driverUnpackType = LOCAL_GL_HALF_FLOAT_OES;
}
////////////////
pi = {LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES};
- dui = {pi.format, pi.format, pi.type};
+ dui = {pi.format, pi.format, driverUnpackType};
swizzle = nullptr;
if (needSizedInternal) {
dui.internalFormat = LOCAL_GL_RGBA16F;
}
fnAdd(webgl::EffectiveFormat::RGBA16F);
//////
pi = {LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT_OES};
- dui = {pi.format, pi.format, pi.type};
+ dui = {pi.format, pi.format, driverUnpackType};
swizzle = nullptr;
if (needSizedInternal) {
dui.internalFormat = LOCAL_GL_RGB16F;
}
fnAdd(webgl::EffectiveFormat::RGB16F);
//////
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1157,16 +1157,18 @@ WebGLTexture::TexImage(const char* funcN
mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.",
funcName);
return;
}
if (glError) {
mContext->ErrorInvalidOperation("%s: Unexpected error during upload: 0x%04x",
funcName, glError);
+ printf_stderr("%s: dui: %x/%x/%x\n", funcName, driverUnpackInfo->internalFormat,
+ driverUnpackInfo->unpackFormat, driverUnpackInfo->unpackType);
MOZ_ASSERT(false, "Unexpected GL error.");
return;
}
////////////////////////////////////
// Update our specification data.
const ImageInfo newImageInfo(dstUsage, blob->mWidth, blob->mHeight, blob->mDepth,
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -2578,17 +2578,17 @@ GLContext::FlushIfHeavyGLCallsSinceLastF
}
MakeCurrent();
fFlush();
}
/*static*/ bool
GLContext::ShouldDumpExts()
{
- return gfxEnv::GlDumpExtensions();
+ return true; //gfxEnv::GlDumpExtensions();
}
bool
DoesStringMatch(const char* aString, const char *aWantedString)
{
if (!aString || !aWantedString)
return false;
--- a/gfx/gl/GLContextFeatures.cpp
+++ b/gfx/gl/GLContextFeatures.cpp
@@ -831,16 +831,25 @@ GLContext::InitFeatures()
if (IsExtensionSupported(featureInfo.mExtensions[j])) {
mAvailableFeatures[featureId] = true;
break;
}
}
}
+ if (ShouldDumpExts()) {
+ for (size_t featureId = 0; featureId < size_t(GLFeature::EnumMax); featureId++) {
+ GLFeature feature = GLFeature(featureId);
+ printf_stderr("[%s] Feature::%s\n",
+ IsSupported(feature) ? "enabled" : "disabled",
+ GetFeatureName(feature));
+ }
+ }
+
if (WorkAroundDriverBugs()) {
#ifdef XP_MACOSX
// MacOSX 10.6 reports to support EXT_framebuffer_sRGB and EXT_texture_sRGB but
// fails to convert from sRGB to linear when reading from an sRGB texture attached
// to an FBO. (bug 843668)
if (!nsCocoaFeatures::OnLionOrLater())
MarkUnsupported(GLFeature::sRGB_framebuffer);
#endif // XP_MACOSX