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"