mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
ARB_texture_rg: Correct some errors in RED / RG internal format handling
Fixes several problems: The half-float, float, and integer internal formats depend on ARB_texture_rg and other extensions. RG_INTEGER is not a valid internal format. Generic compressed formats depend on ARB_texture_rg, not EXT_texture_compression_rgtc. Use GL_RED instead of GL_R.
This commit is contained in:
parent
bb45ab0a96
commit
3ebbc176f9
1 changed files with 32 additions and 9 deletions
|
|
@ -403,29 +403,54 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
|
|||
|
||||
if (ctx->Extensions.ARB_texture_rg) {
|
||||
switch (internalFormat) {
|
||||
case GL_R8:
|
||||
case GL_R16:
|
||||
case GL_R16F:
|
||||
/* R16F depends on both ARB_half_float_pixel and ARB_texture_float.
|
||||
*/
|
||||
if (!ctx->Extensions.ARB_half_float_pixel)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_R32F:
|
||||
if (!ctx->Extensions.ARB_texture_float)
|
||||
break;
|
||||
return GL_RED;
|
||||
case GL_R8I:
|
||||
case GL_R8UI:
|
||||
case GL_R16I:
|
||||
case GL_R16UI:
|
||||
case GL_R32I:
|
||||
case GL_R32UI:
|
||||
return GL_R;
|
||||
case GL_RG:
|
||||
case GL_RG_INTEGER:
|
||||
case GL_RG8:
|
||||
case GL_RG16:
|
||||
if (!ctx->Extensions.EXT_texture_integer)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_R8:
|
||||
case GL_R16:
|
||||
case GL_RED:
|
||||
case GL_COMPRESSED_RED:
|
||||
return GL_RED;
|
||||
|
||||
case GL_RG16F:
|
||||
/* RG16F depends on both ARB_half_float_pixel and ARB_texture_float.
|
||||
*/
|
||||
if (!ctx->Extensions.ARB_half_float_pixel)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_RG32F:
|
||||
if (!ctx->Extensions.ARB_texture_float)
|
||||
break;
|
||||
return GL_RG;
|
||||
case GL_RG8I:
|
||||
case GL_RG8UI:
|
||||
case GL_RG16I:
|
||||
case GL_RG16UI:
|
||||
case GL_RG32I:
|
||||
case GL_RG32UI:
|
||||
if (!ctx->Extensions.EXT_texture_integer)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_RG:
|
||||
case GL_RG8:
|
||||
case GL_RG16:
|
||||
case GL_COMPRESSED_RG:
|
||||
return GL_RG;
|
||||
default:
|
||||
; /* fallthrough */
|
||||
|
|
@ -463,11 +488,9 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
|
|||
|
||||
if (ctx->Extensions.EXT_texture_compression_rgtc) {
|
||||
switch (internalFormat) {
|
||||
case GL_COMPRESSED_RED:
|
||||
case GL_COMPRESSED_RED_RGTC1_EXT:
|
||||
case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
|
||||
return GL_RED;
|
||||
case GL_COMPRESSED_RG:
|
||||
case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
|
||||
case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
|
||||
return GL_RG;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue