mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
mesa: change _mesa_format_to_type_and_comps() format parameter type
This commit is contained in:
parent
bd00a7fa4b
commit
729ff875f4
4 changed files with 10 additions and 11 deletions
|
|
@ -1495,7 +1495,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
|||
struct gl_texture_object *texObj)
|
||||
{
|
||||
const struct gl_texture_image *srcImage;
|
||||
const struct gl_texture_format *convertFormat;
|
||||
gl_format convertFormat;
|
||||
const GLubyte *srcData = NULL;
|
||||
GLubyte *dstData = NULL;
|
||||
GLint level, maxLevels;
|
||||
|
|
@ -1521,11 +1521,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
|||
texObj->Target == GL_TEXTURE_CUBE_MAP_ARB);
|
||||
|
||||
if (srcImage->_BaseFormat == GL_RGB) {
|
||||
convertFormat = &_mesa_texformat_rgb;
|
||||
convertFormat = MESA_FORMAT_RGB;
|
||||
components = 3;
|
||||
}
|
||||
else if (srcImage->_BaseFormat == GL_RGBA) {
|
||||
convertFormat = &_mesa_texformat_rgba;
|
||||
convertFormat = MESA_FORMAT_RGBA;
|
||||
components = 4;
|
||||
}
|
||||
else {
|
||||
|
|
@ -1561,7 +1561,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
|||
}
|
||||
else {
|
||||
/* uncompressed */
|
||||
convertFormat = srcImage->TexFormat;
|
||||
convertFormat = srcImage->TexFormat->MesaFormat;
|
||||
}
|
||||
|
||||
_mesa_format_to_type_and_comps(convertFormat, &datatype, &comps);
|
||||
|
|
@ -1664,7 +1664,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
|
|||
if (dstImage->IsCompressed) {
|
||||
GLubyte *temp;
|
||||
/* compress image from dstData into dstImage->Data */
|
||||
const GLenum srcFormat = convertFormat->BaseFormat;
|
||||
const GLenum srcFormat = _mesa_get_format_base_format(convertFormat);
|
||||
GLint dstRowStride
|
||||
= _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth);
|
||||
const StoreTexImageFunc storeImage =
|
||||
|
|
|
|||
|
|
@ -1351,14 +1351,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
|
|||
|
||||
|
||||
/**
|
||||
* Return datatype and number of components per texel for the
|
||||
* given gl_texture_format.
|
||||
* Return datatype and number of components per texel for the given gl_format.
|
||||
*/
|
||||
void
|
||||
_mesa_format_to_type_and_comps(const struct gl_texture_format *format,
|
||||
_mesa_format_to_type_and_comps(gl_format format,
|
||||
GLenum *datatype, GLuint *comps)
|
||||
{
|
||||
switch (format->MesaFormat) {
|
||||
switch (format) {
|
||||
case MESA_FORMAT_RGBA8888:
|
||||
case MESA_FORMAT_RGBA8888_REV:
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
|
|||
|
||||
|
||||
extern void
|
||||
_mesa_format_to_type_and_comps(const struct gl_texture_format *format,
|
||||
_mesa_format_to_type_and_comps(gl_format format,
|
||||
GLenum *datatype, GLuint *comps);
|
||||
|
||||
extern FetchTexelFuncF
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
|
|||
|
||||
assert(target != GL_TEXTURE_3D); /* not done yet */
|
||||
|
||||
_mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat,
|
||||
_mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat->MesaFormat,
|
||||
&datatype, &comps);
|
||||
|
||||
for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue