summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
Commit message (Collapse)AuthorAgeFilesLines
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-184-2/+5
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[email protected]>
* draw: clear the draw buffers in drawZack Rusin2013-06-173-2/+4
| | | | | | | | | | Moves clearing of the draw so target buffers to the draw module. They had to be cleared in the drivers before which was quite messy. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* softpipe: draw_find_shader_output returns -1 on invalid outputsZack Rusin2013-05-301-1/+1
| | | | | | | | It was changed from 0 to allow shader outputs at 0 that are different from position. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: fixup draw_find_shader_outputZack Rusin2013-05-251-1/+1
| | | | | | | | | | | | | | | | | draw_find_shader_output like most of the code in draw used to depend on position always being at output slot 0. which meant that any other attribute being at 0 could signify an error. unfortunately position can be at any of the output slots, thus other attributes can occupy slot 0 and we need to mark the ones which were not found by something else. This commit changes draw_find_shader_output so that it returns -1 if it can't find the given attribute and adjust the code that depended on it returning >0 whenever it correctly found an attrib. 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: Add support for multiple viewportsZack Rusin2013-05-252-7/+14
| | | | | | | | | | | | Gallium supported only a single viewport/scissor combination. This commit changes the interface to allow us to add support for multiple viewports/scissors. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: change TEX_TILE_SIZE and NUM_TEX_TILE_ENTRIESRoland Scheidegger2013-05-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Initially we had NUM_TEX_TILE_ENTRIES of 50, however this was using too much memory (mostly because the tile cache is operating on fixed max current sampler views which could be fixed but that's another topic). So it was decreased to 4. However this is a ridiculously low number which can't actually really work (the number of tiles needed for as little as a single quad with linear_mipmap_linear is 2 to 8 for a 2d texture, and 4 to 16 for a 3d texture), as it just about guarantees there will be cache thrashing sometimes (just about always for 3d textures in fact, since while there are 4 entries the cache is direct mapped). So increase that number to 16 (which is still on the low side for direct mapped cache though I guess using something like 4-way associativity would be more effective than increasing this further) which has at least some good chance to avoid thrashing. Since we don't want to increase memory requirements however in turn decrease the tile size accordingly from 64 to 32 (as a bonus point this also decreases the cost of texture thrashing which might still happen sometimes). I've seen performance improvement in the order of factor ~200 (specifically, drawing the first frame from the replay from bug 41787 needs "only" ~10s instead of ~30min, meaning I can actually compare the output with other drivers...) with this. Reviewed-by: Jose Fonseca <[email protected]>
* softpipe: disambiguate TILE_SIZE / TEX_TILE_SIZERoland Scheidegger2013-05-223-38/+38
| | | | | | | These can be different (just like NUM_TEX_TILE_ENTRIES / NUM_ENTRIES), though currently they aren't. Reviewed-by: Jose Fonseca <[email protected]>
* draw: try to prevent overflows on index buffersZack Rusin2013-05-141-3/+10
| | | | | | | | | | | | Pass in the size of the index buffer, when available, and use it to handle out of bounds conditions. The behavior in the case of an overflow needs to be the same as with other overflows in the vertex processing pipeline meaning that a vertex should still be generated but all attributes in it set to zero. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: don't crash on vertex buffer overflowZack Rusin2013-05-141-2/+4
| | | | | | | | | | | | | | We would crash when stride was bigger than the size of the buffer. The correct behavior is to just fetch zero's in this case. Unfortunatly with user_buffer's there's no way to validate the size because currently we're just not getting it. Adjust the draw interface to pass the size along the mapped buffer, which works perfectly for buffer backed vertex_buffers and, in future, it will allow us to plumb user_buffer sizes through the same interface. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE for GLMarek Olšák2013-05-111-0/+2
| | | | | | v2: fix typo 65535 -> 65536 Reviewed-by: Brian Paul <[email protected]>
* gallium: fix type of flags in pipe_context::flush()Chia-I Wu2013-05-042-2/+2
| | | | | | | | | | | | | | | | It should be unsigned, not enum pipe_flush_flags. Fixed a build error: src/gallium/state_trackers/egl/android/native_android.cpp:426:29: error: invalid conversion from 'int' to 'pipe_flush_flags' [-fpermissive] v2: replace all occurrences of enum pipe_flush_flags by unsigned Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Marek Olšák <[email protected]> [olv: document the parameter now that the type is unsigned]
* gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* softpipe: fix streamout with an emptry geometry shaderZack Rusin2013-04-222-12/+23
| | | | | | | | | Same approach as in the llvmpipe, if the geometry shader is null and we have stream output then attach it to the vertex shader right before executing the draw pipeline. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* st/mesa: optionally apply texture swizzle to border color v2Christoph Bumiller2013-04-181-0/+2
| | | | | | | | | | | | This is the only sane solution for nv50 and nvc0 (really, trust me), but since on other hardware the border colour is tightly coupled with texture state they'd have to undo the swizzle, so I've added a cap. The dependency of update_sampler on the texture updates was introduced to avoid doing the apply_depthmode to the swizzle twice. v2: Moved swizzling helper to u_format.c, extended the CAP to provide more accurate information.
* softpipe/so: use the correct variable for reporting stream outZack Rusin2013-04-171-5/+15
| | | | | | | | we were using the wrong vars, reporting incorrect stream output statistics. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: implement pipeline statistics in the draw moduleZack Rusin2013-04-167-2/+77
| | | | | | | | | | | | | This is a basic implementation of the pipeline statistics in the draw module. The interface is similar to the stream output statistics and also requires that the callers explicitly enable it. Included is the implementation of the interface in llvmpipe and softpipe. Only softpipe enables the pipeline statistics capability though because llvmpipe is lacking gathering of the fragment shading and rasterization statistics. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* softpipe: misc updates to image dumping in softpipe_flush()Brian Paul2013-04-091-3/+4
|
* gallium: add PIPE_CAP_QUERY_PIPELINE_STATISTICSChristoph Bumiller2013-04-031-0/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* gallium,st/mesa: don't use blit-based transfers with software rasterizersMarek Olšák2013-03-231-0/+1
| | | | | | | | | The blit-based paths for TexImage, GetTexImage, and ReadPixels aren't very fast with software rasterizer. Now Gallium drivers have the ability to turn them off. Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* softpipe: silence some asst. MSVC type warnings in sp_tex_sample.cBrian Paul2013-03-211-6/+6
|
* softpipe: silence some MSVC signed/unsigned warningsBrian Paul2013-03-212-2/+2
|
* softpipe: silence some MSVC float/double warningsBrian Paul2013-03-211-6/+6
|
* gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3Christoph Bumiller2013-03-201-0/+2
| | | | | | | | | | | | | | | This makes it possible to identify gl_TexCoord and gl_PointCoord for drivers where sprite coordinate replacement is restricted. The new PIPE_CAP_TGSI_TEXCOORD decides whether these varyings should be hidden behind the GENERIC semantic or not. With this patch only nvc0 and nv30 will request that they be used. v2: introduce a CAP so other drivers don't have to bother with the new semantic v3: adapt to introduction gl_varying_slot enum
* softpipe: fix up NUM_ENTRIES confusionBrian Paul2013-03-143-13/+13
| | | | | | | | | | | | | | | | | | There were two different NUM_ENTRIES #defines for the framebuffer tile cache and the texture tile cache. Rename the later to fix the warnings: In file included from sp_flush.c:40:0: sp_tex_tile_cache.h:76:0: warning: "NUM_ENTRIES" redefined sp_tile_cache.h:78:0: note: this is the location of the previous definition In file included from sp_context.c:50:0: sp_tex_tile_cache.h:76:0: warning: "NUM_ENTRIES" redefined sp_tile_cache.h:78:0: note: this is the location of the previous definition Also, replace occurances of NUM_ENTRIES with Element() macro to be safer. Reviewed-by: José Fonseca <[email protected]>
* softpipe: Shrink context size.José Fonseca2013-03-141-1/+1
| | | | | | | | | | | | | | - each softpipe_tex_tile_cache 50*64*64*4*4 = 3,276,800 bytes - each softpipe_context has 3*32 softpipe_tex_tile_cache, i.e, each softpipe context is 314,572,800 bytes, i.e, 300MB That is, in a 32bits process (around 3GB virtual memory max), we can only fit 10 contexts. This change is a short-term hack to shrink the context size. Longer term we'll need to change how the texture cache works. Reviewed-by: Brian Paul <[email protected]>
* softpipe: don't assert when creating surfaces with multiple layersRoland Scheidegger2013-03-142-16/+32
| | | | | | | | | | | | We can't handle them yet, however we can safely just warn (we will just render to first layer, which is fine since we can't handle rendertarget system value neither). Also make behavior more predictable with buffer surfaces (it would sometimes hit bogus asserts because of the union in the surface, instead create the surface but assert when trying to set a buffer in the framebuffer). Reviewed-by: Jose Fonseca <[email protected]>
* softpipe: don't use samplers with prebaked sampler and sampler_view stateRoland Scheidegger2013-03-116-866/+779
| | | | | | | | | | | | | | This is needed for handling the dx10-style sample opcodes. This also simplifies the logic by getting rid of sampler variants completely (sampler_views though OTOH have sort of variants because some of their state is different depending on the shader stage they are bound to). No significant performance difference (openarena run: 840 frames in 459.8 seconds vs. 840 frames in 460.5 seconds). v2: fix reference counting bug spotted by Jose. Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: add texel offsets and derivatives to sampler interfaceRoland Scheidegger2013-03-021-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Something I never got around to implement, but this is the tgsi execution side for implementing texel offsets (for ordinary texturing) and explicit derivatives for sampling (though I guess the ordering of the components for the derivs parameters is debatable). There is certainly a runtime cost associated with this. Unless there are different interfaces used depending on the "complexity" of the texture instructions, this is impossible to avoid. Offsets are always active (I think checking if they are active or not is probably not worth it since it should mostly be an add), whereas the sampler_control is extended for explicit derivatives. For now softpipe (the only user of this) just drops all those new values on the floor (which is the part I never implemented...). Additionally this also fixes (discovered by accident) inconsistent projective divide for the comparison coord - the code did do the projection for shadow2d targets, but not shadow1d ones. This also drops checking for projection modifier on array targets, since they aren't possible in any extension I know of (hence we don't actually know if the array layer should also be divided or not). Reviewed-by: Brian Paul <[email protected]>
* softpipe/draw/tgsi: simplify driver/tgsi sampler interfaceRoland Scheidegger2013-02-288-117/+186
| | | | | | | | | | | | | | | Use a single sampler adapter instead of per-sampler-unit samplers, and just pass along texture unit and sampler unit in the calls. The reason is that for dx10-style sample opcodes pre-wired samplers including all the texture state aren't really feasible (and for sample_i/sviewinfo we don't even have samplers). Of course right now softpipe doesn't actually do anything more than just look up all its pre-wired per-texunit/per-samplerunit sampler as it did before so this doesn't really achieve much except one more function call, however this is now all softpipe's fault (fixing that in a way which doesn't suck is still an unsolved problem). Reviewed-by: Jose Fonseca <[email protected]>
* softpipe: clean up lod computationRoland Scheidegger2013-02-082-70/+93
| | | | | | | | | | | | | | | This should handle the new lod_zero modifier more correctly. The runtime-conditional is a bit more complex however we now also do scalar lod computation when appropriate which should more than make up for it. The refactoring should also fix an issue with explicit lods (lod clamp wasn't applied to them). Also, always pass lod as the 5th element from tgsi executor, which simplifies things (get rid of annoying conditionals later). v2: based on Brian's feedback, use switch in a couple of places, fix up some function parameter names, fix up comments. Reviewed-by: Brian Paul <[email protected]>
* softpipe: get rid of tgsi_sampler_control param in img_filterRoland Scheidegger2013-02-082-40/+37
| | | | | | | | None of the filters used it (why would they). Maybe that param was just there because some of the lines were considered to be too short... Reviewed-by: Dave Airlie <[email protected]>
* softpipe: fix using optimized filter functionRoland Scheidegger2013-02-081-0/+1
| | | | | | | | | | | This optimized filter (when using repeat wrap modes, linear min/mag/mip filters, pot textures) only applies to 2d textures, but nothing prevented it from being used for other textures (likely leading to very bogus sample results). Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* gallium/util: remove duplicated function util_format_is_rgb_no_alphaMarek Olšák2013-02-061-1/+1
| | | | | | It only checks if alpha is present, so it's the same as util_format_has_alpha. Reviewed-by: Brian Paul <[email protected]>
* gallium: handle unhandled PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENTAndreas Boll2013-02-041-0/+2
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60098 Signed-off-by: Brian Paul <[email protected]>
* softpipe: add casts to silence MSVC warningsBrian Paul2013-01-251-2/+2
| | | | Reviewed-by: José Fonseca <[email protected]>
* gallium: remove PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATEMarek Olšák2013-01-151-2/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* softpipe: implement separate depth-stencil clearMarek Olšák2013-01-151-3/+12
| | | | | | The CAP is going away. Reviewed-by: Brian Paul <[email protected]>
* Remove hacks for static MakefilesMatt Turner2013-01-131-3/+0
| | | | | | | | | | | v2: Andreas Boll <[email protected]> - don't remove compatibility with scripts for the old build system v3: Andreas Boll <[email protected]> - remove more obsolete hacks v4: Andreas Boll <[email protected]> - add a previously removed TOP variable to fix vgapi build
* Clean up .gitignore filesMatt Turner2013-01-101-1/+0
|
* softpipe: Convert to automakeMatt Turner2013-01-103-37/+65
|
* gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flagMarek Olšák2013-01-042-4/+6
| | | | | | | | | | | | | | | | | Usage with pipe_context: pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME); Usage with st_context_iface: st->flush(st, ST_FLUSH_END_OF_FRAME, NULL); The flag is only a hint for drivers. Radeon will use it for buffer eviction heuristics in the kernel (e.g. for queries like how many frames have passed since a buffer was used). The flag is currently only generated by st/dri on SwapBuffers. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]>
* gallium: s/PIPE_CAP_TIMER_QUERY/PIPE_CAP_QUERY_TIME_ELAPSED/José Fonseca2012-12-201-1/+1
| | | | | | | | To better reflect what it is being advertised. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* softpipe: fix up FS variant unbinding / deletionBrian Paul2012-12-193-11/+9
| | | | | | | | | | | | The old call to tgsi_exec_machine_bind_shader() in softpipe_delete_fs_state() was never called since the shader's original tokens are never passed to the tgsi interpreter (only shader _variant_ tokens are). Now, unbind the variant's tokens from the tgsi interpreter when we free the variant. This doesn't fix any known bugs but it's the right thing to do. Note: This is a candidate for the stable branches.
* softpipe: fix unreliable FS variant binding bugBrian Paul2012-12-193-14/+10
| | | | | | | | | | | | | In exec_prepare() we were comparing pointers to see if the fragment shader variant had changed before calling tgsi_exec_machine_bind_shader(). This didn't work reliably when there was a lot of shader token malloc/ freeing going on because the memory might get reused. Instead, bind the shader variant during regular state validation. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404 (fixes a couple of piglit's glsl-max-varyings test) Note: This is a candidate for the stable branches.
* draw: add support for later transform feedback extensionsDave Airlie2012-12-141-1/+1
| | | | | | | | | | | | | | | | | This adds support to draw for the new features of transform feedback. a) fix count_from_stream_output, using max_index+1 for now but it looks like it should be valid as its derived from the vertex elements/vbo. b) fix striding and dst offsets in output buffers - was just wrong before. c) fix crash if tfb is suspended (so.num_targets == 0) This also enables the new features on softpipe. It should be possible to enable them on llvmpipe as well after this commit, but would need to schedule piglit runs. Signed-off-by: Dave Airlie <[email protected]>
* softpipe: remove unused corner0 variableBrian Paul2012-12-121-1/+0
|
* gallium: remove pipe_surface::usageMarek Olšák2012-12-121-1/+0
| | | | | | Not really used by anybody now. Reviewed-by: Brian Paul <[email protected]>
* softpipe: implement seamless cubemap support. (v1.1)Dave Airlie2012-12-122-9/+139
| | | | | | | | | | | | | | | | | This adds seamless sampling for cubemap boundaries if requested. The corner case averaging is messy but seems like it should be spec compliant. The face direction stuff is also a bit messy, I've no idea if that could or should be simpler, or even if all my directions are fully correct! v1.1: update comments, drop unneeded seamless calls for nearest, fix if statement layout. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* softpipe: Use os_time_get_nano() everywhere.José Fonseca2012-12-112-5/+5
|
* softpipe: enable GLSL 1.40Dave Airlie2012-12-081-1/+1
| | | | | | This enables GLSL 1.40 advertising by softpipe. Signed-off-by: Dave Airlie <[email protected]>