mesa: Add a _mesa_is_format_color_format helper
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
parent
3c19251f28
commit
f89793946a
|
@ -472,6 +472,25 @@ _mesa_is_format_integer(mesa_format format)
|
|||
return (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if the given format is a color format.
|
||||
*/
|
||||
GLenum
|
||||
_mesa_is_format_color_format(mesa_format format)
|
||||
{
|
||||
const struct gl_format_info *info = _mesa_get_format_info(format);
|
||||
switch (info->BaseFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_STENCIL_INDEX:
|
||||
case GL_DEPTH_STENCIL:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return color encoding for given format.
|
||||
* \return GL_LINEAR or GL_SRGB
|
||||
|
|
|
@ -625,6 +625,9 @@ _mesa_is_format_integer(mesa_format format);
|
|||
extern bool
|
||||
_mesa_is_format_etc2(mesa_format format);
|
||||
|
||||
GLenum
|
||||
_mesa_is_format_color_format(mesa_format format);
|
||||
|
||||
extern GLenum
|
||||
_mesa_get_format_color_encoding(mesa_format format);
|
||||
|
||||
|
|
Loading…
Reference in New Issue