diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2006-09-23 16:09:26 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2006-09-23 16:09:26 +0000 |
commit | 1ad12874b30dcb2228621da1f519b846b4975fde (patch) | |
tree | c8bde8b8a3619a4d6619b08ee7b454b750e801df /progs | |
parent | 7b803d649a02fa071b6f82f28e2308e7845d11c4 (diff) |
allocate larger TempImage, use COMBO var to choose test format/type
Diffstat (limited to 'progs')
-rw-r--r-- | progs/demos/readpix.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c index 75ba45c1e5..c0aac2272f 100644 --- a/progs/demos/readpix.c +++ b/progs/demos/readpix.c @@ -29,33 +29,32 @@ static GLboolean ScaleAndBias = GL_FALSE; static GLboolean Benchmark = GL_FALSE; static GLubyte *TempImage = NULL; -#if 0 +#define COMBO 1 +#if COMBO == 0 #define ReadFormat ImgFormat #define ReadType GL_UNSIGNED_BYTE -#endif -#if 1 +#elif COMBO == 1 static GLenum ReadFormat = GL_RGBA; static GLenum ReadType = GL_UNSIGNED_BYTE; -#endif -#if 0 +#elif COMBO == 2 static GLenum ReadFormat = GL_RGB; static GLenum ReadType = GL_UNSIGNED_BYTE; -#endif -#if 0 +#elif COMBO == 3 static GLenum ReadFormat = GL_RGB; static GLenum ReadType = GL_UNSIGNED_SHORT_5_6_5; -#endif -#if 0 +#elif COMBO == 4 static GLenum ReadFormat = GL_RGBA; static GLenum ReadType = GL_UNSIGNED_SHORT_1_5_5_5_REV; -#endif -#if 0 +#elif COMBO == 5 static GLenum ReadFormat = GL_BGRA; static GLenum ReadType = GL_UNSIGNED_SHORT_5_5_5_1; -#endif -#if 0 +#elif COMBO == 6 static GLenum ReadFormat = GL_BGRA; static GLenum ReadType = GL_UNSIGNED_SHORT_4_4_4_4_REV; +#elif COMBO == 7 +static GLenum ReadFormat = GL_RGBA; +static GLenum ReadType = GL_HALF_FLOAT_ARB; +#undef GL_OES_read_format #endif @@ -313,8 +312,10 @@ Init( GLboolean ciMode ) Reset(); - /* allocate an extra 1KB in case we're tinkering with pack alignment */ - TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * sizeof(GLubyte) + /* allocate large TempImage to store and image data type, plus an + * extra 1KB in case we're tinkering with pack alignment. + */ + TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * 4 + 1000); assert(TempImage); } |