r600: add beginnings of ARL instruction
[mesa.git] / src / mesa / drivers / glide / fxdd.c
index e218a316aa8ea574f7de80c81a233f9f2ff1ccd2..2bc60399ea2d5358e65166f525216e922aac7b4c 100644 (file)
 
 #if defined(FX)
 
-#include "image.h"
-#include "mtypes.h"
+#include "main/image.h"
+#include "main/mtypes.h"
 #include "fxdrv.h"
-#include "buffers.h"
-#include "enums.h"
-#include "extensions.h"
-#include "macros.h"
-#include "texstore.h"
-#include "teximage.h"
+#include "main/buffers.h"
+#include "main/enums.h"
+#include "main/extensions.h"
+#include "main/macros.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
 #include "swrast/swrast.h"
 #include "swrast/s_context.h"
 #include "swrast_setup/swrast_setup.h"
@@ -162,9 +162,7 @@ fxDDClearColor(GLcontext * ctx, const GLfloat color[4])
 
 
 /* Clear the color and/or depth buffers */
-static void fxDDClear( GLcontext *ctx,
-                       GLbitfield mask, GLboolean all,
-                       GLint x, GLint y, GLint width, GLint height )
+static void fxDDClear( GLcontext *ctx, GLbitfield mask )
 {
    fxMesaContext fxMesa = FX_CONTEXT(ctx);
    GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM);
@@ -173,8 +171,7 @@ static void fxDDClear( GLcontext *ctx,
    const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff);
 
    if ( TDFX_DEBUG & MESA_VERBOSE ) {
-      fprintf( stderr, "fxDDClear( %d, %d, %d, %d )\n",
-                      (int) x, (int) y, (int) width, (int) height );
+      fprintf( stderr, "fxDDClear\n");
    }
 
    /* we can't clear accum buffers nor stereo */
@@ -389,7 +386,7 @@ static void fxDDClear( GLcontext *ctx,
    grRenderBuffer(fxMesa->currentFB);
 
    if (softwareMask)
-      _swrast_Clear( ctx, softwareMask, all, x, y, width, height );
+      _swrast_Clear( ctx, softwareMask );
 }
 
 
@@ -1666,7 +1663,6 @@ static const struct tnl_pipeline_stage *fx_pipeline[] = {
    &_tnl_texture_transform_stage,
    &_tnl_point_attenuation_stage,
 #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program)
-   &_tnl_arb_vertex_program_stage,
    &_tnl_vertex_program_stage,
 #endif
    &_tnl_render_stage,
@@ -1777,6 +1773,8 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
    ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1;
    ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits);
 
+   ctx->Const.MaxDrawBuffers = 1;
+
    fxMesa->new_state = _NEW_ALL;
    if (!fxMesa->haveHwStencil) {
       /* don't touch stencil if there is none */
@@ -1786,7 +1784,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
    /* Initialize the software rasterizer and helper modules.
     */
    _swrast_CreateContext(ctx);
-   _ac_CreateContext(ctx);
+   _vbo_CreateContext(ctx);
    _tnl_CreateContext(ctx);
    _swsetup_CreateContext(ctx);
 
@@ -1829,7 +1827,7 @@ fxDDDestroyFxMesaContext(fxMesaContext fxMesa)
 {
    _swsetup_DestroyContext(fxMesa->glCtx);
    _tnl_DestroyContext(fxMesa->glCtx);
-   _ac_DestroyContext(fxMesa->glCtx);
+   _vbo_DestroyContext(fxMesa->glCtx);
    _swrast_DestroyContext(fxMesa->glCtx);
 
    if (fxMesa->state)
@@ -1866,7 +1864,6 @@ fxDDInitExtensions(GLcontext * ctx)
    }
 
    if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
-      _mesa_enable_extension(ctx, "GL_ARB_texture_compression");
       _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
       _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
       _mesa_enable_extension(ctx, "GL_S3_s3tc");
@@ -1898,7 +1895,6 @@ fxDDInitExtensions(GLcontext * ctx)
        * fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock:
        *    grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette));
        */
-      /*_mesa_enable_extension(ctx, "GL_ARB_texture_compression");*/
       _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap");
    }
 
@@ -1921,15 +1917,11 @@ fxDDInitExtensions(GLcontext * ctx)
    }
 
    /* core-level extensions */
-   _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays");
-   _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays");
-   _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
    /* dangerous */
    if (getenv("MESA_FX_ALLOW_VP")) {
       _mesa_enable_extension(ctx, "GL_ARB_vertex_program");
       _mesa_enable_extension(ctx, "GL_NV_vertex_program");
       _mesa_enable_extension(ctx, "GL_NV_vertex_program1_1");
-      _mesa_enable_extension(ctx, "GL_MESA_program_debug");
    }
 #if 0
    /* this requires _tnl_vertex_cull_stage in the pipeline */
@@ -1955,12 +1947,12 @@ fx_check_IsInHardware(GLcontext * ctx)
       return FX_FALLBACK_RENDER_MODE;
    }
 
-   if (ctx->Stencil.Enabled && !fxMesa->haveHwStencil) {
+   if (ctx->Stencil._Enabled && !fxMesa->haveHwStencil) {
       return FX_FALLBACK_STENCIL;
    }
 
-   if (ctx->DrawBuffer->_ColorDrawBufferMask[0] != BUFFER_BIT_FRONT_LEFT &&
-       ctx->DrawBuffer->_ColorDrawBufferMask[0] != BUFFER_BIT_BACK_LEFT) {
+   if ((ctx->DrawBuffer->_ColorDrawBufferIndexes[0] != BUFFER_BIT_FRONT_LEFT) &&
+       (ctx->DrawBuffer->_ColorDrawBufferIndexes[0] != BUFFER_BIT_BACK_LEFT)) {
       return FX_FALLBACK_DRAW_BUFFER;
    }
 
@@ -2104,7 +2096,7 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state)
    }
 
    _swrast_InvalidateState(ctx, new_state);
-   _ac_InvalidateState(ctx, new_state);
+   _vbo_InvalidateState(ctx, new_state);
    _tnl_InvalidateState(ctx, new_state);
    _swsetup_InvalidateState(ctx, new_state);