Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/3dfx/fxpipeline.c

    r2938 r3598  
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    6565       ((ctx->Texture.ReallyEnabled & 0xf) && VB->TexCoordPtr[0]->size>2) ||
    6666       ((ctx->Texture.ReallyEnabled & 0xf0) && VB->TexCoordPtr[1]->size>2) ||
    67         (VB->ClipPtr->size != 4)) /* Brokes clipping otherwise */
     67        (VB->ClipPtr->size != 4))              /* Brokes clipping otherwise*/
    6868      gl_render_elts( VB );
    69    else 
     69   else
    7070      fxDDRenderElementsDirect( VB );
    7171}
    7272
    73 static void fxDDCheckRenderVBIndirect( GLcontext *ctx, 
    74                                        struct gl_pipeline_stage *d )
    75 {   
     73static void fxDDCheckRenderVBIndirect( GLcontext *ctx,
     74                                       struct gl_pipeline_stage *d )
     75{
    7676   d->type = 0;
    7777
    7878   if ((ctx->IndirectTriangles & DD_SW_SETUP) == 0 &&
    79        ctx->Driver.MultipassFunc == 0) 
     79       ctx->Driver.MultipassFunc == 0)
    8080   {
    8181      d->type = PIPE_IMMEDIATE;
    8282      d->inputs = VERT_SETUP_FULL | VERT_ELT | VERT_PRECALC_DATA;
    83    }     
     83   }
    8484}
    8585
     
    122122 */
    123123GLuint fxDDRegisterPipelineStages( struct gl_pipeline_stage *out,
    124                                    const struct gl_pipeline_stage *in,
    125                                    GLuint nr )
     124                                   const struct gl_pipeline_stage *in,
     125                                   GLuint nr )
    126126{
    127127   GLuint i, o;
     
    130130      switch (in[i].ops) {
    131131      case PIPE_OP_RAST_SETUP_1|PIPE_OP_RENDER:
    132         out[o] = in[i];
    133         out[o].state_change = NEW_CLIENT_STATE;
    134         out[o].check = fxDDCheckMergeAndRender;
    135          out[o].run = fxDDMergeAndRender;       
    136         o++;
    137         break;
     132        out[o] = in[i];
     133        out[o].state_change = NEW_CLIENT_STATE;
     134        out[o].check = fxDDCheckMergeAndRender;
     135         out[o].run = fxDDMergeAndRender;
     136        o++;
     137        break;
    138138      case PIPE_OP_RAST_SETUP_0:
    139         out[o] = in[i];
    140         out[o].cva_state_change = NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS;
    141         out[o].state_change = ~0;
    142         out[o].check = fxDDCheckPartialRasterSetup;
    143         out[o].run = fxDDPartialRasterSetup;
    144         o++;
    145         break;
     139        out[o] = in[i];
     140        out[o].cva_state_change = NEW_LIGHTING|NEW_TEXTURING|NEW_RASTER_OPS;
     141        out[o].state_change = ~0;
     142        out[o].check = fxDDCheckPartialRasterSetup;
     143        out[o].run = fxDDPartialRasterSetup;
     144        o++;
     145        break;
    146146      case PIPE_OP_RAST_SETUP_0|PIPE_OP_RAST_SETUP_1:
    147         out[o] = in[i];
    148         out[o].run = fxDDDoRasterSetup;
    149         o++;
    150         break;
     147        out[o] = in[i];
     148        out[o].run = fxDDDoRasterSetup;
     149        o++;
     150        break;
    151151      case PIPE_OP_RENDER:
    152         out[o] = in[i];
    153         if (in[i].run == gl_render_elts) {
    154             out[o].run = fxDDRenderElements;
    155         } else if (in[i].run == gl_render_vb_indirect) {
    156             out[o].check = fxDDCheckRenderVBIndirect;
    157             out[o].run = fxDDRenderVBIndirect;
    158         } else if (in[i].run == gl_render_vb) {
    159             out[o].run = fxDDRenderVB;
    160         }
    161 
    162         o++;
    163         break;
     152        out[o] = in[i];
     153        if (in[i].run == gl_render_elts) {
     154            out[o].run = fxDDRenderElements;
     155        } else if (in[i].run == gl_render_vb_indirect) {
     156            out[o].check = fxDDCheckRenderVBIndirect;
     157            out[o].run = fxDDRenderVBIndirect;
     158        } else if (in[i].run == gl_render_vb) {
     159            out[o].run = fxDDRenderVB;
     160        }
     161
     162        o++;
     163        break;
    164164      default:
    165         out[o++] = in[i];
    166         break;
     165        out[o++] = in[i];
     166        break;
    167167      }
    168168   }
     
    171171}
    172172
    173 #define ILLEGAL_ENABLES (TEXTURE0_3D|           \
    174                          TEXTURE1_3D|           \
    175                          ENABLE_TEXMAT0 |       \
    176                          ENABLE_TEXMAT1 |       \
    177                          ENABLE_TEXGEN0 |       \
    178                          ENABLE_TEXGEN1 |       \
    179                          ENABLE_USERCLIP |      \
    180                          ENABLE_LIGHT |         \
    181                         ENABLE_FOG)
    182 
    183 
    184                          
     173#define ILLEGAL_ENABLES (TEXTURE0_3D|           \
     174                         TEXTURE1_3D|           \
     175                         ENABLE_TEXMAT0 |       \
     176                         ENABLE_TEXMAT1 |       \
     177                         ENABLE_TEXGEN0 |       \
     178                         ENABLE_TEXGEN1 |       \
     179                         ENABLE_USERCLIP |      \
     180                         ENABLE_LIGHT |         \
     181                        ENABLE_FOG)
     182
     183
     184
    185185/* Because this is slotted in by the OptimizePipeline function, most
    186186 * of the information here is just for gl_print_pipeline().  Only the
    187  * run member is required. 
     187 * run member is required.
    188188 */
    189189static struct gl_pipeline_stage fx_fast_stage = {
     
    199199   0,
    200200   0,
    201    0,                           /* never called */
     201   0,                           /* never called */
    202202   fxDDFastPath
    203203};
     
    210210 */
    211211GLboolean fxDDBuildPrecalcPipeline( GLcontext *ctx )
    212 {   
     212{
    213213   struct gl_pipeline *pipe = &ctx->CVA.pre;
    214214   fxMesaContext fxMesa = FX_CONTEXT(ctx);
    215    
     215
    216216
    217217   if (fxMesa->is_in_hardware &&
    218        fxMesa->render_index == 0 && 
     218       fxMesa->render_index == 0 &&
    219219       (ctx->Enabled & ILLEGAL_ENABLES) == 0 &&
    220220       (ctx->Array.Flags & (VERT_OBJ_234|
    221                             VERT_TEX0_4|
    222                             VERT_TEX1_4|
    223                             VERT_ELT)) == (VERT_OBJ_23|VERT_ELT))
     221                            VERT_TEX0_4|
     222                            VERT_TEX1_4|
     223                            VERT_ELT)) == (VERT_OBJ_23|VERT_ELT))
    224224   {
    225       if (MESA_VERBOSE & (VERBOSE_STATE|VERBOSE_DRIVER)) 
    226         if (!fxMesa->using_fast_path)
    227             fprintf(stderr, "fxMesa: using fast path\n");
     225      if (MESA_VERBOSE & (VERBOSE_STATE|VERBOSE_DRIVER))
     226        if (!fxMesa->using_fast_path)
     227            fprintf(stderr, "fxMesa: using fast path\n");
    228228
    229229      pipe->stages[0] = &fx_fast_stage;
     
    233233      fxMesa->using_fast_path = 1;
    234234      return 1;
    235    } 
    236 
    237    if (fxMesa->using_fast_path) 
     235   }
     236
     237   if (fxMesa->using_fast_path)
    238238   {
    239       if (MESA_VERBOSE & (VERBOSE_STATE|VERBOSE_DRIVER)) 
    240          fprintf(stderr, "fxMesa: fall back to full pipeline %x %x %x %x %x\n",
    241                 fxMesa->is_in_hardware,
    242                 fxMesa->render_index,
    243                 (ctx->Enabled & ILLEGAL_ENABLES),
    244                 (ctx->Array.Summary & (VERT_OBJ_23)),
    245                 (ctx->Array.Summary & (VERT_OBJ_4|VERT_TEX0_4|VERT_TEX1_4)));
     239      if (MESA_VERBOSE & (VERBOSE_STATE|VERBOSE_DRIVER))
     240         fprintf(stderr, "fxMesa: fall back to full pipeline %x %x %x %x %x\n",
     241                fxMesa->is_in_hardware,
     242                fxMesa->render_index,
     243                (ctx->Enabled & ILLEGAL_ENABLES),
     244                (ctx->Array.Summary & (VERT_OBJ_23)),
     245                (ctx->Array.Summary & (VERT_OBJ_4|VERT_TEX0_4|VERT_TEX1_4)));
    246246
    247247      fxMesa->using_fast_path = 0;
     
    251251      return 0;
    252252   }
    253    
     253
    254254   return 0;
    255255}
     
    271271
    272272   if (fxMesa->is_in_hardware &&
    273        fxMesa->render_index == 0 && 
     273       fxMesa->render_index == 0 &&
    274274       (ctx->Enabled & ILLEGAL_ENABLES) == 0 &&
    275275       (ctx->Array.Summary & VERT_ELT))
Note: See TracChangeset for help on using the changeset viewer.