st/mesa: initialize the MaxViewport, MaxRenderbufferSize constants
authorBrian Paul <brianp@vmware.com>
Tue, 21 Feb 2012 15:26:30 +0000 (08:26 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 24 Feb 2012 15:03:15 +0000 (08:03 -0700)
Use the max 2D/rect texture size as the limit.  If that's not true
for some devices we'll need new PIPE_CAP_ queries.

src/mesa/state_tracker/st_extensions.c

index fb36a6809c026dd78c69ebc9bfd51081bc15fa62..33bc6ed729b9acc377eb4e53b36c8f31ec4aa906 100644 (file)
@@ -108,6 +108,14 @@ void st_init_limits(struct st_context *st)
 
    c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits);
 
+   /* Define max viewport size and max renderbuffer size in terms of
+    * max texture size (note: max tex RECT size = max tex 2D size).
+    * If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
+    */
+   c->MaxViewportWidth =
+   c->MaxViewportHeight =
+   c->MaxRenderbufferSize = c->MaxTextureRectSize;
+
    c->MaxDrawBuffers
       = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
               1, MAX_DRAW_BUFFERS);