aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blitter.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium/u_blitter: fix some shader memory leaksBrian Paul2014-07-091-0/+9
| | | | | | | The _msaa shaders weren't getting freed. Cc: "10.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORTIlia Mirkin2014-07-031-1/+1
| | | | | | | | | Now that this cap is used to determine the availability of both, adjust its name to reflect the new reality. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/u_blitter: implement scaled blitting in the Z directionMarek Olšák2014-04-041-9/+31
| | | | So that pipe->blit can be used for 3D mipmap generation.
* gallium/u_blitter: don't adjust cubemap coordinates by a small numberMarek Olšák2014-04-041-1/+1
| | | | | It may cause issues with mipmap generation. I think it was used to make some piglit tests pass on r300g.
* gallium: allow setting of the internal stream output offsetZack Rusin2014-03-071-4/+9
| | | | | | | | | | | | | | | | D3D10 allows setting of the internal offset of a buffer, which is in general only incremented via actual stream output writes. By allowing setting of the internal offset draw_auto is capable of rendering from buffers which have not been actually streamed out to. Our interface didn't allow. This change functionally shouldn't make any difference to OpenGL where instead of an append_bitmask you just get a real array where -1 means append (like in D3D) and 0 means do not append. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/util: Fix memory leakAaron Watry2014-03-061-0/+2
| | | | | | | | | | Fix a leaked vertex shader in u_blitter.c Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> CC: "10.1" <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: implement shader-based MSAA resolve with bilinear filteringMarek Olšák2013-12-141-31/+48
| | | | | | | | | For scaled resolve. The filter is only good for magnification. If somebody has an idea how to implement a good filter for minification, I'm all ears. I'd have to use derivatives probably. Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: implement shader-based MSAA resolveMarek Olšák2013-12-141-23/+93
| | | | | | | | | We need this for integer formats and upside-down blits, which Radeons don't support for MSAA resolving. It can be used by calling util_blitter_blit. Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: remove useless parameters from some functionsMarek Olšák2013-12-141-14/+10
| | | | Reviewed-by: Brian Paul <[email protected]>
* util: fix compile breakageBrian Paul2013-12-121-1/+1
| | | | D'oh!
* util: move variable declaration out of for-loopBrian Paul2013-12-121-1/+3
| | | | To fix MSVC build.
* gallium/util: implement new color clear API in u_blitterMarek Olšák2013-12-121-3/+42
|
* gallium/util: implement layered framebuffer clear in u_blitterMarek Olšák2013-12-031-24/+48
| | | | | | | | | | | | | All bound layers (from first_layer to last_layer) should be cleared. This uses a vertex shader which outputs gl_Layer = gl_InstanceID, so each instance goes to a different layer. By rendering a quad and setting the instance count to the number of layers, it will trivially clear all layers. This requires AMD_vertex_shader_layer (or PIPE_CAP_TGSI_VS_LAYER), which only radeonsi supports at the moment. r600 could do this too. Standard DX11 hardware will have to use a geometry shader though, which has higher overhead.
* u_gen_mipmap: Use untampered cubemap texture coords when generating mipmaps.José Fonseca2013-11-201-1/+2
| | | | | | | | | | | | | | | | | | | It's not necessary to scale down cubemap texture coords when generating mipmaps: we are doing a 2x minification therefore it's guaranteed that the texture coords will always be at least 1 texel away of the edges. Scaling down can actually be harmful, as it may cause artefacts when generating mipmaps with nearest filtering. Sample points will lie exactly in the middle each 2x2 texels, so the scaling factor was causing different texels to be take on each quadrant of the cube face. This is apparent with a 1x1 checkerboard pattern in the base mipmap level: instead of next mipmap level receiving a constant color throughout the face, it will have different colors for each quadrant of the face. The behaviour for blits is left untouched for now, but the cubemap texture coord scaling hack should be reconsidered eventually. Reviewed-by: Brian Paul <[email protected]>
* gallium: new, unified pipe_context::set_sampler_views() functionBrian Paul2013-10-231-6/+6
| | | | | | | | | | | | The new function replaces four old functions: set_fragment/vertex/ geometry/compute_sampler_views(). Note: at this time, it's expected that the 'start' parameter will always be zero. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Emil Velikov <[email protected]>
* util: remove old bind_fragment_sampler_states() calls from blitter codeBrian Paul2013-10-031-22/+9
|
* util: use pipe_context::bind_sampler_states() if non-nullBrian Paul2013-10-031-6/+22
|
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-181-1/+2
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[email protected]>
* gallium/u_blitter: make clearing independent of the colorbuffer formatMarek Olšák2013-06-131-42/+4
| | | | | | | There isn't any difference between 32_FLOAT and 32_*INT in vertex fetching. Both of them don't do any format conversion. Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: make clearing independent of the number of bound colorbuffersMarek Olšák2013-06-131-55/+25
| | | | | | We can use the fragment shader TGSI property WRITES_ALL_CBUFS. Reviewed-by: Brian Paul <[email protected]>
* gallium: Add support for multiple viewportsZack Rusin2013-05-251-4/+4
| | | | | | | | | | | | Gallium supported only a single viewport/scissor combination. This commit changes the interface to allow us to add support for multiple viewports/scissors. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca2013-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | half_pixel_center. Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <[email protected]> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <[email protected]>
* gallium/u_blitter: implement buffer clearingMarek Olšák2013-04-231-7/+80
| | | | | | | | | | | | Although this might be useful for ARB_clear_buffer_object, I need it for initializating resources in r600g. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Brian Paul <[email protected]> v2: comment cleanups NOTE: This is a candidate for the 9.1 branch.
* gallium/u_blitter: fix is_blit_generic_supported() stencil checkingBrian Paul2013-04-051-12/+14
| | | | | | | | | | | | | | | Don't check if there's sampler support for stencil if we're not going to actually blit/copy stencil values. Fixes the case where we mistakenly said we can't support a blit of depth values from S8Z24 to X8Z24. Also, rename the is_stencil variable to dst_has_stencil to improve readability. NOTE: This is a candidate for the stable branches. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* gallium/util: attempt to fix blitting multisample texture arraysMarek Olšák2013-03-111-1/+1
| | | | We don't have a test for this yet, but obviously the swizzle was wrong.
* u_blitter: don't create illegal shaders for 1D/3D/RECT/CUBE MSAADave Airlie2013-03-041-0/+5
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* util/u_blitter: Set pipe_sampler_state::normalized_coords correctly.José Fonseca2013-02-231-4/+22
| | | | | | | | | We might want to revisit the normalized_coords semantics, but this is the current expected behavior. Fixes fdo bug 61091. Reviewed-by: Brian Paul <[email protected]>
* r300g: implement MSAAMarek Olšák2013-01-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | This is not as optimized as r600g - the MSAA compression is missing, so r300g needs a lot of bandwidth (more than r600g to do the same thing). However, if the bandwidth is not an issue for you, you can enjoy this unoptimized MSAA support. The only other missing optimization for MSAA is the fast color clear. MSAA is enabled on r500 only, because that's the only GPU family I tested. That said, MSAA should work on r300 and r400 as well (but you must set RADEON_MSAA=1 to allow it, then turn MSAA on in your app or set GALLIUM_MSAA=n, n >= 2, n <= 6) I will enable the support by default on r300-r400 once someone (other than me) tests those chipsets with piglit. The supported modes are 2x, 4x, 6x. The supported MSAA formats are RGBA8, BGRA8, and RGBA16F (r500 only). Those 3 formats are used for all GL internal formats. Tested with piglit. (I have ported all MSAA tests to GL2.1)
* util: move var declaration before loop to fix MSVC errorBrian Paul2013-01-041-1/+2
|
* gallium/u_blitter: implement 3D blittingMarek Olšák2013-01-041-30/+74
| | | | | | Scaling and flipping in the Z direction isn't allowed yet. Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: fix blitting TEXTURE_CUBE_ARRAY with a non-zero cube indexMarek Olšák2013-01-041-0/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: minor simplificationMarek Olšák2013-01-041-10/+11
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: unify some parameters into a dstbox parameter in blit_genericMarek Olšák2013-01-041-13/+18
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: remove useless parameter from blitter_default_dst_textureMarek Olšák2013-01-041-5/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: Remove the overlapped blit assert from ↵Henri Verbeet2012-12-161-28/+0
| | | | | | | | | | | | util_blitter_blit_generic(). This is used by st_BlitFramebuffer() / r600_blit(), and ARB_fbo allows overlapped blits, even though the result is undefined. No piglit regressions on r600g / CYPRESS. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: remove pipe_surface::usageMarek Olšák2012-12-121-7/+0
| | | | | | Not really used by anybody now. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: move util_try_blit_via_copy_region to u_surface.cMarek Olšák2012-12-121-146/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* 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]>
* 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]>
* 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]>
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-17/+15
| | | | | | | | | | | | | | | | | | | | | 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-291-0/+8
| | | | | | | | | | 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/blitter: silence assorted MSVC warningsBrian Paul2012-10-171-13/+14
| | | | | | | Fix signed/unsigned comparison warnings and float/int assignment warnings. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* r600g: implement MSAA resolving for 8-bit and 16-bit integer formatsMarek Olšák2012-10-121-2/+3
| | | | by changing the format to NORM.
* gallium/u_blitter: add helper for blitting via resource_copy_regionMarek Olšák2012-09-301-0/+140
| | | | | | 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-301-89/+195
| | | | | | | 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-301-0/+36
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>