From bf5d6cf455c02d752cfea320f14765b997dc7266 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 21 Aug 2009 17:41:43 -0400 Subject: [PATCH] r600: better default state size. Hopefully suokko's emit size impovements will land soon. --- src/mesa/drivers/dri/r600/r700_chip.c | 20 +++++++++++--------- src/mesa/drivers/dri/r600/r700_fragprog.c | 2 ++ src/mesa/drivers/dri/r600/r700_vertprog.c | 2 ++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 2d68f021dfc..e1c0c34670d 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -837,19 +837,21 @@ static int check_always(GLcontext *ctx, struct radeon_state_atom *atom) #define ALLOC_STATE( ATOM, SZ, EMIT ) \ do { \ - context->atoms.ATOM.cmd_size = (SZ); \ - context->atoms.ATOM.cmd = NULL; \ - context->atoms.ATOM.name = #ATOM; \ - context->atoms.ATOM.idx = 0; \ - context->atoms.ATOM.check = check_always; \ - context->atoms.ATOM.dirty = GL_FALSE; \ - context->atoms.ATOM.emit = (EMIT); \ - context->radeon.hw.max_state_size += (SZ); \ - insert_at_tail(&context->radeon.hw.atomlist, &context->atoms.ATOM); \ + context->atoms.ATOM.cmd_size = (SZ); \ + context->atoms.ATOM.cmd = NULL; \ + context->atoms.ATOM.name = #ATOM; \ + context->atoms.ATOM.idx = 0; \ + context->atoms.ATOM.check = check_always; \ + context->atoms.ATOM.dirty = GL_FALSE; \ + context->atoms.ATOM.emit = (EMIT); \ + context->radeon.hw.max_state_size += (SZ); \ + insert_at_tail(&context->radeon.hw.atomlist, &context->atoms.ATOM); \ } while (0) void r600InitAtoms(context_t *context) { + /* FIXME: rough estimate for "large" const and shader state */ + context->radeon.hw.max_state_size = 7500; /* Setup the atom linked list */ make_empty_list(&context->radeon.hw.atomlist); diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 6249bde6f18..394482594e8 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -305,6 +305,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) (context->chipobj.MemUse)(context, fp->shadercode.buf->id); */ + R600_STATECHANGE(context, spi); + r700->ps.SQ_PGM_START_PS.u32All = 0; /* set from buffer obj */ unNumOfReg = fp->r700Shader.nRegs + 1; diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 31e71cdfa30..14da4ed1d30 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -368,6 +368,8 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) (context->chipobj.MemUse)(context, vp->shadercode.buf->id); */ + R600_STATECHANGE(context, spi); + r700->vs.SQ_PGM_START_VS.u32All = 0; /* set from buffer object. */ SETfield(r700->vs.SQ_PGM_RESOURCES_VS.u32All, vp->r700Shader.nRegs + 1, -- 2.30.2