mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
mesa: add _mesa_get_format_max_bits()
Returns max bits per channel for the given format. Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
fd104a8459
commit
488d7fc67d
2 changed files with 19 additions and 0 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "imports.h"
|
||||
#include "formats.h"
|
||||
#include "mfeatures.h"
|
||||
#include "macros.h"
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1613,6 +1614,21 @@ _mesa_get_format_bits(gl_format format, GLenum pname)
|
|||
}
|
||||
|
||||
|
||||
GLuint
|
||||
_mesa_get_format_max_bits(gl_format format)
|
||||
{
|
||||
const struct gl_format_info *info = _mesa_get_format_info(format);
|
||||
GLuint max = MAX2(info->RedBits, info->GreenBits);
|
||||
max = MAX2(max, info->BlueBits);
|
||||
max = MAX2(max, info->AlphaBits);
|
||||
max = MAX2(max, info->LuminanceBits);
|
||||
max = MAX2(max, info->IntensityBits);
|
||||
max = MAX2(max, info->DepthBits);
|
||||
max = MAX2(max, info->StencilBits);
|
||||
return max;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the data type (or more specifically, the data representation)
|
||||
* for the given format.
|
||||
|
|
|
|||
|
|
@ -290,6 +290,9 @@ _mesa_get_format_bytes(gl_format format);
|
|||
extern GLint
|
||||
_mesa_get_format_bits(gl_format format, GLenum pname);
|
||||
|
||||
extern GLuint
|
||||
_mesa_get_format_max_bits(gl_format format);
|
||||
|
||||
extern GLenum
|
||||
_mesa_get_format_datatype(gl_format format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue