summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
AgeCommit message (Collapse)AuthorFilesLines
3 dayspipe-loader: plumb a flag for implicit driver load through screen creationMike Blumenkrantz5-8/+11
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
3 daysloader: delete unused param from pipe_loader_vk_probe_dri()Mike Blumenkrantz2-4/+3
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
4 daysutil: import pipe_box and its helpersMarek Olšák6-306/+4
We'll use them. There are also new helpers that we'll use. Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28733>
11 daysRevert "gallivm/ssbo: mask offset with exec_mask instead of building the 'if'"Konstantin Seurer1-4/+7
mem_access_base_pointer loads memory (the descriptor) and therefore needs to be guarded. Fixes dEQP-VK.spirv_assembly.instruction.terminate_invocation.terminate.no_null_pointer_load. Fixes: fc8a83c ("gallivm/ssbo: mask offset with exec_mask instead of building the 'if'") Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28614>
14 daysgallium: delete PIPE_CAP_NIR_COMPACT_ARRAYSMike Blumenkrantz1-1/+0
this is now nir_shader_compiler_options::compact_arrays Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
14 daysttn: stop using PIPE_CAP_NIR_COMPACT_ARRAYS and check compact_arraysMike Blumenkrantz1-7/+4
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28601>
2024-04-11gallium/pipe: Add contiguous planes per-surface attributeHannes Mann1-0/+1
Attribute is set when textures are created by compatible drivers, but not when importing from DMA-BUF. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165>
2024-04-09llvmpipe: Fix function call handlingKonstantin Seurer1-1/+1
Fixes using images and samplers inside functions and allows for function calls outside of kernels. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-05gallium: Add dmabuf arg to memory fd allocation APILucas Fryzek1-2/+4
Modify the memory fd allocation API to provide an argument to specify if the allocating fd should be a dmabuf. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27805>
2024-04-03vl_win32_screen_create: Take ownership of winsys injected to created ↵Sil Vilerino1-5/+8
d3d12_screen Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28546>
2024-03-30tgsi_to_nir: translate TG4Marek Olšák1-0/+17
Tested-by: David Heidelberg <david@ixit.cz> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28349>
2024-03-27gallium: remove always-false parameterErik Faye-Lund3-19/+5
We always pass false to util_map_texcoords2d_onto_cubemap function, which allows us to avoid the dodgy case of using a close-to-one scaling factor in an attempt to avoid sampling on the edges. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27759>
2024-03-22meson: Remove the non-used -DDEBUG manuallyYonggang Luo1-13/+0
And also remove the workarounds for LLVM and bellagio Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092>
2024-03-22treewide: Replace usage of macro DEBUG with MESA_DEBUG when possibleYonggang Luo21-36/+36
This is achieved by the following steps: #ifndef DEBUG => #if !MESA_DEBUG defined(DEBUG) => MESA_DEBUG #ifdef DEBUG => #if MESA_DEBUG This is done by replace in vscode excludes docs,*.rs,addrlib,src/imgui,*.sh,src/intel/vulkan/grl/gpu These are safe because those files should keep DEBUG macro is already excluded; and not directly replace DEBUG, as we have some symbols around it. Use debug or NDEBUG instead of DEBUG in comments when proper This for reduce the usage of DEBUG, so it's easier migrating to MESA_DEBUG These are found when migrating DEBUG to MESA_DEBUG, these are all comment update, so it's safe Replace comment /* DEBUG */ and /* !DEBUG */ with proper /* MESA_DEBUG */ or /* !MESA_DEBUG */ manually DEBUG || !NDEBUG -> MESA_DEBUG || !NDEBUG !DEBUG && NDEBUG -> !(MESA_DEBUG || !NDEBUG) Replace the DEBUG present in comment with proper new MESA_DEBUG manually Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092>
2024-03-21gallium: use u_box_3d to initialize pipe_box instead of non-designated ↵Marek Olšák2-15/+12
initializers This is the original utility for initializing pipe_box. It prevents breakage when pipe_box fields are reordered. Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27953>
2024-03-18compiler,gallium: move u_reduced_prim to commonJuan A. Suarez Romero1-21/+0
Useful function that even Vulkan drivers can use. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28171>
2024-03-18Pass no-verify-fixpoint option to instcombine in LLVM 18Nikita Popov1-0/+4
When LLVM 18 is used, pass the no-verify-fixpoint option when running the instcombine pass. Otherwise LLVM may abort with an error. The background here is that this option is enabled by default for testing purposes, because instcombine is normally only explicitly invoked like this inside tests. If it is used in an actual production pipeline, the no-verify-fixpoint option needs to be enabled. This should fix the issue reported at https://bugzilla.redhat.com/show_bug.cgi?id=2268800. Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28101>
2024-03-15treewide: Replace the invalid usage #if DEBUG with #ifdef DEBUGYonggang Luo4-4/+4
This is done by find&replace and exclude the following folders in vscode docs,*.rs,addrlib,src/imgui,*.sh,src/intel/vulkan/grl/gpu This is a prepare step for re-working https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21946 These issues are found when to try switch DEBUG to MESA_DEBUG=0|1 in MR https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28083>
2024-03-12u/inlines: constify util_res_sample_count()Mike Blumenkrantz1-1/+1
no functional changes Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28115>
2024-03-12nir/opt_shrink_vectors: shrink some intrinsics from startAlyssa Rosenzweig1-1/+1
If the backend supports it, intrinsics with a component() are straightforward to shrink from the start. Notably helps vectorized I/O. v2: add an option for this and enable only on grown up backends, because some backends ignore the component() parameter. RADV GFX11: Totals from 921 (1.16% of 79439) affected shaders: Instrs: 616558 -> 615529 (-0.17%); split: -0.30%, +0.14% CodeSize: 3099864 -> 3095632 (-0.14%); split: -0.25%, +0.11% Latency: 2177075 -> 2160966 (-0.74%); split: -0.79%, +0.05% InvThroughput: 299997 -> 298664 (-0.44%); split: -0.47%, +0.02% VClause: 16343 -> 16395 (+0.32%); split: -0.01%, +0.32% SClause: 10715 -> 10714 (-0.01%) Copies: 24736 -> 24701 (-0.14%); split: -0.37%, +0.23% PreVGPRs: 30179 -> 30173 (-0.02%) VALU: 353472 -> 353439 (-0.01%); split: -0.03%, +0.02% SALU: 40323 -> 40322 (-0.00%) VMEM: 25353 -> 25352 (-0.00%) AGX: total instructions in shared programs: 2038217 -> 2038049 (<.01%) instructions in affected programs: 10249 -> 10081 (-1.64%) total alu in shared programs: 1593094 -> 1592939 (<.01%) alu in affected programs: 7145 -> 6990 (-2.17%) total fscib in shared programs: 1589254 -> 1589102 (<.01%) fscib in affected programs: 7217 -> 7065 (-2.11%) total bytes in shared programs: 13975666 -> 13974722 (<.01%) bytes in affected programs: 65942 -> 64998 (-1.43%) total regs in shared programs: 592758 -> 591187 (-0.27%) regs in affected programs: 6936 -> 5365 (-22.65%) Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> (v1) Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28004>
2024-03-12panfrost: add driconf infrastructureErik Faye-Lund1-3/+10
This is the boiler-plate code needed to support driver-specific driconf variables in Panfrost. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
2024-03-07util/blitter: iterate samples in stencil_fallbackMike Blumenkrantz1-27/+30
this matches handling in do_blits and fixes multisampled stencil blits fixes (nv): GTF-GL45.gtf44.GL31Tests.texture_stencil8.texture_stencil8_gl44 cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27988>
2024-03-06frontend/va: Support media only post proc without compositor using shaders ↵Sil Vilerino2-8/+13
or surfaces Reviewed-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27997>
2024-03-06lavapipe: Implement VK_KHR_acceleration_structureKonstantin Seurer1-0/+1
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25616>
2024-03-01auxiliary/rtasm: fix unaligned storesRoland Scheidegger1-3/+4
Unaliged stores are unspecified behavior according to C rules, hence address sanitizers may complain. Even though this worked fine in practice (it's almost impossible here for the compiler to do something "wrong" even if it assumes the store is aligned, given such stores work just fine on x86), we should follow the rules. The widely accepted solution for this (it may be somewhat surprising you can't actually do unaligned assignments explicitly somehow in C) nowadays is to just use memcpy(). The compiler should figure out (at least with optimizations enabled) it's just a trivial store and optimize it back to a single cpu instruction, while still satisfying asan. (I've verified that even in debug builds the memcpy() is actually optimized away anyway, I suspect there's some compiler flags somewhere forcing this behavior.) Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10208 Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27896>
2024-03-01panfrost: Add the gallium glue to get panfrost loaded when panthor is detectedBob Beckett3-0/+5
Needed if we don't want to force users to pass GALLIUM_DRIVER=panfrost. Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26358>
2024-02-29gallium: add a nboxes param to flush_frontbufferMike Blumenkrantz5-5/+7
this allows conveying damage regions through the sw presentation interface Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
2024-02-23vdpau: Refactor query for video surface formats.Chris Rankin1-8/+8
Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10614 Signed-off-by: Chris Rankin <rankincj@gmail.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27730>
2024-02-23gallium: Add new PIPE_CAP_CL_GL_SHARINGAntonio Gomes1-0/+3
We have a situation where some drivers have all the required features, but they are not working with gl_sharing, so we end up advertising it wrongly. Add this cap to ensure this driver was tested to work with cl_khr_gl_sharing. Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26071>
2024-02-22gallivm: Consider the initial mask when terminating loopsKonstantin Seurer4-21/+30
Partial subgroups can lead to infinite loops otherwise. cc: mesa-stable Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27603>
2024-02-12llvmpipe: Set "+64bit" for X86_64Lepton Wu1-0/+7
Without this, on some "buggy" qemu cpu setup, LLVM could crash if LLVM detects the wrong CPU type. Fixes: f92cadccc65 ("llvmpipe: Always using util_get_cpu_caps to get cpu caps for llvm on x86") Signed-off-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27539>
2024-02-12gallium: add PIPE_CAP_FP16 for AMD_gpu_shader_half_floatTimothy Arceri1-0/+1
Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18540>
2024-02-10gallivm/ssbo: mask offset with exec_mask instead of building the 'if'Błażej Szczygieł1-7/+4
It prevents reading the invalid out-of-bounds offset if exec_mask is 0 without building the 'if' condition. We can do it only when reading the memory. It's faster than run time 'if' condition Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27302>
2024-02-10gallivm/ssbo: replace run time loop by compile time loopBłażej Szczygieł1-117/+116
Unrolled loop is notably faster. Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27302>
2024-02-10st/mesa: constify the pipe_draw_info parameter and remove obsolete commentsMarek Olšák1-1/+1
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27525>
2024-02-09compiler,gallium: move u_decomposed_prim to commonAlyssa Rosenzweig1-25/+0
nir will use Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27457>
2024-02-08gallium/u_threaded: expose helpers for filling set_vertex_buffers externallyMarek Olšák2-16/+56
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27198>
2024-02-07gallium/noop: don't leak resources due to take_ownershipMarek Olšák1-0/+16
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium: remove take_ownership from set_vertex_buffers, assume it's trueMarek Olšák16-59/+49
This removes the take_ownership parameter and defines the behavior as if take_ownership was always true, which is the fast path. This way, we don't have to have 2 codepaths in set_vertex_buffers of every driver. The old behavior is optionally available through util_set_vertex_buffers. It also documents a new constraint that count in set_vertex_buffers must be equal to the number of vertex buffers referenced by vertex elements or 0. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium/u_threaded: allow drivers to change tc_call_set_vertex_buffers functionMarek Olšák2-23/+24
Move the execute function pointers to struct threaded_context, so that drivers can change it. Also move struct tc_vertex_buffers into the header file, so that drivers can implement their own function. This allows drivers to inline pipe_context::set_vertex_buffers for TC. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium/u_threaded: remove the count=0 path from tc_call_set_vertex_buffersMarek Olšák1-5/+0
The default path has the same behavior. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07cso: remove CSO_UNBIND_VERTEX_BUFFER0Marek Olšák4-6/+2
It has no effect other than unreferencing buffers, which are then immediatelly re-bound by st/mesa, so it doesn't do anything. The name is also incorrect because it unbound all vertex buffers. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium/hud: set take_ownership=true for set_vertex_buffersMarek Olšák1-8/+13
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium/util: add take_ownership parameter into util_draw_vertex_bufferMarek Olšák3-5/+6
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium/u_blitter: set take_ownership=true for set_vertex_buffersMarek Olšák1-4/+2
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-07gallium: always set vertex elements before setting vertex buffersMarek Olšák7-15/+16
Drivers can use this constraint to merge vertex elements and vertex buffers in set_vertex_buffers instead of in draw_vbo. Suggested by: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8142 Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27492>
2024-02-01gallium: refactor to use DETECT_OS_ANDROIDYiwei Zhang1-2/+3
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27374>
2024-02-01auxiliary/draw: fix streamout overflow calculationRoland Scheidegger1-20/+15
If the stride is larger than the component with the largest offset plus the size of that component, it is still considered an overflow if there's not enough space in the buffer to fit the whole stride-sized thing, even when there would be enough space to actually write all components. This is actually much simpler too, since we don't need to verify the individual components at all (stride is guaranteed to be larger or equal to the component with the largest offset plus the size of that component). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27368>
2024-02-01gallium/u_blitter: Fix a few uninitialized fb_stateLuc Ma1-5/+5
An uninitialized pipe_framebuffer_state maybe causes some issues if someone is about to use its members such as `fb_state.layers`. Signed-off-by: Luc Ma <luc@sietium.com> Reported-by: Mark Zhou <mark@sietium.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27332>
2024-01-31winsys/gdi: Custom acquisition of hDCMax R1-2/+2
In d3d10umd it is required to pass D3DKMT_PRESENT in context_private of flush_frontbuffer, but wgl passes HDC in it. To accomidate this when gdi_sw_winsys is created functions that acquire and release hdc from context_private are passed. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27333>