From: Brian Paul Date: Fri, 16 Jan 2009 20:31:04 +0000 (-0700) Subject: intel: added intel_rendering_to_texture() helper function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=345a08a77fa16f58ef956c896f1bf5f4cf118243;p=mesa.git 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... --- 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 */