aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
Commit message (Collapse)AuthorAgeFilesLines
...
* draw: Make it possible to create a llvm free contextJakob Bornecrantz2012-01-092-15/+35
| | | | | Signed-off-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: replace assert(0) with debug_warn_once()Brian Paul2012-01-073-6/+6
| | | | | | If the assertion was hit, it probably meant that we were unable to allocate or map a vertex buffer. Instead of dying in a debug build, issue a warning and continue.
* draw: whitespace fixes, etc.Brian Paul2012-01-074-173/+160
|
* gallium: make vbuf_render::set_primitive() return voidBrian Paul2012-01-074-29/+10
| | | | All the implementations of this function always return TRUE.
* draw: fix missing include for u_format.Dave Airlie2012-01-071-0/+1
| | | | Signed-off-by: Dave Airlie <[email protected]>
* draw: don't translate non-floats to float.Dave Airlie2012-01-071-0/+22
| | | | | | | | translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types. This fixes a bunch of piglit tests. Signed-off-by: Dave Airlie <[email protected]>
* draw: fix piglit base vertex + user vertex array testsDave Airlie2012-01-061-1/+1
| | | | | | | | | | | | | This fixes draw-elements-base-vertex user_varrays draw-elements-instanced-base-vertex user_varrays for softpipe with no llvm support (DRAW_USE_LLVM=false) I'm not sure if this is the correct answer, but these tests were showing a max_index of 7, then trying to fetch up to 43, maybe it should be fixing max_index earlier somewhere to take care of this. Signed-off-by: Dave Airlie <[email protected]>
* gallium/draw: fix two side handlingDave Airlie2011-12-191-18/+9
| | | | | | | | | | | | The code didn't handle the case where front wasn't specified in the vertex shader outputs, but back was. In that case we were doing a copy from back to non-existant front, this code checks we have existant front/backs and only does the copy when they both exist. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: interface changes necessary to implement transform feedback (v5)Marek Olšák2011-12-154-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: - EXT_transform_feedback - ARB_transform_feedback2 - ARB_transform_feedback_instanced The old interface was not useful for OpenGL and had to be reworked. This interface was originally designed for OpenGL, but additional changes have been made in order to make st/d3d1x support easier. The most notable change is the stream-out info must be linked with a vertex or geometry shader and cannot be set independently. This is due to limitations of existing hardware (special shader instructions must be used to write into stream-out buffers), and it's also how OpenGL works (stream outputs must be specified prior to linking shaders). Other than that, each stream output buffer has a "view" into it that internally maintains the number of bytes which have been written into it. (one buffer can be bound in several different transform feedback objects in OpenGL, so we must be able to have several views around) The set_stream_output_targets function contains a parameter saying whether new data should be appended or not. Also, the view can optionally be used to provide the vertex count for draw_vbo. Note that the count is supposed to be stored in device memory and the CPU never gets to know its value. OpenGL way | Gallium way ------------------------------------ BeginTF = set_so_targets(append_bitmask = 0) PauseTF = set_so_targets(num_targets = 0) ResumeTF = set_so_targets(append_bitmask = ~0) EndTF = set_so_targets(num_targets = 0) DrawTF = use pipe_draw_info::count_from_stream_output v2: * removed the reset_stream_output_targets function * added a parameter append_bitmask to set_stream_output_targets, each bit specifies whether new data should be appended to each buffer or not. v3: * added PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME for ARB_tfb2, note that the draw-auto subset is always required (for d3d10), only the pause/resume functionality is limited if the CAP is not advertised v4: * update gallium/docs v5: * compactified struct pipe_stream_output_info, updated dump/trace
* llvmpipe,draw,gallivm: Ensure we don't walk beyond the end of the shader ↵José Fonseca2011-12-081-2/+7
| | | | | | | | | | | variant list. u_simple_list.h uses a sentinel element, and not a NULL element. So ensure list is not empty when reducing the list of shader variants. Something I noticed while trying to free variants more aggressively. Reviewed-by: Brian Paul <[email protected]>
* util/draw: replace assertions with conditionals in util_draw_max_index()Brian Paul2011-11-151-5/+15
| | | | | | | | | | | | | | Don't assert/die if a VBO is too small. Return zero instead. For debug builds, emit a warning message since this is an unusual situation that might indicate that there's a bug in the app. Note that util_draw_max_index() now returns max_index+1 instead of max_index. This lets us return zero to indicate that one of the VBOs is too small to draw anything. Fixes a failure with the new piglit vbo-too-small test. Reviewed-by: José Fonseca <[email protected]>
* draw: Handle failure to allocate aligned_constant_storage.José Fonseca2011-11-141-3/+9
| | | | | | | | Also, actually update const_storage_size, therefore avoiding to unnecessarily reallocate aligned_constant_storage every single time draw_vs_set_constants() is called. Reviewed-by: Brian Paul <[email protected]>
* draw: handle out of memory conditionsBrian Paul2011-11-111-3/+5
| | | | | If the vbuf backend fails to allocate a vertex buffer, don't crash or assert.
* draw/llvm: silence uninitialized variable warningsBrian Paul2011-11-101-0/+2
|
* Remove tgsi_sse2.José Fonseca2011-11-089-3591/+2
| | | | tgsi_exec is simple. llvm is fast. tgsi_sse2 ends up being neither.
* draw: assert that we have non-null fragment shaderBrian Paul2011-11-032-0/+4
| | | | Instead of just segfaulting. Recently ran into this.
* draw/llvm: set draw->pt.user.planes field in draw_set_clip_state()Brian Paul2011-10-111-1/+2
| | | | | | | | | | | | | Previously it was getting set in draw_set_mapped_constant_buffer() but if there were no shader constants, that function wasn't called. So the pt.user.planes field was null and we died when we tried to access the clip planes in the LLVM-generated code. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41663 Note: This is a candidate for the 7.11 branch. Reviewed-by: José Fonseca <[email protected]>
* draw/llvm: fix hard-coded number of total clip planesBrian Paul2011-10-115-14/+23
| | | | | | | | Instead of 12 use DRAW_TOTAL_CLIP_PLANES. The max number of user-defined clip planes was increased to 8 so the total number of planes is 14. This doesn't fix any specific bug, but clearly the old code was wrong. Reviewed-by: José Fonseca <[email protected]>
* gallium: add polygon offset clamp stateChristoph Bumiller2011-09-281-0/+6
| | | | This is required for D3D1x and supported by hardware.
* gallium: move border color to be a color unionDave Airlie2011-09-271-1/+1
| | | | | | | | | | EXT_texture_integer also specifies border color should be a color union, the values are used according to the texture sampler format. (update docs) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: Never allocate duplicate extra vertex attribs.José Fonseca2011-09-255-46/+54
| | | | | | | Prevents mismatches when the VS outputs generic attributes not used by the FS. Reviewed-by: Brian Paul <[email protected]>
* draw: Make copy of the TGSI tokens.José Fonseca2011-09-252-2/+6
| | | | | | | | There is no guarantee that the tokens TGSI will persist beyond the create_fs_state. The pipe driver (and therefore the draw module) is responsible for making copies of the TGSI tokens when it needs them. Reviewed-by: Brian Paul <[email protected]>
* draw/llvm: add additional null pointer checkin ↵Brian Paul2011-09-231-1/+1
| | | | draw_pt_fetch_pipeline_or_emit_llvm()
* draw: add support for guard-band clippingBrian Paul2011-09-228-6/+50
|
* draw: Reduce the number of vertex shader variants per context to 128.José Fonseca2011-09-221-1/+1
|
* draw: Respect max_indices from the renderer.Kurt Daverman2011-09-221-1/+1
|
* Gallium: remove unnecessary ifdef for MAX_CLIPPED_VERTICES.Paul Berry2011-09-201-2/+0
| | | | | | | | | | | draw_pipe_clip.c contained an ifdef to ensure that its local definition of MAX_CLIPPED_VERTICES would not take effect if the global MAX_CLIPPED_VERTICES (defined in src/mesa/main/config.h) was already defined. This was unnecessary because draw_pipe_clip.c doesn't directly or indirectly include src/mesa/main/config.h. Removed the ifdef to reduce confusion. Reviewed-by: Brian Paul <[email protected]>
* draw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()Brian Paul2011-09-101-273/+97
| | | | | | | | These two functions were nearly the same with lots of duplicated code. Now pass in a boolean 'elts' flag and use a few conditionals to implement the linear vs. indexed cases. Reviewed-by: José Fonseca <[email protected]>
* llvmpipe: fix build with LLVM 3.0svnTobias Droste2011-07-191-13/+35
| | | | | | | | | LLVM 3.0svn introduced a new type system. It defines a new way to create named structs and removes the (now not needed) LLVMInvalidateStructLayout function. See revision 134829 of LLVM. Signed-off-by: Tobias Droste <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* draw: Fix fetch_max calculation.José Fonseca2011-07-041-1/+2
| | | | | | | | | | It should be max_index = start + count - 1 instead of max_index = count - 1
* Gallium: fix buffer overflowMicael Dias2011-07-011-0/+11
| | | | Signed-off-by: José Fonseca <[email protected]>
* Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our ↵Stéphane Marchesin2011-06-292-0/+17
| | | | stage.
* draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)Brian Paul2011-06-081-5/+57
| | | | | | | | | | | | | | | | | | | | Previously, we were errantly drawing some interior edges of clipped polygons and quads. Also, we were introducing extra edges where polygons intersected the view frustum clip planes. The main problem was that we were ignoring the edgeflags encoded in the primitive header's 'flags' field which are set during polygon/quad ->tri decomposition. We need to observe those during clipping. Since we can't modify the existing vert's edgeflag fields, we need to store them in a parallel array. Edge flags also need to be handled differently for view frustum planes vs. user-defined clip planes. In the former case we don't want to draw new clip edges but in the later case we do. This matches NVIDIA's behaviour and it just looks right. Finally, note that the LLVM draw code does not properly set vertex edge flags. It's OK on the regular software path though.
* draw: rename draw_vs_varient.c to draw_vs_variant.cBrian Paul2011-06-071-0/+0
|
* draw/llvm: whitespace, formatting fixesBrian Paul2011-06-071-38/+51
|
* draw: s/1/TRUE/Brian Paul2011-06-071-2/+2
|
* gallium/draw: Fix enum type taken by draw_get_shader_param().Michel Dänzer2011-05-031-1/+1
| | | | | | | | | | Pointed out by clang: src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion from enumeration type 'enum pipe_cap' to different enumeration type 'enum pipe_shader_cap' [-Wconversion] return tgsi_exec_get_shader_param(param); ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
* draw: remove set-but-unused variableMarek Olšák2011-05-011-2/+1
|
* draw: fix point/line/tri flushing bug in vbuf codeBrian Paul2011-04-221-4/+10
| | | | | | | | Need to reset the point/line/tri functions to point to the "first" versions whenever we flush vertices. Fixes unfilled polygon rendering errors seen in demos/samples/logo.c. See comments for more info. NOTE: This is a candidate for the 7.10 branch.
* llvmpipe: Take the sampler view's first_level into account when sampling.Fabian Bieler2011-04-085-6/+15
|
* draw: Fix thinko in debug warnings.José Fonseca2011-04-061-3/+3
|
* draw: Prevent out-of-bounds vertex buffer access.José Fonseca2011-04-017-7/+37
| | | | Based on some code and ideas from Keith Whitwell.
* draw: Revert code reorg in previous change.José Fonseca2011-03-311-4/+4
| | | | | | | | | | Because fetch_count = max_index - min_index + 1 overflows for min_index = 0 and max_index = 0xffffffff. Fixes fdo 35815.
* draw: implement vertex color clamping, and disable SSE and PPC pathsLuca Barbieri2011-03-314-9/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (some little changes by Marek Olšák) Squashed commit of the following: commit 737c0c6b7d591ac0fc969a7590e1691eeef0ce5e Author: Luca Barbieri <[email protected]> Date: Fri Aug 27 02:13:57 2010 +0200 draw: disable SSE and PPC paths (use LLVM instead) These paths don't support vertex clamping, and are anyway obsoleted by LLVM. If you want to re-enable them, add vertex clamping and test that it works with the ARB_color_buffer_float piglit tests. commit fed3486a7ca0683b403913604a26ee49a3ef48c7 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:27:38 2010 +0200 draw_llvm: respect vertex color clamp commit ef0efe9f3d1d0f9b40ebab78940491d2154277a9 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:26:43 2010 +0200 draw: respect vertex clamping in interpreter path
* draw: Forgot to remove one istart usage.José Fonseca2011-03-301-1/+1
|
* draw: Fix bug when drawing ushort indices.José Fonseca2011-03-301-6/+8
| | | | | | | | | | When the condition min_index == 0 && sizeof(ib[0]) == sizeof(draw_elts[0]) was true, we were wrongly ignoring istart and processing indices 0. Reorder some statements to make the code easier to understand.
* draw: Fix draw_variant_output::format's type.José Fonseca2011-03-132-3/+4
|
* draw: remove unnecessary flushMarek Olšák2011-03-111-7/+0
|
* draw: Silence tgsi_emit_sse2 failed messages.José Fonseca2011-03-041-1/+2
|
* draw: setup pipe's draw pointer for the aapoint stageBrian Paul2011-02-281-0/+2
| | | | | | The other draw stages like aaline and pstipple were already doing this. If the driver used the aapoint stage but not the others it would crash because of a null pipe->draw pointer.