diff options
author | Andre Maasikas <[email protected]> | 2011-01-20 13:05:21 +0200 |
---|---|---|
committer | Andre Maasikas <[email protected]> | 2011-01-20 13:11:56 +0200 |
commit | c20778e76f1203063977337ebbe1bd2aacef5dc0 (patch) | |
tree | 54e8f4a3e66da0cd2d9c88ddd8dc1bb54d4ad46f /src | |
parent | e8c7d7598fb48237508f566204c71ba8f74d544f (diff) |
r600c: bump sq gpr resources if a shader needs more than default
ideally this should be set once in the beginning of CS but there's
no way to change values there while in the middle of rendering.
For now reemitting SQ setup seems to work probably due to
r700WaitForIdleClean after each render
currently does not to try to decrease values once increased
fixes hangs in glsl-vs-vec4-indexing-temp-src-in-nested-loop-combined
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined for my rv740
maybe more for other chips
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r600/r700_fragprog.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r600/r700_vertprog.c | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 66cb9d62a60..0323e32d705 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -511,6 +511,7 @@ GLboolean r700SetupFragmentProgram(struct gl_context * ctx) unsigned int ui, i; unsigned int unNumOfReg; unsigned int unBit; + unsigned int num_sq_ps_gprs; GLuint exportCount; GLboolean point_sprite = GL_FALSE; @@ -621,6 +622,15 @@ GLboolean r700SetupFragmentProgram(struct gl_context * ctx) SETfield(r700->ps.SQ_PGM_RESOURCES_PS.u32All, ui, NUM_GPRS_shift, NUM_GPRS_mask); + num_sq_ps_gprs = ((r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All & NUM_PS_GPRS_mask) >> NUM_PS_GPRS_shift); + + if(ui > num_sq_ps_gprs) + { + /* care! thich changes sq - needs idle state */ + R600_STATECHANGE(context, sq); + SETfield(r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All, ui, NUM_PS_GPRS_shift, NUM_PS_GPRS_mask); + } + CLEARbit(r700->ps.SQ_PGM_RESOURCES_PS.u32All, UNCACHED_FIRST_INST_bit); if(fp->r700Shader.uStackSize) /* we don't use branch for now, it should be zero. */ diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 7ba49d8f986..7d4be9180a0 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -605,6 +605,7 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) struct gl_program_parameter_list *paramList; unsigned int unNumParamData; unsigned int ui; + unsigned int num_sq_vs_gprs; if(GL_FALSE == vp->loaded) { @@ -656,6 +657,16 @@ GLboolean r700SetupVertexProgram(struct gl_context * ctx) SETfield(r700->vs.SQ_PGM_RESOURCES_VS.u32All, vp->r700Shader.nRegs + 1, NUM_GPRS_shift, NUM_GPRS_mask); + num_sq_vs_gprs = ((r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All & NUM_VS_GPRS_mask) >> NUM_VS_GPRS_shift); + + if((vp->r700Shader.nRegs + 1) > num_sq_vs_gprs) + { + /* care! thich changes sq - needs idle state */ + R600_STATECHANGE(context, sq); + SETfield(r700->sq_config.SQ_GPR_RESOURCE_MGMT_1.u32All, vp->r700Shader.nRegs + 1, + NUM_VS_GPRS_shift, NUM_VS_GPRS_mask); + } + if(vp->r700Shader.uStackSize) /* we don't use branch for now, it should be zero. */ { SETfield(r700->vs.SQ_PGM_RESOURCES_VS.u32All, vp->r700Shader.uStackSize, |