mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fix OpenGL ES luminance formats (which aren't deprecated in GLES)
This commit is contained in:
parent
98a86bf43a
commit
30fc995a2d
@ -8341,7 +8341,7 @@ get_external_image_format(Texture *tex) const {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case Texture::F_alpha:
|
case Texture::F_alpha:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
return GL_ALPHA;
|
return GL_ALPHA;
|
||||||
#else
|
#else
|
||||||
return GL_RED;
|
return GL_RED;
|
||||||
@ -8386,7 +8386,7 @@ get_external_image_format(Texture *tex) const {
|
|||||||
|
|
||||||
case Texture::F_luminance:
|
case Texture::F_luminance:
|
||||||
case Texture::F_sluminance:
|
case Texture::F_sluminance:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
return GL_LUMINANCE;
|
return GL_LUMINANCE;
|
||||||
#else
|
#else
|
||||||
return GL_RED;
|
return GL_RED;
|
||||||
@ -8394,7 +8394,7 @@ get_external_image_format(Texture *tex) const {
|
|||||||
case Texture::F_luminance_alphamask:
|
case Texture::F_luminance_alphamask:
|
||||||
case Texture::F_luminance_alpha:
|
case Texture::F_luminance_alpha:
|
||||||
case Texture::F_sluminance_alpha:
|
case Texture::F_sluminance_alpha:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
return GL_LUMINANCE_ALPHA;
|
return GL_LUMINANCE_ALPHA;
|
||||||
#else
|
#else
|
||||||
return GL_RG;
|
return GL_RG;
|
||||||
@ -8967,14 +8967,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case Texture::F_alpha:
|
case Texture::F_alpha:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
return force_sized ? GL_ALPHA8 : GL_ALPHA;
|
return force_sized ? GL_ALPHA8 : GL_ALPHA;
|
||||||
#else
|
#else
|
||||||
return force_sized ? GL_R8 : GL_RED;
|
return force_sized ? GL_R8 : GL_RED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case Texture::F_luminance:
|
case Texture::F_luminance:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
#ifndef OPENGLES
|
#ifndef OPENGLES
|
||||||
if (tex->get_component_type() == Texture::T_float) {
|
if (tex->get_component_type() == Texture::T_float) {
|
||||||
return GL_LUMINANCE16F_ARB;
|
return GL_LUMINANCE16F_ARB;
|
||||||
@ -8992,7 +8992,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
|
|||||||
#endif
|
#endif
|
||||||
case Texture::F_luminance_alpha:
|
case Texture::F_luminance_alpha:
|
||||||
case Texture::F_luminance_alphamask:
|
case Texture::F_luminance_alphamask:
|
||||||
#ifdef SUPPORT_FIXED_FUNCTION
|
#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES)
|
||||||
#ifndef OPENGLES
|
#ifndef OPENGLES
|
||||||
if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) {
|
if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) {
|
||||||
return GL_LUMINANCE_ALPHA16F_ARB;
|
return GL_LUMINANCE_ALPHA16F_ARB;
|
||||||
@ -11531,7 +11531,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES_2)
|
#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES)
|
||||||
// Do we need to apply a swizzle mask to emulate these deprecated
|
// Do we need to apply a swizzle mask to emulate these deprecated
|
||||||
// texture formats?
|
// texture formats?
|
||||||
switch (tex->get_format()) {
|
switch (tex->get_format()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user