Re: [Mesa-dev] [v4 PATCH 04/10] mesa: add helper functions for geometry of gl_framebuffer

2015-06-09 Thread Ian Romanick
With the whitespace issues pointed out by Ilia fixed (which I noticed
too... lol), this patch is

Reviewed-by: Ian Romanick ian.d.roman...@intel.com

On 05/27/2015 02:49 AM, Kevin Rogovin wrote:
 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.
 
 v2:
  Split from patch mesa:helper-conveniance functions for drivers to implement 
 ARB_framebuffer_no_attachment.
 
 v3:
  Add error check for functions of extension.
  Implement DSA functions dependent on extension.
 
 v4:
  Formatting fixes.
 
 Signed-off-by: Kevin Rogovin kevin.rogo...@intel.com
 ---
  src/mesa/main/framebuffer.h | 28 
  src/mesa/main/mtypes.h  |  8 +++-
  2 files changed, 35 insertions(+), 1 deletion(-)
 
 diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
 index d02b86f..8b2aa34 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);
 diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
 index 5abbc0a..08316dc 100644
 --- a/src/mesa/main/mtypes.h
 +++ b/src/mesa/main/mtypes.h
 @@ -3187,7 +3187,13 @@ struct gl_framebuffer
  * GL_ARB_framebuffer_no_attachments must check for the flag 
 _HasAttachments
  * and if GL_FALSE, must then use the values in DefaultGeometry to 
 initialize
  * its viewport, scissor and so on (in particular _Xmin, _Xmax, _Ymin and
 -* _Ymax do NOT take into account _HasAttachments being false)
 +* _Ymax do NOT take into account _HasAttachments being false). To get the
 +* geometry of the framebuffer, the  helper functions
 +*   _mesa_geometric_width(),
 +*   _mesa_geometric_height(),
 +*   _mesa_geometric_samples() and
 +*   _mesa_geometric_layers()
 +* are available that check _HasAttachments.
  */
 GLboolean _HasAttachments;
  
 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [v4 PATCH 04/10] mesa: add helper functions for geometry of gl_framebuffer

2015-05-27 Thread Ilia Mirkin
More trivia:

On Wed, May 27, 2015 at 5:49 AM, Kevin Rogovin kevin.rogo...@intel.com wrote:
 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.

 v2:
  Split from patch mesa:helper-conveniance functions for drivers to implement 
 ARB_framebuffer_no_attachment.

 v3:
  Add error check for functions of extension.
  Implement DSA functions dependent on extension.

 v4:
  Formatting fixes.

 Signed-off-by: Kevin Rogovin kevin.rogo...@intel.com
 ---
  src/mesa/main/framebuffer.h | 28 
  src/mesa/main/mtypes.h  |  8 +++-
  2 files changed, 35 insertions(+), 1 deletion(-)

 diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
 index d02b86f..8b2aa34 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

Here and below, why 2 spaces between inline and 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);
 diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
 index 5abbc0a..08316dc 100644
 --- a/src/mesa/main/mtypes.h
 +++ b/src/mesa/main/mtypes.h
 @@ -3187,7 +3187,13 @@ struct gl_framebuffer
  * GL_ARB_framebuffer_no_attachments must check for the flag 
 _HasAttachments
  * and if GL_FALSE, must then use the values in DefaultGeometry to 
 initialize
  * its viewport, scissor and so on (in particular _Xmin, _Xmax, _Ymin and
 -* _Ymax do NOT take into account _HasAttachments being false)
 +* _Ymax do NOT take into account _HasAttachments being false). To get the
 +* geometry of the framebuffer, the  helper functions

Why 2 spaces between the and helper?

 +*   _mesa_geometric_width(),
 +*   _mesa_geometric_height(),
 +*   _mesa_geometric_samples() and
 +*   _mesa_geometric_layers()
 +* are available that check _HasAttachments.
  */
 GLboolean _HasAttachments;

 --
 1.9.1

 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [v4 PATCH 04/10] mesa: add helper functions for geometry of gl_framebuffer

2015-05-27 Thread Rogovin, Kevin

 You should wait until you get a real review from someone before reposting.

I think that is good advice. Indeed, I am not going to post a v5 of this series 
until for each patch there is:

 Two review bys, possibly qualified with fix the mentioned formatting issues
OR
 Specific change requests. 

The patch series has not really changed in any meaningful way (in terms of 
compiled output) since v2.

-Kevin
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [v4 PATCH 04/10] mesa: add helper functions for geometry of gl_framebuffer

2015-05-27 Thread Rogovin, Kevin
Hi, 
 +static inline  GLuint
Here and below, why 2 spaces between inline and GLuint?

I have no clue.  I suspect it is a scar from  some search/replace fiasco over 3 
weeks ago. You are the first person who spotted that nit.

 --- a/src/mesa/main/mtypes.h
 +++ b/src/mesa/main/mtypes.h
 @@ -3187,7 +3187,13 @@ struct gl_framebuffer
  * GL_ARB_framebuffer_no_attachments must check for the flag 
 _HasAttachments
  * and if GL_FALSE, must then use the values in DefaultGeometry to 
 initialize
  * its viewport, scissor and so on (in particular _Xmin, _Xmax, _Ymin and
 -* _Ymax do NOT take into account _HasAttachments being false)
 +* _Ymax do NOT take into account _HasAttachments being false). To get 
 the
 +* geometry of the framebuffer, the  helper functions

 Why 2 spaces between the and helper?

No clue. You are again the first person to spot that space. 

It would be nice to get a fix these nits I found and get a reviewed by badge.

-Kevin
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [v4 PATCH 04/10] mesa: add helper functions for geometry of gl_framebuffer

2015-05-27 Thread Ilia Mirkin
On Wed, May 27, 2015 at 9:21 AM, Rogovin, Kevin kevin.rogo...@intel.com wrote:
 Hi,
 +static inline  GLuint
Here and below, why 2 spaces between inline and GLuint?

 I have no clue.  I suspect it is a scar from  some search/replace fiasco over 
 3 weeks ago. You are the first person who spotted that nit.

 --- a/src/mesa/main/mtypes.h
 +++ b/src/mesa/main/mtypes.h
 @@ -3187,7 +3187,13 @@ struct gl_framebuffer
  * GL_ARB_framebuffer_no_attachments must check for the flag 
 _HasAttachments
  * and if GL_FALSE, must then use the values in DefaultGeometry to 
 initialize
  * its viewport, scissor and so on (in particular _Xmin, _Xmax, _Ymin 
  and
 -* _Ymax do NOT take into account _HasAttachments being false)
 +* _Ymax do NOT take into account _HasAttachments being false). To get 
 the
 +* geometry of the framebuffer, the  helper functions

 Why 2 spaces between the and helper?

 No clue. You are again the first person to spot that space.

 It would be nice to get a fix these nits I found and get a reviewed by 
 badge.

Unfortunately I'm not in a great position to do that -- I'm good at
noticing simple issues, but I'm not always familiar with the larger GL
implications. Framebuffers are still a bit in the great unknown for me
(but I think I've finally mastered the concept of a texture). But I
glanced at your patches and spotted a couple of things that seemed
odd, so figured I'd point them out. You should wait until you get a
real review from someone before reposting.

Cheers,

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev