summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-09-14 02:39:52 -0700
committerKenneth Graunke <[email protected]>2012-09-15 20:13:09 -0700
commit679c93ff89c71cbd3b1d24e88abd38f00b8c1f02 (patch)
tree609294c7d14e392d1a880a34801afb512dbe8b25 /src/mesa/drivers/common
parentb6c2234c22d5a935012870fa254e68d026ef265e (diff)
meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL errors. One such operation is _mesa_meta_Clear(). On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead. Fixes the ES1 conformance test miplin.c, which was regressed by commit 08be1d288f216232d3974f5997b266a8dd720928. NOTE: This is a candidate for the 9.0 branch. v2: Also blacklist GL_TEXTURE_3D, per Brian's comment. v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297 Reviewed-by: Brian Paul <[email protected]> [v1] Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 80eeff39ef4..3b13ad7f130 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -623,19 +623,24 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
if (ctx->Texture.Unit[u].Enabled ||
ctx->Texture.Unit[u].TexGenEnabled) {
_mesa_ActiveTextureARB(GL_TEXTURE0 + u);
- _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
_mesa_set_enable(ctx, GL_TEXTURE_2D, GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE);
if (ctx->Extensions.ARB_texture_cube_map)
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE);
- if (ctx->Extensions.NV_texture_rectangle)
- _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);
if (ctx->Extensions.OES_EGL_image_external)
_mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
+
+ if (ctx->API == API_OPENGL) {
+ _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE);
+ if (ctx->Extensions.NV_texture_rectangle)
+ _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
+ } else {
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_STR_OES, GL_FALSE);
+ }
}
}
}