[Mesa-dev] [PATCH 9/9] meta: Support BlitFramebuffer from all the other texture targets.
Eric Anholt
eric at anholt.net
Tue Apr 8 14:03:20 PDT 2014
There's already code for them due to the GenerateMipmap path, so we just
need to make sure we've got our coordinates present.
v2: Apply De Morgan's law (review by Ken)
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/common/meta_blit.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index 3f91082..6f52bee 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -397,16 +397,6 @@ blitframebuffer_texture(struct gl_context *ctx,
srcLevel = readAtt->TextureLevel;
texObj = readAtt->Texture;
target = texObj->Target;
-
- switch (target) {
- case GL_TEXTURE_2D:
- case GL_TEXTURE_RECTANGLE:
- case GL_TEXTURE_2D_MULTISAMPLE:
- case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
- break;
- default:
- return false;
- }
} else if (ctx->Driver.BindRenderbufferTexImage) {
/* Otherwise, we need the driver to be able to bind a renderbuffer as
* a texture image.
@@ -551,7 +541,9 @@ blitframebuffer_texture(struct gl_context *ctx,
struct vertex verts[4];
GLfloat s0, t0, s1, t1;
- if (target == GL_TEXTURE_2D) {
+ if (target != GL_TEXTURE_RECTANGLE_ARB &&
+ target != GL_TEXTURE_2D_MULTISAMPLE &&
+ target != GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
const struct gl_texture_image *texImage
= _mesa_select_tex_image(ctx, texObj, target, srcLevel);
s0 = srcX0 / (float) texImage->Width;
@@ -560,9 +552,6 @@ blitframebuffer_texture(struct gl_context *ctx,
t1 = srcY1 / (float) texImage->Height;
}
else {
- assert(target == GL_TEXTURE_RECTANGLE_ARB ||
- target == GL_TEXTURE_2D_MULTISAMPLE ||
- target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY);
s0 = (float) srcX0;
s1 = (float) srcX1;
t0 = (float) srcY0;
--
1.9.1
More information about the mesa-dev
mailing list