Lines Matching defs:layout

1001     * of the format but only depends on the bit-layout of the channels.
1205 const struct isl_channel_layout *layout,
1209 if (layout->type == ISL_VOID)
1213 assert(layout->type == ISL_UNORM);
1216 switch (layout->type) {
1219 if (layout->bits == 8) {
1223 packed = _mesa_float_to_unorm(srgb, layout->bits);
1226 packed = _mesa_float_to_unorm(value->f32[i], layout->bits);
1230 packed = _mesa_float_to_snorm(value->f32[i], layout->bits);
1233 assert(layout->bits == 16 || layout->bits == 32);
1234 if (layout->bits == 16) {
1241 packed = MIN(value->u32[i], u_uintN_max(layout->bits));
1244 packed = CLAMP(value->u32[i], u_intN_min(layout->bits),
1245 u_intN_max(layout->bits));
1252 unsigned dword = layout->start_bit / 32;
1253 unsigned bit = layout->start_bit % 32;
1254 assert(bit + layout->bits <= 32);
1255 data_out[dword] |= (packed & u_uintN_max(layout->bits)) << bit;
1295 const struct isl_channel_layout *layout,
1299 if (layout->type == ISL_VOID)
1302 unsigned dword = layout->start_bit / 32;
1303 unsigned bit = layout->start_bit % 32;
1304 assert(bit + layout->bits <= 32);
1305 uint32_t packed = (data_in[dword] >> bit) & u_uintN_max(layout->bits);
1313 assert(layout->type == ISL_UNORM);
1315 switch (layout->type) {
1318 if (layout->bits == 8) {
1321 float srgb = _mesa_unorm_to_float(packed, layout->bits);
1325 unpacked.f32 = _mesa_unorm_to_float(packed, layout->bits);
1329 unpacked.f32 = _mesa_snorm_to_float(util_sign_extend(packed, layout->bits),
1330 layout->bits);
1333 assert(layout->bits == 16 || layout->bits == 32);
1334 if (layout->bits == 16) {
1344 unpacked.u32 = util_sign_extend(packed, layout->bits);