Backed out changeset b09d48d2b473 (bug 1655101) for causing mochitest webgl failures on dom/canvas/TexUnpackBlob.cpp

This commit is contained in:
Sandor Molnar 2023-09-26 19:09:49 +03:00
parent 76a53558da
commit deca8deb21
6 changed files with 7 additions and 18 deletions

View File

@ -4414,8 +4414,7 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
const auto& contextInfo = mNotLost->info;
const auto fallbackReason = [&]() -> Maybe<std::string> {
auto fallbackReason =
BlitPreventReason(level, offset, pi, *desc, Limits());
auto fallbackReason = BlitPreventReason(level, offset, pi, *desc);
if (fallbackReason) return fallbackReason;
const bool canUploadViaSd = contextInfo.uploadableSdTypes[sdType];

View File

@ -660,8 +660,7 @@ bool TexUnpackImage::Validate(const WebGLContext* const webgl,
Maybe<std::string> BlitPreventReason(const int32_t level, const ivec3& offset,
const webgl::PackingInfo& pi,
const TexUnpackBlobDesc& desc,
const Limits& limits) {
const TexUnpackBlobDesc& desc) {
const auto& size = desc.size;
const auto& unpacking = desc.unpacking;
@ -692,12 +691,8 @@ Maybe<std::string> BlitPreventReason(const int32_t level, const ivec3& offset,
}();
if (premultReason) return premultReason;
if (pi.format != LOCAL_GL_RGBA && pi.format != LOCAL_GL_RGB) {
return "`format` is not RGBA or RGB";
}
if (pi.format == LOCAL_GL_RGB && !limits.rgbColorRenderable) {
return "`format` is RGB, which is not color-renderable";
if (pi.format != LOCAL_GL_RGBA) {
return "`format` is not RGBA";
}
if (pi.type != LOCAL_GL_UNSIGNED_BYTE) {
@ -729,8 +724,8 @@ bool TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec,
// -
const auto reason = BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi,
mDesc, tex->mContext->Limits());
const auto reason =
BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi, mDesc);
if (reason) {
webgl->GeneratePerfWarning(
"Failed to hit GPU-copy fast-path."

View File

@ -43,8 +43,7 @@ struct DriverUnpackInfo;
Maybe<std::string> BlitPreventReason(int32_t level, const ivec3& offset,
const webgl::PackingInfo&,
const TexUnpackBlobDesc&,
const Limits& limits);
const TexUnpackBlobDesc&);
class TexUnpackBlob {
public:

View File

@ -237,8 +237,6 @@ static webgl::Limits MakeLimits(const WebGLContext& webgl) {
gl::GLContext::KHR_texture_compression_astc_hdr);
}
limits.rgbColorRenderable = webgl.gl->IsRGBColorRenderable();
if (webgl.IsWebGL2() ||
limits.supportedExtensions[WebGLExtensionID::WEBGL_draw_buffers]) {
gl.GetUIntegerv(LOCAL_GL_MAX_DRAW_BUFFERS, &limits.maxColorDrawBuffers);

View File

@ -651,7 +651,6 @@ struct Limits final {
// Exts
bool astcHdr = false;
bool rgbColorRenderable = false;
uint32_t maxColorDrawBuffers = 1;
uint64_t queryCounterBitsTimeElapsed = 0;
uint64_t queryCounterBitsTimestamp = 0;

View File

@ -282,7 +282,6 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
}
bool HasPBOState() const { return (!IsGLES() || Version() >= 300); }
bool IsRGBColorRenderable() { return !IsGLES() || Version() >= 300; }
/**
* If this context is double-buffered, returns TRUE.