glamor: Unifdef the cache format indices.

We only ask for GL_RGB on desktop GL as far as I can see, but now if
GLES2 did happen to ask for GL_RGB it would return a cache index
instead of -1.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Eric Anholt 2013-12-27 02:04:11 -08:00
parent d63283860a
commit 0e4f341418
2 changed files with 2 additions and 20 deletions

View File

@ -197,11 +197,7 @@ struct glamor_saved_procs {
SetWindowPixmapProcPtr set_window_pixmap;
};
#ifdef GLAMOR_GLES2
#define CACHE_FORMAT_COUNT 3
#else
#define CACHE_FORMAT_COUNT 2
#endif
#define CACHE_BUCKET_WCOUNT 4
#define CACHE_BUCKET_HCOUNT 4

View File

@ -1020,20 +1020,6 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
return 0;
}
/* Currently, we use RGBA to represent all formats. */
inline static int
cache_format(GLenum format)
{
switch (format) {
case GL_ALPHA:
return 1;
case GL_RGBA:
return 0;
default:
return -1;
}
}
#else
#define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst)
@ -1206,6 +1192,8 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
return 0;
}
#endif
inline static int
cache_format(GLenum format)
{
@ -1221,8 +1209,6 @@ cache_format(GLenum format)
}
}
#endif
static inline int
glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap,
GLenum * format,