st_context.h File Reference

Include dependency graph for st_context.h:

Go to the source code of this file.

Data Structures

struct  st_state_flags
struct  st_tracked_state
struct  st_context
struct  st_framebuffer
 Wrapper for GLframebuffer. More...

Defines

#define FRONT_STATUS_UNDEFINED   0
#define FRONT_STATUS_DIRTY   1
#define FRONT_STATUS_COPY_OF_BACK   2
#define ST_NEW_MESA   0x1
#define ST_NEW_FRAGMENT_PROGRAM   0x2
#define ST_NEW_VERTEX_PROGRAM   0x4
#define ST_NEW_FRAMEBUFFER   0x8
#define Y_0_TOP   1
#define Y_0_BOTTOM   2

Functions

static struct st_contextst_context (GLcontext *ctx)
void st_init_driver_functions (struct dd_function_table *functions)
void st_invalidate_state (GLcontext *ctx, GLuint new_state)
 Called via ctx->Driver.UpdateState().
static GLuint st_fb_orientation (const struct gl_framebuffer *fb)
int st_get_msaa (void)
 Check for multisample env var override.


Define Documentation

#define FRONT_STATUS_COPY_OF_BACK   2

Definition at line 50 of file st_context.h.

#define FRONT_STATUS_DIRTY   1

Definition at line 49 of file st_context.h.

#define FRONT_STATUS_UNDEFINED   0

Definition at line 48 of file st_context.h.

#define ST_NEW_FRAGMENT_PROGRAM   0x2

Definition at line 54 of file st_context.h.

#define ST_NEW_FRAMEBUFFER   0x8

Definition at line 56 of file st_context.h.

#define ST_NEW_MESA   0x1

Definition at line 53 of file st_context.h.

#define ST_NEW_VERTEX_PROGRAM   0x4

Definition at line 55 of file st_context.h.

#define Y_0_BOTTOM   2

Definition at line 218 of file st_context.h.

#define Y_0_TOP   1

Definition at line 217 of file st_context.h.


Function Documentation

static struct st_context* st_context ( GLcontext *  ctx  )  [static, read]

Definition at line 193 of file st_context.h.

00194 {
00195    return ctx->st;
00196 }

static GLuint st_fb_orientation ( const struct gl_framebuffer *  fb  )  [static]

Definition at line 221 of file st_context.h.

References Y_0_BOTTOM, and Y_0_TOP.

00222 {
00223    if (fb && fb->Name == 0) {
00224       /* Drawing into a window (on-screen buffer).
00225        *
00226        * Negate Y scale to flip image vertically.
00227        * The NDC Y coords prior to viewport transformation are in the range
00228        * [y=-1=bottom, y=1=top]
00229        * Hardware window coords are in the range [y=0=top, y=H-1=bottom] where
00230        * H is the window height.
00231        * Use the viewport transformation to invert Y.
00232        */
00233       return Y_0_TOP;
00234    }
00235    else {
00236       /* Drawing into user-created FBO (very likely a texture).
00237        *
00238        * For textures, T=0=Bottom, so by extension Y=0=Bottom for rendering.
00239        */
00240       return Y_0_BOTTOM;
00241    }
00242 }

int st_get_msaa ( void   ) 

Check for multisample env var override.

Definition at line 95 of file st_context.c.

00096 {
00097    const char *msaa = _mesa_getenv("__GL_FSAA_MODE");
00098    if (msaa)
00099       return atoi(msaa);
00100    return 0;
00101 }

void st_init_driver_functions ( struct dd_function_table *  functions  ) 

Definition at line 294 of file st_context.c.

References st_init_accum_functions(), st_init_bitmap_functions(), st_init_blit_functions(), st_init_bufferobject_functions(), st_init_clear_functions(), st_init_drawpixels_functions(), st_init_fbo_functions(), st_init_feedback_functions(), st_init_flush_functions(), st_init_get_functions(), st_init_program_functions(), st_init_query_functions(), st_init_rasterpos_functions(), st_init_readpixels_functions(), st_init_string_functions(), st_init_texture_functions(), and st_invalidate_state().

00295 {
00296    _mesa_init_glsl_driver_functions(functions);
00297 
00298 #if FEATURE_accum
00299    st_init_accum_functions(functions);
00300 #endif
00301 #if FEATURE_EXT_framebuffer_blit
00302    st_init_blit_functions(functions);
00303 #endif
00304    st_init_bufferobject_functions(functions);
00305    st_init_clear_functions(functions);
00306 #if FEATURE_drawpix
00307    st_init_bitmap_functions(functions);
00308    st_init_drawpixels_functions(functions);
00309    st_init_rasterpos_functions(functions);
00310 #endif
00311    st_init_fbo_functions(functions);
00312    st_init_get_functions(functions);
00313 #if FEATURE_feedback
00314    st_init_feedback_functions(functions);
00315 #endif
00316    st_init_program_functions(functions);
00317 #if FEATURE_ARB_occlusion_query
00318    st_init_query_functions(functions);
00319 #endif
00320    st_init_readpixels_functions(functions);
00321    st_init_texture_functions(functions);
00322    st_init_flush_functions(functions);
00323    st_init_string_functions(functions);
00324 
00325    functions->UpdateState = st_invalidate_state;
00326 }

void st_invalidate_state ( GLcontext *  ctx,
GLuint  new_state 
)

Called via ctx->Driver.UpdateState().

Definition at line 77 of file st_context.c.

References st_context::dirty, st_state_flags::mesa, st_state_flags::st, st_context(), and ST_NEW_MESA.

00078 {
00079    struct st_context *st = st_context(ctx);
00080 
00081    st->dirty.mesa |= new_state;
00082    st->dirty.st |= ST_NEW_MESA;
00083 
00084    /* This is the only core Mesa module we depend upon.
00085     * No longer use swrast, swsetup, tnl.
00086     */
00087    _vbo_InvalidateState(ctx, new_state);
00088 }


Generated on Tue Sep 29 06:25:54 2009 for Gallium3D by  doxygen 1.5.4