summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu
AgeCommit message (Collapse)Author
2008-11-11CELL: two-sided stencil fixesRobert Ellison
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.
2008-11-07CELL: fix several stencil problemsRobert Ellison
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.
2008-11-05cell: minor reformatting, var renamingBrian Paul
2008-10-30CELL: fix use of stencil value maskRobert Ellison
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.
2008-10-30cell: Protected use of non-initialized untile buffersJonathan White
2008-10-30CELL: stencil bug fixesRobert Ellison
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.
2008-10-30cell: Added check for PIPE_FLUSH_RENDER_CACHE to cell_flush to fix black ↵Jonathan White
blocks during st_readpixels due to a flush wait not happening in order to allow any previous rendering to complete.
2008-10-29cell: add scalar param to emit_function_call() to indicate scalar function callsBrian Paul
Scalar calls only use the X component of the src regs and smear the result across the dest register's X/Y/Z/W.
2008-10-28cell: fix a number of fence issuesBrian Paul
Plus add assertions to check status, alignment, etc.
2008-10-28cell: don't include libmisc.hBrian Paul
Doesn't seem to be needed and fixes compilation with SDK 3.1 beta.
2008-10-27cell: fix some problems when displaying to a PIPE_FORMAT_B8G8R8A8_UNORM screenBrian Paul
2008-10-27cell: Added support for untwiddling textures during glReadPixels. This ↵Jonathan White
allows glReadPixels to work correctly on cell now and makes conformance tests that use pixel compares useable.
2008-10-22cell: include pthread.hBrian Paul
2008-10-22cell: implement fencing for texture buffersBrian Paul
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.
2008-10-22cell: set cell->num_texturesBrian Paul
2008-10-22cell: note that dst reg writing needs clampingBrian Paul
2008-10-20cell: minor improvements to batch buffer functionsBrian Paul
2008-10-20cell: temporarily disable freeing of tiled texture memoryBrian Paul
Allows glDrawPixels to work for now...
2008-10-17cell: add new debug flag (cache) to report texture cache stats on exitBrian Paul
2008-10-17cell: more efficient state emit for textures/samplersBrian Paul
2008-10-16cell: implement KIL instructionBrian Paul
2008-10-16cell: CELL_NUM_SPUS env varBrian Paul
2008-10-16cell: clean up various texture-related thingsBrian Paul
Distinguish among texture targets in codegen. progs/demos/cubemap.c runs correctly now too.
2008-10-15cell: start some performance measurementsBrian Paul
Use the spu_write_decrementer() and spu_read_decrementer() functions to measure time. Convert to milliseconds according to the system timebase value.
2008-10-15cell: send rasterizer state to SPUs in proper way, remove front_winding hackBrian Paul
2008-10-15cell: query # cells tooBrian Paul
2008-10-15cell: query number SPUs with spe_cpu_info_get()Brian Paul
2008-10-15cell: use CELL_MAX_SPUS consistently.Brian Paul
2008-10-15cell: remove some old, pre-batchbuffer stuffBrian Paul
2008-10-15cell: simplify spu debug codeBrian Paul
2008-10-15cell: propogate blend color to SPUs for the fallback fragment ops codeBrian Paul
2008-10-15cell: need to flush draw module when constants changeBrian Paul
2008-10-14cell: initial bits for 3D texture supportBrian Paul
2008-10-14cell: replace FREE() with align_free()Brian Paul
2008-10-14cell: support for cubemapsBrian Paul
Though, progs/demos/cubemap.c doesn't quite work right...
2008-10-14cell: fall-through case for TGSI_OPCODE_TXBBrian Paul
2008-10-14cell: fix npot texture tiling bugsBrian Paul
2008-10-14cell: fix assertionsBrian Paul
2008-10-14cell: fix tex image stride bugsBrian Paul
2008-10-14cell: now do texture twiddling in the right way, at the right time.Brian Paul
Also handles images smaller than 32x32 now.
2008-10-14cell: remove old code, clean-ups, etc.Brian Paul
2008-10-13cell: initial work for mipmap texture filteringBrian Paul
2008-10-10cell: more instruction scheduling optimizations (MIN/MAX/LERP/etc)Brian Paul
Also, optimize register->memory stores.
2008-10-10cell: pass texture unit (sampler number) to txp() functionBrian Paul
The glsl/multitex demo runs now.
2008-10-10cell: fix function prologue/epilogue code for large stack framesBrian Paul
The ai instruction is limited to a 10-bit signed immediate value.
2008-10-10CELL: fixing stencil bugsRobert Ellison
These are the defects found and fixed so far. Several more have been observed; I'm working on them. - Fixed an error in spe_load_uint() that caused incorrect values to be loaded if the given unsigned value had the low 18 bits as 0, and that caused inefficient code to be emitted if the given value had the high 14 bits as 0. - Fixed a problem in stencil code generation where optional registers weren't tracked correctly. - Fixed a problem that the stencil function NEVER was acting as ALWAYS. - Fixed several problems that could occur if stenciling were enabled but depth was disabled. - Fixed a problem with two-sided stencil writemask handling that could cause a stencil writemask to not be applied. - Fixed several state permutations that were incorrectly flagged as not requiring stencil values to be calculated.
2008-10-10cell: call cell_flush_int() at end of cell_create_context()Brian Paul
Ensures that SPUs are initialized/ready before proceeding. This fixes a spurious assertion failure when the SPU-side shader function info hasn't been returned to the PPU before shader codegen.
2008-10-10cell: fix LERP when dst reg is a src regBrian Paul
Also, bump up frame size and fix some assertions.
2008-10-10cell: fix fm/fs copy & paste bug from a few commits agoBrian Paul
2008-10-10cell: fix bug in emit_FLR() when src reg == dst regBrian Paul