Xiang, Haihao wrote: > On Tue, 2008-08-05 at 08:45 -0600, Brian Paul wrote: >> Xiang, Haihao wrote: >>> On Thu, 2008-07-31 at 13:34 +0800, Xiang, Haihao wrote: >>>> Hi, Brian >>>> >>>> Currently the counter used for temporaries doesn't include all >>>> intermediate results when emitting program instructions, however a >>>> device driver needs to allocate hardware registers for these >>>> intermediate results. The attached patch tries to fix this issue, could >>>> you take a look? >>>> >>> Is it right? >> I think the simplest way to determine the number of registers used is to >> simply count them in the resulting program at the end. >> >> Your patch doesn't correctly count registers when a variable occupies >> more than one register (mat4 or large struct, for example). >> >> It should be a simple matter to write a function that scans a program >> and counts the number of temp regs used. Do you want to try that? >> >> The _slang_update_inputs_outputs() function is an example of scanning a >> program for certain types of registers. >> > A new patch to update the program's NumTemporaries field. Maybe only > need to scan src registers or dst registers. Please take a look.
Looks good. I'm committing the patch (with minor clean-ups). -Brian ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev