Jonathan Adamczewski wrote: > I've been considering some optimisations to the SPU render, > particularly pulling the clipping test out of spu_tri.c: > setup_sort_vertices() that is done for each tri for each tile and > instead doing the test once for each tri in spu_render.c: > cmd_render() and creating a mask. > > In the process of trying to work out if this was actually a good > idea, I spent some time trying to understand exactly where/how > vertices are transformed into window coords before being passed > through to the spu render from cell_vbuf.c, with the idea that > calculating a tile-clip mask when the verts are transformed might be > a good idea. > > The comment in cell_vbuf.c file indicates that this is done in the > draw module. I had a poke around to try to find where that might be > or what it might look like, but grepping through function pointers > gets tricky (and tedious) fairly quickly. Where is the code that > handles vertex transforms for the Cell driver?
There's several paths through the draw code but if you grep for 'viewport' you should find where window coords are produced. > Also, can I get a rough summary of what needs to be done to get > vertex setup done on the SPU? (again) I believe Ian's previous SPU vertex xform code worked by splitting up the vertex buffer among the SPUs, having each SPU process its piece, then sending the new vertices back to main memory where the PPU continued with clipping, viewport xform, etc. What we have now (PPU vertex xform) is faster. There's probably a few different ways that vertex xform (and clipping, etc) could be done with the SPUs but it'll be some work. At some point, the vertex data needs to get redistributed among the SPUs for rasterization. Putting everything back to main memory and pulling it back to the SPUs seems pretty inefficient. Personally, before I'd go too far with anything I'd spend some time on instrumenting and profiling to learn where time is currently spent for a variety of workloads. -Brian ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
