From d5432ac584f922527922c6813f39f6caa00b9037 Mon Sep 17 00:00:00 2001 From: Vladimir Dergachev Date: Tue, 11 Jan 2005 05:59:07 +0000 Subject: [PATCH] Switch back to using immediate mode code - use of AGP space is interfering with texture management. 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 | 9 +++++++-- src/mesa/drivers/dri/r300/r300_state.c | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 4e33781fc4f..249da09f27e 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -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); diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bf5685aa7d0..6555d306ecf 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -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 */ -- 2.30.2