summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_framebuffer.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-02-29 13:24:31 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-02-29 13:24:31 +1100
commit8c77e6f674206ef34ab15026b08e495209dcd4ea (patch)
tree7d21d99eee6970b340bc7a3afedeadfc99dd5745 /src/mesa/state_tracker/st_framebuffer.c
parent68ef52886263690632552ae187a4673945c2ab74 (diff)
parentebe3b34ad225e320a09bb4069ce4d24808386327 (diff)
Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_framebuffer.c')
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index bca3fa5c38..d46a9178b1 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -27,8 +27,10 @@
#include "main/imports.h"
+#include "main/buffers.h"
#include "main/context.h"
#include "main/framebuffer.h"
+#include "main/matrix.h"
#include "main/renderbuffer.h"
#include "st_public.h"
#include "st_context.h"
@@ -124,6 +126,17 @@ void st_resize_framebuffer( struct st_framebuffer *stfb,
if (stfb->Base.Width != width || stfb->Base.Height != height) {
GET_CURRENT_CONTEXT(ctx);
if (ctx) {
+ if (stfb->InitWidth == 0 && stfb->InitHeight == 0) {
+ /* didn't have a valid size until now */
+ stfb->InitWidth = width;
+ stfb->InitHeight = height;
+ if (ctx->Viewport.Width <= 1) {
+ /* set context's initial viewport/scissor size */
+ _mesa_set_viewport(ctx, 0, 0, width, height);
+ _mesa_set_scissor(ctx, 0, 0, width, height);
+ }
+ }
+
_mesa_resize_framebuffer(ctx, &stfb->Base, width, height);
assert(stfb->Base.Width == width);