summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/cell/common.h
Commit message (Collapse)AuthorAgeFilesLines
* gallium/cell: Remove the driver.Kai Wasserbäch2011-11-291-377/+0
| | | | | | | Complicates Gallium3D development and doesn't seem to have active users. Signed-off-by: Kai Wasserbäch <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* cell: comment-out unneeded padding fieldBrian Paul2010-07-261-1/+1
|
* cell: adjust structure paddingBrian Paul2010-02-121-1/+2
| | | | | | The size of some core Gallium state structures has changed so the padding on some cell structs needed to be adjusted to keep them a multiple of 16 bytes.
* cell: fix the usual cell breakageMarc Dietrich2010-02-081-2/+1
| | | | | | also update the cell config a bit Signed-off-by: Brian Paul <[email protected]>
* gallium: Generalize the alignment macros to other compilers and any alignment.José Fonseca2010-01-121-1/+2
|
* cell: fix compilationMarc Dietrich2009-08-301-1/+1
|
* cell: allocate batch buffers w/ 16-byte alignmentJonathan Adamczewski2009-01-121-11/+32
| | | | | | | | | | | Replace cell_batch{align,alloc)*() with cell_batch_alloc16(), allocating multiples of 16 bytes that are 16 byte aligned. Opcodes are stored in preferred slot of SPU machine word. Various structures are explicitly padded to 16 byte multiples. Added STATIC_ASSERT().
* CELL: use variant-length fragment ops programsRobert Ellison2008-11-211-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a set of changes that optimizes the memory use of fragment operation programs (by using and transmitting only as much memory as is needed for the fragment ops programs, instead of maximal sizes), as well as eliminate the dependency on hard-coded maximal program sizes. State that is not dependent on fragment facing (i.e. that isn't using two-sided stenciling) will only save and transmit a single fragment operation program, instead of two identical programs. - Added the ability to emit a LNOP (No Operation (Load)) instruction. This is used to pad the generated fragment operations programs to a multiple of 8 bytes, which is necessary for proper operation of the dual instruction pipeline, and also required for proper SPU-side decoding. - Added the ability to allocate and manage a variant-length struct cell_command_fragment_ops. This structure now puts the generated function field at the end, where it can be as large as necessary. - On the PPU side, we now combine the generated front-facing and back-facing code into a single variant-length buffer (and only use one if the two sets of code are identical) for transmission to the SPU. - On the SPU side, we pull the correct sizes out of the buffer, allocate a new code buffer if the one we have isn't large enough, and save the code to that buffer. The buffer is deallocated when the SPU exits. - Commented out the emit_fetch() static function, which was not being used.
* CELL: two-sided stencil fixesRobert Ellison2008-11-111-1/+5
| | | | | | | | | | | | | | | | | | | With these changes, the tests/stencil_twoside test now works. - Eliminate blending from the stencil_twoside test, as it produces an unneeded dependency on having blending working - The spe_splat() function will now work if the register being splatted and the destination register are the same - Separate fragment code generated for front-facing and back-facing fragments. Often these are the same; if two-sided stenciling is on, they can be different. This is easier and faster than generating code that does both tests and merges the results. - Fixed a cut/paste bug where if the back Z-pass stencil operation were different from all the other operations, the back Z-fail results were incorrect.
* CELL: fix several stencil problemsRobert Ellison2008-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This small set of changes repairs several different stenciling problems; now redbook/stencil also runs correctly (and maybe others - I haven't checked everything yet). - The number of instructions that had been allocated for fragment ops used to be 64 (in cell/common.h). With complicated stencil use, we managed to get up to 93, which caused a segfault before we noticed we'd overran our memory buffer. It's now been bumped to 128, which should be enough for even complicated stencil and fragment op usage. - The status of cell surfaces never changed beyond the initial PIPE_SURFACE_STATUS_UNDEFINED. When a user called glClear() to clear just the Z buffer (but not the stencil buffer), this caused the check_clear_depth_with_quad() function to return false (because the surface status was believed to be undefined), and so the device was instructed to clear the whole buffer (including the stencil buffer), instead of correctly using a quad to clear just the depth, leaving the stencil alone. This has been fixed similarly to the way the i915 driver handles the surface status: during cell_clear_surface(), the status is set to PIPE_SURFACE_STATUS_DEFINED. Then a partial buffer clear is handled with a quad, as expected. Note that we are *not* using PIPE_SURFACE_STATUS_CLEAR (also similar to the i915); technically, we should be setting the surface status to CLEAR on a clear, and to DEFINED when we actually draw something (say on cell_vbuf_draw()), but it's difficult to figure out exactly which surfaces are affected by a cell_vbuf_draw(), so for now we're doing the easy thing. - The fragment ops handling was very clever about only pulling out the parts of the Z/stencil buffer that it needed for calculations; but this failed when only part of the buffer was written, because the part that was never pulled out was inadvertently cleared. Now all the data from the combined Z/stencil buffer is pulled out, just so the proper values can be recombined later and written back to the buffer correctly. As a bonus, the fragment op code generation is simplified.
* cell: implement fencing for texture buffersBrian Paul2008-10-221-0/+25
| | | | | | | If we delete a texture, we need to keep the underlying tiled data buffer around until any rendering that references it has completed. Keep a list of buffers referenced by a rendering batch. Unref/free them when the associated batch's fence is executed/signalled.
* cell: add new debug flag (cache) to report texture cache stats on exitBrian Paul2008-10-171-0/+1
|
* cell: start some performance measurementsBrian Paul2008-10-151-0/+1
| | | | | Use the spu_write_decrementer() and spu_read_decrementer() functions to measure time. Convert to milliseconds according to the system timebase value.
* cell: send rasterizer state to SPUs in proper way, remove front_winding hackBrian Paul2008-10-151-4/+14
|
* cell: use CELL_MAX_SPUS consistently.Brian Paul2008-10-151-1/+1
|
* cell: remove some old, pre-batchbuffer stuffBrian Paul2008-10-151-14/+0
|
* cell: move some CELL_MAX constantsBrian Paul2008-10-151-1/+5
|
* cell: simplify spu debug codeBrian Paul2008-10-151-0/+1
|
* cell: propogate blend color to SPUs for the fallback fragment ops codeBrian Paul2008-10-151-0/+4
|
* cell: initial bits for 3D texture supportBrian Paul2008-10-141-0/+1
|
* cell: support for cubemapsBrian Paul2008-10-141-0/+1
| | | | Though, progs/demos/cubemap.c doesn't quite work right...
* cell: initial work for mipmap texture filteringBrian Paul2008-10-131-2/+4
|
* cell: increase SPU_MAX_FRAGMENT_PROGRAM_INSTSBrian Paul2008-10-081-1/+1
|
* cell: add support for fragment shader constant buffersBrian Paul2008-10-071-0/+1
|
* CELL: changes to generate SPU code for stencilingRobert Ellison2008-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* cell: checkpoint: support for function calls in SPU shadersBrian Paul2008-09-261-1/+17
| | | | | | | Will be used for instructions like SIN/COS/POW/TEX/etc. The PPU needs to know the address of some functions in the SPU address space. Send that info to the PPU/main memory rather than patch up shaders on the SPU side. Not finished/tested yet...
* CELL: fleshing out the blending fragment opsRobert Ellison2008-09-171-6/+5
| | | | | | | | | | | | | | | | | | | | | - Added two new debug flags (to be used with the CELL_DEBUG environment variable). The first, "CELL_DEBUG=fragops", activates SPE fragment ops debug messages. The second, "CELL_DEBUG=fragopfallback", will eventually be used to disable the use of generated SPE code for fragment ops in favor of the default fallback reference routine. (During development, though, the parity of this flag is reversed: all users will get the reference code *unless* CELL_DEBUG=fragopfallback is set. This will prevent hiccups in code generation from affecting the other developers.) - Formalized debug message usage and macros in spu/spu_main.c. - Added lots of new code to ppu/cell_gen_fragment.c to extend the number of supported source RGB factors from 4 to 15, and to complete the list of supported blend equations. More coming, to complete the source and destination RGB and alpha factors, and to complete the rest of the fragment operations...
* cell: export CELL_DEBUG=asm to dump SPU assembly codeBrian Paul2008-09-151-1/+2
|
* cell: initial support for fragment shader code generation.Brian Paul2008-09-111-0/+15
| | | | | | TGSI shaders are translated into SPE instructions which are then sent to the SPEs for execution. Only a few opcodes work, no swizzling yet, no support for constants/immediates, etc.
* cell: remove old state CMDs, added commentsBrian Paul2008-09-111-6/+10
|
* cell: remove old blend/depth/stencil/logicop structsBrian Paul2008-09-111-29/+0
|
* cell: checkpoint: remove more of the old per-fragment codeBrian Paul2008-09-111-0/+2
|
* cell: checkpoint commit of new per-fragment processingBrian Paul2008-09-111-3/+17
| | | | | | | Do code generation for alpha test, z test, stencil, blend, colormask and framebuffer/tile read/write as a single code block. Ian's previous blend/z/stencil test code is still there but mostly disabled and will be removed soon.
* cell: implement CELL_DEBUG env/options varBrian Paul2008-09-041-0/+4
| | | | | | Options so far: "checker" module tile clear color by SPU ID to see where the tiles are "sync" to do synchronous DMA (only partially implemented)
* gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.hBrian Paul2008-08-241-1/+0
| | | | Also, rename p_tile.[ch] to u_tile.[ch]
* cell: more work for multi-texture supportBrian2008-03-311-4/+13
|
* cell: initial work to support multi-textureBrian2008-03-311-2/+6
|
* cell: updated comments: s/test/SPE/Brian2008-03-311-3/+3
|
* cell: Implement code-gen for logic opIan Romanick2008-03-261-2/+9
| | | | | | | This also implements code-gen for the float-to-packed color conversion. It's currently hardcoded for A8R8G8B8, but that can easily be fixed as soon as other color depths are supported by the Cell driver.
* cell: Use code-gen for alpha blendIan Romanick2008-03-201-0/+10
| | | | So far this is only tested when GL_BLEND is disabled.
* cell: Initial code-gen for alpha / stencil / depth testingIan Romanick2008-03-171-0/+10
| | | | | | | | Alpha test is currently broken because all per-fragment testing occurs before alpha is calculated. Stencil test is currently broken because the Z-clear code asserts if there is a stencil buffer.
* Cell: Remove erroneous ALIGN16_ATTRIB attributesIan Romanick2008-02-211-3/+3
| | | | | | | If a structure is marked as being aligned the SPE compiler performs extra optimizations (sadly, only -O2 is used) when reading the structure. Since most of the structures sent in batch buffers are only 8-byte aligned, this resulted in mysterous bugs with -O2.
* Cell: Initial pass at unified data cacheIan Romanick2008-02-211-0/+8
|
* Cell: emit vertex shaders and uniforms more intelligentlyIan Romanick2008-02-191-11/+11
|
* Cell: Enable code gen for SPE attribute fetchIan Romanick2008-02-151-4/+11
| | | | Doubles are still unsupported.
* Code reorganization: move files into their places.José Fonseca2008-02-151-0/+220
This is in a separate commit to ensure renames are properly preserved.