summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx
Commit message (Collapse)AuthorAgeFilesLines
* nvfx: add NOUVEAU_VTXIDX_IN_VRAM variable to put vertex/index buffers in VRAMLuca Barbieri2010-03-233-1/+33
| | | | | | | | | | | | On some systems, putting vertex and index buffers in VRAM instead of GART memory eliminates massive graphics corruption which is otherwise present, due to unclear causes. This patch adds an environment variable that does that, along with helpful messages. It turns it on by default on G7x, as it is what I am seeing corruption on and some other reports also seemed to pinpoint these cards.
* nvfx: delay allocation of buffers in GART/VRAM to validation timeLuca Barbieri2010-03-232-5/+3
| | | | | | | | | | | | | | | | | | | | | | | Currently we allocate buffers in GART or VRAM at creation time. However, when using swtnl, this results in reads from uncached memory, which drastically impair performance. So, for now, cause nouveau_screen.c to not pass any placement flags to buffer creation, so that the buffers are moved later. Previously libdrm itself did this, but was changed to not to do it. This may introduce an extra copy in normal usage, but this currently does not seem to introduce significant performance degradation. This will be revisited when pipebuffer is integrated. Note that for AGP systems, properly solving this may be complex since currently there is no fast way of reading from GART/VRAM. We will probably need to try mapping AGP as writethrough and, in addition, make buffer creation more aware of future buffer usage.
* nvfx: don't crash on empty fragment programLuca Barbieri2010-03-231-1/+2
|
* nvfx: fix coding style in nvfx_transfer.cLuca Barbieri2010-03-231-8/+8
|
* nvfx: stop incessantly spewing debug messages on the terminalLuca Barbieri2010-03-232-3/+8
| | | | | | | | | | | Currently we are continuously spewing messages about these variables since we call debug_get_bool_option everytime we want to check their value. This is annoying, slows things down due to terminal rerendering and obscures useful messages. This patch only calls debug_get_bool_option once and caches the result in a static variable.
* nvfx: fix/workaround nv3x hwtnl issuesLuca Barbieri2010-03-231-5/+6
| | | | | | | | | | | This patch re-emits the viewport state on framebuffer or rasterizer change. This seems to be necessary on nv3x, but the reason is not fully understood. It is quite likely that this isn't really the correct fix, but seems to work, and makes nv3x much better.
* nvfx: fix sampler views supportLuca Barbieri2010-03-223-3/+2
| | | | The code was half converted, resulting in texturing being totally broken.
* nvfx: fix up after mergeKeith Whitwell2010-03-151-9/+7
|
* Merge commit 'origin/master' into gallium-sampler-viewKeith Whitwell2010-03-152-2/+36
| | | | | | | | | Conflicts: src/gallium/drivers/nv30/nv30_context.h src/gallium/drivers/nv30/nv30_state.c src/gallium/drivers/nv40/nv40_context.h src/gallium/drivers/nv40/nv40_state.c src/gallium/drivers/r300/r300_emit.c
* nvfx: remove src_native_swz, which was a no-opLuca Barbieri2010-03-152-88/+0
| | | | | | | | | | src_native_swz was used to translate 0/1 swizzles back when Gallium supported them. That support was later removed from Gallium, and the function currently always returns true. Remove it.
* nvfx: clean up shader headerLuca Barbieri2010-03-154-103/+92
| | | | | | | | Currently the behavior of shader.h depends on some constants that are defined differently in vertex and fragment programs. This patch cleans that up by splitting the relevant symbols in vertex program and fragment program variants
* nvfx: draw: make swtnl draw_elements actually work.Luca Barbieri2010-03-151-1/+1
| | | | It was totally broken: the index buffer was passed as NULL!
* nvfx: draw: emit color as floating pointLuca Barbieri2010-03-151-1/+1
| | | | Don't lose precision by converting to u8.
* nvfx: draw: make perspective corrective texturing workLuca Barbieri2010-03-151-1/+8
| | | | | | | We must divide everything in the position by w, and emit position as a 4-component vector. Not sure why we must divide, but it works (see progs/redbook/checker).
* nvfx: draw: create draw vp with uregLuca Barbieri2010-03-151-43/+24
| | | | | This avoids duplicating the vertex program generation logic and makes the same code work for both nv30 and nv40.
* nvfx: add NOUVEAU_SWTNL to force swtnl at runtimeLuca Barbieri2010-03-151-3/+10
| | | | Replace the FORCE_SWTNL macro with a NOUVEAU_SWTNL environment variable.
* nvfx: move nv04_surface_2d.c into nvfx directoryLuca Barbieri2010-03-155-2/+585
| | | | It is only used on pre-nv50 and nvfx is the only Gallium pre-nv50 driver.
* nvfx: fix viewport state after bypass removal for swtnlLuca Barbieri2010-03-151-11/+24
| | | | | | The adjustment of nv30/nv40 after the removal of bypass incorrectly removed the hardware viewport bypass code, which we still need for swtnl and also forgot to remove NVFX_NEW_RAST from pipe.
* nv30, nv40: move last files to nvfx/ and rm -rf nv30 nv40Luca Barbieri2010-03-157-4/+673
| | | | | | | | | | | This is the last nvfx unification patch. nv[34]0_fragtex.c are moved to the common directory nv[34]0_shader.h are renamed to nv[34]0_vertprog.h and moved to the common directory The separate nv30 and nv40 directories are removed from the build system
* nv30, nv40: partially non-trivially unify sampler state in nv[34]0_state.cLuca Barbieri2010-03-154-26/+174
| | | | | | Many things, like texture wrap modes and min/mag filters are common. Some others, like annisotropy and lod settings, are not.
* nv30, nv40: partially non-trivially unify nv[34]0_fragtex.cLuca Barbieri2010-03-154-17/+62
| | | | | The bulk files cannot be unified, but the frontend can and allows to share some code and simplify state_emit.c
* nv30, nv40: unify nv[34]0_context.cLuca Barbieri2010-03-154-9/+94
| | | | | They are now almost identical, except for nv30 vs nv40 fragtex initialization.
* nv30, nv40: fully unify nv[34]0_context.hLuca Barbieri2010-03-153-4/+20
| | | | Move the remaining content to the common header.
* nv30, nv40: non-trivially unify nv[34]0_screen.cLuca Barbieri2010-03-152-0/+437
| | | | | | The files have the same structure but are substantially different. They are unified with appropriate conditionals.
* nv30, nv40: non-trivially unify nv[34]0_vertprog.cLuca Barbieri2010-03-155-9/+1115
| | | | | | | | | | | | | | | | 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: partially unify nv[34]0_state.cLuca Barbieri2010-03-153-0/+614
| | | | | | | | | state.c is identical except for: 1. Sampler state creation is different 2. nv40 swtnl support 3. Separate blend equations on nv40 This patch unifies nv[34]0_state.c, except the sampler state creation code.
* nv30, nv40: unify nv[34]0_vbo.cLuca Barbieri2010-03-154-6/+576
| | | | | | 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-154-1/+377
| | | | | | | | | | | | 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-154-2/+1019
| | | | | | | | | 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 partially unify nv[34]0_shader.hLuca Barbieri2010-03-151-0/+407
| | | | | | | | | | | | shader.h is similar, except for the following differences: 1. The instruction sets are not exactly the same, but mostly similar 2. Vertex program fields are in different bit positions This patch unifies all parts of nv[34]0_shader.h except the vertex program fields. Vertex opcodes are also changed so that the constant names includes SCA if it is a scalar opcode and VEC if it is a vector opcode.
* nv30, nv40: non-trivially unify nv[34]0_state_fb.cLuca Barbieri2010-03-154-1/+237
| | | | | | | | | | | | | | 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-154-1/+41
| | | | The files are identical, except for an extra comment in nv30.
* nv30, nv40: unify nv[34]0_query.cLuca Barbieri2010-03-154-0/+194
| | | | The files are identical except formatting.
* nv30, nv40: unify nv[34]0_miptree.cLuca Barbieri2010-03-152-0/+248
| | | | | | | | | | | | | | | | The only difference between nv30 and nv40 is that nv30 allowed swizzling for more texture types. This patch preserves the existing behavior, using conditional code. Note however that this does not make sense, since all texture types can be swizzled on nv40 and probably on nv30 too. However, the handling of swizzled surfaces in the current 2D code is partially broken, so it's best not to touch this. A whole rewrite of the 2D code will be submitted, which will solve this problem.
* nv30, nv40: unify nv[34]0_state_stipple.cLuca Barbieri2010-03-154-1/+43
| | | | | | | 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-154-2/+46
|
* nv30, nv40: unify identical nv[34]0_state_scissor.cLuca Barbieri2010-03-154-1/+39
|
* nv30, nv40: unify identical nv[34]0_state_rasterizer.cLuca Barbieri2010-03-154-1/+20
|
* nv30, nv40: unify identical nv[34]0_state_blend.cLuca Barbieri2010-03-154-2/+47
|
* nv30, nv40: non-trivially unify nv[34]0_state_emit.cLuca Barbieri2010-03-153-0/+195
| | | | | | | | 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.
* nv30, nv40: unify identical nv[34]0_transfer.cLuca Barbieri2010-03-153-1/+187
|
* nv30, nv40: unify identical nv[34]0_clear.cLuca Barbieri2010-03-153-4/+20
|
* nvfx: add nvfx directory to build systemLuca Barbieri2010-03-151-0/+11
| | | | | | | Will be used to hold source files unified between nv30 and nv40. Eventually all nv30 and nv40 code will be moved there and the nv30 and nv40 directories will be removed.
* nv30, nv40: add is_nv4x member to context and screen structsLuca Barbieri2010-03-152-0/+4
| | | | This will make it faster to check for nv40.
* nv30, nv40: unify all structures and headers, except shadersLuca Barbieri2010-03-153-0/+310
This patch unifies nv[34]0_screen.h, nv[34]0_context.h and nv[34]0_state.h The unified files are put in a new "nvfx" directory. nv30_context.h and nv40_context.h still exist to hold the function prototypes and include nvfx_context.h nv[34]0_screen.h and nv[34]0_state.h are deleted, replaced by the unified versions. nv40 includes some extra fields for swtnl and user clip planes support. These fields will be unused on nv30 until that functionality gets added to it too (by unification with nv40).