mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.
(cherry-picked from commit d1fc920f61)
This commit is contained in:
parent
4a14f76c69
commit
c66ffcf663
1 changed files with 11 additions and 2 deletions
|
|
@ -78,6 +78,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &intel->ctx;
|
struct gl_context *ctx = &intel->ctx;
|
||||||
struct intel_renderbuffer *irb;
|
struct intel_renderbuffer *irb;
|
||||||
|
bool copy_supported = false;
|
||||||
bool copy_supported_with_alpha_override = false;
|
bool copy_supported_with_alpha_override = false;
|
||||||
|
|
||||||
intel_prepare_render(intel);
|
intel_prepare_render(intel);
|
||||||
|
|
@ -90,13 +91,21 @@ do_copy_texsubimage(struct intel_context *intel,
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy_supported = intelImage->base.TexFormat == irb->Base.Format;
|
||||||
|
|
||||||
|
/* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
|
||||||
|
if (irb->Base.Format == MESA_FORMAT_ARGB8888 &&
|
||||||
|
intelImage->base.TexFormat == MESA_FORMAT_XRGB8888) {
|
||||||
|
copy_supported = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Converting XRGB8888 to ARGB8888 requires setting the alpha bits to 1.0 */
|
||||||
if (irb->Base.Format == MESA_FORMAT_XRGB8888 &&
|
if (irb->Base.Format == MESA_FORMAT_XRGB8888 &&
|
||||||
intelImage->base.TexFormat == MESA_FORMAT_ARGB8888) {
|
intelImage->base.TexFormat == MESA_FORMAT_ARGB8888) {
|
||||||
copy_supported_with_alpha_override = true;
|
copy_supported_with_alpha_override = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intelImage->base.TexFormat != irb->Base.Format &&
|
if (!copy_supported && !copy_supported_with_alpha_override) {
|
||||||
!copy_supported_with_alpha_override) {
|
|
||||||
if (unlikely(INTEL_DEBUG & DEBUG_FALLBACKS))
|
if (unlikely(INTEL_DEBUG & DEBUG_FALLBACKS))
|
||||||
fprintf(stderr, "%s mismatched formats %s, %s\n",
|
fprintf(stderr, "%s mismatched formats %s, %s\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue