Lines Matching defs:desc
143 clamp_color(const struct util_format_description *desc, union pipe_color_union *dst, const union pipe_color_union *src, unsigned i)
145 int non_void = util_format_get_first_non_void_channel(desc->format);
146 switch (desc->channel[i].type) {
148 if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_FLOAT) {
151 if (desc->channel[non_void].normalized)
153 else if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_SIGNED)
160 if (desc->channel[i].normalized)
163 dst->i[i] = MAX2(src->i[i], -(1<<(desc->channel[i].size - 1)));
164 dst->i[i] = MIN2(dst->i[i], (1 << (desc->channel[i].size - 1)) - 1);
168 if (desc->channel[i].normalized)
171 dst->ui[i] = MIN2(src->ui[i], BITFIELD_MASK(desc->channel[i].size));
282 const struct util_format_description *desc = util_format_description(psurf->format);
292 clamp_color(desc, &clear->color, pcolor, i);