aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
Commit message (Collapse)AuthorAgeFilesLines
* r300,r600,radeonsi: replace RADEON_FLUSH_* with PIPE_FLUSH_*Marek Olšák2017-11-291-1/+1
| | | | | | and handle PIPE_FLUSH_HINT_FINISH in r300. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/u_blitter: use 2D_ARRAY for cubemap blits if possibleMarek Olšák2017-06-071-1/+1
| | | | | | | | so that we can use TXF. The cubemap blit pixel shader code size: 148 -> 92 bytes Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/util: replace pipe_mutex_unlock() with mtx_unlock()Timothy Arceri2017-03-071-1/+1
| | | | | | | | | | pipe_mutex_unlock() was made unnecessary with fd33a6bcd7f12. Replaced using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_unlock(\([^)]*\)):mtx_unlock(\&\1):g' {} \; Reviewed-by: Marek Olšák <[email protected]>
* gallium/util: replace pipe_mutex_lock() with mtx_lock()Timothy Arceri2017-03-071-1/+1
| | | | | | | | | | replace pipe_mutex_lock() was made unnecessary with fd33a6bcd7f12. Replaced using: find ./src -type f -exec sed -i -- \ 's:pipe_mutex_lock(\([^)]*\)):mtx_lock(\&\1):g' {} \; Reviewed-by: Marek Olšák <[email protected]>
* gallium/radeon: handle render_condition_enable for clear_rt/dsMarek Olšák2016-08-101-2/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: add render_condition_enable param to clear_render_target/depth_stencilMarek Olšák2016-08-101-2/+4
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/radeon: use cs_check_space throughoutNicolai Hähnle2016-06-011-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* util/u_blitter: implement alpha blending for pipe->blitMarek Olšák2015-08-211-1/+2
|
* gallium/radeon: allow the winsys to choose the IB sizeMarek Olšák2015-08-061-1/+1
| | | | | | | Picked from the amdgpu branch. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* r300g: fix sRGB->sRGB blitsMarek Olšák2015-03-091-0/+9
| | | | Cc: 10.5 10.4 <[email protected]>
* r300g: implement MSAA copies by resolving and upsamplingMarek Olšák2014-09-241-2/+3
| | | | There's no other way. It will use hw resolve + blit.
* r300g: BlitFramebuffer should follow render conditionMarek Olšák2014-06-031-3/+4
|
* gallium/util: use ui[4] instead of ui in union util_colorRoland Scheidegger2014-04-251-2/+2
| | | | | | | | util_color often merely represents a collection of bytes, however it is inconvenient if those bytes can only be accessed as floats/doubles for int formats exceeding 32bits. (Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and short member were left as is.)
* r300g: don't crash when getting NULL colorbuffersMarek Olšák2014-04-251-2/+2
| | | | Cc: [email protected]
* gallium: remove PIPE_USAGE_STATICMarek Olšák2014-02-061-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: remove useless parameters from some functionsMarek Olšák2013-12-141-2/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: allow choosing which colorbuffers to clearMarek Olšák2013-12-121-1/+1
| | | | | | | | | | | | | | Required for glClearBuffer, which only clears one colorbuffer attachment. Example: If the first colorbuffer is float and the second one is int: pipe->clear(pipe, PIPE_CLEAR_COLOR0, float_clear_color, ...); pipe->clear(pipe, PIPE_CLEAR_COLOR1, int_clear_color, ...); This doesn't need any driver changes yet, because all drivers just use: if (flags & PIPE_CLEAR_COLOR) .. The drivers which support GL 3.0 will have to implement it properly though.
* gallium/util: implement layered framebuffer clear in u_blitterMarek Olšák2013-12-031-3/+1
| | | | | | | | | | | | | 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.
* gallium: add flush_resource context functionMarek Olšák2013-09-201-0/+6
| | | | | | | | | r600g needs explicit flushing before DRI2 buffers are presented on the screen. v2: add (stub) implementations for all drivers, fix frontbuffer flushing v3: fix galahad Signed-off-by: Marek Olšák <[email protected]>
* gallium/u_blitter: make clearing independent of the colorbuffer formatMarek Olšák2013-06-131-2/+1
| | | | | | | 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-1/+0
| | | | | | We can use the fragment shader TGSI property WRITES_ALL_CBUFS. Reviewed-by: Brian Paul <[email protected]>
* r300g: fix blending and alpha-test with RGBX16F and enable MSAA for itMarek Olšák2013-02-071-1/+2
|
* r300g: fix and cleanup flushing before clearing CMASK, ZMASK, and HIZMarek Olšák2013-01-151-0/+7
|
* r300g: implement MSAA compression and fast MSAA color clearMarek Olšák2013-01-151-2/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | These are optimizations which make MSAA a lot faster. The MSAA work is complete with this commit. (except for enablement of AA optimizations for RGBA16F, for which a patch is ready and waiting until the kernel CS checker fix lands) MSAA can't be made any faster as far as hw programming is concerned. The catch is only one process and one colorbuffer can use the optimizations at a time. There usually is only one MSAA colorbuffer, so it shouldn't be an issue. Also, there is a limit on the size of MSAA colorbuffer resolution in terms of megapixels. If the limit is surpassed, the AA optimizations are disabled. The limit is: - 1 Mpix on low-end and some mid-level chipsets (1024x768 and 1280x720) - 2 Mpix on some mid-level chipsets (1600x1200 and 1920x1080) - 3 or 4 Mpix on high-end chipsets (2048x1536 or 2560x1600, respectively) It corresponds to the number of raster pipes (= GB pipes) available, each pipe can hold 1 Mpix of AA compression data. If it's enabled, the driver prints to stdout: radeon: Acquired access to AA optimizations.
* r300g: fix MSAA resolve to an untiled textureMarek Olšák2013-01-141-1/+4
| | | | | RB3D_DEBUG_CTL doesn't help, so I resolve to a tiled temporary texture and then blitting it to the destination one, which we also do in other situations.
* r300g: if both Z and stencil are present, they must be fast-cleared togetherMarek Olšák2013-01-141-6/+11
|
* r300g: random hyperz cleanupsMarek Olšák2013-01-141-1/+1
|
* r300g: implement MSAAMarek Olšák2013-01-061-13/+158
| | | | | | | | | | | | | | | | | | | | | | 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)
* gallium/u_blitter: unify some parameters into a dstbox parameter in blit_genericMarek Olšák2013-01-041-6/+8
| | | | 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]>
* r300g: increment num_z_clears only if we have Hyper-ZMarek Olšák2012-12-021-2/+1
|
* r300g: enable Hyper-Z by default on r500Marek Olšák2012-12-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | I fixed the only known bugs on r500 with 0222b2bd4107b9e5cabfbc06c1a6ca3eae. Now there are no piglit regressions with Hyper-Z and all apps I tested seem to work. To summarize how it works: - Only one process can use it at a time. This is a hardware limitation. - The first process to clear a zbuffer gets the exclusive access to use Hyper-Z. - Compositors don't use any zbuffer, so they won't steal it, but some web browsers do, so make sure there's no web browser running if you want your game to use Hyper-Z. - There's no need to restart an app which couldn't get the access to Hyper-Z. Just quit the app which took it, the driver can turn it on for the other app in the middle of rendering. - If an app gets the access to Hyper-Z, it prints "radeon: Acquired Hyper-Z" to stdout. r300-r400: Hyper-Z will be enabled by default on r300-r400 once sufficient testing is done with piglit and Lightsmark at least. Be sure to set the env var RADEON_HYPERZ and run piglit with parameters: -c 0
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-2/+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]>
* r300g: implement blitMarek Olšák2012-09-301-0/+40
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blitter: add gallium blit implementationMarek Olšák2012-09-301-3/+5
| | | | | | | 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: document custom meta helpersMarek Olšák2012-08-151-1/+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).
* gallium/u_blitter: add ability to blit only depth or only stencilMarek Olšák2012-08-041-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: make user vertex buffers optionalMarek Olšák2012-04-241-9/+3
| | | | | | | | | | | This couldn't be split because it would break bisecting. Summary: * r300g,r600g: stop using u_vbuf * r300g,r600g: also report that the FIXED vertex type is unsupported * u_vbuf: refactor for use in the state tracker * cso: wire up u_vbuf with cso_context * st/mesa: conditionally install u_vbuf
* u_vbuf: override create/bind/destroy_vertex_elements_stateMarek Olšák2012-04-241-1/+2
|
* u_vbuf: override set_vertex_buffersMarek Olšák2012-04-241-2/+2
|
* r300g/swtcl: don't enter u_vbuf_mgrMarek Olšák2012-04-041-2/+7
|
* Squash-merge branch 'gallium-clip-state'Marek Olšák2012-01-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/tgsi/tgsi_strings.c src/mesa/state_tracker/st_atom_clip.c commit d919791f2742e913173d6b335128e7d4c63c0840 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 17:59:22 2012 +0100 d3d1x: adapt to new clip state commit cfec82bca3fefcdefafca3f4555285ec1d1ae421 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:16:51 2012 +0100 gallium/docs: update for clip state changes commit c02bfeb81ad9f62041a2285ea6373bbbd602912a Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:21:43 2012 +0100 tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS commit d4e0a785a6a23ad2f6819fd72e236acb9750028d Author: Brian Paul <[email protected]> Date: Thu Jan 5 08:30:00 2012 -0700 tgsi: consolidate TGSI string arrays in new tgsi_strings.h There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <[email protected]> commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 12:48:09 2012 +0100 gallium: extend user_clip_plane_enable to apply to clip distances commit f1d5016c07f786229ed057effbe55fbfd160b019 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 02:39:09 2012 +0100 nvfx: adapt to new clip state commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 01:41:39 2012 +0100 st/mesa: fix DrawPixels with GL_DEPTH_CLAMP commit c86ad730aa1c017788ae88a55f54071bf222be12 Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:51:30 2012 +0100 nv50: adapt to new clip state commit 3a8ae6ac243bae5970729dc4057fe02d992543dc Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:32:36 2012 +0100 nvc0: adapt to new clip state commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11 Author: Marek Olšák <[email protected]> Date: Thu Dec 29 01:32:51 2011 +0100 draw: initalize pt.user.planes in draw_init This fixes a crash in glean/fpexceptions. commit e3056524b19b56d473f4faff84ffa0eb41497408 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:26:55 2011 +0100 svga: adapt to new clip state commit c5bfa8b37d6d489271df457229081d6bbb51b4b7 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:11:51 2011 +0100 r600g: adapt to new clip state commit f11890905362f62627c4a28a8255b76eb7de7df2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:10:26 2011 +0100 r300g: adapt to new clip state commit e37465327c79a01112f15f6278d9accc5bf3103f Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:39:16 2011 +0100 draw: adapt to new clip state This adds a regression in the LLVM clipping path. Can anybody see anything wrong with the code? It works for every other case, just glean/fpexceptions crashes when doing the "Infinite clip plane test". commit b474d2b18c72d965eefae4e427c269cba5ce6ba2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:14:59 2011 +0100 u_blitter: don't save/set/restore clip state commit 9dd240ea91f523a677af45e8d0adb9e661e28602 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:11:56 2011 +0100 gallium: don't cso_save/set/restore clip state The enable bits are in the rasterizer state. commit a4f7031179f5f4ad524b34b394214b984ac950f6 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:58:55 2011 +0100 gallium: default depth_clip to 1 depth_clip = !depth_clamp commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:14:19 2011 +0100 trace,util: update state logging to new clip state Also dump the other missing flags. commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 10:43:43 2011 +0100 st/mesa: adapt to new clip state commit b7b656a42fca19d7c85267f42649a206a85a2c72 Author: Marek Olšák <[email protected]> Date: Sat Dec 17 15:45:19 2011 +0100 gallium: move state enable bits from clip_state to rasterizer_state
* r300g: rework resource_copy_region, not changing pipe_resourceMarek Olšák2012-01-011-72/+100
| | | | | | | | | | | | | Changing pipe_resource was wrong, because it can be used by other contexts at the same time. This fixes the last possible race condition in r300g that I know of. This also fixes blitting NPOT compressed textures. Random pixels sometimes appeared at the right-hand edge of the texture. Finally, this removes r300_texture_desc::stride_in_pixels. It makes little sense with sampler views and surfaces being able to override width0, height0, and the format entirely.
* gallium: rename ZS stencil type to UINT (v2)Dave Airlie2011-10-111-1/+1
| | | | | | | | | | these are never USCALED, always UINT in reality. taken from some work by Christoph Bumiller v2: fixup formatting of table + tabs Signed-off-by: Dave Airlie <[email protected]>
* u_blitter: add integer clear supportDave Airlie2011-10-091-1/+2
| | | | | | | | | | | We need add a new set of fragment shader variants, along with new vertex elements for signed and unsigned clears. The new fragment shader variants are due to the integers values requiring CONSTANT interpolation. The new vertex element descriptions are for passing the clear color as an unsigned or signed integer value. Signed-off-by: Dave Airlie <[email protected]>
* r300g: remove unused r300_resource::tex_offsetMarek Olšák2011-10-081-4/+4
|
* gallium: move clear paths from rgba to a pointer to a color union (v2)Dave Airlie2011-09-181-5/+5
| | | | | | | | | | | | | | | This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values. Notes: 1. the value is opaque. 2. only when the value is used should it be interpretered according to the surface format it is going to be used with. 3. float clears on integer buffers and vice-versa are undefined. v2: fixed up vega and graw, dropped hunks that shouldn't have been in patch. Signed-off-by: Dave Airlie <[email protected]>
* u_blitter: rename util_blitter_copy_region -> util_blitter_copy_textureMarek Olšák2011-08-161-2/+2
|
* r300g: silence some warnings about uninitialized variablesBrian Paul2011-08-091-3/+5
|