Commit Graph
4 Commits
Author SHA1 Message Date
shinyobjectz 61b832fcba gpu: one backend rule for every wgpu instance, so Bevy's own device and the kernels take DX12 on an Intel GPU too
#180's first commit chose DX12 for an Intel GPU only in the shared device. Bevy's own device (when the shared one
fails) and systems/k's kernels asked wgpu for every backend, so they still met the Intel Vulkan driver that crashed
0.1.7 on Windows. raea_gpu_device::backends() is now the one answer for all three: WGPU_BACKEND when set; else, on
Windows, DX12 alone when DX12's pick is Intel's own GPU (dx12_first); else every backend, wgpu's default. Found once
a process. On a Mac nothing changes: the sample room renders at 10.0-10.1 ms a frame warm, against main's 10.1-10.5.
2026-11-18 10:03:25 -08:00
shinyobjectz 9b9dd9e780 K's min, max and clamp take their bounds plus a zero the GPU compiler can't prove (#82)
On a Snapdragon X's Adreno X1-85 (Vulkan), a byte from clamp, min or max that was then shifted and or'd into a word
came out with 0xff in its top two bytes: the compiler fused the three into a pack it gets wrong. nv12buf.k packs four
luma bytes that way, so half the luma words of a bright frame were wrong and video striped. The bounds now add kz,
i32(shape.n >> 31u), which is zero but read from the shape uniform, so the compiler can't fuse them. The reporter
found the trigger and this fix on the device (128,319 of 262,144 words wrong before, 0 after); the test runs their
kernels, clamp and min/max each packed with or and shl, against the interpreter on random pixels. 05c978867's
unsigned shl stays (an i32 shift into the sign bit is still left to the compiler) but wasn't the cause.
2026-11-10 08:28:08 -08:00
shinyobjectz 05c9788672 A video's bright parts come out whole on GPUs whose compilers treat a signed shift into the sign bit as undefined. nv12.k packs four luma bytes (and two chroma pairs) into a word with shl, the top byte by 24, and the WGSL shifted i32: a byte of 128 or more overflows into the sign bit, which WGSL defines but a driver's compiler (a Windows on ARM GPU's, #82) didn't, so every 4 pixels of a bright region came out as two right and two at 255, white stripes over the whole video (the reporter's luma plane: 29,489 of 29,495 words whose second byte is 128+ have both top bytes 255; none below). K's shl now shifts as u32 and bitcasts back, the same bits as the interpreter's wrapping_shl, so nv12.k, nv12buf.k and p010buf.k (whose 22-bit shift overflows the same way) are unchanged. 1 test: the WGSL shifts unsigned, and on the GPU all 256 bytes pack as the interpreter packs them. 2026-11-10 05:14:25 -08:00
shinyobjectz f675b0ad2b raea dc579e418 2026-10-31 13:15:29 -07:00