aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup_tri.c
Commit message (Collapse)AuthorAgeFilesLines
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: Respect bottom_edge_rule when computing the rasterization bounding ↵José Fonseca2014-01-081-1/+1
| | | | | | | | | | | | | | boxes. This was inadvertently forgotten when replacing gl_rasterization_rules with lower_left_origin and half_pixel_center (commit 2737abb44efebfa10ac84b183c20fc5818d1514e). This makes a difference when lower_left_origin != half_pixel_center, e.g, D3D10. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Zack Rusin <[email protected]>
* llvmpipe: (trivial) get rid of triangle subdivision codeRoland Scheidegger2013-12-141-174/+0
| | | | | | | | This code was always problematic, and with 64bit rasterization we no longer need it at all. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: clamp fragment shader depth write to the current viewport depth range.Matthew McClure2013-12-091-7/+8
| | | | | | | | | | | | | | | | | With this patch, generate_fs_loop will clamp any fragment shader depth writes to the viewport's min and max depth values. Viewport selection is determined by the geometry shader output for the viewport array index. If no index is specified, then the default viewport index is zero. Semantics for this path can be found in draw_clamp_viewport_idx and lp_clamp_viewport_idx. lp_jit_viewport was created to store viewport information visible to JIT code, and is validated when the LP_NEW_VIEWPORT dirty flag is set. lp_rast_shader_inputs is responsible for passing the viewport_index through the rasterizer stage to fragment stage (via lp_jit_thread_data). Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* llvmpipe: support 8bit subpixel precisionZack Rusin2013-11-251-53/+94
| | | | | | | | | | | | | 8 bit precision is required by d3d10 but unfortunately requires 64 bit rasterizer. This commit implements 64 bit rasterization with full support for 8bit subpixel precision. It's a combination of all individual commits from the llvmpipe-rast-64 branch. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: abstract the code to set number of subpixel bitsZack Rusin2013-10-091-1/+1
| | | | | | | | | | As we're moving towards expanding the number of subpixel bits and the width of the variables used in the computations we need to make this code a bit more centralized. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: count c_primitives before discarding null primsZack Rusin2013-09-251-7/+6
| | | | | | | | | We need to count the clipper primitives before the rasterizer discards one it considers to be null. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* Revert "llvmpipe: increase number of subpixel bits to eight"Zack Rusin2013-09-241-1/+1
| | | | | | | | | This reverts commit 755c11dc5e94f17097c186edaaa39d818396f14c. We agreed that this is band-aid that's not very useful and the proper solution is to rewrite the rasterization algo so that it operates on 64 bit values. Signed-off-by: Zack Rusin <[email protected]>
* llvmpipe: align the array used for subdivived verticesZack Rusin2013-09-231-1/+1
| | | | | | | | | | | When subdiving a triangle we're using a temporary array to store the new coordinates for the subdivided triangles. Unfortunately the array used for that was not aligned properly causing random crashes in the llvm jit code which was trying to load vectors from it. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: increase number of subpixel bits to eightZack Rusin2013-09-231-1/+1
| | | | | | | | | | | | | Unfortunately d3d10 requires a lot higher precision (e.g. wgf11clipping tests for it). The smallest number of precision bits with which it passes is 8. That means that we need to decrease the maximum length of an edge that we can handle without subdivision by 4 bits. Abstracted the code a bit to make it easier to change once to switch to 64bit rasterization. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: fix pipeline statistics with a null psZack Rusin2013-08-141-1/+2
| | | | | | | | | | If the fragment shader is null then pixel shader invocations have to be equal to zero. And if we're running a null ps then clipper invocations and primitives should be equal to zero but only if both stancil and depth testing are disabled. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: fix a bug in opaque optimizationRoland Scheidegger2013-06-271-14/+14
| | | | | | | | | If there are queries active the opaque optimization reseting the bin needs to be disabled. (Not really tested since the bug was discovered by code inspection not an actual test failure.) Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: add support for nested / overlapping queriesRoland Scheidegger2013-06-261-2/+2
| | | | | | | | | | | | | | | | OpenGL doesn't support this but d3d10 does. It is a bit of a pain as it is necessary to keep track of queries still active at the end of a scene, which is also why I cheat a bit and limit the amount of simultaneously active queries to (arbitrary) 16 (simplifies things because don't have to deal with a real list that way). I can't think of a reason why you'd really want large numbers of overlapping/nested queries so it is hopefully fine. (This only affects queries which need to be binned.) v2: don't copy remainder of array when deleting an entry simply replace the deleted entry with the last one (order doesn't matter). Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: rework query logicRoland Scheidegger2013-06-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Previously lp_rast_begin_query commands were always inserted into each bin, and re-issued if the scene was restarted, while lp_rast_end_query commands were executed for each still active query at the end of tile rasterization. Also, the ps_invocations and vis_counter were set to zero when the respective command was encountered. This however cannot work for multiple queries of the same type (note that occlusion counter and occlusion predicate while different type were also affected). So, change the logic to always set the ps_invocations and vis_counter to zero at the start of tile rasterization, and then use "start" and "end" per-thread query values when encountering the begin/end query commands instead, which should work for multiple queries of the same type. This also means queries do not have to be reissued in a new scene, however they still need to be finished at end of tile rasterization, so a list of queries still active at the end of a scene needs to be maintained. Also while here don't bin the queries which don't do anything in rasterization. (This change does not actually handle multiple queries of the same type yet, as the list of active queries is just a simple fixed array and setup can still only have one query active per type.) Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: handle more queriesRoland Scheidegger2013-06-191-0/+8
| | | | | | | | | | | Handle PIPE_QUERY_GPU_FINISHED and PIPE_QUERY_TIMESTAMP_DISJOINT, and also fill out the ps_invocations and c_primitives from the PIPE_QUERY_PIPELINE_STATISTICS (the others in there should already be handled). Note that ps_invocations isn't pixel exact, just 16 pixel exact but I guess it's better than nothing. Doesn't really seem to work correctly but there's probably bugs elsewhere. Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: add support for layered renderingRoland Scheidegger2013-06-071-2/+15
| | | | | | | | | | | | | | | | Mostly just make sure the layer parameter gets passed through to the right places (and get clamped, can do this at setup time), fix up clears to clear all layers and disable opaque optimization. Luckily don't need to touch the jitted code. (Clears invoked via pipe's clear_render_target method will not work however since the pipe_util_clear function used for it doesn't handle clearing multiple layers yet.) v2: per Brian's suggestion, prettify var initialization and add some comments, add assertion for impossible layer specification for surface. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: clamp scissors to be between 0 and maxZack Rusin2013-05-251-1/+1
| | | | | | | | | | We need to clamp to make sure invalid shader doesn't crash our driver. The spec says to return 0-th index for everything that's out of bounds. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: implement support for multiple viewportsZack Rusin2013-05-251-5/+12
| | | | | | | | | | Largely related to making sure the rasterizer can correctly pick out the correct scissor box for the current viewport. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca2013-04-231-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | half_pixel_center. Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <[email protected]> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <[email protected]>
* llvmpipe: use triangle subdivision to avoid fixed-point overflow issuesBrian Paul2013-04-011-0/+175
| | | | | | | | | | | | If we're drawing to a surface that's 2048 x 2048 pixels or larger there's danger of fixed-point overflow in the triangle rasterization code. That leads to various rendering glitches. Rather than implement some intricate changes to the rasterization code, simply subdivide triangles into smaller subtriangles to avoid the issue. Only do this when the drawing surface is larger than 2048 by 2048. Reviewed-by: José Fonseca <[email protected]>
* llvmpipe: add 'f' suffix to 1.0 in fixed_to_float()Brian Paul2013-03-281-1/+1
|
* llvmpipe: Don't mess with the provoking vertex when inverting a triangle.Olivier Galibert2012-05-181-5/+40
| | | | | | | Fixes a bunch of piglit tests related to flat interpolation of floats. Signed-off-by: Olivier Galibert <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* llvmpipe: Calculate fixed point coordinates for triangle setup earlier.James Benton2012-05-141-56/+106
| | | | | | | | | | | | This allows us to calculate the triangle's area using fixed point, previously it was cacluated in floating point space. It was possible that a triangle which had negative area in floating point space had a positive area in fixed point space. Fixes fdo 40920. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: Fix triangle bounding box calculation to be correctly inclusive or ↵James Benton2012-05-111-8/+6
| | | | | | | | exclusive Tested with custom rasterisation test tool added to piglit suite, reduced errors Signed-off-by: José Fonseca <[email protected]>
* llvmpipe: Fix the 4 planes (lines) case properly.José Fonseca2011-10-051-16/+17
| | | | | | | | The previous change was not effective for lines, because there is no 4 planes 4x4 block rasterization path: it is handled by the 16x16 block case too, and the 16x16 block was not being budged as it should. This fixes assertion failures on line rasterization.
* llvmpipe: Ensure the 16x16 special rasterization path does not touch outside ↵José Fonseca2011-10-051-3/+21
| | | | | | | | | | | | | | the tile. llvmpipe has a few special rasterization paths for triangles contained in 16x16 blocks, but it allows the 16x16 block to be aligned only to a 4x4 grid. Some 16x16 blocks could actually intersect the tile if the triangle is 16 pixels in one dimension but 4 in the other, causing a buffer overflow. The fix consists of budging the 16x16 blocks back inside the tile.
* llvmpipe: added some debug assertions, but disabledBrian Paul2010-11-041-0/+10
|
* llvmpipe: avoid generating tri_16 for tris which extend past tile boundsKeith Whitwell2010-11-021-9/+25
| | | | | | | | | | Don't trim triangle bounding box to scissor/draw-region until after the logic for emitting tri_16. Don't generate tri_16 commands for triangles with untrimmed bounding boxes outside the current tile. This is important as the tri-16 itself can extend past tile bounds and we don't want to add code to it to check against tile bounds (slow) or restrict it to locations within a tile (pessimistic).
* llvmpipe: remove unused arg from jit_setup_tri functionKeith Whitwell2010-10-171-2/+1
|
* Merge remote branch 'origin/master' into lp-setup-llvmKeith Whitwell2010-10-171-202/+303
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/drivers/llvmpipe/lp_setup_coef.c src/gallium/drivers/llvmpipe/lp_setup_coef.h src/gallium/drivers/llvmpipe/lp_setup_coef_intrin.c src/gallium/drivers/llvmpipe/lp_setup_point.c src/gallium/drivers/llvmpipe/lp_setup_tri.c src/gallium/drivers/llvmpipe/lp_state_derived.c src/gallium/drivers/llvmpipe/lp_state_fs.h
| * llvmpipe: fail cleanly on malloc failure in lp_setup_alloc_triangleKeith Whitwell2010-10-171-4/+4
| |
| * llvmpipe: use aligned loads/stores for plane valuesKeith Whitwell2010-10-151-3/+3
| |
| * llvmpipe: do plane calculations with intrinsicsKeith Whitwell2010-10-151-57/+148
| | | | | | | | This is a step towards moving this code into the rasterizer.
| * llvmpipe: don't store plane.ei value in binned dataKeith Whitwell2010-10-151-9/+4
| | | | | | | | Further reduce the size of a binned triangle.
| * llvmpipe: slightly shrink the size of a binned triangleKeith Whitwell2010-10-151-63/+65
| |
| * llvmpipe: don't pass frontfacing as a floatKeith Whitwell2010-10-151-1/+1
| |
| * llvmpipe: reintroduce SET_STATE binner commandKeith Whitwell2010-10-151-23/+28
| | | | | | | | But bin lazily only into bins which are receiving geometry.
| * Revert "llvmpipe: try to keep plane c values small"Keith Whitwell2010-10-121-23/+15
| | | | | | | | | | | | | | This reverts commit 9773722c2b09d5f0615a47cecf4347859474dc56. Looks like there are some floor/rounding issues here that need to be better understood.
| * llvmpipe: try to keep plane c values smallKeith Whitwell2010-10-121-15/+23
| | | | | | | | Avoid accumulating more and more fixed point bits.
| * llvmpipe: add rast_tri_4_16 for small lines and pointsKeith Whitwell2010-10-081-4/+9
| |
| * llvmpipe: clean up setup_tri a littleKeith Whitwell2010-10-081-27/+26
| |
| * llvmpipe: avoid overflow in triangle cullingKeith Whitwell2010-10-081-40/+39
| | | | | | | | | | | | | | | | | | | | | | Avoid multiplying fixed-point values. Calculate triangle area in floating point use that for culling. Lift area calculations up a level as we are already doing this in the triangle_both() case. Would like to share the calculated area with attribute interpolation, but the way the code is structured makes this difficult.
| * llvmpipe: fail gracefully on oom in scene creationKeith Whitwell2010-10-081-6/+9
| |
| * llvmpipe: handle up to 8 planes in triangle binnerKeith Whitwell2010-09-251-7/+8
| |
* | llvmpipe: use llvm for attribute interpolant calculationKeith Whitwell2010-09-181-14/+28
|/ | | | | Basically no change relative to hard-coded version, but this will be useful for other changes later.
* llvmpipe: return zero from floor_pot(zero)Keith Whitwell2010-09-151-1/+3
|
* llvmpipe: Change asm to __asm__.Witold Baryluk2010-09-131-3/+3
| | | | | | | According to gcc documentation both are equivalent, second are prefered as first can make conflict with existing symbols. Signed-off-by: José Fonseca <[email protected]>
* llvmpipe: Unbreak rasterization on 64bit.José Fonseca2010-09-131-24/+22
|
* llvmpipe: use gcc asm only with gccJosé Fonseca2010-09-131-1/+1
|
* llvmpipe: introduce tri_3_4 for tiny trianglesKeith Whitwell2010-09-121-0/+12
|