зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 1e5750541f2d (bug 1604622) for Mochitest failures in dom/canvas/test/webgl-conf/generated/test_conformance__extensions__oes-texture-float.html
This commit is contained in:
Родитель
fe7bd3c390
Коммит
04f0022c40
|
@ -22,9 +22,8 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
webgl::DriverUnpackInfo dui;
|
||||
const GLint* swizzle = nullptr;
|
||||
|
||||
const auto fnAdd = [&](webgl::EffectiveFormat effFormat) {
|
||||
MOZ_ASSERT_IF(swizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
|
||||
|
||||
const auto fnAdd = [&fua, &pi, &dui,
|
||||
&swizzle](webgl::EffectiveFormat effFormat) {
|
||||
auto usage = fua->EditUsage(effFormat);
|
||||
usage->textureSwizzleRGBA = swizzle;
|
||||
fua->AddTexUnpack(usage, pi, dui);
|
||||
|
@ -32,18 +31,19 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
fua->AllowUnsizedTexFormat(pi, usage);
|
||||
};
|
||||
|
||||
bool useSizedFormats = true;
|
||||
const bool hasSizedLegacyFormats = gl->IsCompatibilityProfile();
|
||||
if (gl->IsGLES() && gl->Version() < 300) {
|
||||
useSizedFormats = false;
|
||||
}
|
||||
const bool needsSwizzle = gl->IsCoreProfile();
|
||||
MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
|
||||
|
||||
const bool needsSizedFormat = !gl->IsGLES();
|
||||
|
||||
////////////////
|
||||
|
||||
pi = {LOCAL_GL_RGBA, LOCAL_GL_FLOAT};
|
||||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (needsSizedFormat ||
|
||||
gl->IsExtensionSupported(
|
||||
gl::GLContext::CHROMIUM_color_buffer_float_rgba)) {
|
||||
dui.internalFormat = LOCAL_GL_RGBA32F;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::RGBA32F);
|
||||
|
@ -53,7 +53,7 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
pi = {LOCAL_GL_RGB, LOCAL_GL_FLOAT};
|
||||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_RGB32F;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::RGB32F);
|
||||
|
@ -63,14 +63,11 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_FLOAT};
|
||||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE32F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_R32F;
|
||||
dui.unpackFormat = LOCAL_GL_RED;
|
||||
swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT};
|
||||
swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE32F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Luminance32F);
|
||||
|
||||
|
@ -79,14 +76,11 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
pi = {LOCAL_GL_ALPHA, LOCAL_GL_FLOAT};
|
||||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_ALPHA32F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_R32F;
|
||||
dui.unpackFormat = LOCAL_GL_RED;
|
||||
swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_R32F, LOCAL_GL_RED, LOCAL_GL_FLOAT};
|
||||
swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_ALPHA32F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Alpha32F);
|
||||
|
||||
|
@ -95,14 +89,11 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_FLOAT};
|
||||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA32F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_RG32F;
|
||||
dui.unpackFormat = LOCAL_GL_RG;
|
||||
swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_RG32F, LOCAL_GL_RG, LOCAL_GL_FLOAT};
|
||||
swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA32F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Luminance32FAlpha32F);
|
||||
}
|
||||
|
|
|
@ -21,9 +21,8 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
webgl::DriverUnpackInfo dui;
|
||||
const GLint* swizzle = nullptr;
|
||||
|
||||
const auto fnAdd = [&](webgl::EffectiveFormat effFormat) {
|
||||
MOZ_ASSERT_IF(swizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
|
||||
|
||||
const auto fnAdd = [&fua, &pi, &dui,
|
||||
&swizzle](webgl::EffectiveFormat effFormat) {
|
||||
auto usage = fua->EditUsage(effFormat);
|
||||
usage->textureSwizzleRGBA = swizzle;
|
||||
fua->AddTexUnpack(usage, pi, dui);
|
||||
|
@ -31,11 +30,10 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
fua->AllowUnsizedTexFormat(pi, usage);
|
||||
};
|
||||
|
||||
bool useSizedFormats = true;
|
||||
const bool hasSizedLegacyFormats = gl->IsCompatibilityProfile();
|
||||
if (gl->IsGLES() && gl->Version() < 300) {
|
||||
useSizedFormats = false;
|
||||
}
|
||||
const bool needsSwizzle = gl->IsCoreProfile();
|
||||
MOZ_ASSERT_IF(needsSwizzle, gl->IsSupported(gl::GLFeature::texture_swizzle));
|
||||
|
||||
const bool needsSizedFormat = !gl->IsGLES();
|
||||
|
||||
GLenum driverUnpackType = LOCAL_GL_HALF_FLOAT;
|
||||
if (!gl->IsSupported(gl::GLFeature::texture_half_float)) {
|
||||
|
@ -48,7 +46,7 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
pi = {LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES};
|
||||
dui = {pi.format, pi.format, driverUnpackType};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_RGBA16F;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::RGBA16F);
|
||||
|
@ -58,7 +56,7 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
pi = {LOCAL_GL_RGB, LOCAL_GL_HALF_FLOAT_OES};
|
||||
dui = {pi.format, pi.format, driverUnpackType};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_RGB16F;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::RGB16F);
|
||||
|
@ -68,14 +66,11 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
pi = {LOCAL_GL_LUMINANCE, LOCAL_GL_HALF_FLOAT_OES};
|
||||
dui = {pi.format, pi.format, driverUnpackType};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE16F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_R16F;
|
||||
dui.unpackFormat = LOCAL_GL_RED;
|
||||
swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType};
|
||||
swizzle = webgl::FormatUsageInfo::kLuminanceSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE16F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Luminance16F);
|
||||
|
||||
|
@ -84,14 +79,11 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
pi = {LOCAL_GL_ALPHA, LOCAL_GL_HALF_FLOAT_OES};
|
||||
dui = {pi.format, pi.format, driverUnpackType};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_ALPHA16F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_R16F;
|
||||
dui.unpackFormat = LOCAL_GL_RED;
|
||||
swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_R16F, LOCAL_GL_RED, driverUnpackType};
|
||||
swizzle = webgl::FormatUsageInfo::kAlphaSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_ALPHA16F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Alpha16F);
|
||||
|
||||
|
@ -100,14 +92,11 @@ WebGLExtensionTextureHalfFloat::WebGLExtensionTextureHalfFloat(
|
|||
pi = {LOCAL_GL_LUMINANCE_ALPHA, LOCAL_GL_HALF_FLOAT_OES};
|
||||
dui = {pi.format, pi.format, driverUnpackType};
|
||||
swizzle = nullptr;
|
||||
if (useSizedFormats) {
|
||||
if (hasSizedLegacyFormats) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA16F_ARB;
|
||||
} else {
|
||||
dui.internalFormat = LOCAL_GL_RG16F;
|
||||
dui.unpackFormat = LOCAL_GL_RG;
|
||||
swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
|
||||
}
|
||||
if (needsSwizzle) {
|
||||
dui = {LOCAL_GL_RG16F, LOCAL_GL_RG, driverUnpackType};
|
||||
swizzle = webgl::FormatUsageInfo::kLumAlphaSwizzleRGBA;
|
||||
} else if (needsSizedFormat) {
|
||||
dui.internalFormat = LOCAL_GL_LUMINANCE_ALPHA16F_ARB;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::Luminance16FAlpha16F);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче