summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-08-21 17:41:43 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-08-21 17:46:32 -0400
commitbf5d6cf455c02d752cfea320f14765b997dc7266 (patch)
tree42154bf50da24a787493e0f641d1216a037e89e4
parent4cfb1b880b52d6bba32f4ebec78040ff6bf6737f (diff)
r600: better default state size.
Hopefully suokko's emit size impovements will land soon.
-rw-r--r--src/mesa/drivers/dri/r600/r700_chip.c20
-rw-r--r--src/mesa/drivers/dri/r600/r700_fragprog.c2
-rw-r--r--src/mesa/drivers/dri/r600/r700_vertprog.c2
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 2d68f021df..e1c0c34670 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 6249bde6f1..394482594e 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 31e71cdfa3..14da4ed1d3 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,