}
}
+PixelFormat get_default_sized_pixelformat(PixelFormat pf)
+{
+ pf = get_unsized_pixelformat(pf);
+ unsigned size = 1;
+ if(pf==DEPTH_COMPONENT)
+ {
+ if(get_gl_api()==OPENGL_ES2 && !ARB_depth_buffer_float)
+ size = 2;
+ else
+ size = 4;
+ }
+ return get_sized_pixelformat(pf, size);
+}
+
PixelFormat get_srgb_pixelformat(PixelFormat pf)
{
switch(pf)
PixelFormat get_base_pixelformat(PixelFormat);
PixelFormat get_unsized_pixelformat(PixelFormat);
PixelFormat get_sized_pixelformat(PixelFormat, unsigned = 1);
+PixelFormat get_default_sized_pixelformat(PixelFormat);
PixelFormat get_srgb_pixelformat(PixelFormat);
unsigned get_component_count(PixelFormat);
unsigned get_component_size(PixelFormat);
PixelFormat Renderbuffer::normalize_format(PixelFormat fmt)
{
- if(!get_component_size(fmt) && MSP_sized_internal_formats)
- {
- unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1);
- return get_sized_pixelformat(fmt, size);
- }
+ if(!get_component_size(fmt) && OES_required_internalformat)
+ return get_default_sized_pixelformat(fmt);
return fmt;
}
void Texture::set_internal_format(PixelFormat fmt)
{
- if(!get_component_size(fmt) && MSP_sized_internal_formats)
- {
- unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1);
- fmt = get_sized_pixelformat(fmt, size);
- }
+ if(!get_component_size(fmt) && OES_required_internalformat)
+ fmt = get_default_sized_pixelformat(fmt);
FormatSwizzle swiz = NO_SWIZZLE;
if(ARB_texture_rg && ARB_texture_swizzle)