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);
* 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.
*/
bool _HasAttachments;