From d9c5bd591774d860d583971614558bc8ace8d5ac Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 14 Nov 2026 22:25:39 +0900 Subject: [PATCH] =?UTF-8?q?meshoptimizer-m=201.3.1:=20the=20library=20buil?= =?UTF-8?q?t=20with=20-ffp-contract=3Doff=20and=20without=20fast=20math=20?= =?UTF-8?q?=E2=80=94=20the=20same=20meshlets,=20clusters=20and=20simplific?= =?UTF-8?q?ations=20on=20every=20platform.=20With=20the=20platform's=20def?= =?UTF-8?q?ault=20arm64=20fuses=20a=20multiply=20and=20an=20add=20into=20o?= =?UTF-8?q?ne=20rounding=20and=20a=20scattered=2048=20=C3=97=2048=20sheet'?= =?UTF-8?q?s=20meshlets=20differ=20from=20x86-64's=20(found=20by=20a=20con?= =?UTF-8?q?sumer's=20test=20on=20ubuntu-24.04-arm:=20its=20widest=20cluste?= =?UTF-8?q?r=201.57=20against=201.5);=20the=20first=20wrapper=20revision?= =?UTF-8?q?=20(mwrap.md:=20upstream=201.3,=20revision=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++++++-- README.zh.md | 8 ++++++-- mcpp.toml | 6 +++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1a691e7..b5614e9 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ vertex fetch optimization, simplification, meshlets, spatial ordering, the vertex, index and meshlet codecs — is vendored byte for byte from the 1.3 release and built with the package; nothing else is linked. +The library is built with `-ffp-contract=off` and without fast math, so the +same input gives the same output bit for bit on every platform: with the +platform's own default arm64 fuses a multiply and an add into one rounding +and the meshlets of a scattered 48 × 48 sheet differ from x86-64's (from +1.3.1; 1.3 kept the platform's default). + ## Modules - `import mcpplibs.mwrap.meshoptimizer;`: the whole API (118 names: 9 types, 20 enumerators, 89 functions), re-exporting the one below @@ -27,7 +33,7 @@ release and built with the package; nothing else is linked. ## Getting started ```sh -mcpp new lod --template mcpplibs.mwrap.meshoptimizer@1.3 +mcpp new lod --template mcpplibs.mwrap.meshoptimizer@1.3.1 cd lod mcpp run ``` @@ -37,7 +43,7 @@ and simplifies it to a tenth of its triangles. ```toml [dependencies] -mcpplibs.mwrap.meshoptimizer = "1.3" +mcpplibs.mwrap.meshoptimizer = "1.3.1" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index dc5233d..27daeb9 100644 --- a/README.zh.md +++ b/README.zh.md @@ -15,6 +15,10 @@ 简化、meshlet、空间排序、顶点/索引/meshlet 编解码——逐字节取自 1.3 发布包并随本包 构建,不链接其他东西。 +库以 `-ffp-contract=off`、不开 fast math 编译,同样的输入在每个平台上逐位得到同样的 +输出:按平台默认,arm64 会把乘与加合成一次舍入,打乱的 48 × 48 网格得到的 meshlet +与 x86-64 不同(1.3.1 起;1.3 用的是平台默认)。 + ## Modules - `import mcpplibs.mwrap.meshoptimizer;`:全部 API(118 个名字:9 个类型、20 个枚举值、89 个函数),并再导出下面这个 @@ -25,7 +29,7 @@ ## 快速开始 ```sh -mcpp new lod --template mcpplibs.mwrap.meshoptimizer@1.3 +mcpp new lod --template mcpplibs.mwrap.meshoptimizer@1.3.1 cd lod mcpp run ``` @@ -34,7 +38,7 @@ mcpp run ```toml [dependencies] -mcpplibs.mwrap.meshoptimizer = "1.3" +mcpplibs.mwrap.meshoptimizer = "1.3.1" ``` ```cpp diff --git a/mcpp.toml b/mcpp.toml index a93cf8f..5dc5efa 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "meshoptimizer" -version = "1.3" +version = "1.3.1" description = "meshoptimizer 1.3 C++ modules for mcpp (import mcpplibs.mwrap.meshoptimizer;): mesh indexing, vertex cache / overdraw / fetch optimization, simplification, meshlets, and the vertex / index codecs" license = "Apache-2.0" authors = ["mcpp-community"] @@ -17,6 +17,10 @@ kind = "lib" # (upstream/documents.json: the release tarball, each file's checksum). sources = ["src/*.cppm", "upstream/meshoptimizer/src/*.cpp"] include_dirs = ["upstream/meshoptimizer/src"] +# Every platform makes the same meshlets, clusters and simplifications: the +# compiler fuses no multiply and add into one rounding (arm64's default does, +# x86-64's cannot without FMA), so no float decision differs by platform. +cxxflags = ["-ffp-contract=off", "-fno-fast-math"] [dev-dependencies] compat.gtest = "1.15.2"