Mesa (gallium-0.2): CELL: changes to generate SPU code for stenciling
Robert Ellison
papillo at kemper.freedesktop.org
Sat Oct 4 00:08:18 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: afaa53040bd01ca86762e7d7b1a5a65810767921
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=afaa53040bd01ca86762e7d7b1a5a65810767921
Author: Robert Ellison <papillo at tungstengraphics.com>
Date: Fri Oct 3 18:00:43 2008 -0600
CELL: changes to generate SPU code for stenciling
This set of code changes are for stencil code generation
support. Both one-sided and two-sided stenciling are supported.
In addition to the raw code generation changes, these changes had
to be made elsewhere in the system:
- Added new "register set" feature to the SPE assembly generation.
A "register set" is a way to allocate multiple registers and free
them all at the same time, delegating register allocation management
to the spe_function unit. It's quite useful in complex register
allocation schemes (like stenciling).
- Added and improved SPE macro calculations.
These are operations between registers and unsigned integer
immediates. In many cases, the calculation can be performed
with a single instruction; the macros will generate the
single instruction if possible, or generate a register load
and register-to-register operation if not. These macro
functions are: spe_load_uint() (which has new ways to
load a value in a single instruction), spe_and_uint(),
spe_xor_uint(), spe_compare_equal_uint(), and spe_compare_greater_uint().
- Added facing to fragment generation. While rendering, the rasterizer
needs to be able to determine front- and back-facing fragments, in order
to correctly apply two-sided stencil. That requires these changes:
- Added front_winding field to the cell_command_render block, so that
the state tracker could communicate to the rasterizer what it
considered to be the front-facing direction.
- Added fragment facing as an input to the fragment function.
- Calculated facing is passed during emit_quad().
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 246 +++++-
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 41 +-
src/gallium/drivers/cell/common.h | 1 +
src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 881 +++++++++++++++++---
src/gallium/drivers/cell/ppu/cell_render.c | 1 +
src/gallium/drivers/cell/ppu/cell_vbuf.c | 1 +
src/gallium/drivers/cell/spu/spu_main.h | 3 +-
src/gallium/drivers/cell/spu/spu_per_fragment_op.c | 19 +-
src/gallium/drivers/cell/spu/spu_per_fragment_op.h | 3 +-
src/gallium/drivers/cell/spu/spu_render.c | 4 +-
src/gallium/drivers/cell/spu/spu_tri.c | 35 +-
src/gallium/drivers/cell/spu/spu_tri.h | 2 +-
12 files changed, 1091 insertions(+), 146 deletions(-)
Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=afaa53040bd01ca86762e7d7b1a5a65810767921
More information about the mesa-commit
mailing list