@swf2es/native 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/render/binary.d.ts +1 -1
- package/dist/render/binary.d.ts.map +1 -1
- package/dist/render/binary.js +2 -2
- package/dist/render/binary.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,7 +160,12 @@ level in one call, into DXT1 or DXT5 blocks identical to
|
|
|
160
160
|
`@swf2es/context3d`'s TypeScript encoder. It takes tightly packed top-down
|
|
161
161
|
RGBA, repeats edge pixels for partial 4×4 blocks, and keeps the reference's
|
|
162
162
|
double arithmetic and tie breaking. Four colour distances are compared
|
|
163
|
-
together with integer SIMD.
|
|
163
|
+
together with integer SIMD. DXT5 alpha endpoints choose their exact palette
|
|
164
|
+
entry directly (entry zero wins equal-endpoint ties); other values retain the
|
|
165
|
+
nearest distance while searching. Uniform 4×4 blocks emit equal colour endpoints
|
|
166
|
+
and zero indices immediately: DXT1 ignores alpha for this check, while DXT5
|
|
167
|
+
requires all four channels to match. The check stops at the first differing
|
|
168
|
+
pixel; other blocks keep the general colour fit. It returns `null` for invalid dimensions or
|
|
164
169
|
input sizes, failed allocation, a refused module or a trap, so the caller
|
|
165
170
|
can use the TypeScript path.
|
|
166
171
|
|
|
@@ -174,8 +179,17 @@ DXT5 upload's workspace between calls. A trap also drops the instance.
|
|
|
174
179
|
|
|
175
180
|
The host Zig tests cover flat blocks and edge repetition;
|
|
176
181
|
`tests/unit/native-dxt.test.ts` compares blocks against the TypeScript
|
|
177
|
-
reference on thousands of levels
|
|
178
|
-
|
|
182
|
+
reference on thousands of levels and all 32,896 alpha endpoint pairs, including
|
|
183
|
+
nearby palette values. It checks that each was encoded in wasm and exercises
|
|
184
|
+
rejection, traps and release.
|
|
185
|
+
|
|
186
|
+
`node tests/bench/dxt.ts before-checkout after-checkout --json` compares two built
|
|
187
|
+
native encoders, alternating A/B and B/A after warmup and checking their bytes
|
|
188
|
+
against the TypeScript reference. It includes opaque and binary-alpha textures
|
|
189
|
+
as well as flat, gradient and random RGBA, coloured tiles, mixed flat/noisy
|
|
190
|
+
blocks and constant RGB with varying alpha; `--large` selects 2048-square levels.
|
|
191
|
+
Without checkout paths it compares TypeScript with the current native encoder.
|
|
192
|
+
`--crossings` checks one encoding export per warmed level separately from timing.
|
|
179
193
|
|
|
180
194
|
## compress
|
|
181
195
|
|