summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
Commit message (Collapse)AuthorAgeFilesLines
* r600g: add more cases for copying unsupported formats to resource_copy_regionMarek Olšák2013-01-261-0/+12
| | | | just in case a new format is added to gallium
* r600g: don't use radeon_surface_level::npix_x/y/zMarek Olšák2013-01-261-15/+13
| | | | | | | npix_x/y/z is wrong with NPOT textures, since it's always aligned to POT if the level is non-zero, so we can't use that. This fixes piglit/spec/EXT_texture_shared_exponent/fbo-generatemipmap-formats.
* r600g: implement buffer copying using CP DMA for R7xx, Evergreen, CaymanMarek Olšák2013-01-081-5/+8
| | | | | | | | | | R6xx doesn't work - the issue seems to be with flushing (sometimes the destination buffer contains garbage). There are no hangs, so we're good. R7xx doesn't seem to have any alignment restriction despite our initial thinking. Everything just works. Reviewed-by: Alex Deucher <[email protected]>
* gallium/u_blitter: unify some parameters into a dstbox parameter in blit_genericMarek Olšák2013-01-041-3/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: remove useless parameter from blitter_default_dst_textureMarek Olšák2013-01-041-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: always use a tiled resource as the destination of MSAA resolveMarek Olšák2012-12-211-2/+7
| | | | | | | | | i.e. we have to allocate a temporary tiled resource if dst isn't tiled. This fixes hardlocks on r6xx-r7xx, though using a linear resource is forbidden on later asics as well. NOTE: This is a candidate for the stable branches.
* r600g: add htile support v16Jerome Glisse2012-12-201-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | htile is used for HiZ and HiS support and fast Z/S clears. This commit just adds the htile setup and Fast Z clear. We don't take full advantage of HiS with that patch. v2 really use fast clear, still random issue with some tiles need to try more flush combination, fix depth/stencil texture decompression v3 fix random issue on r6xx/r7xx v4 rebase on top of lastest mesa, disable CB export when clearing htile surface to avoid wasting bandwidth v5 resummarize htile surface when uploading z value. Fix z/stencil decompression, the custom blitter with custom dsa is no longer needed. v6 Reorganize render control/override update mecanism, fixing more issues in the process. v7 Add nop after depth surface base update to work around some htile flushing issue. For htile to 8x8 on r6xx/r7xx as other combination have issue. Do not enable hyperz when flushing/uncompressing depth buffer. v8 Fix htile surface, preload and prefetch setup. Only set preload and prefetch on htile surface clear like fglrx. Record depth clear value per level. Support several level for the htile surface. First depth clear can't be a fast clear. v9 Fix comments, properly account new register in emit function, disable fast zclear if clearing different layer of texture array to different value v10 Disable hyperz for texture array making test simpler. Force db_misc_state update when no depth buffer is bound. Remove unused variable, rename depth_clearstencil to depth_clear. Don't allocate htile surface for flushed depth. Something broken the cliprect change, this need to be investigated. v11 Rebase on top of newer mesa v12 Rebase on top of newer mesa v13 Rebase on top of newer mesa, htile surface need to be initialized to zero, somehow special casing first clear to not use fast clear and thus initialize the htile surface with proper value does not work in all case. v14 Use resource not texture for htile buffer make the htile buffer size computation easier and simpler. Disable preload on evergreen as its still troublesome in some case v15 Cleanup some comment and remove some left over v16 Define name for bit 20 of CP_COHER_CNTL Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Jerome Glisse <[email protected]>
* r600g: add assertions to prevent creation of invalid surfacesMarek Olšák2012-12-201-16/+0
|
* gallium: remove pipe_surface::usageMarek Olšák2012-12-121-4/+0
| | | | | | Not really used by anybody now. Reviewed-by: Brian Paul <[email protected]>
* r600g: add initial cube map array support (v2)Dave Airlie2012-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | This contains the evergreen support. Support is possible on rv670 upwards and the code in here should work, but it doesn't and I haven't debugged it to figure out why. Beyond just adding support for the cube map array sampling, r600 resinfo isn't conformant with the GL specification, which states the number of layers should be returned for the textureSize, so we have to track in an external constant buffer the layers for each sampler if we need them in the shader. v2: only update the sampler constants if the sampler views have changed, as suggested by Marek. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: add in-place DB decompression and texturing with DB tilingMarek Olšák2012-11-061-12/+78
| | | | | | | | | | | | | | | | | | | | | 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-3/+1
| | | | | | | | | | | | | | | | | | | | | 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-17/+25
| | | | | | | | | | 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.
* r600g: implement MSAA resolving for 8-bit and 16-bit integer formatsMarek Olšák2012-10-121-3/+41
| | | | by changing the format to NORM.
* r600g: atomize depth-stencil-alpha stateMarek Olšák2012-10-101-1/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: atomize rasterizer stateMarek Olšák2012-10-101-1/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: atomize scissor stateMarek Olšák2012-10-101-1/+1
| | | | | | The workaround for R600 lacking VPORT_SCISSOR_ENABLE has also been simplified. Reviewed-by: Jerome Glisse <[email protected]>
* r600g: atomize fetch shaderMarek Olšák2012-10-101-1/+1
| | | | | | | The state object is actually a buffer, it's literally a buffer containing the shader code. Reviewed-by: Jerome Glisse <[email protected]>
* r600g: atomize blend stateMarek Olšák2012-10-101-1/+1
| | | | | | | | | | | This is not so trivial, because we disable blending if the dual src blending is turned on and the number of color outputs is less than 2. I decided to create 2 command buffers in the blend state object and just switch between them when needed, because there are other states unrelated to blending (like the color mask) and those shouldn't be changed (the old code had it wrong). Reviewed-by: Jerome Glisse <[email protected]>
* r600g: inline r600_atom_dirtyMarek Olšák2012-10-101-3/+3
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: don't modify pipe_resource in resource_copy_region, fixing race conditionMarek Olšák2012-10-061-145/+73
| | | | | | pipe_resource can be shared between contexts, we shouldn't modify its description. Instead, let's use the resource "views" (sampler views and surfaces), where we can freely change almost any property of a resource.
* gallium: remove resource_resolveMarek Olšák2012-09-301-152/+0
| | | | | | | The functionality is provided by the new blit function. Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r600g: implement blitMarek Olšák2012-09-301-14/+130
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: add gallium blit implementationMarek Olšák2012-09-301-23/+15
| | | | | | | 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-12/+5
| | | | | Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* r600g: atomize framebuffer stateMarek Olšák2012-09-221-2/+2
| | | | | | Tested on RS880, Evergreen and Cayman. Reviewed-by: Alex Deucher <[email protected]>
* r600g: consolidate decompression code for the blitterMarek Olšák2012-09-141-29/+37
|
* r600g: atomize viewport stateMarek Olšák2012-09-131-3/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: atomize stencil ref stateMarek Olšák2012-09-131-3/+1
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: put sampler states and views into an array indexed by shader typeMarek Olšák2012-09-131-4/+4
| | | | Reviewed-by: Jerome Glisse <[email protected]>
* r600g: do fine-grained sampler state updatesMarek Olšák2012-09-131-2/+2
| | | | | | | | | | | | Update only those sampler states which are changed in a shader stage, instead of always updating all sampler states in the shader stage. That requires keeping a bitmask of those states which are enabled, and those states which are dirty at a given point (subset of enabled states). This is similar to how sampler views, constant buffers, and vertex buffers are handled. Reviewed-by: Jerome Glisse <[email protected]>
* r600g: implement MSAA for CaymanMarek Olšák2012-08-311-7/+27
| | | | | Everything works except for blitting MSAA colorbuffers, which isn't so trivial on Cayman. It's a rarely-used feature anyway.
* r600g: disable MSAA depth decompression on r6xxMarek Olšák2012-08-301-1/+10
|
* r600g: implement compression for MSAA colorbuffers for evergreenMarek Olšák2012-08-271-0/+79
| | | | | | | | | | | | | | | | This adds the FMASK and CMASK buffers. They share the same resource with color data. COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"), so that we can keep FAST_CLEAR enabled all the time. Both FMASK and CMASK must be present at the moment. If either one is missing, the other one is not used. v2: add cayman regs in the list Reviewed-by: Jerome Glisse <[email protected]>
* r600g: cleanup names around depth decompressionMarek Olšák2012-08-271-9/+9
| | | | | | for consistency with the upcoming color decompression naming Reviewed-by: Jerome Glisse <[email protected]>
* r600g: fix blits of subsampled formatsMarek Olšák2012-08-161-20/+63
|
* r600g: rename r600_resource_texture to r600_textureMarek Olšák2012-08-161-10/+10
|
* r600g: cleanup r600_resource_texture in favor of radeon_surfaceMarek Olšák2012-08-161-3/+3
|
* gallium/u_blitter: document custom meta helpersMarek Olšák2012-08-151-2/+2
|
* r600g: implement copying between MSAA texturesMarek Olšák2012-08-151-4/+10
|
* r600g: implement MSAA color resolveMarek Olšák2012-08-151-0/+80
|
* r600g: implement MSAA depth-stencil decompression and resolveMarek Olšák2012-08-151-32/+132
| | | | and integer textures, which are resolved the same as depth, I think.
* r600g: implement set_sample_maskMarek Olšák2012-08-151-0/+1
|
* gallium/u_blitter: implement blitting multisample resourcesMarek Olšák2012-08-151-2/+2
| | | | It can blit only one sample at a time (it should be called in a loop).
* r600g: make sure copying of all texture formats is acceleratedMarek Olšák2012-08-041-10/+50
|
* r600g: don't decompress depth or stencil if there isn't anyMarek Olšák2012-08-041-5/+7
|
* gallium/u_blitter: remove fallback for stencil copy that all drivers skippedMarek Olšák2012-08-041-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* r600g: implement wait-free buffer transfer for DISCARD_RANGEMarek Olšák2012-07-181-5/+3
| | | | | Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: accelerate buffer copyingMarek Olšák2012-07-181-23/+47
| | | | | | | This will be useful for efficient handling of the DISCARD transfer flags. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
* r600g: remove needless wrapper r600_texture_depth_flushMarek Olšák2012-07-181-4/+9
|