Switch back to using immediate mode code - use of AGP space is interfering with textu...
authorVladimir Dergachev <volodya@freedesktop.org>
Tue, 11 Jan 2005 05:59:07 +0000 (05:59 +0000)
committerVladimir Dergachev <volodya@freedesktop.org>
Tue, 11 Jan 2005 05:59:07 +0000 (05:59 +0000)
Ideally, r300_render is ready to be rewritten to use standard Mesa include files, but I don't think I'll get around to it.

src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c

index 4e33781fc4f26baed56905e037fcfe2262384f9b..249da09f27e40730bd05ae47a48949f985fe5731 100644 (file)
@@ -207,6 +207,11 @@ static void r300_render_immediate_primitive(r300ContextPtr rmesa,
    
    if(type<0)return;
 
+   /* A packet cannot have more than 16383 data words.. */
+   if(((end-start)*8+4*rmesa->state.texture.tc_count)>16380){
+       fprintf(stderr, "%s:%s: Too many vertices to paint. Fix me !\n");
+       return;
+       }
 
    start_immediate_packet(end-start, type, 8+4*rmesa->state.texture.tc_count);
 
@@ -484,7 +489,7 @@ static GLboolean r300_run_render(GLcontext *ctx,
                
    #if 1
        
-       #if 0
+       #if 1
         return r300_run_immediate_render(ctx, stage);
        #else 
         return r300_run_vb_render(ctx, stage);
@@ -584,7 +589,7 @@ static void r300_check_render(GLcontext *ctx, struct tnl_pipeline_stage *stage)
        FALLBACK_IF(ctx->Multisample.Enabled); // GL_MULTISAMPLE_ARB
 
        /* One step at a time - let one texture pass.. */
-       for (i = 1; i < ctx->Const.MaxTextureUnits; i++)
+       for (i = 2; i < ctx->Const.MaxTextureUnits; i++)
                FALLBACK_IF(ctx->Texture.Unit[i].Enabled);
 
 
index bf5685aa7d038568929edbf8b68be7487d3d402d..6555d306ecf3893588f87ff197e210a3a56e5351 100644 (file)
@@ -964,7 +964,8 @@ void r300_setup_textures(GLcontext *ctx)
                        /* We don't know how to set this yet */
                        //value from r300_lib.c for RGB24
                        //r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x88a0c; 
-                       r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=translate_texture_format(ctx, i, t->format, t->base.tObj->Image[0][0]->IntFormat);
+                       r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=translate_texture_format(ctx, i, t->format,
+                               r300->state.texture.unit[i].texobj!=NULL?t->base.tObj->Image[0][0]->IntFormat:3);
                        /* Use the code below to quickly find matching texture
                           formats. Requires an app that displays the same texture
                           repeatedly  */