From 33720a26492ee8d606307d7af1e30103bc2f4173 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sun, 30 Aug 2026 19:35:55 +0200 Subject: [PATCH 1/4] update.py for automated gfx/angle updating based on the tag specified in UPSTREAM Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- generate_build_data.py | 27 +++++++++++++++++---------- update.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 10 deletions(-) create mode 100755 update.py diff --git a/generate_build_data.py b/generate_build_data.py index bad3e6888..475986eec 100755 --- a/generate_build_data.py +++ b/generate_build_data.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from os import path, listdir +from os import listdir, path REPO = path.dirname(__file__) ANGLE = path.join(REPO, "gfx", "angle") @@ -110,26 +110,33 @@ def write(data, f): def no_platform_sources(source): # Filter out any accidental inclusion of platform-specific source files. - return "system_utils_posix.cpp" not in source and "system_utils_linux.cpp" not in source + return ( + "system_utils_posix.cpp" not in source + and "system_utils_linux.cpp" not in source + ) def write_lib(lib, data, f): name = str.encode(lib2const(lib)) defines = [ - b"(%s, %s)" % ( - string_literal(k), - b"None" if v is True else b"Some(%s)" % string_literal(v) - ) + b"(%s, %s)" + % (string_literal(k), b"None" if v is True else b"Some(%s)" % string_literal(v)) for k, v in data["DEFINES"].items() ] f.write(b"pub const %s: Data = Data {\n" % name) f.write(b" lib: %s,\n" % string_literal(lib)) - write_list(b"sources", map(string_literal, filter(no_platform_sources, data["SOURCES"])), f) + write_list( + b"sources", map(string_literal, filter(no_platform_sources, data["SOURCES"])), f + ) write_list(b"includes", map(string_literal, data["LOCAL_INCLUDES"]), f) write_list(b"defines", defines, f) write_list(b"os_libs", map(string_literal, data["OS_LIBS"]), f) - write_list(b"use_libs", map(lib_enum, filter(lambda s: "zlib" not in s, data["USE_LIBS"])), f) + write_list( + b"use_libs", + map(lib_enum, filter(lambda s: "zlib" not in s, data["USE_LIBS"])), + f, + ) if data["SHARED"]: f.write(b" shared: true,\n") else: @@ -144,7 +151,7 @@ def lib_enum(s: str): def string_literal(s): prelen = 1 raw = repr(s).replace('"', '\\"') - return b"\"%s\"" % raw[prelen:-prelen].encode("utf-8") + return b'"%s"' % raw[prelen:-prelen].encode("utf-8") def write_list(name, items, f): @@ -155,5 +162,5 @@ def write_list(name, items, f): f.write(b" ],\n") -if __name__ == '__main__': +if __name__ == "__main__": run() diff --git a/update.py b/update.py new file mode 100755 index 000000000..d5f51bb0b --- /dev/null +++ b/update.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +# update gfx/angle based on the tag specified in UPSTREAM + +import tarfile +import urllib.request +from pathlib import Path + +upstream_txt = Path("UPSTREAM").read_text() + +tag = upstream_txt.removeprefix("gfx/angle is taken from ").split(":", 1)[0].strip() + +print(f"Using Firefox tag: {tag}") + +url = f"https://github.com/mozilla-firefox/firefox/archive/refs/tags/{tag}.tar.gz" +prefix = f"firefox-{tag}/gfx/angle/" + +print(f"Downloading {url}") + +with urllib.request.urlopen(url) as response: + print("Extracting") + + with tarfile.open(fileobj=response, mode="r|gz") as archive: + for member in archive: + if not member.name.startswith(prefix): + continue + + member.name = member.name[len(prefix) :] + + if member.name: + archive.extract(member, path="gfx/angle") + + +for patch in Path("patches").glob("*.patch"): + print(f"Applying patch: {patch}") + import subprocess + + subprocess.run(["git", "apply", str(patch), "--reject"], check=True) + +from generate_build_data import run + +run() From 70ce51b1dbd3bd273f04caa894e6099227e5f9f4 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sun, 30 Aug 2026 19:40:27 +0200 Subject: [PATCH 2/4] update ANGLE to FIREFOX_153_1_0esr_RELEASE Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- UPSTREAM | 2 +- .../checkout/out/gen/angle/angle_commit.h | 6 +- .../src/compiler/translator/IntermNode.cpp | 52 +++- .../src/compiler/translator/OutputHLSL.cpp | 8 +- .../checkout/src/gpu_info_util/SystemInfo.cpp | 1 + .../checkout/src/gpu_info_util/SystemInfo.h | 23 +- .../src/gpu_info_util/SystemInfo_vulkan.cpp | 1 + .../renderer/d3d/d3d11/Renderer11.cpp | 1 - .../renderer/d3d/d3d11/TextureStorage11.cpp | 32 ++- .../src/libANGLE/renderer/driver_utils.cpp | 1 + .../src/libANGLE/renderer/driver_utils.h | 34 +-- gfx/angle/cherry_picks.txt | 237 ++++++++++++++++-- gfx/angle/moz.build | 2 - gfx/angle/moz.yaml | 8 +- gfx/angle/update-angle.py | 11 +- gfx/angle/vendor_from_git.py | 3 + 16 files changed, 344 insertions(+), 78 deletions(-) mode change 100644 => 100755 gfx/angle/update-angle.py diff --git a/UPSTREAM b/UPSTREAM index 807982df4..db2fdcdc9 100644 --- a/UPSTREAM +++ b/UPSTREAM @@ -1 +1 @@ -gfx/angle is taken from FIREFOX_140_12_0esr_RELEASE: f8025617e815f21388b40baf189338d31a5f9a0a \ No newline at end of file +gfx/angle is taken from FIREFOX_153_1_0esr_RELEASE: 468445e58d3acc7e4e059be99856daff1f2ae8f1 \ No newline at end of file diff --git a/gfx/angle/checkout/out/gen/angle/angle_commit.h b/gfx/angle/checkout/out/gen/angle/angle_commit.h index aa5c39bc9..6041b303b 100644 --- a/gfx/angle/checkout/out/gen/angle/angle_commit.h +++ b/gfx/angle/checkout/out/gen/angle/angle_commit.h @@ -1,5 +1,5 @@ -#define ANGLE_COMMIT_HASH "6eb59c58d21b" +#define ANGLE_COMMIT_HASH "7b0bc3d196d4" #define ANGLE_COMMIT_HASH_SIZE 12 -#define ANGLE_COMMIT_DATE "2026-06-01 14:52:43 +0200" -#define ANGLE_COMMIT_POSITION 19766 +#define ANGLE_COMMIT_DATE "2026-06-09 02:49:49 -0700" +#define ANGLE_COMMIT_POSITION 19767 #define ANGLE_HAS_BINARY_LOADING diff --git a/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp b/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp index a932b534b..c36dce93e 100644 --- a/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp +++ b/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp @@ -839,6 +839,12 @@ bool TIntermAggregate::isConstantNullValue() const const TConstantUnion *TIntermAggregate::getConstantValue() const { + // Cap constant-fold allocations. This runs during parsing, before the + // post-parse ValidateTypeSizeLimitations check that uses the configurable + // ShBuiltInResources limits (which are not accessible here). Firefox + // defaults to MaxPrivateVariableSizeInBytes = 1 MB, so 256K floats. + constexpr size_t kMaxConstantFoldElements = 256 * 1024; + if (!hasConstantValue()) { return nullptr; @@ -850,14 +856,25 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const if (isArray()) { size_t elementSize = mArguments.front()->getAsTyped()->getType().getObjectSize(); - constArray = new TConstantUnion[elementSize * getOutermostArraySize()]; + angle::CheckedNumeric checkedArraySize = elementSize; + checkedArraySize *= getOutermostArraySize(); + size_t arraySize = 0; + if (!checkedArraySize.AssignIfValid(&arraySize) || arraySize > kMaxConstantFoldElements) + { + return nullptr; + } + constArray = new TConstantUnion[arraySize]; size_t elementOffset = 0u; for (TIntermNode *constructorArg : mArguments) { const TConstantUnion *elementConstArray = constructorArg->getAsTyped()->getConstantValue(); - ASSERT(elementConstArray); + if (!elementConstArray) + { + delete[] constArray; + return nullptr; + } size_t elementSizeBytes = sizeof(TConstantUnion) * elementSize; memcpy(static_cast(&constArray[elementOffset]), static_cast(elementConstArray), elementSizeBytes); @@ -866,8 +883,12 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const return constArray; } - size_t resultSize = getType().getObjectSize(); - constArray = new TConstantUnion[resultSize]; + size_t resultSize = getType().getObjectSize(); + if (resultSize > kMaxConstantFoldElements) + { + return nullptr; + } + constArray = new TConstantUnion[resultSize]; TBasicType basicType = getBasicType(); size_t resultIndex = 0u; @@ -877,6 +898,11 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const TIntermNode *argument = mArguments.front(); TIntermTyped *argumentTyped = argument->getAsTyped(); const TConstantUnion *argumentConstantValue = argumentTyped->getConstantValue(); + if (!argumentConstantValue) + { + delete[] constArray; + return nullptr; + } // Check the special case of constructing a matrix diagonal from a single scalar, // or a vector from a single scalar. if (argumentTyped->getType().getObjectSize() == 1u) @@ -949,6 +975,11 @@ const TConstantUnion *TIntermAggregate::getConstantValue() const TIntermTyped *argumentTyped = argument->getAsTyped(); size_t argumentSize = argumentTyped->getType().getObjectSize(); const TConstantUnion *argumentConstantValue = argumentTyped->getConstantValue(); + if (!argumentConstantValue) + { + delete[] constArray; + return nullptr; + } for (size_t i = 0u; i < argumentSize; ++i) { if (resultIndex >= resultSize) @@ -2239,8 +2270,17 @@ const TConstantUnion *TIntermBinary::getConstantValue() const return nullptr; } - const TConstantUnion *leftConstantValue = mLeft->getConstantValue(); - int index = mRight->getConstantValue()->getIConst(); + const TConstantUnion *leftConstantValue = mLeft->getConstantValue(); + if (!leftConstantValue) + { + return nullptr; + } + const TConstantUnion *rightConstantValue = mRight->getConstantValue(); + if (!rightConstantValue) + { + return nullptr; + } + int index = rightConstantValue->getIConst(); const TConstantUnion *constIndexingResult = nullptr; if (mOp == EOpIndexDirect) { diff --git a/gfx/angle/checkout/src/compiler/translator/OutputHLSL.cpp b/gfx/angle/checkout/src/compiler/translator/OutputHLSL.cpp index 12f220b44..8611aa41d 100644 --- a/gfx/angle/checkout/src/compiler/translator/OutputHLSL.cpp +++ b/gfx/angle/checkout/src/compiler/translator/OutputHLSL.cpp @@ -3458,11 +3458,15 @@ bool OutputHLSL::writeConstantInitialization(TInfoSinkBase &out, { if (initializer->hasConstantValue()) { + const TConstantUnion *constValue = initializer->getConstantValue(); + if (!constValue) + { + return false; + } symbolNode->traverse(this); out << ArrayString(symbolNode->getType()); out << " = {"; - writeConstantUnionArray(out, initializer->getConstantValue(), - initializer->getType().getObjectSize()); + writeConstantUnionArray(out, constValue, initializer->getType().getObjectSize()); out << "}"; return true; } diff --git a/gfx/angle/checkout/src/gpu_info_util/SystemInfo.cpp b/gfx/angle/checkout/src/gpu_info_util/SystemInfo.cpp index b2149c9f6..06983f749 100644 --- a/gfx/angle/checkout/src/gpu_info_util/SystemInfo.cpp +++ b/gfx/angle/checkout/src/gpu_info_util/SystemInfo.cpp @@ -45,6 +45,7 @@ std::string VendorName(VendorID vendor) case kVendorID_NVIDIA: return "NVIDIA"; case kVendorID_Qualcomm: + case kVendorID_Qualcomm_DXGI: return "Qualcomm"; case kVendorID_VeriSilicon: return "VeriSilicon"; diff --git a/gfx/angle/checkout/src/gpu_info_util/SystemInfo.h b/gfx/angle/checkout/src/gpu_info_util/SystemInfo.h index 7347404ae..871eb426f 100644 --- a/gfx/angle/checkout/src/gpu_info_util/SystemInfo.h +++ b/gfx/angle/checkout/src/gpu_info_util/SystemInfo.h @@ -101,17 +101,18 @@ bool GetSystemInfo(SystemInfo *info); bool GetSystemInfoVulkan(SystemInfo *info); // Known PCI vendor IDs -constexpr VendorID kVendorID_AMD = 0x1002; -constexpr VendorID kVendorID_ARM = 0x13B5; -constexpr VendorID kVendorID_Broadcom = 0x14E4; -constexpr VendorID kVendorID_GOOGLE = 0x1AE0; -constexpr VendorID kVendorID_ImgTec = 0x1010; -constexpr VendorID kVendorID_Intel = 0x8086; -constexpr VendorID kVendorID_NVIDIA = 0x10DE; -constexpr VendorID kVendorID_Qualcomm = 0x5143; -constexpr VendorID kVendorID_VMWare = 0x15ad; -constexpr VendorID kVendorID_Apple = 0x106B; -constexpr VendorID kVendorID_Microsoft = 0x1414; +constexpr VendorID kVendorID_AMD = 0x1002; +constexpr VendorID kVendorID_ARM = 0x13B5; +constexpr VendorID kVendorID_Broadcom = 0x14E4; +constexpr VendorID kVendorID_GOOGLE = 0x1AE0; +constexpr VendorID kVendorID_ImgTec = 0x1010; +constexpr VendorID kVendorID_Intel = 0x8086; +constexpr VendorID kVendorID_NVIDIA = 0x10DE; +constexpr VendorID kVendorID_Qualcomm = 0x5143; +constexpr VendorID kVendorID_Qualcomm_DXGI = 0x4D4F4351; +constexpr VendorID kVendorID_VMWare = 0x15ad; +constexpr VendorID kVendorID_Apple = 0x106B; +constexpr VendorID kVendorID_Microsoft = 0x1414; // Known non-PCI (i.e. Khronos-registered) vendor IDs constexpr VendorID kVendorID_Vivante = 0x10001; diff --git a/gfx/angle/checkout/src/gpu_info_util/SystemInfo_vulkan.cpp b/gfx/angle/checkout/src/gpu_info_util/SystemInfo_vulkan.cpp index 96b6019fd..9ceea4687 100644 --- a/gfx/angle/checkout/src/gpu_info_util/SystemInfo_vulkan.cpp +++ b/gfx/angle/checkout/src/gpu_info_util/SystemInfo_vulkan.cpp @@ -239,6 +239,7 @@ bool GetSystemInfoVulkanWithICD(SystemInfo *info, vk::ICD preferredICD) gpu.detailedDriverVersion.patch = properties.driverVersion & 0x3F; break; case kVendorID_Qualcomm: + case kVendorID_Qualcomm_DXGI: gpu.driverVendor = "Qualcomm Technologies, Inc"; if (properties.driverVersion & 0x80000000) { diff --git a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp index 0aba0078d..0c8ff703c 100644 --- a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +++ b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp @@ -2064,7 +2064,6 @@ angle::Result Renderer11::drawLineLoop(const gl::Context *context, GetLineLoopIndices(indices, type, static_cast(count), glState.isPrimitiveRestartEnabled(), &mScratchIndexDataBuffer); - uint64_t spaceNeeded64 = sizeof(GLuint) * mScratchIndexDataBuffer.size(); ANGLE_CHECK(GetImplAs(context), spaceNeeded64 <= std::numeric_limits::max(), "Failed to create a 32-bit looping index buffer for " diff --git a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp index f1277462a..800beace9 100644 --- a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp +++ b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp @@ -13,6 +13,7 @@ #include #include "common/MemoryBuffer.h" +#include "anglebase/numerics/checked_math.h" #include "common/utilities.h" #include "libANGLE/Context.h" #include "libANGLE/ImageIndex.h" @@ -799,22 +800,35 @@ angle::Result TextureStorage11::setData(const gl::Context *context, const d3d11::Format &d3d11Format = d3d11::Format::Get(image->getInternalFormat(), mRenderer->getRenderer11DeviceCaps()); - const d3d11::DXGIFormatSize &dxgiFormatInfo = - d3d11::GetDXGIFormatSizeInfo(d3d11Format.texFormat); - const size_t outputPixelSize = dxgiFormatInfo.pixelBytes; - - UINT bufferRowPitch = static_cast(outputPixelSize) * width; - UINT bufferDepthPitch = bufferRowPitch * height; - - const size_t neededSize = bufferDepthPitch * depth; angle::MemoryBuffer *conversionBuffer = nullptr; const uint8_t *data = nullptr; + UINT bufferRowPitch = 0; + UINT bufferDepthPitch = 0; LoadImageFunctionInfo loadFunctionInfo = d3d11Format.getLoadFunctions()(type); if (loadFunctionInfo.requiresConversion) { - ANGLE_TRY(mRenderer->getScratchMemoryBuffer(context11, neededSize, &conversionBuffer)); + const d3d11::DXGIFormatSize &dxgiFormatInfo = + d3d11::GetDXGIFormatSizeInfo(d3d11Format.texFormat); + + const size_t outputPixelSize = dxgiFormatInfo.pixelBytes; + + angle::CheckedNumeric checkedBufferRowPitch = outputPixelSize; + checkedBufferRowPitch *= static_cast(width); + + angle::CheckedNumeric checkedBufferDepthPitch = checkedBufferRowPitch * height; + angle::CheckedNumeric checkedNeededSize = checkedBufferDepthPitch * depth; + + ANGLE_CHECK_GL_MATH(context11, checkedNeededSize.IsValid() && + checkedBufferRowPitch.IsValid() && + checkedBufferDepthPitch.IsValid()); + + bufferRowPitch = checkedBufferRowPitch.ValueOrDie(); + bufferDepthPitch = checkedBufferDepthPitch.ValueOrDie(); + + ANGLE_TRY(mRenderer->getScratchMemoryBuffer( + context11, checkedNeededSize.ValueOrDie(), &conversionBuffer)); loadFunctionInfo.loadFunction(width, height, depth, pixelData + srcSkipBytes, srcRowPitch, srcDepthPitch, conversionBuffer->data(), bufferRowPitch, bufferDepthPitch); diff --git a/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.cpp b/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.cpp index 360a0dd9a..568f77cf3 100644 --- a/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.cpp +++ b/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.cpp @@ -264,6 +264,7 @@ const char *GetVendorString(uint32_t vendorId) return "NVIDIA"; case VENDOR_ID_POWERVR: return "Imagination Technologies"; + case VENDOR_ID_QUALCOMM_DXGI: case VENDOR_ID_QUALCOMM: return "Qualcomm"; case VENDOR_ID_SAMSUNG: diff --git a/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.h b/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.h index 3addc07ff..ded6f8749 100644 --- a/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.h +++ b/gfx/angle/checkout/src/libANGLE/renderer/driver_utils.h @@ -22,19 +22,18 @@ enum VendorID : uint32_t VENDOR_ID_APPLE = 0x106B, VENDOR_ID_ARM = 0x13B5, // Broadcom devices won't use PCI, but this is their Vulkan vendor id. - VENDOR_ID_BROADCOM = 0x14E4, - VENDOR_ID_GOOGLE = 0x1AE0, - VENDOR_ID_INTEL = 0x8086, - VENDOR_ID_MESA = 0x10005, - VENDOR_ID_MICROSOFT = 0x1414, - VENDOR_ID_NVIDIA = 0x10DE, - VENDOR_ID_POWERVR = 0x1010, - // This is Qualcomm PCI Vendor ID. - // Android doesn't have a PCI bus, but all we need is a unique id. - VENDOR_ID_QUALCOMM = 0x5143, - VENDOR_ID_SAMSUNG = 0x144D, - VENDOR_ID_VIVANTE = 0x9999, - VENDOR_ID_VMWARE = 0x15AD, + VENDOR_ID_BROADCOM = 0x14E4, + VENDOR_ID_GOOGLE = 0x1AE0, + VENDOR_ID_INTEL = 0x8086, + VENDOR_ID_MESA = 0x10005, + VENDOR_ID_MICROSOFT = 0x1414, + VENDOR_ID_NVIDIA = 0x10DE, + VENDOR_ID_POWERVR = 0x1010, + VENDOR_ID_QUALCOMM_DXGI = 0x4D4F4351, + VENDOR_ID_QUALCOMM = 0x5143, + VENDOR_ID_SAMSUNG = 0x144D, + VENDOR_ID_VIVANTE = 0x9999, + VENDOR_ID_VMWARE = 0x15AD, }; enum AndroidDeviceID : uint32_t @@ -94,7 +93,14 @@ inline bool IsPowerVR(uint32_t vendorId) inline bool IsQualcomm(uint32_t vendorId) { - return vendorId == VENDOR_ID_QUALCOMM; + // Qualcomm is an unusual one. It has two different vendor IDs depending on + // where you look. On Windows, DXGI will report the VENDOR_ID_QUALCOMM_DXGI + // value (due to it being an ACPI device rather than PCI device), but their + // native Vulkan driver will actually report their PCI vendor ID (the + // VENDOR_ID_QUALCOMM value). So we have to check both, to ensure we arrive + // at the right conclusion regardless of what source we are querying for + // vendor information. + return vendorId == VENDOR_ID_QUALCOMM || vendorId == VENDOR_ID_QUALCOMM_DXGI; } inline bool IsSamsung(uint32_t vendorId) diff --git a/gfx/angle/cherry_picks.txt b/gfx/angle/cherry_picks.txt index bdb55192a..97e99b236 100644 --- a/gfx/angle/cherry_picks.txt +++ b/gfx/angle/cherry_picks.txt @@ -1,6 +1,12 @@ -commit 6eb59c58d21b6148fe13c0374201cafd9464e32e +commit 7b0bc3d196d480cce121a7aef375eda817e7e7ce +Author: Ashley Hale +Date: Tue Jun 09 02:49:49 2026 -0700 + + Cherry-pick another translator fix + +commit a25624ef5e0ffa6d30956d99fba040de008a1b3f Author: Shahbaz Youssefi -Date: Tue Apr 7 15:51:37 2026 -0400 +Date: Tue Apr 07 15:51:37 2026 -0400 M148: Translator: Fix redeclared built-in type checks @@ -17,7 +23,7 @@ Date: Tue Apr 7 15:51:37 2026 -0400 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7818777 Reviewed-by: Yuxin Hu -commit b2a02e6a10589f2890ab8522bd00d3102834925d +commit 71efafb2033e86950eb40ba4e455f2034960f6bd Author: Geoff Lang Date: Thu Mar 26 18:05:30 2026 -0500 @@ -34,9 +40,202 @@ Date: Thu Mar 26 18:05:30 2026 -0500 (cherry picked from commit bf6dd974238bceec7a0a27987e2e02e177f2b7f8) Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7653195 +commit e3878006704bd7142896fcefa410925a04ad8ee4 +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Mon May 11 11:20:55 2026 +0200 + + add missing include + +commit ff1e5e2227563f239be3f537eeae9de05f2effb5 +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Mon May 11 11:16:18 2026 +0200 + + eliminate `static_cast` + +commit 99774d7dd4b8719be30921ff32d01cbea999ccbd +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Mon May 11 11:09:56 2026 +0200 + + use correct framebuffer var + +commit a1db0642de56a9a0d7754cd068c97a852f54a16b +Author: Shrek Shao +Date: Thu Apr 02 15:41:06 2026 -0700 + + D3D11: Fix overflow in compressed 3D texture deferred-init + + The ANGLE D3D11 backend computed the zero-fill buffer size for + block-compressed 3D textures using an unchecked + 32-bit multiplication that did not account for block height. + This produced a value four times larger than the actual + compressed image size and could overflow for sufficiently large + textures. + + This fix: + 1. Uses InternalFormat::computeCompressedImageSize to correctly + calculate the required buffer size for compressed textures, + taking block dimensions into account. + 2. Employs angle::CheckedNumeric for uncompressed texture size + calculations to prevent potential integer overflows. + 3. Adds a regression test DeferredInit3DOverflow + that uses large texture dimensions (2048x2048x320) to verify + there is no ASAN error. + + Bug: b/497896137 + Fixed: b/501314630 + Change-Id: I76f0fb008af34e8ac78870318e608d16ed4ddd93 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7728091 + Reviewed-by: Shahbaz Youssefi + Commit-Queue: Shahbaz Youssefi + Auto-Submit: Shrek Shao + (cherry picked from commit 838c9be2bc21df9ab804428d53bf61fa906be4b4) + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7783400 + Reviewed-by: Geoff Lang + +commit 2601573081fe88bf56a13247b74b62313557798d +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Mon May 11 10:45:36 2026 +0200 + + call `SafeDelete` only if `onDestroy` has not errored + +commit 07b62327e0b091b4ccbd9e79bc63b5563a4db91e +Author: Steven Noonan +Date: Wed Apr 29 11:50:10 2026 +0200 + + handle Qualcomm's mixed vendor IDs + + This is a weird situation. Up until Qualcomm had a native Vulkan driver + for Windows (with the Snapdragon X series chips), the only vendor ID + observable on Windows was 0x4D4F4351. This was reported through DXGI, + device manager, etc. + + But with their native Vulkan driver, they now report 0x5143 as well: + + VkPhysicalDeviceProperties: + --------------------------- + apiVersion = 1.3.295 (4206887) + driverVersion = 0.807.0 (2150789120) + vendorID = 0x5143 + deviceID = 0x36334330 + deviceType = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU + deviceName = Qualcomm(R) Adreno(TM) X1-85 GPU + pipelineCacheUUID = 0eba4509-4351-0000-0000-010c05430000 + + And yet, DXGI still reports 0x4D4F4351. Cool, huh? + + Let's teach IsQualcomm to understand both vendor IDs to ensure the + device is correctly detected as a tile-based renderer in the Vulkan + backend. + + Bug: angleproject:390866623 + Change-Id: I9170c30262ace269498f066e922a279c7e981de6 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6183621 + Reviewed-by: Geoff Lang + Reviewed-by: Shahbaz Youssefi + Commit-Queue: Geoff Lang + Auto-Submit: Steven Noonan + +commit c75106cebae93b7c103ff1e63b274c3047b520ff +Author: Shrek Shao +Date: Tue Mar 17 14:04:32 2026 -0700 + + Fix D3D11 integer overflows in streaming vertex buffer path + + The D3D11 backend's streaming vertex buffer path had several integer + arithmetic errors that could lead to under-reservation or out-of-bounds + memory access when using large base instance values. + + Key changes: + - mathutil.h: Added UnsignedCeilDivide64 to handle 64-bit values safely. + - Renderer11/Renderer9: Updated getVertexSpaceRequired to use size_t and + CheckedNumeric for instance calculations, preventing 32-bit truncation. + - VertexBuffer: Updated storeDynamicAttribute to use CheckedNumeric when + calculating adjustedCount for instanced attributes with a base instance. + - VertexDataManager: Changed firstVertexIndex from GLint to size_t to + prevent negative index wrapping and added overflow checks for vertex + buffer size validation. + - Added a regression test (D3D11OverflowTest.cpp) to verify that large + baseInstance values do not cause crashes in the D3D11 backend. + + This is a Gemini generated CL with manual modifications. + + Bug: chromium:489791424 + Change-Id: I86d13594ee6da6238d8c6583c5268b4bd2ee2658 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7675790 + Auto-Submit: Shrek Shao + Commit-Queue: Shahbaz Youssefi + Reviewed-by: Geoff Lang + Reviewed-by: Shahbaz Youssefi + +commit c194cd0c42e86451d1499c57397e7ef8eefa135c +Author: Antonio Maiorano +Date: Tue Apr 07 16:03:19 2026 -0400 + + D3D11: Fix potential OOB read in StoreStaticAttrib + + Bug: b/489369089 + Change-Id: Ieda5e911ed0b122af49af15f52eb938787346143 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7736785 + Reviewed-by: Geoff Lang + Commit-Queue: Antonio Maiorano + +commit d941ceb42e6066d57561ba5d6054a5dedfa63055 +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Mon Apr 27 14:27:19 2026 +0200 + + improve `EmulatedIndexedStorage::getBuffer` + +commit c276b24aa48b75d454cc496bdcf6d170eed5cff3 +Author: Geoff Lang +Date: Mon Mar 23 17:32:05 2026 -0400 + + D3D11: Protect against overflows for texture staging buffers + + When TextureStorage11 needs to calculate sizes of intermediate buffers + for data conversion, do the math in 64-bit using CheckedNumerics. + Validate that the results fit into 32 bits. + + Bug: chromium:491760376 + Change-Id: Ie5942291fe7790c229cb1070fa9a2325fa40ac2f + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7695232 + Reviewed-by: Shahbaz Youssefi + Commit-Queue: Geoff Lang + +commit 9efddc5cfb20ac0028690bdfc5304a6a7c86dd39 +Author: teoxoy <28601907+teoxoy@users.noreply.github.com> +Date: Wed Apr 22 18:57:59 2026 +0200 + + break out of loop early + +commit 1640bca09e9ab1cd44c0d2d5b2ee3baafff426fe +Author: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com> +Date: Thu Apr 09 17:44:53 2026 +0200 + + Add return statement for empty bodies + +commit d4d97ea4f918c6d702d62cde4b76d2d6c4723777 +Author: Stephen White +Date: Wed Mar 04 15:44:30 2026 -0500 + + M146: D3D11: fix overflow in line loop and triangle fan + + If an index buffer is created of element type less than 32bit (e.g., + GL_UNSIGNED_BYTE) and used in a line loop or triangle fan, D3D11 must + widen it to 32-bit. This can cause an overflow if the widened size in + bytes is greater than INT_MAX. The fix is to detect the overflow and + abort. + + Bug: chromium:487977696 + Change-Id: I57b1dcc9b3d968da88282164a5f92386500c6205 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7637780 + Reviewed-by: Geoff Lang + Commit-Queue: Stephen White + (cherry picked from commit 4b7aace914924f634c4148c41e6fc87198867fa5) + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7657185 + commit b0098a1ebdb0400b515ff7a662685bda111e9e87 Author: Emilio Cobos Álvarez -Date: Thu Apr 9 15:03:30 2026 +0200 +Date: Thu Apr 09 15:03:30 2026 +0200 Add a missing change to 7918168436578718b234bfd56da152e34a85af1d that is in Gecko. @@ -59,7 +258,7 @@ Date: Mon Mar 27 13:05:36 2023 -0400 commit 4f5c3dbc01f70efbaaed41743893ed2c8a7653cd Author: Emilio Cobos Álvarez -Date: Thu Apr 9 13:40:10 2026 +0200 +Date: Thu Apr 09 13:40:10 2026 +0200 Add missing codegen from #27. @@ -112,7 +311,7 @@ Date: Thu May 30 11:36:58 2024 -0600 commit 28669be7c0129fa7ed117f730484db302a39bcb2 Author: Nisha Jain -Date: Thu Mar 7 14:19:58 2024 +0200 +Date: Thu Mar 07 14:19:58 2024 +0200 Avoid asserts when const folding binary ops on void variables @@ -129,7 +328,7 @@ Date: Thu Mar 7 14:19:58 2024 +0200 commit ebaab5cd66b66183175f8c5d5f72210afcba38ca Author: Kimmo Kinnunen -Date: Fri Mar 8 14:26:56 2024 +0200 +Date: Fri Mar 08 14:26:56 2024 +0200 Check array index against unsigned array size @@ -145,7 +344,7 @@ Date: Fri Mar 8 14:26:56 2024 +0200 commit 5a3f53d8bff0709e94e9b5c2a97684c9a012f6f6 Author: Erica Li -Date: Fri Mar 8 12:40:09 2024 +0200 +Date: Fri Mar 08 12:40:09 2024 +0200 Avoid assert with multiple memory qualifiers @@ -160,7 +359,7 @@ Date: Fri Mar 8 12:40:09 2024 +0200 commit f95d411e7d0c5cfb4b0dfef2ecadb952cc92b06a Author: Kimmo Kinnunen -Date: Tue Mar 5 21:42:32 2024 +0200 +Date: Tue Mar 05 21:42:32 2024 +0200 Ensure unary math op parse to an node on error @@ -176,7 +375,7 @@ Date: Tue Mar 5 21:42:32 2024 +0200 commit 386e3783a143a5268df86bdf93cd10892419f395 Author: Kimmo Kinnunen -Date: Mon Mar 4 14:43:10 2024 +0200 +Date: Mon Mar 04 14:43:10 2024 +0200 Fix layout(index=) parse assert on es 100 shaders @@ -230,7 +429,7 @@ Date: Tue Feb 13 17:54:12 2024 +0200 commit a7ce496eaa3ac8f108190ca544e00024edead840 Author: Kimmo Kinnunen -Date: Wed Feb 7 14:25:32 2024 +0200 +Date: Wed Feb 07 14:25:32 2024 +0200 Fix an assert on multidim array constructors @@ -251,13 +450,13 @@ Date: Wed Feb 7 14:25:32 2024 +0200 commit 7918168436578718b234bfd56da152e34a85af1d Author: Kelsey Gilbert -Date: Tue Jun 4 15:37:29 2024 -0700 +Date: Tue Jun 04 15:37:29 2024 -0700 Add GLSL variable byte size limits to ShBuiltInResources. commit 31c0a5bff1330706aff3c4594c8166745814a45b Author: Shahbaz Youssefi -Date: Wed May 3 13:41:36 2023 -0400 +Date: Wed May 03 13:41:36 2023 -0400 WebGL: Limit total size of private data @@ -271,7 +470,7 @@ Date: Wed May 3 13:41:36 2023 -0400 commit ddaf44ac75d5d0390873c2af193e02159ecbe672 Author: Geoff Lang -Date: Fri Dec 8 13:20:36 2023 -0500 +Date: Fri Dec 08 13:20:36 2023 -0500 Validate Uniform variable limits with each iteration @@ -318,13 +517,13 @@ Date: Wed Mar 29 16:13:39 2023 -0700 commit aa3a569c8ddc1122d55663749a6db63e48b3033c Author: Ashley Hale -Date: Wed Mar 1 18:03:04 2023 -0800 +Date: Wed Mar 01 18:03:04 2023 -0800 Disable ClearView with scissor on Skylake iGPU because of observed bugs with edge corruption. (#27) commit d93c05cd2d786f2c624fbf8f4465238b38a771a1 Author: Kelsey Gilbert -Date: Thu Sep 8 17:10:21 2022 -0700 +Date: Thu Sep 08 17:10:21 2022 -0700 Import in SymbolTable_ESSL_autogen.cpp. @@ -369,7 +568,7 @@ Date: Thu Feb 11 17:34:00 2021 -0800 commit 43e9d9a7c95b509869a774fab62bf42d6d15b745 Author: Jeff Muizelaar -Date: Wed May 6 14:04:42 2020 -0400 +Date: Wed May 06 14:04:42 2020 -0400 Don't use ClearView if we previously used dual source blending on Intel gen6. (#22) @@ -383,13 +582,13 @@ Date: Wed May 6 14:04:42 2020 -0400 commit b16ebaa05424354c06c2ccdccc36df2c7c1b191e Author: Erich Gubler -Date: Wed Nov 9 21:12:44 2022 -0500 +Date: Wed Nov 09 21:12:44 2022 -0500 Fix broken build from `-Wexit-time-destructors` on Windows x64 commit 4c3a473aec4e09ffacd0466817cb851529087767 Author: Dzmitry Malyshau -Date: Thu Dec 5 13:02:14 2019 -0500 +Date: Thu Dec 05 13:02:14 2019 -0500 Restrict the slow texture upload workaround to 128bit formats. (#21) diff --git a/gfx/angle/moz.build b/gfx/angle/moz.build index ee870a088..c5422ff92 100644 --- a/gfx/angle/moz.build +++ b/gfx/angle/moz.build @@ -1,5 +1,3 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/gfx/angle/moz.yaml b/gfx/angle/moz.yaml index 189812f43..af696e58d 100644 --- a/gfx/angle/moz.yaml +++ b/gfx/angle/moz.yaml @@ -15,19 +15,19 @@ origin: # release, and upstream repo locations refer to the third party upstream, # Angle is vendored from a mozilla git repository that pulls from # upstream and mainntains local patches there. - release: commit ceec659ac60b0c8ee9d9c602ca1a878ec1d3a88f Fri Nov 4 13:35:51 2022 +0000 + release: commit ceec659ac60b0c8ee9d9c602ca1a878ec1d3a88f Fri Nov 04 13:35:51 2022 +0000 revision: ceec659ac60b0c8ee9d9c602ca1a878ec1d3a88f license: BSD-3-Clause updatebot: - maintainer-phab: jgilbert - maintainer-bz: jgilbert@mozilla.com + maintainer-phab: ahale + maintainer-bz: ahale@mozilla.com tasks: - type: commit-alert enabled: True branch: chromium/5359 - needinfo: ["jgilbert@mozilla.com"] + needinfo: ["ahale@mozilla.com"] vendoring: url: https://chromium.googlesource.com/angle/angle diff --git a/gfx/angle/update-angle.py b/gfx/angle/update-angle.py old mode 100644 new mode 100755 index 23a094312..50ee697cb --- a/gfx/angle/update-angle.py +++ b/gfx/angle/update-angle.py @@ -6,9 +6,7 @@ assert __name__ == "__main__" r""" -To update ANGLE in Gecko, use Windows with git-bash, and setup depot_tools, python2, and -python3. Because depot_tools expects `python` to be `python2` (shame!), python2 must come -before python3 in your path. +To update ANGLE in Gecko, use Windows with git-bash, and setup depot_tools and python3. Upstream: https://chromium.googlesource.com/angle/angle @@ -19,8 +17,9 @@ This script leaves a record of the merge-base and cherry-picks that we pull into Gecko. (gfx/angle/cherries.log) -ANGLE<->Chrome version mappings are here: https://omahaproxy.appspot.com/ -An easy choice is to grab Chrome's Beta's ANGLE branch. +You can find out the current git hash of the ANGLE shipping in Chrome Beta using this command: +curl https://chromiumdash.appspot.com/fetch_releases?platform=Win32&channel=beta' | jq -r '.[0].hashes.angle +(or just go to https://chromiumdash.appspot.com/fetch_releases?platform=Win32&channel=beta and look for yourself) ## Usage @@ -406,7 +405,7 @@ def export_target(target_full_name) -> Set[str]: if REGISTERED_DEFINES[k] == False: line = "# " + line except KeyError: - print(f"[{name}] Unrecognized define: {k}") + print(f"[{name}] Unrecognized define: {k} = {v}") line = "# Unrecognized: " + line lines.append(line) lines.append("") diff --git a/gfx/angle/vendor_from_git.py b/gfx/angle/vendor_from_git.py index 35fdfd244..a8f751f2a 100644 --- a/gfx/angle/vendor_from_git.py +++ b/gfx/angle/vendor_from_git.py @@ -55,6 +55,7 @@ def record_cherry_picks(dir_in_gecko, merge_base_origin): "git", "show", "-s", + "--date=format:%a %b %d %H:%M:%S %Y %z", "--format=commit %H %cd", merge_base, stdout=subprocess.PIPE, @@ -66,6 +67,7 @@ def record_cherry_picks(dir_in_gecko, merge_base_origin): mb_info = run_checked( "git", "log", + "--date=format:%a %b %d %H:%M:%S %Y %z", "--format=medium", "--no-decorate", "--no-abbrev-commit", @@ -75,6 +77,7 @@ def record_cherry_picks(dir_in_gecko, merge_base_origin): cherries = run_checked( "git", "log", + "--date=format:%a %b %d %H:%M:%S %Y %z", "--format=medium", "--no-decorate", "--no-abbrev-commit", From e8c717a0a715661e06ae8b740d1cbfe7be03515e Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Sun, 30 Aug 2026 19:41:23 +0200 Subject: [PATCH 3/4] bump version Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f014f6943..124c99a6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mozangle" -version = "0.6.0" +version = "0.7.0" authors = ["The ANGLE Project Authors", "The Servo Project Developers"] license = "BSD-3-Clause" description = "Mozilla's fork of Google ANGLE, repackaged as a Rust crate." From 5603d24ef225eb0645c1bf38a724ca155589848c Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Mon, 31 Aug 2026 07:03:03 +0200 Subject: [PATCH 4/4] integrity check Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- .github/workflows/rust.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b40aefb53..53f3f4db1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -59,6 +59,20 @@ jobs: - run: apt update && apt install -y libx11-dev - run: cargo test --target ${{ matrix.target }} + integrity: + name: Integrity + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 1 + - name: Update gfx/angle + run: | + python3 ./update.py + git add . + - name: Check gfx/angle integrity + run: git diff --staged --no-ext-diff --exit-code + build_result: name: Result runs-on: ubuntu-latest @@ -66,6 +80,7 @@ jobs: needs: - "build" - "linux-cross-compile" + - "integrity" steps: - name: Mark the job as successful