diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_viewport.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c index d4742eb897d..d654ed6e771 100644 --- a/src/mesa/state_tracker/st_cb_viewport.c +++ b/src/mesa/state_tracker/st_cb_viewport.c @@ -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, diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index be8fef189ef..cdac5a1c7c9 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -31,6 +31,7 @@ #include "main/mtypes.h" #include "pipe/p_state.h" #include "state_tracker/st_api.h" +#include "main/fbobject.h" struct bitmap_cache; struct blit_state; @@ -238,7 +239,7 @@ void st_invalidate_state(struct gl_context * ctx, GLuint new_state); static INLINE GLuint st_fb_orientation(const struct gl_framebuffer *fb) { - if (fb && fb->Name == 0) { + if (fb && _mesa_is_winsys_fbo(fb)) { /* Drawing into a window (on-screen buffer). * * Negate Y scale to flip image vertically. diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 748624f3d94..875e0c44ac1 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -64,7 +64,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; } /** |