int getNumUsedChannels (TextureFormat::ChannelOrder order)
{
// make sure this table is updated if type table is updated
- DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 16);
+ DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 18);
switch (order)
{
case TextureFormat::RGBA: return 4;
case TextureFormat::ARGB: return 4;
case TextureFormat::BGRA: return 4;
+ case TextureFormat::sR: return 1;
+ case TextureFormat::sRG: return 2;
case TextureFormat::sRGB: return 3;
case TextureFormat::sRGBA: return 4;
case TextureFormat::D: return 1;
const TextureSwizzle& getChannelReadSwizzle (TextureFormat::ChannelOrder order)
{
// make sure to update these tables when channel orders are updated
- DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 16);
+ DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 18);
static const TextureSwizzle INV = {{ TextureSwizzle::CHANNEL_ZERO, TextureSwizzle::CHANNEL_ZERO, TextureSwizzle::CHANNEL_ZERO, TextureSwizzle::CHANNEL_ONE }};
static const TextureSwizzle R = {{ TextureSwizzle::CHANNEL_0, TextureSwizzle::CHANNEL_ZERO, TextureSwizzle::CHANNEL_ZERO, TextureSwizzle::CHANNEL_ONE }};
case TextureFormat::RGBA: return RGBA;
case TextureFormat::ARGB: return ARGB;
case TextureFormat::BGRA: return BGRA;
+ case TextureFormat::sR: return R;
+ case TextureFormat::sRG: return RG;
case TextureFormat::sRGB: return RGB;
case TextureFormat::sRGBA: return RGBA;
case TextureFormat::D: return D;
const TextureSwizzle& getChannelWriteSwizzle (TextureFormat::ChannelOrder order)
{
// make sure to update these tables when channel orders are updated
- DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 16);
+ DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 18);
static const TextureSwizzle INV = {{ TextureSwizzle::CHANNEL_LAST, TextureSwizzle::CHANNEL_LAST, TextureSwizzle::CHANNEL_LAST, TextureSwizzle::CHANNEL_LAST }};
static const TextureSwizzle R = {{ TextureSwizzle::CHANNEL_0, TextureSwizzle::CHANNEL_LAST, TextureSwizzle::CHANNEL_LAST, TextureSwizzle::CHANNEL_LAST }};
case TextureFormat::RGBA: return RGBA;
case TextureFormat::ARGB: return ARGB;
case TextureFormat::BGRA: return BGRA;
+ case TextureFormat::sR: return R;
+ case TextureFormat::sRG: return RG;
case TextureFormat::sRGB: return RGB;
case TextureFormat::sRGBA: return RGBA;
case TextureFormat::D: return D;
"ARGB",
"BGRA",
+ "sR",
+ "sRG",
"sRGB",
"sRGBA",