[Mesa-dev] [v3 PATCH 04/10] mesa: add helper convenience functions for fetching geometry of gl_framebuffer
Matt Turner
mattst88 at gmail.com
Thu May 21 16:17:58 PDT 2015
On Thu, May 21, 2015 at 2:30 PM, <kevin.rogovin at intel.com> wrote:
> From: Kevin Rogovin <kevin.rogovin at intel.com>
>
> 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.
>
> v1 -> v2
> Split from patch "mesa:helper-conveniance functions for drivers to implement ARB_framebuffer_no_attachment".
>
> v2 -> v3
> Add error check for functions of extension.
> Implement DSA functions dependent on extension.
>
> Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
> ---
> src/mesa/main/framebuffer.h | 29 +++++++++++++++++++++++++++++
> src/mesa/main/mtypes.h | 8 +++++++-
> 2 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
> index d02b86f..c402ce7 100644
> --- a/src/mesa/main/framebuffer.h
> +++ b/src/mesa/main/framebuffer.h
> @@ -76,6 +76,35 @@ _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;
> +}
> +
> +
Extra new line.
> +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);
More information about the mesa-dev
mailing list