mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
mesa: override_internal_format() function for debug/test purposes (disabled)
This commit is contained in:
parent
8a8919a7dd
commit
1826ff3fb3
1 changed files with 49 additions and 0 deletions
|
|
@ -2440,6 +2440,49 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Debug helper: override the user-requested internal format */
|
||||||
|
static GLenum
|
||||||
|
override_internal_format(GLenum internalFormat, GLint width, GLint height)
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
if (internalFormat == GL_RGBA16F_ARB ||
|
||||||
|
internalFormat == GL_RGBA32F_ARB) {
|
||||||
|
printf("Convert rgba float tex to int %d x %d\n", width, height);
|
||||||
|
return GL_RGBA;
|
||||||
|
}
|
||||||
|
else if (internalFormat == GL_RGB16F_ARB ||
|
||||||
|
internalFormat == GL_RGB32F_ARB) {
|
||||||
|
printf("Convert rgb float tex to int %d x %d\n", width, height);
|
||||||
|
return GL_RGB;
|
||||||
|
}
|
||||||
|
else if (internalFormat == GL_LUMINANCE_ALPHA16F_ARB ||
|
||||||
|
internalFormat == GL_LUMINANCE_ALPHA32F_ARB) {
|
||||||
|
printf("Convert luminance float tex to int %d x %d\n", width, height);
|
||||||
|
return GL_LUMINANCE_ALPHA;
|
||||||
|
}
|
||||||
|
else if (internalFormat == GL_LUMINANCE16F_ARB ||
|
||||||
|
internalFormat == GL_LUMINANCE32F_ARB) {
|
||||||
|
printf("Convert luminance float tex to int %d x %d\n", width, height);
|
||||||
|
return GL_LUMINANCE;
|
||||||
|
}
|
||||||
|
else if (internalFormat == GL_ALPHA16F_ARB ||
|
||||||
|
internalFormat == GL_ALPHA32F_ARB) {
|
||||||
|
printf("Convert luminance float tex to int %d x %d\n", width, height);
|
||||||
|
return GL_ALPHA;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
else if (internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) {
|
||||||
|
internalFormat = GL_RGBA;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
else {
|
||||||
|
return internalFormat;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return internalFormat;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called from the API. Note that width includes the border.
|
* Called from the API. Note that width includes the border.
|
||||||
|
|
@ -2453,6 +2496,8 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||||
|
|
||||||
|
internalFormat = override_internal_format(internalFormat, width, 1);
|
||||||
|
|
||||||
#if FEATURE_convolve
|
#if FEATURE_convolve
|
||||||
if (_mesa_is_color_format(internalFormat)) {
|
if (_mesa_is_color_format(internalFormat)) {
|
||||||
_mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL);
|
_mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL);
|
||||||
|
|
@ -2550,6 +2595,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||||
|
|
||||||
|
internalFormat = override_internal_format(internalFormat, width, height);
|
||||||
|
|
||||||
#if FEATURE_convolve
|
#if FEATURE_convolve
|
||||||
if (_mesa_is_color_format(internalFormat)) {
|
if (_mesa_is_color_format(internalFormat)) {
|
||||||
_mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth,
|
_mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth,
|
||||||
|
|
@ -2664,6 +2711,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||||
|
|
||||||
|
internalFormat = override_internal_format(internalFormat, width, height);
|
||||||
|
|
||||||
if (target == GL_TEXTURE_3D ||
|
if (target == GL_TEXTURE_3D ||
|
||||||
(ctx->Extensions.MESA_texture_array &&
|
(ctx->Extensions.MESA_texture_array &&
|
||||||
target == GL_TEXTURE_2D_ARRAY_EXT)) {
|
target == GL_TEXTURE_2D_ARRAY_EXT)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue