X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frenderbuffer.cpp;h=f146a915d64d27c213ef42b192068e4c8d14cd56;hb=ff46db8939d1763eab5bbb4dca711d635fdb5f23;hp=5098362261e45743d396c81ea9bc5b9878d3c9ae;hpb=96fb9a0237a7c3f6fc23406ce50cd1c6fe484111;p=libs%2Fgl.git diff --git a/source/renderbuffer.cpp b/source/renderbuffer.cpp index 50983622..f146a915 100644 --- a/source/renderbuffer.cpp +++ b/source/renderbuffer.cpp @@ -23,11 +23,8 @@ Renderbuffer::~Renderbuffer() 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; } @@ -49,6 +46,9 @@ void Renderbuffer::storage(PixelFormat fmt, unsigned wd, unsigned ht) void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned wd, unsigned ht) { + if(!samples) + return storage(fmt, wd, ht); + static Require _req(EXT_framebuffer_multisample); fmt = normalize_format(fmt); require_pixelformat(fmt);