summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 1a178988b68..d05c870128c 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -224,7 +224,19 @@ static mesa_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
const GLuint ui = 1;
const GLubyte littleEndian = *((const GLubyte *)&ui);
- if (fbo)
+
+ /* Unfortunately, regardless the fbo flag, we might still be asked to
+ * attach a texture to a fbo later, which then won't succeed if we chose
+ * one which isn't renderable. And unlike more exotic formats, apps aren't
+ * really prepared for the incomplete framebuffer this results in (they'd
+ * have to retry with same internalFormat even, just different
+ * srcFormat/srcType, which can't really be expected anyway).
+ * Ideally, we'd defer format selection until later (if the texture is
+ * used as a rt it's likely there's never data uploaded to it before attached
+ * to a fbo), but this isn't really possible, so for now just always use
+ * a renderable format.
+ */
+ if (1 || fbo)
return _radeon_texformat_argb8888;
if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||