From 345a08a77fa16f58ef956c896f1bf5f4cf118243 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Jan 2009 13:31:04 -0700 Subject: intel: added intel_rendering_to_texture() helper function. When we're rendering to textures we have to invert the viewport transformation. This helper cleans up that test and can be used elsewhere... --- src/mesa/drivers/dri/intel/intel_fbo.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mesa/drivers/dri/intel/intel_fbo.h') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 9d15582d78c..c57a01c759b 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -111,5 +111,22 @@ extern struct intel_region *intel_get_rb_region(struct gl_framebuffer *fb, +/** + * Are we currently rendering into a texture? + */ +static INLINE GLboolean +intel_rendering_to_texture(const GLcontext *ctx) +{ + if (ctx->DrawBuffer->Name) { + /* User-created FBO */ + const struct intel_renderbuffer *irb = + intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); + return irb && irb->RenderToTexture; + } + else { + return GL_FALSE; + } +} + #endif /* INTEL_FBO_H */ -- cgit v1.2.3