diff options
author | marha <marha@users.sourceforge.net> | 2010-04-02 14:47:58 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-04-02 14:47:58 +0000 |
commit | 7933658107276f9d5491f8736a743cf8f8bbd5f2 (patch) | |
tree | f2893a761364e7abc9d934e9c5427e5cf5190c7a /mesalib/src/mesa/shader/programopt.c | |
parent | 83fa9a9811e2c18cffd83a020757f7fb51ffddaa (diff) | |
download | vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.gz vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.bz2 vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.zip |
Updated to following packages:
mesa-7.8
Diffstat (limited to 'mesalib/src/mesa/shader/programopt.c')
-rw-r--r-- | mesalib/src/mesa/shader/programopt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mesalib/src/mesa/shader/programopt.c b/mesalib/src/mesa/shader/programopt.c index 951454570..fb2ebe633 100644 --- a/mesalib/src/mesa/shader/programopt.c +++ b/mesalib/src/mesa/shader/programopt.c @@ -495,6 +495,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) GLuint i; GLint outputMap[VERT_RESULT_MAX]; GLuint numVaryingReads = 0; + GLboolean usedTemps[MAX_PROGRAM_TEMPS]; + GLuint firstTemp = 0; + + _mesa_find_used_registers(prog, PROGRAM_TEMPORARY, + usedTemps, MAX_PROGRAM_TEMPS); assert(type == PROGRAM_VARYING || type == PROGRAM_OUTPUT); assert(prog->Target == GL_VERTEX_PROGRAM_ARB || type != PROGRAM_VARYING); @@ -513,8 +518,10 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) const GLuint var = inst->SrcReg[j].Index; if (outputMap[var] == -1) { numVaryingReads++; - outputMap[var] = _mesa_find_free_register(prog, - PROGRAM_TEMPORARY); + outputMap[var] = _mesa_find_free_register(usedTemps, + MAX_PROGRAM_TEMPS, + firstTemp); + firstTemp = outputMap[var] + 1; } inst->SrcReg[j].File = PROGRAM_TEMPORARY; inst->SrcReg[j].Index = outputMap[var]; |