About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_llvm.h
AgeCommit message (Collapse)Author
2025-11-06llvmpipe: Remove unnecessary includesHEADmainspencer-lunarg
Signed-off-by: spencer-lunarg <spencer@lunarg.com> Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38202>
2025-11-06llvmpipe: Remove trailing whitespacespencer-lunarg
Signed-off-by: spencer-lunarg <spencer@lunarg.com> Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38202>
2025-08-06all: rename pipe_shader_type to mesa_shader_stageQiang Yu
Use command: find . -type f -not -path '*/.git/*' -exec sed -i 's/\benum pipe_shader_type\b/mesa_shader_stage/g' {} + find . -type f -not -path '*/.git/*' -exec sed -i 's/\bpipe_shader_type\b/mesa_shader_stage/g' {} + Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2024-07-16llvmpipe: add function name to gallivm_jit_functionYukari Chiba
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26018>
2024-06-19gallivm: add lp_context_ref for combine usage of LLVMContextSetOpaquePointersYonggang Luo
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26033>
2023-08-14gallium: move vertex stride to CSOMike Blumenkrantz
this simplifies code in most place and enables some optimizations in frontends Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-06-27treewide: replace usage of boolean to boolYonggang Luo
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23577>
2023-06-08draw: add a max stage define and use it in a few placesDave Airlie
This should decrease the size of some memory allocations. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23487>
2023-06-08draw: refactor resources to use arrays instead of explicit structs.Dave Airlie
This should simplify the code and make it easier to refactor later. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23487>
2023-06-08draw: rename jit to vs_jit in lots of places.Dave Airlie
we should have done this when geom shaders got added, do it now, will make it easier to consolidate some code in macros Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23487>
2023-06-06draw: add support for per primitive aos emissionDave Airlie
This add support to the aos emit code so that mesh shaders can use it for per prim outputs. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-05-23gallivm/draw: refactor vertex header jit type outDave Airlie
mesh shaders will want access to this as well so start moving it to common code. Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>
2023-05-17draw: move to use common sampler/image binding codeDave Airlie
Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>
2023-05-17gallivm: refactor common resources out of contextsDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>
2023-05-17draw: align common members in jit context structs.Dave Airlie
this makes all the structs have the same baseline members for resources and aniso_filter_table. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>
2023-04-29gallium: consolidate jit image types between draw/llvmpipeDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18265>
2023-04-29gallivm: consolidate llvmpipe/draw sampler types.Dave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18265>
2023-04-29gallivm: consolidate draw/lp texture type.Dave Airlie
This just makes the type creation, struct and fields the same. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18265>
2022-10-11draw: s/start_or_maxelt/start/ in llvm VS codeBrian Paul
Per the now removed comment, the maxelt part of start_or_maxelt was not used. Rename to start to avoid confusion. Signed-off-by: Brian Paul <brianp@vmware.com> Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19024>
2022-09-03gallium: drop unused macros in draw_llvm.hMihai Preda
The reason is that these macros use lp_build_struct_get(), which is being replaced by lp_build_structure_get2() which takes the explicit pointer type. Rather than attempt to update these unused macros, simply drop them. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>
2022-08-26gallivm: don't indirect image/sampler destroy.Dave Airlie
These are pointless indirections, just call direct the destroy functions. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17946>
2022-08-04llvmpipe/gallivm/draw: introduce a buffer type.Dave Airlie
In order to do vulkan properly we need to move towards proper descriptor based operations for the shader. This is a bit of a precursor, this consolidates the ubo/ssbo stuff into a buffer type and uses that in the backend. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17783>
2022-08-04draw: fix up jit type creation for gs/tcs/tesDave Airlie
These were using numbers instead of defines, which makes reordering them harder. This should have no functional differences. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17783>
2022-07-23gallivm: add lp_build_struct_get() variants that take the LLVM typeMihai Preda
This is needed for LLVM-15 opaque pointers. The new variants taking the type are named with the suffix "2", using the same naming pattern LLVM (e.g. LLVMBuildGEP2 vs. LLVMBuildGEP). Reviewed-by: Brian Paul <brianp@vmware.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-05-12gallium/draw: Properly handle nr_samplers != nr_sampler_views in keysJason Ekstrand
First, make all key_size functions take nr_samplers and nr_sampler_views separately so we ensure both get passed in. Second, rework the offset helpers to take MAX(nr_samplers, nr_sampler_views) so we get the image param offset correct if nr_samplers < nr_sampler_views. While we're here, also re-order the size calculations to be in the same order as the things land in memory. Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16435>
2022-05-04gallium: use LLVM opaque pointers in draw_llvm.cMihai Preda
Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>
2022-04-22gallium/draw: use list.h instead of simple_list.hDylan Baker
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2021-08-17draw: add vertex color clamping to gs/tesDave Airlie
This refactors out the vertex color clamping from the VS shader, and adds calls to it for the tes/gs stages. It also conditionalised they key on having later stages as clamping should only happen in the last stage. This is needed for GL compatibility profiles Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12374>
2021-07-21draw: add sampler max_aniso query.Dave Airlie
Add support for draw shaders for retrieve max anisotropy. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-21draw: add shader access to aniso filter table.Dave Airlie
This allows the draw shaders to access the global filter table vis the context ptr. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>
2021-07-05draw/tess: write correct primitive id into verticesDave Airlie
The code was using a prim assembler after the tess stage, however tess prims aren't necessarily the output prim types, so just put the prim ids into the vertices at tess stage, and skip prim assembly. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11000>
2021-03-12draw: add tess/gs support for multiview indexDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9399>
2021-03-12draw/vs: pass the view index to the vertex shaderDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9399>
2020-07-02draw: pass number of images to image soa createDave Airlie
This is stored for now but will be used as part of indirect image support Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
2020-07-02draw: pass nr_samplers into llvm sample state creation.Dave Airlie
This will be used later to handle indirect texture support. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3778>
2020-05-06draw: add support for num_samples + sample_stride to the image pathsDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
2020-05-06draw: introduce sampler num samples + stride membersDave Airlie
This adds the num samples + sampler stride into the texture mapping paths, currently drivers just pass 0 for now. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
2020-04-27draw/tess: fix TES patch vertices in.Dave Airlie
Fixes CTS KHR-GL45.tessellation_shader.single.max_patch_vertices Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
2020-02-28draw: add main tessellation codeDave Airlie
This is the bulk of the llvm shader builders and tessellation execution code. TCS uses a coroutine launcher like compute shaders to handle barriers. It executes 4-wide with one input vertex per lane. Tessellation happens before the TES is run. TES is just a 4-wide launcher, one per primitive is executed, with one lane per tessellation coordinate input. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
2020-02-28draw: add JIT context/functions for tess stages.Dave Airlie
This adds the initial draw_tess.h with a define needed for the interfaces. TCS input array doesn't need to handle patch inputs so can be smaller. The TCS context has some dummy values to align the textures/images properly. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>
2020-02-07draw: change geom shader output to an array of outputs.Dave Airlie
Instead of a single output ptr, pass in one per output stream. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3530>
2019-12-12gallivm/draw: add support for draw_id system value.Dave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-08-27draw: add vs/gs images supportDave Airlie
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-08-27draw: add jit image type for vs/gs images.Dave Airlie
This introduces the jit image type into the jit interface for vertex/geom shaders Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-08-27gallivm: move first/last level jit texture members.Dave Airlie
This lets us create an image structure with the same basic types as the texture one. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-07-07draw: add support for ssbo ptrs to jit tables.Dave Airlie
This adds ssbo/num_ssbo ptrs to the vs/gs jit tables. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-05-10gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák
2017-03-08draw: s/unsigned/enum pipe_shader_type/Brian Paul
and some s/uint/enum pipe_shader_type/ Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-11-21draw: unify linear and elts draw jit functionsRoland Scheidegger
The code for elts and linear paths was nearly 100% identical by now - with the elts path simply having some additional gather for the elements in the main loop (with some additional small differences before the main loop). Hence nuke the separate functions and decide this at jit shader execution time (simply based on the presence of the elts pointer). Some analysis shows that the generated vs jit functions seem to be just very minimally more complex than the former elts functions, and almost none of the additional complexity is in the main loop (basically just the branch logic for the branch fetching the actual indices). Compared to linear, the codesize of the function is of course a bit larger, however the actual executed code in the main loop appears to be near 100% identical (the additional code looking up indices is skipped as expected). So, I would not expect a (meaningful) performance difference with the generated code, neither with elts nor linear, this does however roughly half the compilation time (the compiled shaders should also use only half the memory of course). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-11-21draw: use same argument order for jit draw linear / elts functionsRoland Scheidegger
This is a bit simpler. Mostly to make it easier to unify the paths later... Reviewed-by: Jose Fonseca <jfonseca@vmware.com>