libobs: Add gs_generalize_format helper

master
jpark37 2021-07-06 21:59:10 -07:00
parent c9766d8e28
commit da3375d5a4
1 changed files with 18 additions and 0 deletions

View File

@ -1005,6 +1005,24 @@ static inline bool gs_is_srgb_format(enum gs_color_format format)
}
}
static inline enum gs_color_format
gs_generalize_format(enum gs_color_format format)
{
switch (format) {
case GS_RGBA_UNORM:
format = GS_RGBA;
break;
case GS_BGRX_UNORM:
format = GS_BGRX;
break;
case GS_BGRA_UNORM:
format = GS_BGRA;
default:;
}
return format;
}
static inline uint32_t gs_get_total_levels(uint32_t width, uint32_t height,
uint32_t depth)
{