aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
Commit message (Collapse)AuthorAgeFilesLines
* util/u_draw: Skip rendering instead of aborting when excessive number of ↵José Fonseca2012-12-041-2/+9
| | | | | | | | | | | | instances is found. This is a temporary hack. I believe the only way of properly fixing this is to check buffer overflow just before fetching based on addresses, instead of number of vertices/instances. This change simply allows tests that stress buffer overflows to complete without asserting, and should not affect valid rendering. Reviewed-by: Brian Paul <[email protected]>
* util/surface: Always use the surface format when clearing.José Fonseca2012-12-041-7/+8
| | | | | | Not the texture format, as they might differ. Reviewed-by: Brian Paul <[email protected]>
* u_cache: fix dereference before NULL checkDave Airlie2012-12-041-4/+4
|
* util: added pipe_surface_release() functionBrian Paul2012-11-301-0/+16
| | | | | | | | | To fix a pipe_context::surface_destroy() use-after-free problem. We previously added pipe_sampler_view_release() for similar reasons. Note: this is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* util/u_format: Kill util_format_is_array().José Fonseca2012-11-292-51/+0
| | | | | | | | It is buggy (it was giving wrong results for some of the formats with padding), and util_format_description::is_array already does precisely what's intended. Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_format: Tighten the meaning of is_array bit to exclude mixed type ↵José Fonseca2012-11-292-2/+11
| | | | | | | | | | | formats. This is what we want in practice. The only change is in PIPE_FORMAT_R8SG8SB8UX8U_NORM, which no longer is considered an array format. Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_format: Fix format manipulation for big-endianAdhemerval Zanella2012-11-291-5/+5
| | | | | | | | This patch fixes various format manipulation for big-endian architectures. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* util: add more memory debugging featuresBrian Paul2012-11-281-1/+81
| | | | | | | | Add a DEBUG_FREED_MEMORY option to help catch use-after-free errors. Add debug_memory_check() function which can be periodically called to check that all known blocks are good. Reviewed-by: José Fonseca <[email protected]>
* util: Updated util_format_is_array to be more accurate.James Benton2012-11-282-3/+16
| | | | | | | Will allow formats with padding, e.g. RGBX. Will now allow swizzled formats as long as the alpha is channel 3. Reviewed-by: Jose Fonseca <[email protected]>
* util: Modified u_rect to default to memcpy.James Benton2012-11-271-8/+1
| | | | | | | | Previously this function would assert if the format didn't fit an expected 4 channel format size. Now will work with any format type with any amount of channels. Signed-off-by: José Fonseca <[email protected]>
* util/format: Fix bug in float to non-float conversion in u_format_pack.py.James Benton2012-11-271-1/+1
| | | | Signed-off-by: José Fonseca <[email protected]>
* util: Only use open coded snprintf for MSVC.Vinson Lee2012-11-162-3/+3
| | | | | | | | | | | | MinGW has snprintf. The patch fixes these warnings with the MinGW SCons build. src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype for ‘util_vsnprintf’ [-Wmissing-prototypes] src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype for ‘util_snprintf’ [-Wmissing-prototypes] Signed-off-by: Vinson Lee <[email protected]> Tested-by: Brian Paul <[email protected]>
* util/u_debug: Fix DEBUG_NAMED_VALUE.José Fonseca2012-11-151-1/+1
| | | | "#__symbol" doesn't work with nested macro expansions, at least not on gcc.
* gallium/u_blitter: handle PIPE_TEXTURE_CUBE_ARRAY in is_box_inside_resourceMarek Olšák2012-11-111-0/+6
|
* u_blitter: fix cube array checkDave Airlie2012-11-101-1/+1
| | | | | | | | Pointed out by Marek on irc, no committing after beer! Signed-off-by: Dave Airlie <[email protected]>
* util/u_surface: Support 3D/array textures in util_resource_copy_region().José Fonseca2012-11-091-26/+44
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_surface: Fix util_clear_depth_stencil for Z32_FLOAT_S8X24_UINT.José Fonseca2012-11-091-12/+6
| | | | | | | | | | util_pack_z_stencil was being unconditionally invoked for all formats, causing an assertion failure for Z32_FLOAT_S8X24_UINT. NOTE: Candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe,util: Fix blending of R and RG formats.José Fonseca2012-11-091-25/+1
| | | | | | | | | Alpha is also 1 for formats like R32G32_FLOAT. NOTE: Candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util: Fix reduction of line adjacency primitives.José Fonseca2012-11-091-0/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_rect: Make it C++ safe.José Fonseca2012-11-091-0/+15
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* u_blitter: don't create fragment program for cube maps unless supported.Dave Airlie2012-11-091-1/+6
| | | | | | should fix http://bugs.freedesktop.org/56906 Signed-off-by: Dave Airlie <[email protected]>
* u_blitter: add cube map array support.Dave Airlie2012-11-091-2/+3
| | | | | | | This adds cube array support to the blitter. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: add defines/shader opcode for texture cube map arrayDave Airlie2012-11-091-0/+3
| | | | | | | | | | | | | | | | This just adds the texture target and capability along with 3 new opcodes required to support this extension. As this extension requires some texture opcodes with samp + 5 args, we need to use another src register, this is only required for TEX, TXL and TXB opcodes to implement this spec. TEX2 is required for shadow cube map arrays TXL2 is required for cube map array sampler + explicit lod TXB2 is required for cube map array sampler + lod bias Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: add in-place DB decompression and texturing with DB tilingMarek Olšák2012-11-061-1/+2
| | | | | | | | | | | | | | | | | | | | | The decompression is done in-place and only the compressed tiles are decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F. The texture unit is programmed to use non-displayable tiling and depth ordering of samples, so that it can fetch the texture in the native DB format. The latest version of the libdrm surface allocator is required for stencil texturing to work. The old one didn't create the mipmap tree correctly. We need a separate mipmap tree for stencil, because the stencil mipmap offsets are not really depth offsets/4. There are still some known bugs, but this should save some memory and it also improves performance a little bit in Lightsmark (especially with low resolutions; tested with Radeon HD 5000). The DB->CB copy is still used for transfers. Reviewed-by: Jerome Glisse <[email protected]>
* util: Make u_framebuffer.h C++ safe.José Fonseca2012-11-051-0/+8
|
* gallium/u_vbuf: document how it worksMarek Olšák2012-11-012-3/+63
|
* gallium/u_vbuf: optimize looping over the list of buffers to uploadMarek Olšák2012-11-011-9/+12
|
* gallium/u_vbuf: skip processing of buffers unused by the vertex element stateMarek Olšák2012-11-011-15/+24
|
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-3112-164/+336
| | | | | | | | | | | | | | | | | | | | | This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <[email protected]>
* r600g: implement texturing with 8x MSAA compressed surfaces for EvergreenMarek Olšák2012-10-292-0/+14
| | | | | | | | | | The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns garbage there. The 8x MSAA case is broken on Cayman, though at least the result looks somewhat correct. Only the 8x MSAA case works on Evergreen and is enabled.
* util: fix MSVC signed/unsigned comparison warning in u_upload_mgr.c codeBrian Paul2012-10-171-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* util: fix MSVC signed/unsigned comparison warning in u_vbuf.c codeBrian Paul2012-10-171-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* util: fix MSVC double/float conversion warning in u_format_r11g11b10f.hBrian Paul2012-10-171-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* util/blitter: silence assorted MSVC warningsBrian Paul2012-10-172-21/+22
| | | | | | | Fix signed/unsigned comparison warnings and float/int assignment warnings. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* util: added debug_print_transfer_flags() functionBrian Paul2012-10-152-0/+45
|
* util: null-out the node's prev/next pointers in list_del()Chris Fester2012-10-151-0/+1
| | | | | Note: This is a candidate for the 9.0 branch. Signed-off-by: Brian Paul <[email protected]>
* u_format_s3tc.c: Don't call getenv() twiceMatt Turner2012-10-121-2/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: implement MSAA resolving for 8-bit and 16-bit integer formatsMarek Olšák2012-10-122-3/+5
| | | | by changing the format to NORM.
* util: fix broken pipe_get_tile_rgba() callBrian Paul2012-10-111-1/+1
| | | | Fix breakage from commit 369e468.
* gallium: unify transfer functionsMarek Olšák2012-10-1113-345/+181
| | | | | | | | | | | | | | "get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
* st/mesa: implement decompress_with_blit using gallium blitMarek Olšák2012-09-302-36/+5
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: add helpers for dumping pipe_box and pipe_blit_infoMarek Olšák2012-09-302-0/+79
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: add helper for blitting via resource_copy_regionMarek Olšák2012-09-302-0/+152
| | | | | | v2: fix off-by-one error in is_box_inside_resource, add comments Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: add gallium blit implementationMarek Olšák2012-09-302-120/+230
| | | | | | | The original blit function is extended and the otAher functions reuse it. Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: add ability to disable and restore the render conditionMarek Olšák2012-09-302-0/+48
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: facilitate co-existence with the Draw moduleMarek Olšák2012-09-302-59/+111
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: check PIPE_CAP_TEXTURE_MULTISAMPLEMarek Olšák2012-09-301-0/+8
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: fix stencil-only blitsMarek Olšák2012-09-141-0/+15
| | | | NOTE: This is a candidate for the stable branches.
* Remove useless checks for NULL before freeingMatt Turner2012-09-052-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same as earlier commit, except for "FREE" This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + FREE (E); + E = NULL; - if (unlikely (E != NULL)) { - FREE(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + FREE ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - FREE((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + FREE (E); - if (unlikely (E != NULL)) { - FREE (E); - } @@ expression E; type T; @@ + FREE ((T) E); - if (unlikely (E != NULL)) { - FREE ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* Use the correct macro _WIN32 for Windows.Vinson Lee2012-09-052-3/+3
| | | | | | | | | | | | | | The correct predefined macro for Windows is _WIN32, not WIN32 or __WIN32__. _WIN32 is defined for 32-bit and 64-bit version of Windows by both MSVC and MinGW compilers. http://sourceforge.net/p/predef/wiki/OperatingSystems http://msdn.microsoft.com/en-us/library/b0084kay.aspx This patch also fixes a MinGW automake build error. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>