~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/r200/r200_context.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
#define need_GL_EXT_blend_equation_separate
76
76
#define need_GL_EXT_blend_func_separate
77
77
#define need_GL_NV_vertex_program
 
78
#define need_GL_ARB_point_parameters
78
79
#include "extension_helper.h"
79
80
 
80
81
#define DRIVER_DATE     "20060602"
86
87
int R200_DEBUG = (0);
87
88
#endif
88
89
 
89
 
 
90
 
/* Return the width and height of the given buffer.
91
 
 */
92
 
static void r200GetBufferSize( GLframebuffer *buffer,
93
 
                               GLuint *width, GLuint *height )
94
 
{
95
 
   GET_CURRENT_CONTEXT(ctx);
96
 
   r200ContextPtr rmesa = R200_CONTEXT(ctx);
97
 
 
98
 
   LOCK_HARDWARE( rmesa );
99
 
   *width  = rmesa->dri.drawable->w;
100
 
   *height = rmesa->dri.drawable->h;
101
 
   UNLOCK_HARDWARE( rmesa );
102
 
}
103
 
 
104
90
/* Return various strings for glGetString().
105
91
 */
106
92
static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
170
156
    { "GL_EXT_blend_func_separate",        GL_EXT_blend_func_separate_functions },
171
157
    { NULL,                                NULL }
172
158
};
173
 
                                                         
 
159
 
174
160
const struct dri_extension ARB_vp_extension[] = {
175
161
    { "GL_ARB_vertex_program",             GL_ARB_vertex_program_functions }
176
162
};
183
169
    { "GL_ATI_fragment_shader",            GL_ATI_fragment_shader_functions }
184
170
};
185
171
 
 
172
const struct dri_extension point_extensions[] = {
 
173
    { "GL_ARB_point_sprite",               NULL },
 
174
    { "GL_ARB_point_parameters",           GL_ARB_point_parameters_functions },
 
175
    { NULL,                                NULL }
 
176
};
 
177
 
186
178
extern const struct tnl_pipeline_stage _r200_render_stage;
187
179
extern const struct tnl_pipeline_stage _r200_tcl_stage;
188
180
 
200
192
   &_tnl_fog_coordinate_stage,
201
193
   &_tnl_texgen_stage,
202
194
   &_tnl_texture_transform_stage,
 
195
   &_tnl_point_attenuation_stage,
203
196
   &_tnl_arb_vertex_program_stage,
204
197
   &_tnl_vertex_program_stage,
205
 
 
206
198
   /* Try again to go to tcl? 
207
199
    *     - no good for asymmetric-twoside (do with multipass)
208
200
    *     - no good for asymmetric-unfilled (do with multipass)
226
218
 */
227
219
static void r200InitDriverFuncs( struct dd_function_table *functions )
228
220
{
229
 
    functions->GetBufferSize            = r200GetBufferSize;
230
 
    functions->ResizeBuffers            = _mesa_resize_framebuffer;
 
221
    functions->GetBufferSize            = NULL; /* OBSOLETE */
231
222
    functions->GetString                = r200GetString;
232
 
 
233
 
    functions->Error                    = NULL;
234
 
    functions->DrawPixels               = NULL;
235
 
    functions->Bitmap                   = NULL;
236
223
}
237
224
 
238
225
static const struct dri_debug_control debug_control[] =
478
465
   if (rmesa->r200Screen->drmSupportsBlendColor) {
479
466
       driInitExtensions( ctx, blend_extensions, GL_FALSE );
480
467
   }
481
 
   if(rmesa->r200Screen->drmSupportsVertexProgram || 
482
 
      driQueryOptionb(&rmesa->optionCache, "arb_vertex_program"))
 
468
   if(rmesa->r200Screen->drmSupportsVertexProgram)
483
469
      driInitSingleExtension( ctx, ARB_vp_extension );
484
470
   if(driQueryOptionb(&rmesa->optionCache, "nv_vertex_program"))
485
471
      driInitSingleExtension( ctx, NV_vp_extension );
486
472
 
487
473
   if ((ctx->Const.MaxTextureUnits == 6) && rmesa->r200Screen->drmSupportsFragShader)
488
474
      driInitSingleExtension( ctx, ATI_fs_extension );
 
475
   if (rmesa->r200Screen->drmSupportsPointSprites)
 
476
      driInitExtensions( ctx, point_extensions, GL_FALSE );
489
477
#if 0
490
478
   r200InitDriverFuncs( ctx );
491
479
   r200InitIoctlFuncs( ctx );
695
683
         fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
696
684
 
697
685
      if ( newCtx->dri.drawable != driDrawPriv ) {
698
 
         driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
 
686
         driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
 
687
                                &newCtx->vbl_seq );
 
688
      }
 
689
 
 
690
      if ( newCtx->dri.drawable != driDrawPriv ||
 
691
           newCtx->dri.readable != driReadPriv ) {
699
692
         newCtx->dri.drawable = driDrawPriv;
 
693
         newCtx->dri.readable = driReadPriv;
 
694
 
700
695
         r200UpdateWindow( newCtx->glCtx );
701
696
         r200UpdateViewportOffset( newCtx->glCtx );
702
697
      }