summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* gallium/pipebuffer: fix parenthesis locationTimothy Arceri2018-04-031-1/+1
| | | | | | | | | | Without this the return value will never get set to -1. This was first added in 49866c8f3457 and copied in 2b396eeed983. Fixes: 2b396eeed983 "gallium/pb_cache: add a copy of cache bufmgr independent of pb_manager" Reviewed-by: Marek Olšák <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102342
* gallivm: Fix include for LLVMAddPromoteMemoryToRegisterPassMike Lothian2018-04-021-0/+3
| | | | | | | | | Include llvm-c/Transforms/Utils.h with the newest LLVM 7 Signed-of-by: Mike Lothian <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Dieter Nützel <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/u_tests: test FBFETCH and shader-based blending with MSAAMarek Olšák2018-04-021-40/+128
| | | | Tested-by: Dieter Nützel <[email protected]>
* util: Move util_is_power_of_two to bitscan.h and rename to ↵Ian Romanick2018-03-298-22/+14
| | | | | | | | | | | util_is_power_of_two_or_zero The new name make the zero-input behavior more obvious. The next patch adds a new function with different zero-input behavior. Signed-off-by: Ian Romanick <[email protected]> Suggested-by: Matt Turner <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* gallium/u_vbuf: Protect against overflow with large instance divisors.Eric Anholt2018-03-261-1/+10
| | | | | | | | | | | | GTF-GLES3.gtf.GL3Tests.instanced_arrays.instanced_arrays_divisor uses -1 as a divisor, so we would overflow to count=0 and upload no data, triggering the assert below. We want to upload 1 element in this case, fixing the test on VC5. v2: Use some more obvious logic, and explain why we don't use the normal round_up(). Reviewed-by: Brian Paul <[email protected]>
* gallium: Do not add -Wframe-address option for gcc <= 4.4.Vinson Lee2018-03-261-1/+1
| | | | | | | | | | | | | | | | This patch fixes these build errors with GCC 4.4. Compiling src/gallium/auxiliary/util/u_debug_stack.c ... src/gallium/auxiliary/util/u_debug_stack.c: In function ‘debug_backtrace_capture’: src/gallium/auxiliary/util/u_debug_stack.c:268: error: #pragma GCC diagnostic not allowed inside functions src/gallium/auxiliary/util/u_debug_stack.c:269: error: #pragma GCC diagnostic not allowed inside functions src/gallium/auxiliary/util/u_debug_stack.c:271: error: #pragma GCC diagnostic not allowed inside functions Fixes: 370e356ebab4 ("gallium: silence __builtin_frame_address nonzero argument is unsafe warning") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105529 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* tgsi,softpipe: use enum tgsi_opcodeBrian Paul2018-03-231-2/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* st/mesa,tgsi: use enum tgsi_opcodeBrian Paul2018-03-234-29/+29
| | | | | | | | | | | Need to update the tgsi code and st_glsl_to_tgsi code at the same time to prevent compile break since C++ is much pickier about implicit enum/unsigned casting. Bump size of glsl_to_tgsi_instruction::op to 10 bits to be sure to avoid MSVC signed enum overflow issue. No change in class size. Reviewed-by: Eric Anholt <[email protected]>
* tgsi/nir: use enum tgsi_opcodeBrian Paul2018-03-231-2/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* tgsi: use enum tgsi_opcodeBrian Paul2018-03-235-14/+14
| | | | Reviewed-by: Eric Anholt <[email protected]>
* gallivm: use enum tgis_opcodeBrian Paul2018-03-232-8/+12
| | | | Reviewed-by: Eric Anholt <[email protected]>
* tgsi: move tgsi_processor_to_shader_stage() to a headerEmil Velikov2018-03-162-15/+16
| | | | | | | | This way we can utilise it with later patches. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: silence __builtin_frame_address nonzero argument is unsafe warningTimothy Arceri2018-03-131-0/+3
| | | | | | | | | Calling __builtin_frame_address with a nonzero argument is unsafe but is sometimes done for debugging purposes. Since this code is part of some debug util code I'm assuming that is the case here and using GCC pragma to silence the warning. Reviewed-by: Jose Fonseca <[email protected]>
* u_vbuf/translate: pass max_index into the set_buffer.Dave Airlie2018-03-121-1/+1
| | | | | | | | | This fixes a memory trashing crash (not the test) seen with dEQP-GLES3.stress.draw.unaligned_data.random.203 on virgl. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium/util: add helper util_wait_for_idleMarek Olšák2018-03-112-0/+15
| | | | This is an old patch that I had.
* u_blit: (trivial) u_blit.h needs to include p_defines.hRoland Scheidegger2018-03-101-0/+1
| | | | | | | (For the pipe_tex_filter enum) Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: fix alpha value for very short aa linesRoland Scheidegger2018-03-102-2/+24
| | | | | | | | The logic would not work correctly for line lengths smaller than 1.0, even a degenerated line with length 0 would still produce a fragment with anyhwere between alpha 0.0 and 0.5. Reviewed-by: Brian Paul <[email protected]>
* gallium: Add a util_blitter path for using a custom VS and FS.Eric Anholt2018-03-092-0/+69
| | | | | | | | | Like the r600 paths to use other custom states, we pass in a couple of parameters to customize the innards of the blitter. It's up to the caller to wrap other state necessary for its shaders (for example, constant buffers for the uniforms the shader uses). Reviewed-by: Marek Olšák <[email protected]>
* tegra: Initial supportThierry Reding2018-03-093-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tegra K1 and later use a GPU that can be driven by the Nouveau driver. But the GPU is a pure render node and has no display engine, hence the scanout needs to happen on the Tegra display hardware. The GPU and the display engine each have a separate DRM device node exposed by the kernel. To make the setup appear as a single device, this driver instantiates a Nouveau screen with each instance of a Tegra screen and forwards GPU requests to the Nouveau screen. For purposes of scanout it will import buffers created on the GPU into the display driver. Handles that userspace requests are those of the display driver so that they can be used to create framebuffers. This has been tested with some GBM test programs, as well as kmscube and weston. All of those run without modifications, but I'm sure there is a lot that can be improved. Some fixes contributed by Hector Martin <[email protected]>. Changes in v2: - duplicate file descriptor in winsys to avoid potential issues - require nouveau when building the tegra driver - check for nouveau driver name on render node - remove unneeded dependency on libdrm_tegra - remove zombie references to libudev - add missing headers to C_SOURCES variable - drop unneeded tegra/ prefix for includes - open device files with O_CLOEXEC - update copyrights Changes in v3: - properly unwrap resources in ->resource_copy_region() - support vertex buffers passed by user pointer - allocate custom stream and const uploader - silence error message on pre-Tegra124 - support X without explicit PRIME Changes in v4: - ship Meson build files in distribution tarball - drop duplicate driver_tegra dependency Reviewed-by: Emil Velikov <[email protected]> Acked-by: Emil Velikov <[email protected]> Tested-by: Andre Heider <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
* gallium/st_dri: Honor the glx_disable_sgi_video_sync config optionThomas Hellstrom2018-03-081-0/+1
| | | | | | | | | | This option is disabled by default. Primarily intended for drivers on virtual hardware. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
* draw: fix line stippling with aa linesRoland Scheidegger2018-03-071-4/+13
| | | | | | | | | | | | | | In contrast to non-aa, where stippling is based on either dx or dy (depending on if it's a x or y major line), stippling is based on actual distance with smooth lines, so adjust for this. (It looks like there's some minor artifacts with mesa demos line-sample and stippling, it looks like the line endpoints aren't quite right with aa + stippling - maybe due to the integer math in the stipple stage, but I can't quite pinpoint it.) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: simplify (and correct) aaline fallback (v2)Roland Scheidegger2018-03-071-409/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation actually was to get rid of the additional tex instruction, since that requires the draw fallback code to intercept all sampler / view calls (even if the fallback is never hit). Basically, the idea is to use coverage of the pixel to calculate the alpha value, and coverage is simply based on the distance to the center of the line (in both line direction, which is useful for wide lines, as well as perpendicular to the line). This is much closer to what hw supporting this natively actually does. It also fixes an issue with line width not quite being correct, as well as endpoints getting stretched too far (in line direction) with wide lines, which is apparent with mesa demo line-sample. (For llvmpipe, it would probably make sense to do something like this directly when drawing lines, since rendering two tris is twice as expensive as a line, but it would need some changes with state management.) Since we're no longer relying on mipmapping to get the alpha value, we also don't need to draw 3 rects (6 tris), one is sufficient. There's still issues (as before): - quite sure it's not correct without half_pixel_center, but can't test this with GL. - aaline + line stipple is incorrect (evident with line-sample demo). Looking at the spec the stipple pattern should actually be based on distance (not just dx or dy for x/y major lines as without aa). - outputs (other than pos + the one used for line aa) should be reinterpolated since we actually increase line length by half a pixel (but there's no tests which would care). v2: simplify the math (should be equivalent), don't need immediate v3: use float versions of atan2,cos,sin, minor cleanups Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* tgsi/scan: use wrap-around shift behavior explicitly for file_maskRoland Scheidegger2018-03-061-2/+5
| | | | | | | | | | | | | | The comment said it will only represent the lowest 32 regs. This was not entirely true in practice, since at least on x86 you'll get masked shifts (unless the compiler could recognize it already and toss it out). It turns out this actually works out alright (presumably noone uses it for temp regs) when increasing max sampler views, so make that behavior explicit. Albeit it feels a bit hacky (but in any case, explicit behavior there is better than undefined behavior). Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/aux/hud: Avoid possible buffer overflowGert Wollny2018-03-051-2/+6
| | | | | | | | | | Limit the length of acceptable cpu names for use in hud_get_num_cpufreq in order to avoid a buffer overflow later in add_object when this name is copied into cpufreq_info::name. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105274 Signed-off-by: Gert Wollny <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/util: use sockets on PIPE_OS_UNIX in u_networkJonathan Gray2018-03-012-10/+4
| | | | | | | | Instead of listing all the UNIX PIPE_OS platforms just use PIPE_OS_UNIX. Makes BSD sockets available on PIPE_OS_BSD. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* cso: don't cycle through PIPE_MAX_SHADER_SAMPLER_VIEWS on context destroyRoland Scheidegger2018-02-281-1/+3
| | | | | | | There's no point, we know the highest non-null one. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: don't needlessly iterate through all sampler view slotsRoland Scheidegger2018-02-281-1/+1
| | | | | | | We already stored the highest (potentially) used number. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi: remove is_msaa_sampler array from tgsi_shader_infoTimothy Arceri2018-02-262-7/+0
| | | | | | | Seems to have not been used since 16be87c90429 Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* gallium: use PIPE_CAP_CONSTBUF0_FLAGSMarek Olšák2018-02-172-1/+22
|
* meson: link dri3 xcb libs into vlwinsys instead of into each targetDylan Baker2018-02-151-1/+6
| | | | | | | | | | This makes the dependencies easier to manage, since each media target doesn't need to worry about linking to half a dozen libraries. Fixes: b1b65397d0c4978e3 ("meson: Build gallium auxiliary") Signed-off-by: Dylan Baker <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* tgsi: Recognize RET in main for tgsi_transformRoland Scheidegger2018-02-141-7/+55
| | | | | | | | | | | | | | | | | | Shaders coming from dx10 state trackers have a RET before the END. And the epilog needs to be placed before the RET (otherwise it will get ignored). Hence figure out if a RET is in main, in this case we'll place the epilog there rather than before the END. (At a closer look, there actually seem to be problems with control flow in general with output redirection, that would need another look. It's enough however to fix draw's aa line emulation in some internal bug - lines tend to be drawn with trivial shaders, moving either a constant color or a vertex color directly to the output). v2: add assert so buggy handling of RET in main is detected Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium/llvmpipe: Fix compiler warnings about ddx/ddy/ddmax.Eric Anholt2018-02-121-1/+1
| | | | | | | My gcc doesn't figure out that dims >= 1 (seems reasonable), and doesn't notice that ddmax is used from the same no_rho_opt as its initialization. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: silence clang warning in blitter codeBrian Paul2018-02-081-1/+1
| | | | | | | Silence "warning: comparison of constant 4294967295 with expression of type 'ubyte'". Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: s/unsigned/enum tgsi_semantic/ in ureg_DECL_output()Brian Paul2018-02-081-1/+1
| | | | | | | So the function matches the prototype. Found with clang. v2: fix copy&paste error Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: use TGSI_INTERPOLATE_x arguments instead of zeros in ureg codeBrian Paul2018-02-081-2/+5
| | | | | | | | | | | | TGSI_INTERPOLATE_CONSTANT and TGSI_INTERPOLATE_LOC_CENTER have the value zero so there's no change in behavior. It seems funny to declare these fs input registers with constant interpolation. But it looks like ureg_DECL_input_layout() is not called anywhere and ureg_DECL_input() is only called from util_make_geometry_passthrough_shader(). Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: s/uint/enum tgsi_semantic/ in simple shader codeBrian Paul2018-02-083-5/+5
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: s/unsigned/enum pipe_shader_type/ in ureg codeBrian Paul2018-02-082-5/+9
| | | | | | | And add a default switch case to silence a compiler warning. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: s/uint/enum tgsi_semantic/ in u_blitter.cBrian Paul2018-02-081-4/+6
| | | | | | | And put static qualifier on const arrays. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: trivial whitespace/formatting fixes in u_blit.cBrian Paul2018-02-081-9/+9
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* cso: add a couple sanity check assertions in cso_draw_vbo()Brian Paul2018-02-081-0/+6
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: use tgsi_semantic enum type in ureg codeBrian Paul2018-02-072-23/+23
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* tgsi: use TGSI enum types in ureg codeBrian Paul2018-02-072-51/+55
| | | | | | v2: fix enum tgsi_interpolate_mode/loc typo. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: replace uint with tgsi enum typesBrian Paul2018-02-072-6/+7
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: replace unsigned with tgsi enum typesBrian Paul2018-02-072-31/+34
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/hud: update some query functionsGrazvydas Ignotas2018-02-084-4/+4
| | | | | | | | It seems these were missed when struct pipe_context * argument was added to hud_graph::query_new_value. Fixes: 3132afdf4c "gallium/hud: pass pipe_context explicitly to most functions" Reviewed-by: Marek Olšák <[email protected]>
* Revert "gallium: build ddebug, noop, rbug, trace as part of auxiliary"Roland Scheidegger2018-02-072-9/+27
| | | | | | This reverts commit 6f82b8d8d0a986aac28e7bec47fc313fb950475c. This broke scons build, and reportedly clover with autotools/meson too.
* gallium: build ddebug, noop, rbug, trace as part of auxiliaryMarek Olšák2018-02-072-27/+9
| | | | | | | Building gallium is faster by 7.5 seconds on a 4core/8thread 3GHz CPU. (gallium build time is reduced by 15% when building only radeonsi) Non-recursive makefiles are great!
* u_blit: (trivial) fix bogus argument order for set_fragment_shaderRoland Scheidegger2018-02-071-2/+2
| | | | | Amazingly this still worked sometimes, albeit I'm not even sure why... This fixes d7bec6f7a6a2a35c80be939db8532011af1e9b67.
* u_blit,u_simple_shaders: add shader to convert from xrbias formatRoland Scheidegger2018-02-074-16/+78
| | | | | | | | | | | | | | | We need this to handle some oddball dx10 format (DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM). What you can do with this format is very limited, hence we don't want to add it as a gallium format (we could not express the properties of this format as ordinary format properties neither, so like all special formats it would need specific code for handling it in any case). While here, also nuke the array for different shaders for different writemasks, as it was not actually used (always full masks are passed in for generating shaders). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* u_simple_shaders: fix mask handling in util_make_fragment_tex_shader_writemaskRoland Scheidegger2018-02-071-1/+1
| | | | | | | | | | | The writemask handling was busted, since writing defaults to output meant they got overwritten by the tex sampling anyway. Albeit the affected components were undefined, so maybe with some luck it still would have worked with some drivers - if not could as well kill it... (This would have affected u_blitter but not u_blit since the latter always used xyzw mask.) Reviewed-by: Brian Paul <[email protected]>