summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Ignore D3DSIO_RET if it is the last instruction in a shaderDanylo Piliaiev2019-09-251-1/+7
| | | | | | | | | | | | | | RET as a last instruction could be safely ignored. Remove it to prevent crashes/warnings in case underlying driver doesn't implement arbitrary returns. A better way would be to remove the RET after the whole shader is parsed which will handle a possible case when the last RET is followed by a comment. CC: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* clover: eliminate "ignoring attributes on template argument" warningKarol Herbst2019-09-251-1/+10
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/codegen: remove unused get_symbol_offsets functionKarol Herbst2019-09-251-12/+0
| | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/llvm: remove harmful std::move callKarol Herbst2019-09-251-1/+1
| | | | | | | | both clang and gcc warn with: "moving a local object in a return statement prevents copy elision" Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/nir: fix compilation with g++-5.5 and maybe earlierKarol Herbst2019-09-231-10/+7
| | | | | | | | fixes "sorry, unimplemented: non-trivial designated initializers not supported" Fixes: deb04adf2ae ("clover: add support for passing kernels as nir to the driver") Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* clover: add support for passing kernels as nir to the driverKarol Herbst2019-09-216-7/+245
| | | | | | | | | | | | | v2: minor formatting fixes v3: call glsl_type_singleton_init_or_ref and glsl_type_singleton_decref v4: capitalize and punctuate comments fix text_executable -> text_intermediate in TODO make glsl_type_singleton wrapper static v5: rewrite how we run the nir passes v6: fix unhandled case switch warning in st/mesa Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v4)
* clover: prepare supporting multiple IRsKarol Herbst2019-09-213-6/+64
| | | | | | | | | | | v2: rework arguments to compiler::compile_program add assert to device::ir_format v3: remove PIPE_SHADER_IR_SPIRV change title Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> (v2) Reviewed-by: Pierre Moreau <[email protected]>
* clover: add support for drivers having no proper binary formatKarol Herbst2019-09-211-2/+3
| | | | | | | | | | | | | Most drivers have actually no binary format and just store the IR directly as a single entry point blob. v2: add a cap to switch between single or multi entry point binaries v3: remove the entry_point field v4: remove PIPE_CAP_MULTI_ENTRY_POINT_BINARIES v5: remove supports_multiple_entry_points Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/functional: add id_equals helperKarol Herbst2019-09-211-0/+15
| | | | | | | | v2: pass argument by value Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* rename pipe_llvm_program_header to pipe_binary_program_headerKarol Herbst2019-09-212-3/+3
| | | | | | | | We want to use it for other formats as well, so give it a more generic name Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* gallium: add blob field to pipe_llvm_program_headerKarol Herbst2019-09-211-2/+1
| | | | | | | | makes it easier to consume a IR_NATIVE binary Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* clover/llvm: Add functions for compiling from source to SPIR-VPierre Moreau2019-09-213-17/+92
| | | | | Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* clover/llvm: Add options for dumping SPIR-V binariesPierre Moreau2019-09-213-1/+37
| | | | | Reviewed-by: Karol Herbst <[email protected]> Acked-by: Francisco Jerez <[email protected]>
* clover/spirv: Add functions for parsing arguments, linking programs, etc.Pierre Moreau2019-09-212-5/+608
| | | | | | | | | v2 (Karol Herbst): silence warnings about unhandled enum values v3 (Karol Herbst): added back array size parsing (needed for structs passed by value) Acked-by: Francisco Jerez <[email protected]> (v2)
* clover/spirv: Add functions for validating SPIR-V binariesPierre Moreau2019-09-214-1/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | Changes since: * v12: - remove autotools (Karol Herbst) - Remove the callback in format_validation_msg. (Francisco Jerez) - Removed is_binary_spirv. (Francisco Jerez) - Pass a string reference to is_valid_spirv instead of the notification callback. (Francisco Jerez) * v11: Fix compilation error introduced in v11. * v10: - Reuse format_validation_msg in is_valid_spirv. - Remove LVL2STR macro in format_validation_msg. * v9: Add `clover_cpp_std` to the overrides of the `libclspirv` target in Meson. * v7: Add DEFINES to libclspirv and libclover, in autotools, as they would otherwise never know whether CLOVER_ALLOW_SPIRV has been defined (Dave Airlie) * v6: Update the dependency name (meson) and the libs variable (Makefile) due to the replacement of llvm-spirv to the new official SPIRV-LLVM-Translator. * v5: Changed to match the updated “clover/llvm: Allow translating from SPIR-V to LLVM IR” in the v6. Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* meson: Check for SPIRV-Tools and llvm-spirvPierre Moreau2019-09-211-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes since: * v12 (Karol Herbst): - rename CLOVER_ALLOW_SPIRV to HAVE_CLOVER_SPIRV * v11 (Karol Herbst): - only set new defines for clover to speed up recompilation - remove autotools * v10: - Add a new flag (`--enable-opencl-spirv` for autotools, and `-Dopencl-spirv=true` for meson) for enabling SPIR-V support in clover, and never automagically enable it without that flag. (Dylan Baker) - When enabling the SPIR-V support, the SPIRV-Tools and SPIRV-LLVM-Translator libraries are now required dependencies. * v7: - Properly align LLVMSPIRVLib comment (Dylan Baker) - Only define CLOVER_ALLOW_SPIRV when **both** dependencies are found: autotools was only requiring one or the other. * v6: Replace the llvm-spirv repository by the new official SPIRV-LLVM-Translator. * v4: Add a comment saying where to find llvm-spirv (Karol Herbst). * v3: - make SPIRV-Tools and llvm-spirv optional (Francisco Jerez); - bump requirement for llvm-spirv to version 0.2 * v2: - Bump the required version of SPIRV-Tools to the latest release; - Add a dependency on llvm-spirv. Reviewed-by: Dylan Baker <[email protected]> (v10) Reviewed-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* gallium/osmesa: Fix the inability to set no context as current.Hal Gentz2019-09-201-0/+5
| | | | | | | | | | | Currently there is no way to make no context current w/gallium + osmesa. The non-gallium version of osmesa does this if the context and buffer passed to `OSMesaMakeCurrent` are both null. This small change makes it so that this is also the case with the gallium version. Cc: [email protected] Signed-off-by: Hal Gentz <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gallium: extend resource_get_param to be as capable as resource_get_handleMarek Olšák2019-09-181-6/+13
| | | | | Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* gallium/xlib: Fix glXMakeCurrent(dpy, None, None, ctx)Adam Jackson2019-09-172-27/+40
| | | | | This is entirely legal in GL 3.0+. I wonder how many more times I'll need to fix this specific bug.
* gallium/xlib: Remove MakeCurrent_PrevContextAdam Jackson2019-09-171-12/+5
| | | | | As the comment notes, this is not thread-safe. You can just as easily use GetCurrentContext instead, so, do that.
* gallium/xlib: Remove drawable caching from the MakeCurrent pathAdam Jackson2019-09-171-32/+3
| | | | | AFAICT this only exists to avoid hitting XMesaFindBuffer, which is a linear search. But you don't have that many GLX drawables, so whatever.
* dri: Use DRM_FORMAT_* instead of defining our own copy.Eric Anholt2019-09-112-37/+38
| | | | | | | | | | | | We have only two defines that aren't from DRM_FORMAT_*: SARGB and SABGR. Keep only those as __DRI_IMAGE_FOURCC and garbage collect the rest. While this header is also used from the X server, the X server doesn't use any __DRI_IMAGE enums. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* gallium: Require LLVM >= 3.9Adam Jackson2019-09-111-30/+0
| | | | | | | | To go any further than this would be to break the current version of Android. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Eliminate gl_config::rgbModeAdam Jackson2019-09-092-47/+28
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Eliminate gl_config::have{Accum,Depth,Stencil}BufferAdam Jackson2019-09-092-6/+2
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove unused gl_config::indexBitsAdam Jackson2019-09-091-2/+0
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/xlib: Fix an obvious thinkoAdam Jackson2019-09-091-1/+1
| | | | | x == !GLX_DIRECT_COLOR is a fancy way of writing x == 0, which is clearly not what was meant.
* clover: replace more complex 3.x version check with LLVM_VERSION_MAJOR/MINOREric Engestrom2019-09-061-2/+3
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Michel Dänzer <[email protected]>
* clover: replace major llvm version checks with LLVM_VERSION_MAJOREric Engestrom2019-09-062-17/+19
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Michel Dänzer <[email protected]>
* clover: Fix build after clang r370122.Hal Gentz2019-09-042-2/+16
| | | | | | | | | | | | | | | | | ../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp: In function ‘std::unique_ptr<clang::CompilerInstance> {anonymous}::create_compiler_instance(const clover::device&, const std::vector<std::__cxx11::basic_string<char> >&, std::string&)’: ../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp:203:81: error: no matching function for call to ‘clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, const char* const*, const char* const*, clang::DiagnosticsEngine&)’ 203 | c->getInvocation(), copts.data(), copts.data() + copts.size(), diag)) | ^ In file included from /opt/llvm64/include/clang/Frontend/CompilerInstance.h:15, from ../mesa/src/gallium/state_trackers/clover/llvm/codegen.hpp:37, from ../mesa/src/gallium/state_trackers/clover/llvm/invocation.cpp:49: /opt/llvm64/include/clang/Frontend/CompilerInvocation.h:157:15: note: candidate: ‘static bool clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, llvm::ArrayRef<const char*>, clang::DiagnosticsEngine&)’ 157 | static bool CreateFromArgs(CompilerInvocation &Res, | ^~~~~~~~~~~~~~ /opt/llvm64/include/clang/Frontend/CompilerInvocation.h:157:15: note: candidate expects 3 arguments, 4 provided Signed-off-by: Hal Gentz <[email protected]> Reviewed-by: Aaron Watry <[email protected]>
* gallium/osmesa: Move 565 format selection checks where the rest are.Eric Anholt2019-09-041-4/+2
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/osmesa: Fix a race in creating the stmgr.Eric Anholt2019-09-041-9/+17
| | | | | | Noticed while looking at other OSMesa bugs. Reviewed-by: Timothy Arceri <[email protected]>
* st/nine: Properly initialize GLSL types for NIR shaders.Timur Kristóf2019-08-281-0/+5
| | | | | | | | NIR shaders use GLSL types (note: these live outside libglsl), and nine needs to properly initialize these just like the other state trackers. This fixes an assertion failure when TTN is used. Signed-off-by: Timur Kristóf <[email protected]>
* glx: Sync <GL/glxext.h> with KhronosAdam Jackson2019-08-221-4/+3
| | | | | | | | Minor fixups required to keep the prototypes matching and to remove mention of retired enums. Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gallium: Add buffer and configs handling or fp16 formatsKevin Strasser2019-08-214-0/+50
| | | | | | | | | | | | | | | Expose configs when allow_fp16_configs has been enabled and DRI_LOADER_CAP_FP16 is set in the loader. Also, make kms_swrast_dri respect format bpp, to allow for allocating buffers wider than 32 bpp. Make fp16 opt-in for gallium. Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium: Use consistent approach for config format filteringKevin Strasser2019-08-211-8/+9
| | | | | | | rgb10 uses an 'if(allowed) continue' approach, do the same for rgba_ordering. Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/vl: use compute preference for all multimedia, not just blitIlia Mirkin2019-08-201-1/+1
| | | | | | | | | | | | The compute paths in vl are a bit AMD-specific. For example, they (on nouveau), try to use a BGRX8 image format, which is not supported. Fixing all this is probably possible, but since the compute paths aren't in any way better, it's difficult to care. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111213 Fixes: 9364d66cb7 (gallium/auxiliary/vl: Add video compositor compute shader render) Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add back YVU supportXiong, James2019-08-161-5/+5
| | | | | | | | PIPE_FORMAT_YV12 is not handled so switching to PIPE_FORMAT_IYUV and adding back YVU support. Signed-off-by: James Xiong <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/dri2: Implement DRI2bufferDamageExtensionDaniel Stone2019-08-131-0/+35
| | | | | | | | | | | | | | | Add a pipe_screen->set_damage_region() hook to propagate set-damage-region requests to the driver, it's then up to the driver to decide what to do with this piece of information. If the hook is left unassigned, the buffer-damage extension is considered unsupported. Signed-off-by: Daniel Stone <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/dri2: Use pipe_screen::resource_get_param in image queriesJordan Justen2019-08-131-0/+71
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* gallium/dri2: Support images with multiple planes for modifiersJordan Justen2019-08-132-3/+33
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* gallium/dri2: Refactor image property queriesJordan Justen2019-08-131-69/+79
| | | | | | | | | | This refactor will let us more easily use pipe_screen::resource_get_param as an alternative to pipe_screen::resource_get_handle. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* gallium/dri2: Support creating multi-planar modifier imagesJordan Justen2019-08-131-10/+19
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* gallium/dri2: Implement dri2ImageExtension.queryDmaBufFormatModifierAttribsJordan Justen2019-08-131-0/+50
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>
* clover: Fix build after clang r367864Jan Vesely2019-08-061-2/+8
| | | | | | | | v2: Drop special case of llvm-9 Signed-off-by: Jan Vesely <[email protected]> Acked-by: Dieter Nützel <[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Aaron Watry <[email protected]>
* mesa/gallium: add dric option to allow overriding GL vendor stringTimothy Arceri2019-08-071-0/+7
| | | | | | | Will be used in the following patch. Reviewed-by: Marek Olšák <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93551
* st/dri: Move dri2_format_mapping table and it's accessors from dri2.c to ↵Jon Turney2019-08-063-213/+223
| | | | | | | | | dri_helpers.c 8af1990a exposed dri2_get_mapping_by_fourcc() in dri_helpers.h, so it could be used by dri_get_egl_image(), but didn't move it. This breaks the build in the with_dri=false case (e.g. when building for a target which doesn't have libdrm, so swrast is only dri driver built)
* st/dri: simplify dri_get_egl_image by reusing dri2_format_tableMike Blumenkrantz2019-07-313-42/+24
| | | | | | | | | | this makes dri2_get_mapping_by_fourcc accessible from dri_helpers.h and does a direct lookup on the fourcc id to match the pipe format v2 (Ken): Allow map to be NULL, use img->texture->format. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Revert "st/dri: simplify dri_get_egl_image by reusing dri2_format_table"Kenneth Graunke2019-07-313-25/+42
| | | | | | This reverts commit c47af8b95f26bd83efe322ff0baa52263fb8625e. It causes dEQP-EGL regressions. (I think there is an easy fix, but we'll have it go through review again.)
* st/dri: simplify dri_get_egl_image by reusing dri2_format_tableMike Blumenkrantz2019-07-313-42/+25
| | | | | | | this makes dri2_get_mapping_by_fourcc accessible from dri_helpers.h and does a direct lookup on the fourcc id to match the pipe format Reviewed-by: Kenneth Graunke <[email protected]>