--- /dev/null
+extension ARB_depth_texture
case LUMINANCE_ALPHA32F:
case SLUMINANCE_ALPHA:
case SLUMINANCE8_ALPHA8: return LUMINANCE_ALPHA;
+ case DEPTH_COMPONENT16:
+ case DEPTH_COMPONENT24:
+ case DEPTH_COMPONENT32: return DEPTH_COMPONENT;
default: return pf;
}
}
case RGBA16F:
case LUMINANCE16F:
case LUMINANCE_ALPHA16F:
+ case DEPTH_COMPONENT16:
return 2;
+ case DEPTH_COMPONENT24:
+ return 3;
case RGB32F:
case RGBA32F:
case LUMINANCE32F:
case LUMINANCE_ALPHA32F:
+ case DEPTH_COMPONENT32:
return 4;
default:
return 1;
case BGRA:
{ static Require _req(EXT_bgra); }
break;
+ case DEPTH_COMPONENT:
+ case DEPTH_COMPONENT16:
+ case DEPTH_COMPONENT24:
+ case DEPTH_COMPONENT32:
+ { static Require _req(ARB_depth_texture); }
+ break;
default:
break;
}
#include <msp/graphics/pixelformat.h>
#include <msp/strings/lexicalcast.h>
#include "gl.h"
+#include <msp/gl/extensions/arb_depth_texture.h>
#include <msp/gl/extensions/arb_texture_float.h>
#include <msp/gl/extensions/ext_bgra.h>
#include <msp/gl/extensions/ext_texture_srgb.h>
{
STENCIL_INDEX = GL_STENCIL_INDEX,
DEPTH_COMPONENT = GL_DEPTH_COMPONENT,
+ DEPTH_COMPONENT16 = GL_DEPTH_COMPONENT16,
+ DEPTH_COMPONENT24 = GL_DEPTH_COMPONENT24,
+ DEPTH_COMPONENT32 = GL_DEPTH_COMPONENT32,
RGB = GL_RGB,
RGBA = GL_RGBA,
RGB8 = GL_RGB8,
DataType Texture::get_alloc_type(PixelFormat fmt)
{
- return (fmt==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE);
+ return (get_base_pixelformat(fmt)==DEPTH_COMPONENT ? UNSIGNED_SHORT : UNSIGNED_BYTE);
}
void Texture::update_parameter(int mask) const