summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Dergachev <volodya@freedesktop.org>2005-01-11 05:59:07 +0000
committerVladimir Dergachev <volodya@freedesktop.org>2005-01-11 05:59:07 +0000
commitd5432ac584f922527922c6813f39f6caa00b9037 (patch)
treebe00b8afc16b8d73405fe5981b1f7a1bfd0b6bc2
parent864137984a80b2ad2c26d54f9281546b4b43c6ae (diff)
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.
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c9
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c3
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 4e33781fc4..249da09f27 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 bf5685aa7d..6555d306ec 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 */