aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup_point.c
Commit message (Collapse)AuthorAgeFilesLines
* llvmpipe: improve rasterization discard logicRoland Scheidegger2018-05-231-7/+15
| | | | | | | | | | | | | | | | | | | | | | This unifies the explicit rasterization discard as well as the implicit rasterization disabled logic (which we need for another state tracker), which really should do the exact same thing. We'll now toss out the prims early on in setup with (implicit or explicit) discard, rather than do setup and binning with them, which was entirely pointless. (We should eventually get rid of implicit discard, which should also enable us to discard stuff already in draw, hence draw would be able to skip the pointless clip and fallback stages in this case.) We still need separate logic for only null ps - this is not the same as rasterization discard. But simplify the logic there and don't count primitives simply when there's an empty fs, regardless of depth/stencil tests, which seems perfectly acceptable by d3d10. While here, also fix statistics for primitives if face culling is enabled. No piglit changes. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe:fix using 32bit rasterization mistakenly, causing overflowsRoland Scheidegger2017-06-231-1/+1
| | | | | | | | | | | | | We use the bounding box (triangle extents) to figure out if 32bit rasterization could potentially overflow. However, we used the bounding box which already got rounded up to 0 for negative coords for this, which is incorrect, leading to overflows and hence bogus rendering in some of our private use. It might be possible to simplify this somehow (we're now using 3 different boxes for binning) but I don't quite see how. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: scale up bounding box planes to subpixel precisionRoland Scheidegger2016-01-131-10/+10
| | | | | | | | | Otherwise some planes we get in rasterization have subpixel precision, others not. Doesn't matter so far, but will soon. (OpenGL actually supports viewports with subpixel accuracy, so could even do bounding box calcs with that). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: fix layer/vp input into fs when not written by prior stagesRoland Scheidegger2015-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | ARB_fragment_layer_viewport requires that if a fs reads layer or viewport index but it wasn't output by gs (or vs with other extensions), then it reads 0. This never worked for llvmpipe, and is surprisingly non-trivial to fix. The problem is the mechanism to handle non-existing outputs in draw is rather crude, it will simply redirect them to whatever is at output 0, thus later stages will just get garbage. So, rather than trying to fix this up (which looks non-trivial), fix this up in llvmpipe setup by detecting this case there and output a fixed zero directly. While here, also optimize the hw vertex layout a bit - previously if the gs outputted layer (or vp) and the fs read those inputs, we'd add them twice to the vertex layout, which is unnecessary. And do some minor cleanup, slots don't require that many bits, there was some bogus (but harmless) float/int mixup for psize slot too, make the slots all unsigned (we always put pos at pos zero thus everything else has to be positive if it exists), and make sure they are properly initialized (layer and vp index slot were not which looked fishy as they might not have got set back to zero when changing from a gs which outputs them to one which does not). This fixes the failures in piglit's arb_fragment_layer_viewport group (3 each for layer and vp). Reviewed-by: Jose Fonseca <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-1/+1
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* llvmpipe: fix large point rasterization with point_quad_rasterizationRoland Scheidegger2014-01-171-12/+19
| | | | | | | | | | The whole round-pointsize-to-int stuff must only be done with GL legacy rules (no point_quad_rasterization) or all the wrong edges are lit up. This was previously in a private branch (d3d pointsprite test complains loudly otherwise) and got lost in a merge. However, it should certainly apply to GL point sprite rasterization as well. Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: Honour pipe_rasterizer::point_quad_rasterization.José Fonseca2014-01-091-10/+57
| | | | | | | | | | | | Commit eda21d2a3010d9fc5a68b55a843c5e44b2abf8dd fixed the rasterization of points for Direct3D but ended up breaking the rasterization of OpenGL non-sprite points, in particular conform's pntrast.c test. The only way to get both working is to properly honour pipe_rasterizer::point_quad_rasterization, and follow the weird OpenGL rule when it is false. Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: Fix the bottom_edge_rule adjustment for points.José Fonseca2014-01-081-4/+4
| | | | | | | | | The adjustment needs to be applied to the y coordinates and not the x coordinates, just like the equivalent code for lines and triangles in lp_setup_line.c and lp_setup_tri.c. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Zack Rusin <[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: add a very useful (disabled) debugging outputZack Rusin2013-12-101-0/+20
| | | | | | | | Disabled by default, but it's very useful when needed. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: clamp fragment shader depth write to the current viewport depth range.Matthew McClure2013-12-091-5/+6
| | | | | | | | | | | | | | | | | 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: 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]>
* draw: inject frontface info into wireframe outputsZack Rusin2013-08-021-2/+13
| | | | | | | | | | | | | | Draw module can decompose primitives into wireframe models, which is a fancy word for 'lines', unfortunately that decomposition means that we weren't able to preserve the original front-face info which could be derived from the original primitives (lines don't have a 'face'). To fix it allow draw module to inject a fake face semantic into outputs from which the backends can figure out the original frontfacing info of the primitives. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> 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: handle more queriesRoland Scheidegger2013-06-191-1/+9
| | | | | | | | | | | 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-0/+7
| | | | | | | | | | | | | | | | 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-4/+8
| | | | | | | | | | 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]>
* Merge remote branch 'origin/master' into lp-setup-llvmKeith Whitwell2010-10-171-102/+190
|\ | | | | | | | | | | | | | | | | | | | | 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: don't store plane.ei value in binned dataKeith Whitwell2010-10-151-4/+0
| | | | | | | | Further reduce the size of a binned triangle.
| * llvmpipe: slightly shrink the size of a binned triangleKeith Whitwell2010-10-151-68/+73
| |
| * llvmpipe: don't pass frontfacing as a floatKeith Whitwell2010-10-151-1/+1
| |
| * llvmpipe: reintroduce SET_STATE binner commandKeith Whitwell2010-10-151-1/+0
| | | | | | | | But bin lazily only into bins which are receiving geometry.
| * llvmpipe: Use lp_tgsi_info.José Fonseca2010-10-111-2/+2
| |
| * llvmpipe: fail gracefully on oom in scene creationKeith Whitwell2010-10-081-2/+3
| |
| * llvmpipe: Fix sprite coord perspective interpolation of Q.José Fonseca2010-10-061-9/+3
| | | | | | | | | | Q coordinate's coefficients also need to be multiplied by w, otherwise it will have 1/w, causing problems with TXP.
| * llvmpipe: Fix perspective interpolation for point sprites.José Fonseca2010-10-061-17/+54
| | | | | | | | | | | | | | | | | | | | | | Once a fragment is generated with LP_INTERP_PERSPECTIVE set for an input, it will do a divide by w for that input. Therefore it's not OK to treat LP_INTERP_PERSPECTIVE as LP_INTERP_LINEAR or vice-versa, even if the attribute is known to not vary. A better strategy would be to take the primitive in consideration when generating the fragment shader key, and therefore avoid the per-fragment perspective divide.
| * gallium/llvmpipe: remove duplicated includeNicolas Kaiser2010-09-301-1/+0
| | | | | | | | | | | | Remove duplicated include. Signed-off-by: Brian Paul <[email protected]>
| * llvmpipe: handle FACING interpolants in line and point setupKeith Whitwell2010-09-251-3/+13
| |
| * llvmpipe: fix sprite texcoord setup for non-projective texturingBrian Paul2010-09-221-27/+58
| | | | | | | | | | | | | | | | Normally the Mesa state tracker uses TXP instructions for texturing. But if a fragment shader uses texture2D() that's a TEX instruction. In that case we were incorrectly computing the texcoord coefficients in the point sprite setup code. Some new comments in the code explain things.
| * llvmpipe: check bitshift against PIPE_MAX_SHADER_OUTPUTSBrian Paul2010-09-201-2/+5
| |
| * llvmpipe: implement sprite coord origin modesBrian Paul2010-09-201-6/+12
| |
| * llvmpipe: rename sprite field, add sprite_coord_originBrian Paul2010-09-201-1/+1
| |
| * llvmpipe: clean-up, comments in setup_point_coefficient()Brian Paul2010-09-201-5/+10
| |
| * llvmpipe: reformatting, remove trailing whitespace, etcBrian Paul2010-09-201-21/+23
| |
* | llvmpipe: use llvm for attribute interpolant calculationKeith Whitwell2010-09-181-5/+8
|/ | | | | Basically no change relative to hard-coded version, but this will be useful for other changes later.
* llvmpipe: use opcodes instead of function pointers in binsKeith Whitwell2010-09-071-1/+3
| | | | Also, move some state from rasterizer struct to the scene.
* llvmpipe: enforce fixed memory limit on scenesKeith Whitwell2010-09-071-5/+19
|
* llvmpipe: point sprites rasterizationHui Qi Tay2010-08-271-1/+62
| | | | | Point sprites now done in the rasterizer setup code instead of going through the draw module.
* llvmpipe: native point rasterization with better pixel rasterizationHui Qi Tay2010-08-271-16/+18
| | | | | | | | A few subpixel_snap and fixed width changes. Conflicts: src/gallium/drivers/llvmpipe/lp_setup_point.c
* llvmpipe: native point rasterizationHui Qi Tay2010-08-271-3/+222
| | | | | | | | Conflicts: src/gallium/drivers/llvmpipe/lp_setup_context.h src/gallium/drivers/llvmpipe/lp_setup_line.c src/gallium/drivers/llvmpipe/lp_setup_tri.c
* llvmpipe: native rasterization for linesHui Qi Tay2010-08-271-2/+2
| | | | | Rasterize lines directly by treating them as 4-sided polygons. Still need to check the exact pixel rasteration.
* llvmpipe: setup_context -> lp_setup_contextJosé Fonseca2010-03-131-2/+2
| | | | | Otherwise IDEs and debuggers have trouble distinguishing from softpipe's setup_context.
* llvmpipe: hook up some state, add stub line and point functionsKeith Whitwell2009-10-091-0/+46