summaryrefslogtreecommitdiff
path: root/src/gallium/include
AgeCommit message (Collapse)AuthorFilesLines
5 daysmesa: add allow_glsl_compat_shaders for shader-dbMarek Olšák1-0/+1
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13870>
6 daysgallium: add a link shader hookAntonio Caggiano1-0/+16
Allow drivers to register a callback for when a shader program is linked. Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13674>
10 daysgallium, windows: Use HANDLE instead of FD for external objectsJesse Natalie1-0/+10
Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Bill Kristiansen <billkris@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13054>
11 daysgallium: implement compute pbo downloadMike Blumenkrantz1-0/+1
this reworks PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER into an enum as PIPE_CAP_TEXTURE_TRANSFER_MODES, enabling drivers to choose a (sometimes) faster, compute-based download mechanism based on a new pipe_screen hook compute pbo download is implemented using shaders with a prolog to convert the input format to generic rgb float values, then an epilog to convert to the output value. the prolog and epilog are determined based on a vec4 of packed ubo data which is dynamically updated based on the API usage currently, the only known limitations are: * GL_ARB_texture_cube_map_array is broken somehow (and disabled) * AMD hardware somehow can't do depth readback? otherwise it should work for every possible case Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>
11 daysgallium: rename PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFERMike Blumenkrantz1-1/+6
this is now a bitfield enum for more functionality Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>
11 daysgallium: add pipe_screen::is_compute_copy_faster hookMike Blumenkrantz1-0/+13
this can be used to query whether a driver expects a given texture copy to be faster as a compute shader or using cpu/gfx transfers Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>
14 daysgallium: add PIPE_CAP_PREFER_POT_ALIGNED_VARYINGSVasily Khoruzhick1-0/+1
Driver should enable this cap if it prefers varyings to be aligned to power of two in a slot, i.e. vec4 in .xyzw, vec3 in .xyz, vec2 in .xy or .zw Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13151>
2021-11-11util/format: Add G8_B8R8_420_UNORM to match Vulkan.Emma Anholt1-0/+1
turnip was playing fast and loose with the name, using the R8_G8B8 format name but actually setting the descriptors up to read G8_B8R8 like Vulkan (sensibly) wants. This caused trouble when trying to make freedreno and turnip share code. By having both orderings as format names, we can share the descriptor code and also confuse readers less. Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.Emma Anholt1-1/+1
The only user, turnip, was actually treating it as this layout, matching vulkan's specification of how the planes map to RGB values. (Y=G means that Cb=B and Cr=R). Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-08gallium: add missing point and line CAPsMarek Olšák1-0/+6
The returned values are the same as the GL frontend. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13676>
2021-11-08gallium: rename PIPE_CAPF_MAX_POINT_WIDTH -> MAX_POINT_SIZEMarek Olšák1-2/+2
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13676>
2021-11-04drirc: add mesa_extension_override optionPierre-Eric Pelloux-Prayer1-0/+1
This allows specific per-application override. The existing MESA_EXTENSION_OVERRIDE env variable is kept. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13364>
2021-11-03gallium: add PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLYMike Blumenkrantz1-0/+1
vulkan requires that vertex attribute access be aligned to the size of a component for the attribute, but GL has no such requirements the existing alignment caps are unnecessarily restrictive for applying this limitation, so this cap now pre-calculates the masks for elements and vertex buffers in vbuf to enable rewriting misaligned buffers Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13556>
2021-10-28glsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checksPierre-Eric Pelloux-Prayer1-0/+1
The GLSL spec says it's an error if a shader statically writes to these 2 variables. Until this commit, Mesa refused to link a shader if it had an unused function writing to one of these variables while another (used) function wrote to the other. This commit adds an option to perform dead function elimination after the intra-stage linking step but before performing these checks. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12897>
2021-10-27glthread: add an option to make glCheckFramebufferStatus a no-opMarek Olšák1-0/+1
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13403>
2021-10-22util/format: Add PIPE_FORMAT_Y8_UNORM as an "other" layout formatMatt Turner1-0/+1
freedreno has a different layout for tiled Y8 planes from normal R8 textures, so we need to be able to talk about them separately. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-19gallium,vbo: add PIPE_BIND_VERTEX_STATE for display listsMarek Olšák1-0/+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/13399>
2021-10-18Revert "gallium: add a is_dri_blit_image bool to pipe_blit_info"Pierre-Eric Pelloux-Prayer1-1/+0
This reverts commit 22a1b7c5b3a9cdbf05a0fd97fb193763a525b732. The only use was radeonsi and it switched to PIPE_BIND_DRI_PRIME instead. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-18gallium/dri: let the driver know if the imported image is DRI_PRIME bufferPierre-Eric Pelloux-Prayer1-0/+1
Use createImageFromFds2 together with __DRI_IMAGE_PRIME_LINEAR_BUFFER, so the driver's resource_from_handle hook will be aware that this specific image is the linear buffer. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13362>
2021-10-13util,gallium: put count in pipe_resource & sampler_view on its own cache lineMarek Olšák2-2/+22
This adds 60 bytes to both structures. It eliminates "False Sharing" for atomic operations (see wikipedia). Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11618>
2021-10-07gallium: add a is_dri_blit_image bool to pipe_blit_infoPierre-Eric Pelloux-Prayer1-0/+1
This indicates driver that a given blit is coming from the DRI frontend. This information can then be used to pick an appropriate blitting method. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12763>
2021-10-06llvmpipe: add support for EXT_memory_object(_fd)Thomas Wagner1-0/+4
Enable the import of memory via opaque fd handles, which are based upon memory-fds. The extension is necessary for sharing images and buffers from Vulkan. Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Heinrich Fink <hfink@snap.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12345>
2021-10-06gallium: add utility and interface for memory fd allocationsThomas Wagner1-0/+21
Add utility functions to allocate aligned memory backed by mem_fd objects. Add interface to Gallium for same allocation. It will be used in later commits for external memory support in Vulkan/OpenGL. Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Heinrich Fink <hfink@snap.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12345>
2021-10-05util/format: Add an RGB planar format for YV12, like we have for NV12.Emma Anholt1-0/+1
Turnip will use this for mapping the to the corresponding hardware format, and we could also extend mesa/st to avoid adding extra samplers for external image sampling of YV12 on freedreno. Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13046>
2021-10-01gallium: add pipe_vertex_state and draw_vertex_state for display listsMarek Olšák4-0/+116
The main motivation is to improve the score of viewperf13/snx. This new interface is designed to be optimal for display lists as implemented by the vbo module. It has much lower CPU overhead in the frontend, threaded context, and the driver. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13050>
2021-09-30driconf, glsl: Add a vs_position_always_precise optionVadym Shovkoplias1-0/+1
This is basically the same workaround as in 9b577f2a88 (driconf, glsl: Add a vs_position_always_invariant option) commit but for tesselation evaluation shaders. Some applications do not mark outputs as precise in tesselation evaluation shaders which can lead to different results in case some optimizations were applied. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com> Fixes: 09705747d72 ("nir/algebraic: Reassociate fadd into fmul in DPH-like pattern") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13027>
2021-09-29gallium: add PIPE_CAP_PREFER_BACK_BUFFER_REUSEPierre-Eric Pelloux-Prayer1-0/+1
This will be used in the next commit. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12788>
2021-09-24gallium/format: move two vertex formats into the proper place.Dave Airlie1-2/+4
These two can be vertex formats with vulkan so lavapipe can expose them. Fixes dEQP-VK.pipeline.vertex_input.single_attribute.uvec4.as_a2r10g10b10_uint_pack32_rate_vertex Fixes: e002f5a086c7 ("gallium: change pipe_vertex_element::src_format to uint8_t") 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/12987>
2021-09-13driconf: remove leftover code for allow_incorrect_primitive_idMarek Olšák1-1/+0
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12809>
2021-09-09gallium: add rasterizer depth_clamp enable bitRoland Scheidegger2-0/+8
This is required for d3d10+, which has depth_clamp always enabled regardless of depth_clip (in contrast to OpenGL, where enabling depth_clamp disables depth_clip). There doesn't seem to be a GL extension for it, but it will be used for lavapipe to implement VK_EXT_depth_clip_enable. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12260>
2021-09-09gallium/api: add validate_egl_image interfaceQiang Yu1-0/+6
For being used by mesa state tracker. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12336>
2021-09-06mesa/st: Add an optional GLSL link fail msg to finalize_nir.Emma Anholt1-1/+4
GLES2 drivers are allowed to reject some GLSL constructs, like dynamic loop bounds (which neither i915g nor vc4 can fully support), but gallium hasn't had any way to trigger a link failure. Add a return msg to the finalize_nir hook, which is called at the end of GLSL linking, and use that. This means that some other callers of finalize need to do something with the msg, and we (for now) just throw it away. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12218>
2021-08-31gallium: add a sample0 only option to blitter.Dave Airlie1-1/+1
Vulkan depth/stencil resolves can ask for just sample 0 instead of averaging. Just add a flag to the state to allow it. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12504>
2021-08-25gallium/tgsi: rip out cylindrical wrap supportErik Faye-Lund1-7/+1
We never enable this feature, so let's rip it out completely. Acked-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12505>
2021-08-24gallium: change pipe_draw_info::mode to uint8_t on MSVC to make it 1 byte largeMarek Olšák1-1/+7
needed by u_threaded_context Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12480>
2021-08-24gallium: use a packed enum to make pipe_prim_mode 1-byte large with __GNUC__Marek Olšák1-1/+1
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12480>
2021-08-21gallium: remove vertices_per_patch, add pipe_context::set_patch_verticesMarek Olšák2-3/+8
We would like draw-only display lists to have immutable draw info and this is the only GL non-draw state in pipe_draw_info (not counting view_mask). It also allows removing some code from draw_vbo for tessellation. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12351>
2021-08-20gallium: add take_ownership into set_sampler_views to skip reference countingMarek Olšák1-0/+1
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12334>
2021-08-13gallium: Remove "optimize" parameter from pipe_screen::finalize_nirIan Romanick1-4/+1
As part of adding support for inline uniforms in Iris, I was going to add a finalize_nir hook. I went looking to see how other drivers use the "optimize" parameter, and I discovered that *nobody* uses it at all. v2: Fix typo in commit message. Noticed by Mike. 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/12317>
2021-08-09gallium: simplify VRAM uploads by adding PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLYMarek Olšák1-0/+1
When this flag is set, u_threaded_context will try not to map it directly for better buffer placement. It's set by drivers when visible VRAM is too small. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12257>
2021-08-02driconf: Add force_gl_renderer overrideRob Clark1-0/+1
Allow driconf to also override GL_RENDERER string. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
2021-08-02gallium/driconf: Allow the driver to parse the driconf options.Emma Anholt1-1/+2
This will give the driver a chance to set a device name separate from the driver name, using info probed during screen creation. All drivers querying driconf in screen creation now have to call parsing on their own, but other drivers get fallback parsing after screen creation. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
2021-08-02gallium: add pipe_vertex_element::dual_slot to move lowering to CSO creationMarek Olšák1-1/+10
This just adds the new field. It will be used to lower 64-bit attribs in drivers (via a helper). Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11370>
2021-08-02gallium: add multi-component 64-bit UINT formats for raw double vertex attribsMarek Olšák1-2/+5
This is the distinction between formats: - PIPE_FORMAT_R64_FLOAT is the legacy "convert-to-float" vertex format. - PIPE_FORMAT_R64_UINT is the raw double format. Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11370>
2021-08-02gallium: change pipe_vertex_element::src_format to uint8_tMarek Olšák2-71/+73
This removes the bitfield packing/unpacking. pipe_format entries are reordered to have vertex formats first because vertex formats must be <= 255. Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11370>
2021-07-26gallium: change rate ctrl struct to arrayThong Thai1-1/+1
Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>
2021-07-26gallium: update h264 struct to track temporal layersThong Thai1-0/+1
Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>
2021-07-26gallium: add temporal layers cap enumThong Thai1-0/+1
Determine the number of temporal layers the encoder supports. Used for encoding Scalable Video Coding (SVC) videos. Signed-off-by: Thong Thai <thong.thai@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>
2021-07-21gallivm: add basic mips64 support and set mcpu to mips64r5 on ls3a4000suijingfeng1-0/+8
ls3a4000 and ls2k1000 cpu is mips64r5 compatible with MSA SIMD instruction set implemented, while ls3a3000 is mips64r2 compatible only. Due to lacking llvm support for loongson CPU, llvm::sys::getHostCPUName(). return "generic" on all loongson mips CPU. So we override the MCPU to mips64r5 if MSA is implemented, feedback to mips64r2 for all other ordinaries. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: suijingfeng <suijingfeng@loongson.cn> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11955>
2021-07-20gallium: add pipe_sampler_state::pad memberMike Blumenkrantz1-0/+1
when zeroing the struct without memset, this needs to be zeroed to avoid garbage data in the padding Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11886>