aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
Commit message (Collapse)AuthorAgeFilesLines
* r300: drop u_mm.h include.Dave Airlie2017-08-031-1/+0
| | | | | | | This is not used in any of these files. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-101-33/+0
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-101-4/+4
|
* gallium: s/uint/enum pipe_shader_type/ for set_constant_buffer()Brian Paul2017-03-081-1/+1
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: add flags parameter to texture barrierIlia Mirkin2017-01-161-1/+1
| | | | | | | | This is so that we can differentiate between flushing any framebuffer reading caches from regular sampler caches. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: Use enum pipe_shader_type in set_sampler_views()Kai Wasserbäch2016-08-291-1/+2
| | | | | Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: Use enum pipe_shader_type in bind_sampler_states() (v2)Kai Wasserbäch2016-08-291-1/+1
| | | | | | | | | | | v1 → v2: - Fixed indentation (noted by Brian Paul) - Removed second assert from nouveau's switch statements (suggested by Brian Paul) Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: make constant_buffer constRob Clark2016-06-201-1/+1
| | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* r300g: remove support for DRM < 2.12.0Marek Olšák2016-03-011-46/+0
|
* gallium/drivers: Sanitize NULL checks into canonical formEdward O'Callaghan2015-12-061-3/+3
| | | | | | | | | | Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* winsys/amdgpu: add addrlib - texture addressing and alignment calculatorMarek Olšák2015-08-141-1/+1
| | | | | | | | | This is an internal project that Catalyst uses and now open source will do too. v2: squashed these commits in: - winsys/amdgpu: fix warnings in addrlib - winsys/amdgpu: set PIPE_CONFIG and NUM_BANKS in tiling_flags
* r300g: small code cleanup (v2)David Heidelberg2015-02-061-1/+0
| | | | | | | v2: incorporated changes from Marek Olšák Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: David Heidelberg <[email protected]>
* r300g: only set clip_halfz for chips with HW TCLMarek Olšák2014-10-281-1/+1
| | | | | I forgot that we cannot emit vertex shader state on a chip without VS. In such a case, clip_halfz is handled by the Draw module.
* r300g: implement pipe_rasterizer_state::clip_halfzMarek Olšák2014-10-221-0/+7
| | | | Reviewed-by: Alex Deucher <[email protected]>
* r300g: replace r300_get_num_samples with a util variantMarek Olšák2014-10-211-25/+1
|
* gallium/util: use ui[4] instead of ui in union util_colorRoland Scheidegger2014-04-251-1/+1
| | | | | | | | 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-18/+28
| | | | Cc: [email protected]
* r300g,r600g,radeonsi: add support for ARB_buffer_storageMarek Olšák2014-02-251-0/+5
| | | | | | All GTT memory mappings are coherent and therefore can be persistent. Reviewed-by: Fredrik Höglund <[email protected]>
* winsys/radeon: set/get the scanout flag with the tiling ioctlsMarek Olšák2013-12-121-1/+1
| | | | | | | | | | | | | | | If we assume that all buffers allocated by the DDX are scanout, a new flag that says "this is not scanout" has to be added to support the non-scanout buffers and maintain backward compatibility. This fixes bad rendering on Wayland. The flag is defined as: #define RADEON_TILING_R600_NO_SCANOUT RADEON_TILING_SWAP_16BIT AFAIK, RADEON_TILING_SWAP_16BIT is not used on SI. Reviewed-by: Michel Dänzer <[email protected]>
* gallium: new, unified pipe_context::set_sampler_views() functionBrian Paul2013-10-231-4/+9
| | | | | | | | | | | | 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]>
* r300g: remove unused function r300_lacks_vertex_texturesMarek Olšák2013-10-041-7/+0
|
* radeon: don't use old bind_vertex/fragment_sampler_states() hooksBrian Paul2013-10-031-21/+0
|
* radeon: implement pipe_context::bind_sampler_states()Brian Paul2013-10-031-0/+26
|
* r300g: rename r300_bind_sampler_states to r300_bind_fragment_sampler_statesBrian Paul2013-10-031-4/+4
|
* Revert "r300g: Give CLIP_DISABLE another try"Marek Olšák2013-07-301-2/+1
| | | | | | | | This reverts commit e866bd1adea2c3b4971ad68e69c644752f2ab7b6. https://bugs.freedesktop.org/show_bug.cgi?id=57875 Cc: [email protected]
* gallium: Add support for multiple viewportsZack Rusin2013-05-251-7/+11
| | | | | | | | | | | | 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]>
* draw: try to prevent overflows on index buffersZack Rusin2013-05-141-1/+1
| | | | | | | | | | | | Pass in the size of the index buffer, when available, and use it to handle out of bounds conditions. The behavior in the case of an overflow needs to be the same as with other overflows in the vertex processing pipeline meaning that a vertex should still be generated but all attributes in it set to zero. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: don't crash on vertex buffer overflowZack Rusin2013-05-141-2/+2
| | | | | | | | | | | | | | We would crash when stride was bigger than the size of the buffer. The correct behavior is to just fetch zero's in this case. Unfortunatly with user_buffer's there's no way to validate the size because currently we're just not getting it. Adjust the draw interface to pass the size along the mapped buffer, which works perfectly for buffer backed vertex_buffers and, in future, it will allow us to plumb user_buffer sizes through the same interface. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* r300g: fix crash while binding a NULL constant bufferMarek Olšák2013-03-261-1/+1
|
* r300g: add support for red-alpha render targetsMarek Olšák2013-02-141-0/+1
|
* r300g: fix blending and alpha-test with RGBX16F and enable MSAA for itMarek Olšák2013-02-071-7/+27
|
* r300g: try to use color varyings for texcoords if max texcoord limit is exceededMarek Olšák2013-02-061-3/+6
| | | | +35 piglits
* r300g: fix blending with RGBX formatsMarek Olšák2013-02-061-117/+191
| | | | Change DST_ALPHA to ONE.
* r300g: fix blending with blend color and RGBA formatsMarek Olšák2013-02-061-0/+11
| | | | NOTE: This is a candidate for the stable branches.
* r300g: add a workaround for the AA colorbuffer addressing bug on R500Marek Olšák2013-01-211-7/+11
|
* r300g: enable AA optimizations for the RGBA16F formatMarek Olšák2013-01-211-0/+3
|
* r300g: implement MSAA compression and fast MSAA color clearMarek Olšák2013-01-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: don't set sample positions to the pixel center if MSAA is disabledMarek Olšák2013-01-101-2/+0
| | | | | | | | | | | but an MSAA resource is bound. This effectively makes the MSAA disable switch not affect rasterization, but it still affects the alpha-to-one and alpha-to-coverage states. This hardware just lacks a proper MSAA disable switch. This fixes graphics corruption in sauerbraten. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59194
* r300g: implement MSAAMarek Olšák2013-01-061-17/+74
| | | | | | | | | | | | | | | | | | | | | | 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)
* r300g: simplify DSA state, add ability to patch FG_ALPHA_FUNC while emittingMarek Olšák2013-01-061-52/+28
| | | | Preparation for MSAA and alpha-to-coverage.
* r300g/swtcl: fix crash when setting vertex buffersMarek Olšák2013-01-041-0/+3
| | | | Broken by e73bf3b805de78299f1a652668ba4e6eab9bac94.
* r300: Don't disable destination read if the src blend factor needs itStefan Dösinger2012-12-071-2/+10
| | | | | | | | | | | The read can remain disabled if the src alpha factor needs it because the result would still be zero. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57984 NOTE: This is a candidate for stable release branches. Signed-off-by: Marek Olšák <[email protected]>
* r300g: Give CLIP_DISABLE another tryStefan Dösinger2012-12-041-1/+2
| | | | Signed-off-by: Marek Olšák <[email protected]>
* Revert "r300g: fix occlusion queries when depth test is disabled or zbuffer ↵Marek Olšák2012-12-021-14/+6
| | | | | | is missing" It broke Hyper-Z terribly.
* r300g: fix crash since the set_vertex_buffers(start_slot) changeMarek Olšák2012-11-131-6/+7
|
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-11/+12
| | | | | | | | | | | | | | | | | | | | | 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: fix colormask with non-BGRA formatsMarek Olšák2012-09-141-26/+62
| | | | NOTE: This is a candidate for the stable branches.
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* draw: simplify index buffer specificationBrian Paul2012-05-311-6/+6
| | | | | Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with draw_set_indexes() which simply takes a pointer and an index size.
* gallium/radeon: Fix r300g tiling breakage.Michel Dänzer2012-05-161-0/+1
| | | | | | Commit 11f056a3f0b87e86267efa8b5ac9d36a343c9dc1 broke the r300g build. Fix it up, and reinstate some code which isn't needed by r600g and radeonsi but is by r300g.