fmt = STENCIL_INDEX;
else if(conv.get()=="DEPTH_COMPONENT")
fmt = DEPTH_COMPONENT;
+ else if(conv.get()=="RED")
+ fmt = RED;
+ else if(conv.get()=="RG")
+ fmt = RG;
else if(conv.get()=="RGB")
fmt = RGB;
else if(conv.get()=="RGBA")
{
switch(pf)
{
+ case R8:
+ case R16F:
+ case R32F: return RED;
+ case RG8:
+ case RG16F:
+ case RG32F: return RG;
case RGB8:
case RGB16F:
case RGB32F:
case SRGB_ALPHA:
case SRGB8_ALPHA8: return RGBA;
case LUMINANCE8:
- case LUMINANCE16F:
- case LUMINANCE32F:
case SLUMINANCE:
case SLUMINANCE8: return LUMINANCE;
case LUMINANCE_ALPHA8:
- case LUMINANCE_ALPHA16F:
- case LUMINANCE_ALPHA32F:
case SLUMINANCE_ALPHA:
case SLUMINANCE8_ALPHA8: return LUMINANCE_ALPHA;
case DEPTH_COMPONENT16:
{
switch(pf)
{
+ case RED: return R8;
+ case RG: return RG8;
case RGB: return RGB8;
case RGBA: return RGBA8;
case SRGB: return SRGB8;
{
case STENCIL_INDEX:
case DEPTH_COMPONENT:
+ case RED:
case LUMINANCE:
case SLUMINANCE:
return 1;
+ case RG:
case LUMINANCE_ALPHA:
case SLUMINANCE_ALPHA:
return 2;
{
switch(pf)
{
+ case R16F:
+ case RG16F:
case RGB16F:
case RGBA16F:
- case LUMINANCE16F:
- case LUMINANCE_ALPHA16F:
case DEPTH_COMPONENT16:
return 2;
case DEPTH_COMPONENT24:
return 3;
+ case R32F:
+ case RG32F:
case RGB32F:
case RGBA32F:
- case LUMINANCE32F:
- case LUMINANCE_ALPHA32F:
case DEPTH_COMPONENT32:
return 4;
default:
{
switch(pf)
{
+ case RED:
+ case R8:
+ case RG:
+ case RG8:
+ { static Require _req(ARB_texture_rg); }
+ break;
+ case R16F:
+ case R32F:
+ case RG16F:
+ case RG32F:
+ { static Require _req(ARB_texture_rg); }
+ { static Require _req(ARB_texture_float); }
+ break;
case RGB16F:
case RGB32F:
case RGBA16F:
case RGBA32F:
- case LUMINANCE16F:
- case LUMINANCE32F:
- case LUMINANCE_ALPHA16F:
- case LUMINANCE_ALPHA32F:
{ static Require _req(ARB_texture_float); }
break;
case SRGB:
#include "gl.h"
#include <msp/gl/extensions/arb_depth_texture.h>
#include <msp/gl/extensions/arb_texture_float.h>
+#include <msp/gl/extensions/arb_texture_rg.h>
#include <msp/gl/extensions/ext_bgra.h>
#include <msp/gl/extensions/ext_texture_srgb.h>
#include <msp/gl/extensions/msp_legacy_features.h>
DEPTH_COMPONENT16 = GL_DEPTH_COMPONENT16,
DEPTH_COMPONENT24 = GL_DEPTH_COMPONENT24,
DEPTH_COMPONENT32 = GL_DEPTH_COMPONENT32,
+ RED = GL_RED,
+ RG = GL_RG,
RGB = GL_RGB,
RGBA = GL_RGBA,
+ R8 = GL_R8,
+ R16F = GL_R16F,
+ R32F = GL_R32F,
+ RG8 = GL_RG8,
+ RG16F = GL_RG16F,
+ RG32F = GL_RG32F,
RGB8 = GL_RGB8,
RGB16F = GL_RGB16F,
RGB32F = GL_RGB32F,
BGRA = GL_BGRA,
LUMINANCE = GL_LUMINANCE,
LUMINANCE8 = GL_LUMINANCE8,
- // TODO Remove LUMINANCE(_ALPHA) float formats once ARB_texture_rg becomes supported
- LUMINANCE16F = GL_LUMINANCE16F_ARB,
- LUMINANCE32F = GL_LUMINANCE32F_ARB,
LUMINANCE_ALPHA = GL_LUMINANCE_ALPHA,
LUMINANCE8_ALPHA8 = GL_LUMINANCE8_ALPHA8,
- LUMINANCE_ALPHA16F = GL_LUMINANCE_ALPHA16F_ARB,
- LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB,
SLUMINANCE = GL_SLUMINANCE,
SLUMINANCE8 = GL_SLUMINANCE8,
SLUMINANCE_ALPHA = GL_SLUMINANCE_ALPHA,