summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe
AgeCommit message (Collapse)AuthorFilesLines
2018-02-17gallium: allow drivers to impose BO flags restrictions on constant buffer 0Marek Olšák1-0/+1
Required by radeonsi for optimal behavior.
2018-02-14gallium: drop all the guard band float caps.Dave Airlie1-5/+0
Nobody queries these and nobody sets them to anything useful, the docs say TODO. Drop them until a use appears. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-02-01gallivm/llvmpipe: add const qualifiers on sampler variablesBrian Paul1-1/+1
Once a lp_build_sampler_soa or lp_build_sampler_aos object is created, it should never be modified. Found by inspection. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-01-30gallium: introduce PIPE_CAP_FENCE_SIGNAL v2Andres Rodriguez1-0/+1
Protects semaphore signaling functionality required by GL_EXT_semaphore. v2: s/semaphore/fence Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-01-19autotools: include meson build files in tarballDylan Baker1-1/+1
This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Acked-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-17gallium: remove PIPE_CAP_USER_CONSTANT_BUFFERSMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-17gallium: remove PIPE_CAP_TEXTURE_SHADOW_MAPMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-17gallium: remove PIPE_CAP_TWO_SIDED_STENCILMarek Olšák1-2/+0
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-01-11meson: Use consistent style for testsDylan Baker1-1/+3
Don't use intermediate variables, use consistent whitespace. Acked-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
2017-12-19gallium: plumb context priority through to driverRob Clark1-0/+1
Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-12-04meson: define driver dependenciesDylan Baker1-0/+8
This allow us to encapsulate the compiler and linkage requirements of each driver in a reusable way. The result will be that each target that needs a specific driver can simply add `driver_<name>` to its dependencies line and the necessary libraries and compiler args will be added. This will allow for a lot of code de-duplication between gallium targets. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-11-21llvmpipe: fix snorm blendingRoland Scheidegger2-28/+159
The blend math gets a bit funky due to inverse blend factors being in range [0,2] rather than [-1,1], our normalized math can't really cover this. src_alpha_saturate blend factor has a similar problem too. (Note that piglit fbo-blending-formats test is mostly useless for anything but unorm formats, since not just all src/dst values are between [0,1], but the tests are crafted in a way that the results are between [0,1] too.) v2: some formatting fixes, and fix a fairly obscure (to debug) issue with alpha-only formats (not related to snorm at all), where blend optimization would think it could simplify the blend equation if the blend factors were complementary, however was using the completely unrelated rgb blend factors instead of the alpha ones... Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-11-13meson: don't use build_by_default for specific gallium driversDylan Baker1-1/+0
Using build_by_default : false is convenient for dependencies that can be pulled in by various diverse components of the build system, the gallium hardware/software drivers and state trackers do not fit that description. Instead, these should be guarded using the variable that tracks whether that driver should be enabled. This leaves a few helper libraries: trace, rbug, etc, and the generic winsys bits as `build_by_default : false` because there are a large number of gallium components that pull them in. v2: - remove build_by_default from winsys convenience libs as well. v3: - Always put drivers before winsys for consistency Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1) Reviewed-by: Eric Anholt <eric@anholt.net>
2017-11-09util: move os_time.[ch] to src/utilNicolai Hähnle6-6/+6
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-11-09util: move pipe_barrier into src/util and rename to util_barrierNicolai Hähnle2-6/+7
The #if guard is probably not 100% equivalent to the previous PIPE_OS check, but if anything it should be an over-approximation (are there pthread implementations without barriers?), so people will get either a good implementation or compile errors that are easy to fix. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-11-06gallium: add PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSETMarek Olšák1-0/+1
2017-11-01gallium: add cap for driver specified max combined shader resources.Dave Airlie1-0/+1
Some hw (evergreen) has a limit on how many combined (images/buffers/mrts) a fragment shader can access. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-10-27gallium: s/unsigned/enum pipe_prim_type/Brian Paul1-1/+1
In the vbuf_render::set_primitive() functions. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-10-18llvmpipe: handle shader sample mask outputRoland Scheidegger1-2/+24
This probably isn't all that useful for GL, but there are apis where sample_mask is a valid output even without msaa. Just discard the pixel if the sample_mask doesn't include the bit for sample 0. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-10-16meson: build llvmpipeDylan Baker1-0/+116
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-10gallium: Create a new PIPE_CAP_TILE_RASTER_ORDER for vc4.Eric Anholt1-0/+1
Because vc4 can control the order that tiles are rasterized in, we can use it to implement overlapping blits using normal drawing and GL_ARB_texture_barrier, as long as we can tell the kernel what order to render the tiles in. This commit introduces the core gallium support, vc4 changes will follow. v2: Fix on the simulator. v3: Add the cap (disabled) to other drivers, add rst docs for the cap. v4: Rebase on PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS v5: Drop vc4 changes from this commit, for clarity. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v3)
2017-10-06gallium: add PIPE_CAP_TGSI_ANY_REG_AS_ADDRESSMarek Olšák1-0/+1
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-03llvmpipe: silence 'variable may be used uninitialized' warningsBrian Paul1-1/+1
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-10-02gallium: Remove util_format_s3tc_init()Matt Turner2-4/+0
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02gallium: Remove util_format_s3tc_enabledMatt Turner2-9/+0
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-09-25scons: use python3-compatible print()Eric Engestrom1-1/+1
These changes were generated using python's `2to3` tool. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102852 Reported-by: Alex Granni <liviuprodea@yahoo.com> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-09-20llvmpipe, gallivm: implement lod queries (LODQ opcode)Roland Scheidegger1-1/+1
This uses all the existing code to calculate lod values for mip linear filtering. Though we'll have to disable the simplifications (if we know some parts of the lod calculation won't actually matter for filtering purposes due to mip clamps etc.). For better or worse, we'll also disable lod calculation hacks (mostly should make a difference for cube maps) always - the issue with per-pixel lod being difficult is mostly because we then have different mipmaps needed for the actual texel fetch, which isn't a problem with lodq. We still use approximation for the log2 - for that reason I believe the float part of the lod is only accurate to about 4-5 bits (and one bit less with 1d textures actually) which is hopefully good enough (though d3d10 technically requires 6 bits - could use quadratic interpolation instead of linear to get 8 bits or so). Since lodq requires unclamped lod, we also have to move some sampler key calculations to texture sampling code - even if we know we're going to access mipmap 0 we still have to calculate lod and apply lod_bias for lodq. Passes piglit ARB_texture_query_lod tests (after having fixed the test). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-09-18gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVENicolai Hähnle3-0/+8
To be able to properly distinguish between GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE. This patch goes through all drivers, having them treat the two query types identically, except: 1. radeon incorrectly enabled conservative mode on PIPE_QUERY_OCCLUSION_PREDICATE. We now do it correctly, only on PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE. 2. st/mesa uses the new query type. Fixes dEQP-GLES31.functional.fbo.no_attachments.* Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-09-15gallium: introduce PIPE_CAP_LOAD_CONSTBUFTimothy Arceri1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-09-09llvmpipe, draw: improve shader cache debuggingRoland Scheidegger1-9/+16
With GALLIVM_DEBUG=perf set, output the relevant stats for shader cache usage whenever we have to evict shader variants. Also add some output when shaders are deleted (but not with the perf setting to keep this one less noisy). While here, also don't delete that many shaders when we have to evict. For fs, there's potentially some cost if we have to evict due to the required flush, however certainly shader recompiles have a high cost too so I don't think evicting one quarter of the cache size makes sense (and, if we're evicting based on IR count, we probably typically evict only very few or just one shader too). For vs, I'm not sure it even makes sense to evict more than one shader at a time, but keep the logic the same for now. Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2017-09-09llvmpipe: enable PIPE_CAP_QUERY_PIPELINE_STATISTICSRoland Scheidegger1-1/+1
This was implemented since forever, but not enabled. It passes all piglit tests except one, arb_pipeline_statistics_query-frag. The reason is that the test (for drawing a 10x10 rect) expects between 100 and 150 pixel shader invocations. But since llvmpipe counts this with 4x4 granularity (and due to the rect being 2 tris) we end up with 224 invocations. I believe however what llvmpipe is doing violates neither the spirit nor the letter of the spec (our fragment shader granularity really is 4x4 pixels, albeit we will bail out early on 2x2 or 4x2 (the latter if AVX is available) granularity), the spec allows to count additional invocations due to implementation reasons. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-09-07llvmpipe, draw: increase shader cache limitsRoland Scheidegger1-3/+1
We're not particularly concerned with memory usage, if the tradeoff is shader recompiles. And it's common for apps to have a lot of shaders nowadays (and, since our shaders include a LOT of context state of course we may create quite a bit more shaders even). So quadruple the amount of shaders draw will cache (from 128 to 512). For llvmpipe (fs shaders) quadruple the number of instructions, keep the number of variants the same for now (only with very simple, non-texturing shaders the variant limit could really be reached), and simplify the definition, it's probably easier to just have one different definition per branch... Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-08-29llvmpipe: initialize llvmpipe->dirty with LP_NEW_SCISSORBrian Paul1-0/+6
If llvmpipe_set_scissor_states() is never called, we still need to be sure that derived scissor/clip state is updated. As of commit 743ad599a97d09b1 that function might not be called. Fixes regressed Piglit gl-1.0-scissor-offscreen -fbo -auto test. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101709 Fixes: 743ad599a97 ("st/mesa: don't set 16 scissors and 16 viewports if they're unused") Cc: "17.2" <mesa-stable@lists.freedesktop.org>
2017-08-21llvmpipe: add some whitespace between functions in lp_texture.cBrian Paul1-0/+3
Trivial.
2017-08-17llvmpipe: enable PIPE_CAP_QUERY_SO_OVERFLOWRoland Scheidegger2-1/+4
The driver supported this since way before the GL spec for it existed. Just need to support both the per-stream and for all streams variants (which are identical due to only supporting 1 stream). Passes piglit arb_transform_feedback_overflow_query-basic. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-08-03gallium: introduce PIPE_CAP_MEMOBJTimothy Arceri1-0/+1
This can be used to guard support for EXT_memory_object and related extensions. v2: update gallium docs v3 (Timothy Arceri): - add cap to nv50 Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-08-02gallium: rename util_dump_* to util_str_* for enum-to-string conversionNicolai Hähnle2-33/+33
This is mostly mechanical search-and-replace, plus touching up the macros in u_dump_defines.c manually a bit. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding capNicolai Hähnle1-0/+1
v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit in the documentation Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-31gallium: add PIPE_CAP_NIR_SAMPLERS_AS_DEREFNicolai Hähnle1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-06-24llvmpipe: initialize default fb correctly in setupRoland Scheidegger1-0/+4
If lp_setup_bind_framebuffer() is never called, then setup fb x1/y1 was not correctly initialized. This can happen if there's never a fb set - both cso and llvmpipe would consider setting this with no cbufs and no zsbuf a redundant change and therefore it would never get set. We rely on this setup fb rect being initialized correctly for the tri intersect tests, throwing away tris which don't intersect. Not initializing it meant we'd then say it intersected, and we'd try to bin that despite that we have no actual tiles to bin it to, leading to assertion failures (pretty harmless since tile 0/0 always exists nevertheless as tiles are statically allocated, albeit that should change at some point). (Note probably not an issue with gl state tracker) Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-06-23llvmpipe:fix using 32bit rasterization mistakenly, causing overflowsRoland Scheidegger4-31/+43
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 <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-06-23llvmpipe: fill in debug vertex info for tri rasterizationRoland Scheidegger1-1/+1
This is pretty useful for debugging rasterization issues, so turn it on based on DEBUG (the actual existence of the fields is also conditionalized on DEBUG, lines fill it out the same too). Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-06-14gallium: add PIPE_CAP_BINDLESS_TEXTURESamuel Pitoiset1-0/+1
Whether bindless texture operations are supported by the underlying driver. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-06-13llvmpipe: Match pipe_context::render_condition prototype.Jose Fonseca2-5/+5
To silence compiler warnings. Trivial.
2017-06-02gallium: Add a cap to check if the driver supports ARB_post_depth_coverageLyude1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-05-27llvmpipe: add LP_NEW_GS flag for updating vertex infoRoland Scheidegger1-0/+1
The vertex information we compute here is really dependent on the last stage before FS. It just happened to work most of the time because new GS tend to come with new VS and/or FS... (The LP_NEW_GS flag was previously set but never used.) Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2017-05-17gallium: add PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTIONMarek Olšák1-0/+1
for skipping mapped-buffer checking in every GL draw call Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10gallium: add PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEXMarek Olšák1-0/+1
The next patch will use it. This is really for svga and GL2-level drivers. Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2017-05-10gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák3-24/+6
pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
2017-05-10gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2-5/+6