st/mesa: use a generic varying to pass the clear color to the FS
[mesa.git] / src / mesa / state_tracker / st_cb_viewport.c
index d4742eb897d6388bb056879cfb73115f4628b3e2..d654ed6e771e681f564b0d2497013e6ed49a0ab9 100644 (file)
@@ -43,7 +43,9 @@ static INLINE struct st_framebuffer *
 st_ws_framebuffer(struct gl_framebuffer *fb)
 {
    /* FBO cannot be casted.  See st_new_framebuffer */
-   return (struct st_framebuffer *) ((fb && !fb->Name) ? fb : NULL);
+   if (fb && _mesa_is_winsys_fbo(fb))
+      return (struct st_framebuffer *) fb;
+   return NULL;
 }
 
 static void st_viewport(struct gl_context * ctx, GLint x, GLint y,