zink: Skip border color clamping for compressed formats.
You won't have a non-void channel for block formats, because "how many bits are there in the red channel" doesn't even make sense. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18957>
This commit is contained in:
@@ -347,15 +347,19 @@ zink_format_clamp_channel_color(const struct util_format_description *desc, unio
|
||||
int non_void = util_format_get_first_non_void_channel(desc->format);
|
||||
switch (desc->channel[i].type) {
|
||||
case UTIL_FORMAT_TYPE_VOID:
|
||||
if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_FLOAT) {
|
||||
dst->f[i] = uif(UINT32_MAX);
|
||||
if (non_void != -1) {
|
||||
if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_FLOAT) {
|
||||
dst->f[i] = uif(UINT32_MAX);
|
||||
} else {
|
||||
if (desc->channel[non_void].normalized)
|
||||
dst->f[i] = 1.0;
|
||||
else if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_SIGNED)
|
||||
dst->i[i] = INT32_MAX;
|
||||
else
|
||||
dst->ui[i] = UINT32_MAX;
|
||||
}
|
||||
} else {
|
||||
if (desc->channel[non_void].normalized)
|
||||
dst->f[i] = 1.0;
|
||||
else if (desc->channel[non_void].type == UTIL_FORMAT_TYPE_SIGNED)
|
||||
dst->i[i] = INT32_MAX;
|
||||
else
|
||||
dst->ui[i] = UINT32_MAX;
|
||||
dst->ui[i] = src->ui[i];
|
||||
}
|
||||
break;
|
||||
case UTIL_FORMAT_TYPE_SIGNED:
|
||||
|
||||
Reference in New Issue
Block a user