iris: Return correct enum names from fmt_swizzle

SCS_ONE and ISL_CHANNEL_SELECT_ONE (and SCS_ZERO and
ISL_CHANNEL_SELECT_ZERO) have the same values, so this doesn't matter in
practice.  However, some compiler warning options will cause warnings to
be generated.

src/gallium/drivers/iris/iris_state.c: In function ‘fmt_swizzle’:
src/gallium/drivers/iris/iris_state.c:2177:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2177 |    case PIPE_SWIZZLE_1: return SCS_ONE;
      |                                ^~~~~~~
src/gallium/drivers/iris/iris_state.c:2178:32: warning: implicit conversion from ‘enum GFX125_ShaderChannelSelect’ to ‘enum isl_channel_select’ [-Wenum-conversion]
 2178 |    case PIPE_SWIZZLE_0: return SCS_ZERO;
      |                                ^~~~~~~~

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>
This commit is contained in:
Ian Romanick
2021-04-12 11:45:51 -07:00
committed by Marge Bot
parent f57c074270
commit 55ac31533d
+2 -2
View File
@@ -2174,8 +2174,8 @@ fmt_swizzle(const struct iris_format_info *fmt, enum pipe_swizzle swz)
case PIPE_SWIZZLE_Y: return fmt->swizzle.g;
case PIPE_SWIZZLE_Z: return fmt->swizzle.b;
case PIPE_SWIZZLE_W: return fmt->swizzle.a;
case PIPE_SWIZZLE_1: return SCS_ONE;
case PIPE_SWIZZLE_0: return SCS_ZERO;
case PIPE_SWIZZLE_1: return ISL_CHANNEL_SELECT_ONE;
case PIPE_SWIZZLE_0: return ISL_CHANNEL_SELECT_ZERO;
default: unreachable("invalid swizzle");
}
}