mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
iris: fix alpha channel for RGB BC1 formats
This commit is contained in:
parent
47d4ea1a16
commit
90274bd48f
1 changed files with 13 additions and 8 deletions
|
|
@ -353,15 +353,20 @@ iris_format_for_usage(const struct gen_device_info *devinfo,
|
|||
{
|
||||
struct isl_swizzle swizzle = ISL_SWIZZLE_IDENTITY;
|
||||
|
||||
if ((usage & ISL_SURF_USAGE_TEXTURE_BIT) && !util_format_is_srgb(pformat)) {
|
||||
if (util_format_is_intensity(pformat)) {
|
||||
swizzle = ISL_SWIZZLE(RED, RED, RED, RED);
|
||||
} else if (util_format_is_luminance(pformat)) {
|
||||
swizzle = ISL_SWIZZLE(RED, RED, RED, ONE);
|
||||
//} else if (util_format_is_alpha(pformat)) {
|
||||
//pformat = alpha_to_red(pformat);
|
||||
//swizzle = ISL_SWIZZLE(ZERO, ZERO, ZERO, RED);
|
||||
if (usage & ISL_SURF_USAGE_TEXTURE_BIT) {
|
||||
if (!util_format_is_srgb(pformat)) {
|
||||
if (util_format_is_intensity(pformat)) {
|
||||
swizzle = ISL_SWIZZLE(RED, RED, RED, RED);
|
||||
} else if (util_format_is_luminance(pformat)) {
|
||||
swizzle = ISL_SWIZZLE(RED, RED, RED, ONE);
|
||||
//} else if (util_format_is_alpha(pformat)) {
|
||||
//pformat = alpha_to_red(pformat);
|
||||
//swizzle = ISL_SWIZZLE(ZERO, ZERO, ZERO, RED);
|
||||
}
|
||||
}
|
||||
if (pformat == PIPE_FORMAT_DXT1_RGB ||
|
||||
pformat == PIPE_FORMAT_DXT1_SRGB)
|
||||
swizzle = ISL_SWIZZLE(RED, GREEN, BLUE, ONE);
|
||||
}
|
||||
|
||||
enum isl_format format = iris_isl_format_for_pipe_format(pformat);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue