Closed
Description
When using min()
or max()
methods on UVec
types (UVec2
, UVec3
, UVec4
)
in rust-gpu, the SPIR-V compiler emits an error requiring the Int8
capability:
error: Missing required capabilities for types
|
= note: i8 type used without OpCapability Int8
Minimal reproduction:
use spirv_std::glam::UVec4;
let uv4 = UVec4::new(1, 2, 3, 4);
let result = uv4.min(UVec4::new(4, 3, 2, 1)); // Triggers Int8
requirement
Workaround:
Manual component-wise comparison works without requiring Int8
:
let min_x = if uv4.x < other.x { uv4.x } else { other.x };
Expected behavior:
UVec
min/max operations should work without requiring the Int8
capability, as the vectors contain u32
values.
Environment:
- rust-gpu version: master
- glam version: via spirv-std
This appears to be an issue with how glam's min/max methods are
implemented for SPIR-V targets, possibly using i8
internally for
comparison operations.