aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/cell
Commit message (Collapse)AuthorAgeFilesLines
* cell: Add missing suffix to SHUFFLE macroJonathan Adamczewski2009-01-131-1/+1
|
* cell: allocate batch buffers w/ 16-byte alignmentJonathan Adamczewski2009-01-128-143/+111
| | | | | | | | | | | 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: optimize unpack_colors() function, saving 12 cyclesBrian Paul2009-01-111-31/+34
|
* cell: move color unpacking code into separate functionBrian Paul2009-01-111-76/+89
|
* cell: re-order the z/stencil fetch/extract/convert instructions for better perfBrian Paul2009-01-111-55/+51
| | | | The new instruction order is 10 cycles faster.
* cell: simplify the 'optional register' codeBrian Paul2009-01-111-62/+50
|
* cell: asst datatype clean-upsBrian Paul2009-01-111-73/+75
|
* cell: move depth/stencil code into separate functionBrian Paul2009-01-111-179/+213
|
* cell: clean-up, re-indent, commentsBrian Paul2009-01-111-95/+139
|
* cell: use tgsi_dump_instruction() instead of spe_comment()Brian Paul2009-01-101-101/+25
|
* cell: added rule to produce .s assembly filesBrian Paul2009-01-101-0/+3
|
* cell: replace 0 with -1 in SPE_COUNT_USABLE_SPES queryJonathan Adamczewski2009-01-061-1/+1
|
* cell: fix code emit for RSQ/RCP when src arg == dst argBrian Paul2009-01-051-6/+8
| | | | Fixes moire-like artifacts seen in fslight demo.
* cell: SIMDize sorting in setup_sort_vertices()Jonathan Adamczewski2009-01-051-55/+42
| | | | | | Put setup.v{min,mid,max,provoke} into a union with qword vertex_headers. Rewrite vertex sorting to more efficiently handle the packed data items. Reduces spu_tri.o by ~128 bytes.
* cell: SIMDize some subtractionsJonathan Adamczewski2009-01-051-8/+10
| | | | | | | Put edge.{dx,dy} into a union with a vector and perform subtractions in setup_sort_vertices() on vectors. Reduces spu_tri.o by ~300 bytes.
* cell: improvements to spu_tri.cJonathan Adamczewski2009-01-041-42/+52
| | | | | | | Replace int setup.span{left,right}[2] with vec_uint4 setup.span.quad SIMDize calculate_mask() and inline into into flush_spans() Set setup.span.quad members using spu_shuffle() or spu_sel(). Reduces spu_tri.o by ~116 bytes.
* cell: new spu_shuffle.h headerJonathan Adamczewski2009-01-041-0/+186
| | | | | | | Facilitates creation of shuffle patterns for use with spu_shuffle() and si_shufb() intrinsics. To be used by subsequent patches.
* cell: initial codegen support for fragment shader loopsBrian Paul2009-01-041-26/+193
| | | | | | Basic for/while loops work now. Only one level of loop nesting is supported at this time (same for if/else). The progs/glsl/mandelbrot demo works, but the colors are too dim.
* cell: add support for PIPE_CAP_TEXTURE_MIRROR_REPEAT queryBrian Paul2009-01-041-0/+4
| | | | We don't really support this texwrap mode yet, but this enables GL 2.1
* cell: clean-up, improve SPU code generationBrian Paul2009-01-041-622/+506
| | | | Start on ARL and address-relative indexing too.
* cell: fix typo (s/10/0)Brian2009-01-031-2/+2
|
* CELL: use variant-length fragment ops programsRobert Ellison2008-11-218-64/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: improve twiddling/untwiddling error textRobert Ellison2008-11-201-2/+2
| | | | | | As suggested by Brian Paul: in the case of a twiddling error, instead of reporting the bad format number (which is all but unusable), report the more useful enum name.
* CELL: fix stencil twiddling, stencil invertRobert Ellison2008-11-131-2/+4
| | | | | | | | | | | | | Many stencil tests were failing because of a failure to read the stencil buffer, due to "twiddling" (or "untwiddling") "an unsupported texture format". This is fixed for the case of a stencil/Z S824Z format (which twiddles just like the 32-bit color formats). tests/stencilwrap.c was failing on the GL_INVERT test, because the emitted code for "spe_xori" turned out not to be an actual "xori" instruction, but rather a "stqd" instruction, because of a typo in the rtasm code. This is now fixed, and tests/stencil_wrap now works.
* CELL: fix stencil test bugsRobert Ellison2008-11-122-12/+15
| | | | | | | | | | | | | | Fixed a boneheaded error in the generation of SPU code that calculates the results of the stencil test. Basically, all the greater than/less than calculations were exactly inverted: they were coded as though the given comparison took the stencil value as a left-hand operand and the reference value as a right-hand operand, but the actual semantics always put the reference as the left-hand operand and the stencil as the right-hand operand. With this fix, tests/dinoshade runs, as do all the other Mesa tests and samples that use stencil (and that don't use texture formats unsupported by Cell).
* cell: include cell_surface.hBrian Paul2008-11-121-0/+1
|
* cell: include cell_pipe_state.hBrian Paul2008-11-121-0/+1
|
* cell: implement NRM3 opcodeBrian Paul2008-11-111-0/+48
|
* CELL: two-sided stencil fixesRobert Ellison2008-11-1110-204/+110
| | | | | | | | | | | | | | | | | | | 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-073-88/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: minor reformatting, var renamingBrian Paul2008-11-051-7/+11
|
* CELL: fix use of stencil value maskRobert Ellison2008-10-301-42/+112
| | | | | | | The Cell stencil tests were completely ignoring the stencil value mask. Now the original code paths are still used if the stencil value mask is all 1s; but code to use the mask for the stencil value and reference value comparisons is now emitted if the mask is not all 1s.
* cell: Protected use of non-initialized untile buffersJonathan White2008-10-301-4/+7
|
* CELL: stencil bug fixesRobert Ellison2008-10-305-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Two definitive bugs in stenciling were fixed. The first, reversed registers in the generated Select Bytes (selb) instruction, caused the stenciling INCR and DECR operations to fail dramatically, putting new values in where old values were supposed to be and vice versa. The second caused stencil tiles to not be read and written from main memory by the SPUs. A per-spu flag, spu.read_depth, was used to indicate whether the SPU should be reading depth tiles, and was set only when depth was enabled. A second flag, spu.read_stencil, was set when stenciling was enabled, but never referenced. As stenciling and depth are in the same tiles on the Cell, and there is no corresponding TAG_WRITE_TILE_STENCIL to complement TAG_WRITE_TILE_COLOR and TAG_WRITE_TILE_Z, I fixed this by eliminating the unused "spu.read_stencil", renaming "spu.read_depth" to "spu.read_depth_stencil", and setting it if either stenciling or depth is enabled. I also added an optimization to the fragment ops generation code, that avoids calculating stencil values and/or stencil writemask when the stencil operations are all KEEP.
* cell: Added check for PIPE_FLUSH_RENDER_CACHE to cell_flush to fix black ↵Jonathan White2008-10-301-1/+1
| | | | blocks during st_readpixels due to a flush wait not happening in order to allow any previous rendering to complete.
* cell: add scalar param to emit_function_call() to indicate scalar function callsBrian Paul2008-10-291-34/+69
| | | | | Scalar calls only use the X component of the src regs and smear the result across the dest register's X/Y/Z/W.
* cell: use simd utilities for pow, exp2, log2Brian Paul2008-10-291-22/+6
|
* cell: fix a number of fence issuesBrian Paul2008-10-284-7/+30
| | | | Plus add assertions to check status, alignment, etc.
* cell: don't include libmisc.hBrian Paul2008-10-281-1/+0
| | | | Doesn't seem to be needed and fixes compilation with SDK 3.1 beta.
* cell: fix some problems when displaying to a PIPE_FORMAT_B8G8R8A8_UNORM screenBrian Paul2008-10-271-0/+3
|
* cell: Added support for untwiddling textures during glReadPixels. This ↵Jonathan White2008-10-272-7/+152
| | | | allows glReadPixels to work correctly on cell now and makes conformance tests that use pixel compares useable.
* cell: include pthread.hBrian Paul2008-10-221-0/+1
|
* cell: implement fencing for texture buffersBrian Paul2008-10-2213-19/+367
| | | | | | | 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: set cell->num_texturesBrian Paul2008-10-221-0/+2
|
* cell: note that dst reg writing needs clampingBrian Paul2008-10-221-0/+16
|
* cell: minor improvements to batch buffer functionsBrian Paul2008-10-201-4/+7
|
* cell: temporarily disable freeing of tiled texture memoryBrian Paul2008-10-201-0/+6
| | | | Allows glDrawPixels to work for now...
* cell: use an approximation in compute_lambda_2d() to avoid sqrtBrian Paul2008-10-171-2/+12
| | | | Though, the logf() call still needs attention.
* cell: add new debug flag (cache) to report texture cache stats on exitBrian Paul2008-10-174-2/+7
|
* cell: more efficient state emit for textures/samplersBrian Paul2008-10-173-45/+58
|