[Mesa-dev] glsl: Improvements to lower_jumps.cpp
Tom Stellard
tstellar at gmail.com
Wed Jul 6 20:27:28 PDT 2011
On Wed, Jul 06, 2011 at 12:18:18PM -0700, Ian Romanick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 07/05/2011 03:07 PM, Paul Berry wrote:
> > The following patch series fixes bug #36669 (EmitNoMainReturn set
> > to 1 doesn't make the GLSL compiler lower all the RET opcodes) as
> > well as several other bugs I found in the course of reviewing
> > lower_jumps.cpp. Some of these bugs prevented certain jumps from
> > ever being lowered, or produced assertion failures. Others
> > merely caused sub-optimal GPU code to be generated, by forcing
> > do_lower_jumps() to take multiple passes in order to lower all
> > jumps.
> >
> > The optimization performed by lower_jumps.cpp is quite complex
> > and has a number of subtle corner cases. In order to be
> > confident that these changes were correct, I added unit tests
> > that verify its operation in isolation. I'm particularly
> > interested to hear comments on how the tests are structured. I'm
> > not aware of unit tests having been used in the mesa project
> > before, and I'd like to find a way that we can make unit testing
> > easier to do in other parts of the project (e.g. other
> > optimization passes).
>
> The only other unit tests in Mesa are for the old matrix math routines
> (fixed function). See src/mesa/math/m_debug*.c.
>
> This is an area that I've been thinking about lately. I noticed that
> XCB uses a framework called check (http://check.sourceforge.net/), and
> I've been wanting to talk to Jamey and Josh about their experience with
> it, but I never seem to get around to it. Maybe now is the right time. :)
>
There are also (3) unit tests for the r300 compiler in
src/mesa/drivers/dri/r300/compiler/tests. I haven't used check before,
but it looks pretty good based on the documentation.
-Tom
More information about the mesa-dev
mailing list