mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
mesa: Add a helper function to query 3D block sizes
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
6abb1b4984
commit
9163c37349
2 changed files with 25 additions and 0 deletions
|
|
@ -320,6 +320,27 @@ _mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the block size (in pixels) for the given format. Normally
|
||||
* the block size is 1x1x1. But compressed formats will have block
|
||||
* sizes of 4x4x4, 3x3x3 pixels, etc.
|
||||
* \param bw returns block width in pixels
|
||||
* \param bh returns block height in pixels
|
||||
* \param bd returns block depth in pixels
|
||||
*/
|
||||
void
|
||||
_mesa_get_format_block_size_3d(mesa_format format,
|
||||
GLuint *bw,
|
||||
GLuint *bh,
|
||||
GLuint *bd)
|
||||
{
|
||||
const struct gl_format_info *info = _mesa_get_format_info(format);
|
||||
*bw = info->BlockWidth;
|
||||
*bh = info->BlockHeight;
|
||||
*bd = info->BlockDepth;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the an array of four numbers representing the transformation
|
||||
* from the RGBA or SZ colorspace to the given format. For array formats,
|
||||
|
|
|
|||
|
|
@ -663,6 +663,10 @@ _mesa_get_format_base_format(uint32_t format);
|
|||
extern void
|
||||
_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh);
|
||||
|
||||
extern void
|
||||
_mesa_get_format_block_size_3d(mesa_format format, GLuint *bw,
|
||||
GLuint *bh, GLuint *bd);
|
||||
|
||||
extern mesa_array_format
|
||||
_mesa_array_format_flip_channels(mesa_array_format format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue