aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r600
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2009-08-02 18:26:12 -0400
committerAlex Deucher <[email protected]>2009-08-02 18:26:12 -0400
commitd07bf2b35c1419bdef824092e509c70ffb11fd67 (patch)
treefc9506503b2d8f233b2b568696f2a0d22280e03a /src/mesa/drivers/dri/r600
parent562ca4961186954d3abf216bcfb1e835b562b234 (diff)
r600: handle state emit better
- move shader-related state with the rest of the shader setup/emit - start to track dirty state better
Diffstat (limited to 'src/mesa/drivers/dri/r600')
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.c3
-rw-r--r--src/mesa/drivers/dri/r600/r700_render.c19
-rw-r--r--src/mesa/drivers/dri/r600/r700_state.c2
3 files changed, 16 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 8debecbab99..dc2fb0144a2 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -457,6 +457,9 @@ void r600InitCmdBuf(context_t *r600) /* from rcommonInitCmdBuf */
GLuint size;
rmesa->hw.max_state_size = 4000; /* rough estimate */
+ rmesa->hw.all_dirty = GL_TRUE;
+ rmesa->hw.is_dirty = GL_TRUE;
+
/* Initialize command buffer */
size = 256 * driQueryOptioni(&rmesa->optionCache,
"command_buffer_size");
diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c
index 34a43858410..20376d2c36d 100644
--- a/src/mesa/drivers/dri/r600/r700_render.c
+++ b/src/mesa/drivers/dri/r600/r700_render.c
@@ -139,6 +139,13 @@ static GLboolean r700SetupShaders(GLcontext * ctx)
r600UpdateTextureState(ctx);
+ r700SendFSState(context); // FIXME just a place holder for now
+ r700SendPSState(context);
+ r700SendVSState(context);
+
+ r700SendTextureState(context);
+ r700SetupStreams(ctx);
+
return GL_TRUE;
}
@@ -274,18 +281,16 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim
void r700EmitState(GLcontext * ctx)
{
context_t *context = R700_CONTEXT(ctx);
+ radeonContextPtr radeon = &context->radeon;
+
+ if (radeon->cmdbuf.cs->cdw && !radeon->hw.is_dirty && !radeon->hw.all_dirty)
+ return;
rcommonEnsureCmdBufSpace(&context->radeon,
context->radeon.hw.max_state_size, __FUNCTION__);
r700Start3D(context);
r700SendSQConfig(context);
- r700SendFSState(context); // FIXME just a place holder for now
- r700SendPSState(context);
- r700SendVSState(context);
-
- r700SendTextureState(context);
- r700SetupStreams(ctx);
r700SendUCPState(context);
r700SendContextStates(context);
@@ -325,8 +330,6 @@ static GLboolean r700RunRender(GLcontext * ctx,
radeonReleaseArrays(ctx, ~0);
- rcommonFlushCmdBuf( &context->radeon, __FUNCTION__ );
-
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c
index b75f5315036..e95f52400a2 100644
--- a/src/mesa/drivers/dri/r600/r700_state.c
+++ b/src/mesa/drivers/dri/r600/r700_state.c
@@ -1854,6 +1854,8 @@ void r700InitState(GLcontext * ctx) //-------------------
/* Set up color compare mask */
r700->CB_CLRCMP_MSK.u32All = 0xFFFFFFFF;
+ context->radeon.hw.all_dirty = GL_TRUE;
+
}
void r700InitStateFuncs(struct dd_function_table *functions) //-----------------