pack_clamp_s8
Description
Pack a vector of 4 signed 32 bit integers into a packed value of 4 8-bit integers, clamping each value to the range [-128, 127] to ensure it fits within 8 bits.
Signature
int8_t4_packed pack_clamp_s8(vector<int, 4> unpackedValue); int8_t4_packed pack_clamp_s8(vector<int16_t, 4> unpackedValue);
Parameters
unpackedValue : vector<int, 4>
unpackedValue : vector<int16_t, 4>
Availability and Requirements
Defined for the following targets:
hlsl
Available in all stages.
glsl
Available in all stages.
cpp
Available in all stages.
cuda
Available in all stages.
metal
Available in all stages.
wgsl
Available in all stages.
spirv
Available in all stages.