diff options
author | Cooper Yuan <[email protected]> | 2009-08-26 16:21:10 +0800 |
---|---|---|
committer | Cooper Yuan <[email protected]> | 2009-08-26 16:21:10 +0800 |
commit | dadf138ddbaecd7fff239df7961aac25e74f14f6 (patch) | |
tree | b5d015755068a84636e3146f37c96f54d226c414 /src/mesa | |
parent | 1664bc1a37ab85c5d1b14d90c4674201c9154382 (diff) |
r600: Update vertex fetch shader if necessary
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/r600/r600_emit.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r600/r700_vertprog.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r600/r700_vertprog.h | 9 |
3 files changed, 19 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_emit.c b/src/mesa/drivers/dri/r600/r600_emit.c index be86de170f9..f8c56e7774b 100644 --- a/src/mesa/drivers/dri/r600/r600_emit.c +++ b/src/mesa/drivers/dri/r600/r600_emit.c @@ -104,7 +104,8 @@ GLboolean r600DeleteShader(GLcontext * ctx, struct radeon_bo * pbo = (struct radeon_bo *)shaderbo; if (pbo) { - radeon_bo_unmap(pbo); + if (pbo->ptr) + radeon_bo_unmap(pbo); radeon_bo_unref(pbo); /* when bo->cref <= 0, bo will be bo_free */ } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index f8f862b33aa..86a67ab766f 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -301,6 +301,11 @@ void r700SelectVertexShader(GLcontext *ctx) unsigned int unBit; unsigned int i; + if (context->radeon.NewGLState & (_NEW_PROGRAM_CONSTANTS|_NEW_PROGRAM)) + { + vpc->needUpdateVF = 1; + } + if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) { vpc->r700AsmCode.bR6xx = 1; @@ -341,6 +346,14 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) unsigned int unNumParamData; unsigned int ui; + if (vp->needUpdateVF) + { + vp->loaded = GL_FALSE; + vp->r700Shader.bNeedsAssembly = GL_TRUE; + Process_Vertex_Program_Vfetch_Instructions(vp, &(vp->mesa_program)); + r600DeleteShader(ctx, vp->shaderbo); + } + if(GL_FALSE == vp->loaded) { if(vp->r700Shader.bNeedsAssembly == GL_TRUE) diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index 4c3b7ee453d..e2e65021fd3 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -45,19 +45,18 @@ struct r700_vertex_program { struct gl_vertex_program mesa_program; /* Must be first */ - struct r700_vertex_program *next; + struct r700_vertex_program *next; r700_AssemblerBase r700AsmCode; R700_Shader r700Shader; - GLboolean translated; + GLboolean translated; GLboolean loaded; + GLboolean needUpdateVF; - /* ... */ - void * shaderbo; - ArrayDesc aos_desc[VERT_ATTRIB_MAX]; + ArrayDesc aos_desc[VERT_ATTRIB_MAX]; }; //Internal |