diff options
author | Brian Paul <[email protected]> | 2009-01-16 13:31:04 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-01-16 13:31:04 -0700 |
commit | 345a08a77fa16f58ef956c896f1bf5f4cf118243 (patch) | |
tree | ce1e8c158a8dc2650d496a29cd14a62e6c319025 /src/mesa/drivers/dri/intel/intel_fbo.h | |
parent | 12c6d28cc7ef36a27389003e9898b512b6f722f9 (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/intel/intel_fbo.h')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.h | 17 |
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 */ |