mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 04:10:09 +01:00
mesa: added _mesa_get_format_block_size()
This commit is contained in:
parent
51bc12d623
commit
7b16c43e43
2 changed files with 19 additions and 0 deletions
|
|
@ -753,6 +753,22 @@ _mesa_get_format_base_format(gl_format format)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the block size (in pixels) for the given format. Normally
|
||||
* the block size is 1x1. But compressed formats will have block sizes
|
||||
* of 4x4 or 8x4 pixels, etc.
|
||||
* \param bw returns block width in pixels
|
||||
* \param bh returns block height in pixels
|
||||
*/
|
||||
void
|
||||
_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
|
||||
{
|
||||
const struct gl_format_info *info = _mesa_get_format_info(format);
|
||||
*bw = info->BlockWidth;
|
||||
*bh = info->BlockHeight;
|
||||
}
|
||||
|
||||
|
||||
/** Is the given format a compressed format? */
|
||||
GLboolean
|
||||
_mesa_is_format_compressed(gl_format format)
|
||||
|
|
|
|||
|
|
@ -155,6 +155,9 @@ _mesa_get_format_datatype(gl_format format);
|
|||
extern GLenum
|
||||
_mesa_get_format_base_format(gl_format format);
|
||||
|
||||
extern void
|
||||
_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_is_format_compressed(gl_format format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue