mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
iris: Silence warnings about implicit enum type conversions
src/gallium/drivers/iris/iris_state.c: In function ‘iris_create_blend_state’:
src/gallium/drivers/iris/iris_state.c:1284:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1284 | be.SourceBlendFactor = src_rgb;
| ^
src/gallium/drivers/iris/iris_state.c:1285:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1285 | be.SourceAlphaBlendFactor = src_alpha;
| ^
src/gallium/drivers/iris/iris_state.c:1286:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1286 | be.DestinationBlendFactor = dst_rgb;
| ^
src/gallium/drivers/iris/iris_state.c:1287:41: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1287 | be.DestinationAlphaBlendFactor = dst_alpha;
| ^
src/gallium/drivers/iris/iris_state.c:1308:28: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1308 | pb.SourceBlendFactor =
| ^
src/gallium/drivers/iris/iris_state.c:1310:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1310 | pb.SourceAlphaBlendFactor =
| ^
src/gallium/drivers/iris/iris_state.c:1312:33: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1312 | pb.DestinationBlendFactor =
| ^
src/gallium/drivers/iris/iris_state.c:1314:38: warning: implicit conversion from ‘enum pipe_blendfactor’ to ‘enum GFX125_3D_Color_Buffer_Blend_Factor’ [-Wenum-conversion]
1314 | pb.DestinationAlphaBlendFactor =
| ^
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>
This commit is contained in:
parent
55ac31533d
commit
aa64342661
1 changed files with 11 additions and 8 deletions
|
|
@ -1281,10 +1281,12 @@ iris_create_blend_state(struct pipe_context *ctx,
|
|||
|
||||
be.ColorBlendFunction = rt->rgb_func;
|
||||
be.AlphaBlendFunction = rt->alpha_func;
|
||||
be.SourceBlendFactor = src_rgb;
|
||||
be.SourceAlphaBlendFactor = src_alpha;
|
||||
be.DestinationBlendFactor = dst_rgb;
|
||||
be.DestinationAlphaBlendFactor = dst_alpha;
|
||||
|
||||
/* The casts prevent warnings about implicit enum type conversions. */
|
||||
be.SourceBlendFactor = (int) src_rgb;
|
||||
be.SourceAlphaBlendFactor = (int) src_alpha;
|
||||
be.DestinationBlendFactor = (int) dst_rgb;
|
||||
be.DestinationAlphaBlendFactor = (int) dst_alpha;
|
||||
|
||||
be.WriteDisableRed = !(rt->colormask & PIPE_MASK_R);
|
||||
be.WriteDisableGreen = !(rt->colormask & PIPE_MASK_G);
|
||||
|
|
@ -1305,14 +1307,15 @@ iris_create_blend_state(struct pipe_context *ctx,
|
|||
pb.AlphaToCoverageEnable = state->alpha_to_coverage;
|
||||
pb.IndependentAlphaBlendEnable = indep_alpha_blend;
|
||||
|
||||
/* The casts prevent warnings about implicit enum type conversions. */
|
||||
pb.SourceBlendFactor =
|
||||
fix_blendfactor(state->rt[0].rgb_src_factor, state->alpha_to_one);
|
||||
(int) fix_blendfactor(state->rt[0].rgb_src_factor, state->alpha_to_one);
|
||||
pb.SourceAlphaBlendFactor =
|
||||
fix_blendfactor(state->rt[0].alpha_src_factor, state->alpha_to_one);
|
||||
(int) fix_blendfactor(state->rt[0].alpha_src_factor, state->alpha_to_one);
|
||||
pb.DestinationBlendFactor =
|
||||
fix_blendfactor(state->rt[0].rgb_dst_factor, state->alpha_to_one);
|
||||
(int) fix_blendfactor(state->rt[0].rgb_dst_factor, state->alpha_to_one);
|
||||
pb.DestinationAlphaBlendFactor =
|
||||
fix_blendfactor(state->rt[0].alpha_dst_factor, state->alpha_to_one);
|
||||
(int) fix_blendfactor(state->rt[0].alpha_dst_factor, state->alpha_to_one);
|
||||
}
|
||||
|
||||
iris_pack_state(GENX(BLEND_STATE), cso->blend_state, bs) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue