fix: particle color byte masking, add reference version

Color channel packing missing & 0xFF after >> 14 extraction — upper
bits bled into adjacent channels causing broken particle fading.
Same class of bug as the alpha output fix earlier.

Added particle_sse_reference.zig (faithful recreation from commit
574f96f) as a separate compilation unit for correctness comparison.
This commit is contained in:
MarcelineVQ
2026-03-24 01:08:01 -07:00
parent 112246e687
commit 2f0e8a8bc0
4 changed files with 552 additions and 5 deletions
+9
View File
@@ -120,6 +120,14 @@ pub fn build(b: *std.Build) void {
.optimize = .ReleaseFast,
}),
});
const particle_ref_obj = b.addObject(.{
.name = "particle_sse_ref",
.root_module = b.createModule(.{
.root_source_file = b.path("src/transform44/particle_sse_reference.zig"),
.target = bone_sse_target,
.optimize = .ReleaseFast,
}),
});
const lib = b.addLibrary(.{
.name = "weirdutils",
@@ -140,6 +148,7 @@ pub fn build(b: *std.Build) void {
lib.root_module.addObject(math_sse_obj);
lib.root_module.addObject(silicon_sse_obj);
lib.root_module.addObject(particle_sse_obj);
lib.root_module.addObject(particle_ref_obj);
b.installArtifact(lib);
// Benchmark harness — native x86 Linux executable for profiling SSE replacements