r300: add hw accelerated support for different vertex data formats
[mesa.git] / src / mesa / drivers / dri / r300 / r300_context.c
index 5b22a11bca2f2c47dd55d7f6f510c46fb3db23c1..b7911f23cce2d866e6b54602b89d5086988dc265 100644 (file)
@@ -64,6 +64,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r300_ioctl.h"
 #include "r300_tex.h"
 #include "r300_emit.h"
+#include "r300_render.h"
 #include "r300_swtcl.h"
 #include "radeon_bocs_wrapper.h"
 
@@ -150,16 +151,8 @@ const struct dri_extension gl_20_extension[] = {
   {"GL_VERSION_2_0",                   GL_VERSION_2_0_functions },
 };
 
-
-extern struct tnl_pipeline_stage _r300_render_stage;
-extern const struct tnl_pipeline_stage _r300_tcl_stage;
-
 static const struct tnl_pipeline_stage *r300_pipeline[] = {
 
-       /* Try and go straight to t&l
-        */
-       &_r300_tcl_stage,
-
        /* Catch any t&l fallbacks
         */
        &_tnl_vertex_transform_stage,
@@ -271,6 +264,10 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
            driQueryOptioni(&r300->radeon.optionCache, "texture_coord_units");
        ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureImageUnits,
                 ctx->Const.MaxTextureCoordUnits);
+    /* FIXME: When no memory manager is available we should set this 
+     * to some reasonable value based on texture memory pool size */
+    /* FIXME: r5xx limit is 4096 */
+    ctx->Const.MaxTextureLevels = 12;
        ctx->Const.MaxTextureMaxAnisotropy = 16.0;
        ctx->Const.MaxTextureLodBias = 16.0;
 
@@ -435,8 +432,11 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        _tnl_allow_pixel_fog(ctx, GL_FALSE);
        _tnl_allow_vertex_fog(ctx, GL_TRUE);
 
-       if (!r300->options.hw_tcl_enabled)
+       if (r300->options.hw_tcl_enabled) {
+               r300InitDraw(ctx);
+       } else {
                r300InitSwtcl(ctx);
+       }
 
        radeon_fbo_init(&r300->radeon);
        radeonInitSpanFuncs( ctx );