mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-06 21:28:15 +02:00
progs/tests: debug code for getting texture component sizes
This commit is contained in:
parent
7ccf60ae40
commit
a017ad2861
2 changed files with 17 additions and 2 deletions
|
|
@ -192,12 +192,15 @@ MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap)
|
|||
}
|
||||
|
||||
if (0) {
|
||||
GLint r, g, b, a;
|
||||
GLint r, g, b, a, l, i;
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a);
|
||||
printf("sizes: %d %d %d %d\n", r, g, b, a);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_LUMINANCE_SIZE, &l);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTENSITY_SIZE, &i);
|
||||
printf("IntFormat: 0x%x R %d G %d B %d A %d L %d I %d\n",
|
||||
intFormat, r, g, b, a, l, i);
|
||||
glGetError();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -181,6 +181,18 @@ static void ReInit( GLenum TC, TEXTURE *Tx )
|
|||
GL_TEXTURE_INTERNAL_FORMAT, &v);
|
||||
printf("Requested internal format = 0x%x, actual = 0x%x\n", TC, v);
|
||||
|
||||
if (0) {
|
||||
GLint r, g, b, a, l, i;
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_LUMINANCE_SIZE, &l);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTENSITY_SIZE, &i);
|
||||
printf("Compressed Bits per R: %d G: %d B: %d A: %d L: %d I: %d\n",
|
||||
r, g, b, a, l, i);
|
||||
}
|
||||
|
||||
/* okay, now cache the compressed texture */
|
||||
Tx->TC = TC;
|
||||
if (Tx->cData != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue