diff options
author | Kevin Rogovin <kevin.rogovin@intel.com> | 2015-06-17 13:29:53 +0300 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2015-06-17 14:39:03 +0300 |
commit | 74987977a36a7111281e8fb53568dc05dbd3a8b4 (patch) | |
tree | 12744ff94c53156373b6dbeb7a7724ff1b0493c2 /src/mesa/main/framebuffer.h | |
parent | 6aa12994bdf0068a9804204a8f1b197cc0f46ec6 (diff) | |
download | external_mesa3d-74987977a36a7111281e8fb53568dc05dbd3a8b4.zip external_mesa3d-74987977a36a7111281e8fb53568dc05dbd3a8b4.tar.gz external_mesa3d-74987977a36a7111281e8fb53568dc05dbd3a8b4.tar.bz2 |
mesa: add helper functions for geometry of gl_framebuffer
Add convenience helper functions for fetching geometry of gl_framebuffer
that return the geometry of the gl_framebuffer instead of the geometry of
the buffers of the gl_framebuffer when then the gl_framebuffer has no
attachments.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
Diffstat (limited to 'src/mesa/main/framebuffer.h')
-rw-r--r-- | src/mesa/main/framebuffer.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index d02b86f..ca286e9 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -76,6 +76,34 @@ _mesa_scissor_bounding_box(const struct gl_context *ctx, const struct gl_framebuffer *buffer, unsigned idx, int *bbox); +static inline GLuint +_mesa_geometric_width(const struct gl_framebuffer *buffer) +{ + return buffer->_HasAttachments ? + buffer->Width : buffer->DefaultGeometry.Width; +} + +static inline GLuint +_mesa_geometric_height(const struct gl_framebuffer *buffer) +{ + return buffer->_HasAttachments ? + buffer->Height : buffer->DefaultGeometry.Height; +} + +static inline GLuint +_mesa_geometric_samples(const struct gl_framebuffer *buffer) +{ + return buffer->_HasAttachments ? + buffer->Visual.samples : buffer->DefaultGeometry.NumSamples; +} + +static inline GLuint +_mesa_geometric_layers(const struct gl_framebuffer *buffer) +{ + return buffer->_HasAttachments ? + buffer->MaxNumLayers : buffer->DefaultGeometry.Layers; +} + extern void _mesa_update_draw_buffer_bounds(struct gl_context *ctx, struct gl_framebuffer *drawFb); |