summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* softpipe: add texture buffer object supportDave Airlie2012-12-082-1/+9
| | | | | | This adds TBO support to softpipe. Signed-off-by: Dave Airlie <[email protected]>
* softpipe: fix unused variable warning.Dave Airlie2012-11-101-1/+1
| | | | Signed-off-by: Dave Airlie <[email protected]>
* softpipe: Fix rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE.José Fonseca2012-11-091-3/+3
| | | | | | | | | We must multiply the factor against the destination, not the source. NOTE: Candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: Handle adjacency primitives.José Fonseca2012-11-091-0/+46
| | | | | | | | | | | | Not fully tested. Based on diagrams from http://msdn.microsoft.com/en-us/library/windows/desktop/bb205124.aspx#Primitive_Adjacency v2: Fix based on Brian's feedback. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: add ARB_texture_cube_map_array support (v1.1)Dave Airlie2012-11-094-14/+171
| | | | | | | | | | | | | This adds support to the softpipe texture sampler and tgsi exec. In order to handle the extra input to the texture sampling, I've had to expand the interfaces to take a c1 value for storing the texture compare value for the TEX2 case. v1.1: add comments (Brian) Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: expose ARB_map_buffer_alignment on RadeonMarek Olšák2012-10-311-0/+1
| | | | | | | | Reviewed-by: Brian Paul <[email protected]> v2: update relnotes-9.1 v3: use align_malloc and align_free for malloced buffers in r300g v4: document the new CAP in the docs
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-313-8/+12
| | | | | | | | | | | | | | | | | | | | | This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <[email protected]>
* softpipe: remove extraneous whitespaceBrian Paul2012-10-261-2/+0
|
* gallium: unify transfer functionsMarek Olšák2012-10-118-183/+74
| | | | | | | | | | | | | | "get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
* softpipe: remove unused functionsMarek Olšák2012-10-112-26/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* softpipe: initialize quadColor2 to fix compile warningsMarek Olšák2012-10-091-1/+1
|