summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-03-17 16:26:42 -0700
committerEric Anholt <[email protected]>2014-04-15 14:34:22 -0700
commitcd808ac848227b850a80c1adbb43ce57ca7d673a (patch)
treeec6dc850e427bf7a4984edefe0e6df362b39e4f8 /src/mesa/drivers/common/meta.c
parent4cc42805e72d7edba0599f4d45099b4ed97ec185 (diff)
meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.
I need to do the same code again for CopyTexSubImage(). v2: Drop incorrect, not-terribly-useful comment (review by Ken) Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index acf927b09a0..ca5d851fff1 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -93,6 +93,36 @@ static void meta_glsl_clear_cleanup(struct clear_state *clear);
static void meta_decompress_cleanup(struct decompress_state *decompress);
static void meta_drawpix_cleanup(struct drawpix_state *drawpix);
+void
+_mesa_meta_bind_fbo_image(struct gl_texture_object *texObj, GLenum target,
+ GLuint level, GLuint layer)
+{
+ switch (target) {
+ case GL_TEXTURE_1D:
+ _mesa_FramebufferTexture1D(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ target,
+ texObj->Name,
+ level);
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_3D:
+ _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ texObj->Name,
+ level,
+ layer);
+ break;
+ default: /* 2D / cube */
+ _mesa_FramebufferTexture2D(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ target,
+ texObj->Name,
+ level);
+ }
+}
+
GLuint
_mesa_meta_compile_shader_with_debug(struct gl_context *ctx, GLenum target,
const GLcharARB *source)