Get_pixel_size still assumes a component size of at least one byte.
{
switch(pf)
{
+ case R8:
+ case RG8:
+ case RGB8:
+ case RGBA8:
+ case SRGB8:
+ case SRGB8_ALPHA8:
+ case LUMINANCE8:
+ case LUMINANCE8_ALPHA8:
+ case SLUMINANCE8:
+ case SLUMINANCE8_ALPHA8:
+ return 1;
case R16F:
case RG16F:
case RGB16F:
case DEPTH_COMPONENT32:
return 4;
default:
- return 1;
+ return 0;
}
}
unsigned get_pixel_size(PixelFormat pf)
{
- return get_component_count(pf)*get_component_size(pf);
+ return get_component_count(pf)*max(get_component_size(pf), 1U);
}
void require_pixelformat(PixelFormat pf)