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:
parent
d63283860a
commit
0e4f341418
|
@ -197,11 +197,7 @@ struct glamor_saved_procs {
|
||||||
SetWindowPixmapProcPtr set_window_pixmap;
|
SetWindowPixmapProcPtr set_window_pixmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef GLAMOR_GLES2
|
|
||||||
#define CACHE_FORMAT_COUNT 3
|
#define CACHE_FORMAT_COUNT 3
|
||||||
#else
|
|
||||||
#define CACHE_FORMAT_COUNT 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CACHE_BUCKET_WCOUNT 4
|
#define CACHE_BUCKET_WCOUNT 4
|
||||||
#define CACHE_BUCKET_HCOUNT 4
|
#define CACHE_BUCKET_HCOUNT 4
|
||||||
|
|
|
@ -1020,20 +1020,6 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
|
||||||
return 0;
|
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
|
#else
|
||||||
#define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst)
|
#define IS_LITTLE_ENDIAN (IMAGE_BYTE_ORDER == LSBFirst)
|
||||||
|
|
||||||
|
@ -1206,6 +1192,8 @@ glamor_get_tex_format_type_from_pictformat(PictFormatShort format,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
inline static int
|
inline static int
|
||||||
cache_format(GLenum format)
|
cache_format(GLenum format)
|
||||||
{
|
{
|
||||||
|
@ -1221,8 +1209,6 @@ cache_format(GLenum format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap,
|
glamor_get_tex_format_type_from_pixmap(PixmapPtr pixmap,
|
||||||
GLenum * format,
|
GLenum * format,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user