mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 13:50:25 +01:00
mesa: Add _mesa_cpal_compressed_format_type
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Jin Yang <jin.a.yang@intel.com>
This commit is contained in:
parent
a2cab751be
commit
b433e7ba07
2 changed files with 20 additions and 0 deletions
|
|
@ -152,6 +152,22 @@ cpal_get_info(GLint level, GLenum internalFormat,
|
|||
return info;
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_cpal_compressed_format_type(GLenum internalFormat, GLenum *format,
|
||||
GLenum *type)
|
||||
{
|
||||
const struct cpal_format_info *info;
|
||||
|
||||
if (internalFormat < GL_PALETTE4_RGB8_OES
|
||||
|| internalFormat > GL_PALETTE8_RGB5_A1_OES) {
|
||||
return;
|
||||
}
|
||||
|
||||
info = &formats[internalFormat - GL_PALETTE4_RGB8_OES];
|
||||
*format = info->format;
|
||||
*type = info->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a call to glCompressedTexImage2D() where internalFormat is a
|
||||
* compressed palette format into a regular GLubyte/RGBA glTexImage2D() call.
|
||||
|
|
|
|||
|
|
@ -38,4 +38,8 @@ extern unsigned
|
|||
_mesa_cpal_compressed_size(int level, GLenum internalFormat,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
extern void
|
||||
_mesa_cpal_compressed_format_type(GLenum internalFormat, GLenum *format,
|
||||
GLenum *type);
|
||||
|
||||
#endif /* TEXPAL_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue