summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-01-16 13:31:04 -0700
committerBrian Paul <[email protected]>2009-01-16 13:31:04 -0700
commit345a08a77fa16f58ef956c896f1bf5f4cf118243 (patch)
treece1e8c158a8dc2650d496a29cd14a62e6c319025 /src/mesa/drivers/dri
parent12c6d28cc7ef36a27389003e9898b512b6f722f9 (diff)
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...
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.h17
1 files changed, 17 insertions, 0 deletions
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 */