aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nvfx_state_emit.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: remove flags from the flush functionMarek Olšák2011-03-111-1/+1
| | | | | | | | | | The drivers have been changed so that they behave as if all of the flags were set. This is already implicit in most hardware drivers and required for multiple contexts. Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag to decide whether flush_frontbuffer should be called. New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
* nvfx: restore BEGIN_RING usageXavier Chantry2010-12-251-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Michel Hermier reported libdrm segfault (and kernel crash) on nv40 using gallium : http://www.mail-archive.com/[email protected]/msg06563.html It turns out these were caused by some missing WAIT_RING (or wrong computation of the WAIT_RING sizes). Unlike all other libdrm_nouveau users, nvfx gallium tried to use a mininum calls of WAIT_RING, one WAIT_RING could apply to many methods for different code paths and spread across several functions. This made it too tricky to find out what the missing or wrong WAIT_RING was. By restoring BEGIN_RING, we force one WAIT_RING per method, and it's much easier to check if the free size required in the pushbuffer is correct. As curro said, "let's keep it simple for the maintainers until the big bottlenecks are gone" Benchmarked on nv35 with openarena, nexuiz and ut2004 and no performance regression. The core of this patch was made with Coccinelle, with minor manual fixes made on top. Tested-by: Michel Hermier <[email protected]> Signed-off-by: Francisco Jerez <[email protected]>
* nvfx: switch to rules-ng-ng register headersLuca Barbieri2010-09-051-28/+28
| | | | | | | | | | This is the new register generation toolkit in use by nouveau. As far as I know, this is the best register description toolkit in existence, and you should use it too for your hardware :) Thanks to Marcin Kościelnicki for inventing it and performing invaluable reverse engineering work of nVidia chips.
* nvfx: add rewritten swtnl supportLuca Barbieri2010-09-051-14/+17
| | | | | | | | The old swtnl code was broken by the new shader linkage support for GLSL. This is a rewrite of swtnl support, which should instead work properly, be faster and more closer to the much more tested hardware pipeline.
* nvfx: fix the temporary copying logic and add assertsLuca Barbieri2010-09-041-2/+6
|
* nvfx: consolidate tiny filesLuca Barbieri2010-09-041-0/+93
| | | | | We probably want to reorganize the remaining files too, but that's for later, maybe.
* nvfx: tidy up state_emitLuca Barbieri2010-09-041-76/+84
|
* nvfx: support all coord conventions in hardwareLuca Barbieri2010-09-041-0/+18
|
* nvfx: allow nested blitter usage, fixing bug in clearLuca Barbieri2010-09-041-3/+0
|
* gallium: Use draw_set_index_buffer and others.Chia-I Wu2010-08-251-0/+3
| | | | | | Update all drivers to use draw_set_index_buffer, draw_set_mapped_index_buffer, and draw_vbo. Remove draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
* nvfx: emit bo relocations only when neededLuca Barbieri2010-08-231-16/+14
| | | | Should improve performance, possibly significantly.
* nvfx: support clip planes sensibly and fix them on nv30Luca Barbieri2010-08-231-0/+82
| | | | | | | | | | Before, we were discarding the compiled vertex program on each vertex program change. Now we compile the program as if there were 6 clip planes and dynamically patch in an "end program" bit at the right place. Also, nv30 should now work.
* nvfx: simplify and correct fragment program update logicLuca Barbieri2010-08-221-0/+2
| | | | | | | This version should hopefully be much clearer and thus less likely to be subtly broken. Also fixes point sprites on nv40 and possibly some other bugs too.
* nvfx: Fix SCons build.Vinson Lee2010-08-211-1/+2
| | | | | Move declarations before code. Fix void pointer arithmetic.
* nvfx: fix GPU hardlocks when depth buffer is absentLuca Barbieri2010-08-211-1/+9
|
* nv30: band-aid viewport issuesLuca Barbieri2010-08-211-3/+5
| | | | | | For some reason nv30 seems to like to reset the viewport, even though attempts to isolate where exactly it does that have currently been inconclusive.
* nvfx: support proper shader linkage - adds glsl supportLuca Barbieri2010-08-211-1/+2
|
* nvfx: rewrite draw code and buffer codeLuca Barbieri2010-08-211-18/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a full rewrite of the drawing and buffer management logic. It offers a lot of improvements: 1. A copy of buffers is now always kept in system memory. This is necessary to allow software processing of them, which is necessary or improves performance in many cases. 2. Support for pushing vertices on the FIFO, with index lookup if necessary. 3. "Smart" draw code that tries to intelligently choose the cheapest way to draw something: whether to use inline vertices or hardware vertex buffer, and whether to use hardware index buffers 4. Support for all vertex formats supported by the hardware 5. Usage of translate to push vertices, supporting all formats that are sensible to use as vertex formats 6. Support for base vertex 7. Usage of Ben Skeggs' primitive splitter originally for nv50, allowing correct splitting of line loops, triangle fans, etc. 8. Support for instancing 9. Precomputation using the vertex elements CSO Thanks to Ben Skeggs for his primitive splitter originally for nv50. Thanks to Christoph Bumiller for his nv50 push code, that was the basis of this work, even though I changed his code dramatically, in particular to replace his ad-hoc vertex data emitter with translate. The changes could also go into nv50 too, but there are substantial differences due to the additional nv50 hardware features.
* nvfx: new 2D: new render temporaries with resourcesLuca Barbieri2010-08-211-14/+67
| | | | | | | | | | | | This patch adds support for creating temporary surfaces to allow rendering to surfaces that cannot be rendered to. It uses the _second_ version of the render temporary infrastructure. This is necessary for swizzled 3D textures and small mipmaps of swizzled 2D textures. This version of the patch creates a resource to use as a temporary instead of a raw BO, making the code simpler.
* Merge branch '7.8'Brian Paul2010-04-191-1/+2
| | | | | | | | Conflicts: src/gallium/auxiliary/draw/draw_context.c src/gallium/auxiliary/draw/draw_pipe_aaline.c src/gallium/drivers/llvmpipe/lp_context.c
* nvfx: rework validation logic to use code and avoid stateobjsLuca Barbieri2010-04-121-79/+77
| | | | | This makes the code faster due to the lack of indirect calls and also makes it much easier to understand what is actually going on.
* nvfx: so->RING_3D: fbLuca Barbieri2010-04-121-3/+1
|
* nvfx: so->RING_3D: fragprogLuca Barbieri2010-04-121-1/+1
|
* nvfx: so->RING_3D: fragtexLuca Barbieri2010-04-121-9/+1
|
* nvfx: so->RING_3D: vboLuca Barbieri2010-04-121-2/+2
|
* nvfx: stop using flush_notifyLuca Barbieri2010-04-121-2/+14
| | | | | Rather than emitting relocations on flush notifications, emit them in nvfx_state_start.
* nv30, nv40: partially non-trivially unify nv[34]0_fragtex.cLuca Barbieri2010-03-151-15/+7
| | | | | The bulk files cannot be unified, but the frontend can and allows to share some code and simplify state_emit.c
* nv30, nv40: fully unify nv[34]0_context.hLuca Barbieri2010-03-151-2/+1
| | | | Move the remaining content to the common header.
* nv30, nv40: non-trivially unify nv[34]0_vertprog.cLuca Barbieri2010-03-151-1/+1
| | | | | | | | | | | | | | | | vertprog.c is similar but has substantial differences: 1. nv40 supports clip planes 2. nv40 uses a more advanced register allocator 3. Some register setup is different 4. Constants with the same name have different values This patch unifies the two files. nv30 gains clip plane support and the nv40 register allocator. A new NVFX_VP(x) macro is introduced that at runtime resolved to either the nv30 or the nv40 constant value. nv30 clip planes are not tested and might not work
* nv30, nv40: unify nv[34]0_vbo.cLuca Barbieri2010-03-151-5/+1
| | | | | | The files are identical, except for swtnl support which is commented out on nv30 and restart being initialized on nv30 to avoid a compiler warning.
* nv30, nv40: non-trivially unify nv[34]0_draw.cLuca Barbieri2010-03-151-1/+5
| | | | | | | | | | | | nv30_draw.c is a stub. This patch makes both nv30 and nv40 use the nv40 swtnl path. Note that this doesn't actually work on nv30 because the vertex program is encoded in the nv40-only layout. However, swtnl was unimplemented before on nv30, so this is not a regression. Furthermore, a patch to fix this is available near the end of the patchset.
* nv30, nv40: non-trivially unify nv[34]0_fragprog.cLuca Barbieri2010-03-151-1/+1
| | | | | | | | | The files are mostly the same except: 1. On NV40, some TGSI instructions are emulated with several hardware ones 2. Some instructions such as DDX/DDY, and STR were missing from nv30 3. NV40 has more sophisticated register management nv30 now supports all instructions and uses the nv40 register management.
* nv30, nv40: non-trivially unify nv[34]0_state_fb.cLuca Barbieri2010-03-151-1/+1
| | | | | | | | | | | | | | The files are significantly different due to: 1. nv30 support 2 render targets, nv40 4 2. z-buffer pitch is set differently 3. nv30 has a limitation of colour_bits >= zeta_bits. This may not actually exist in the driver though 4. nv30 points color0 at depth in the depth-only case 5. nv30 sets NV34TCL_VIEWPORT_TX_ORIGIN to 0. This is probably unnecessary This patch attempts to unify the two files and preserve the existing behavior.
* nv30, nv40: unify nv[34]0_state_viewport.cLuca Barbieri2010-03-151-1/+1
| | | | The files are identical, except for an extra comment in nv30.
* nv30, nv40: unify nv[34]0_state_stipple.cLuca Barbieri2010-03-151-1/+1
| | | | | | | The files are identical, except for the fact that the nv40 version forgets to unreference the stateobj. Unified to the correct nv30 version.
* nv30, nv40: unify identical nv[34]0_state_zsa.cLuca Barbieri2010-03-151-2/+2
|
* nv30, nv40: unify identical nv[34]0_state_scissor.cLuca Barbieri2010-03-151-1/+1
|
* nv30, nv40: unify identical nv[34]0_state_rasterizer.cLuca Barbieri2010-03-151-1/+1
|
* nv30, nv40: unify identical nv[34]0_state_blend.cLuca Barbieri2010-03-151-2/+2
|
* nv30, nv40: non-trivially unify nv[34]0_state_emit.cLuca Barbieri2010-03-151-0/+188
The files are the same except for swtnl support on nv40 and for texture cache flushing on nv40. Unify them, and use a macro to define 4 versions of render_states, for all combinations of nvfx and hwtnl/swtnl.