summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
AgeCommit message (Collapse)Author
2008-11-16i915: Silence warningsJakob Bornecrantz
2008-11-13CELL: fix stencil twiddling, stencil invertRobert Ellison
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.
2008-11-13Merge branch 'gallium-0.2' of ↵Stephane Marchesin
git+ssh://marcheu@git.freedesktop.org/git/nouveau/mesa into gallium-0.2
2008-11-12nv04..nv30: fix pipe_surface initPekka Paalanen
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-12Merge commit 'origin/gallium-0.1' into gallium-0.2Pekka Paalanen
* commit 'origin/gallium-0.1': Mesa: fix number of buffers in st_draw_vbo(). Nouveau: fix nv20_vertex_layout() Nouveau: update nv20 miptree according to nv40. Nouveau: build, link and use nv20. Nouveau: name replace for nv20. Nouveau: Rename nv20/ files as nv20. Nouveau: copy nv30_vertprog.c to nv20. Nouveau: start nv20 by copying the nv10 tree.
2008-11-12CELL: fix stencil test bugsRobert Ellison
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).
2008-11-12cell: include cell_surface.hBrian Paul
2008-11-12cell: include cell_pipe_state.hBrian Paul
2008-11-11cell: implement NRM3 opcodeBrian Paul
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-10nv40: init pipe_surface correctlyBen Skeggs
2008-11-10Merge remote branch 'origin/gallium-0.2' into gallium-0.2Ben Skeggs
2008-11-09gallium: use PIPE_ARCH_SSE to protect use of SSE instrinsics onlyBrian
This allows us to use SSE codegen with debug builds again. When PIPE_ARCH_SSE is set (w/ gcc -msse -msse2) we will also use the gcc SSE intrinsic functions.
2008-11-09Nouveau: fix nv20_vertex_layout()Pekka Paalanen
The function should update nv20->vertex_info, and not just a local struct that's thrown away immediately. Fixes a SIGFPE due to vbuf->vertex_size = 0 in vbuf_alloc_vertices(). Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: update nv20 miptree according to nv40.Pekka Paalanen
glxinfo doesn't degfault anymore. Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: build, link and use nv20.Pekka Paalanen
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: name replace for nv20.Pekka Paalanen
No functional changes, only changed function, struct, macro etc. names. nv10 -> nv20 nv30 -> nv20 celsius -> kelvin Did not touch fifo command macros. Don't try to build nv20_vertprog.c for now. Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: Rename nv20/ files as nv20.Pekka Paalanen
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: copy nv30_vertprog.c to nv20.Pekka Paalanen
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2008-11-08Nouveau: start nv20 by copying the nv10 tree.Pekka Paalanen
Signed-off-by: Pekka Paalanen <pq@iki.fi>
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-06Merge commit 'origin/gallium-0.1' into gallium-0.2Brian Paul
2008-11-06softpipe: debug code (disabled)Brian Paul
2008-11-05cell: minor reformatting, var renamingBrian Paul
2008-11-05Merge commit 'origin/gallium-0.1' into gallium-0.2Brian Paul
Conflicts: src/gallium/auxiliary/rtasm/rtasm_execmem.c src/mesa/shader/slang/slang_emit.c src/mesa/shader/slang/slang_log.c src/mesa/state_tracker/st_atom_framebuffer.c
2008-11-05gallium: call tgsi_set_exec_mask() and use exec mask in SSE ARL codeBrian Paul
This prevents vertex shaders from referencing invalid memory locations when the shader is operating on less than four vertices or fragments.
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-29cell: use simd utilities for pow, exp2, log2Brian Paul
2008-10-29nv40: rename some vars in texture layout codeBen Skeggs
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-27Merge remote branch 'nouveau/gallium-0.1' into gallium-0.2Ben Skeggs
2008-10-27Merge remote branch 'origin/gallium-0.2' into gallium-0.2Ben Skeggs
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-21gallium: remove unused varBrian 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: use an approximation in compute_lambda_2d() to avoid sqrtBrian Paul
Though, the logf() call still needs attention.
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-17cell: use 7-bit weights in sample_texture_2d_bilinear_int()Brian Paul
This allows us to use 16-bit signed mul/add instructions. Had to used unsigned mul before and there's no unsigned mul/add instruction.