aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* llvmpipe: make sample position a global array.Dave Airlie2020-05-071-2/+2
| | | | | | | | | | | | | I messed this up and LLVM asserts on it. Use the gallivm struct wrappers to make it clearer. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2913 Reviewed-by: Erik Faye-Lund <[email protected]> Tested-by: Erik Faye-Lund <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4933>
* tgsi_to_nir: translate non-vec4 image stores correctlyMarek Olšák2020-05-061-2/+5
| | | | | | | set the correct number of components for src data and the intrinsic Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4908>
* gallivm/nir: hooks up texture samples queriesDave Airlie2020-05-061-3/+21
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/sample: add num samples query for txqs (v2)Dave Airlie2020-05-064-0/+9
| | | | | | | v2: add false to the existing users (Roland) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* nir/tgsi: translate the interp locationDave Airlie2020-05-061-0/+5
| | | | | | | translate sample and centroid locations. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm: add mask api to force maskDave Airlie2020-05-062-0/+14
| | | | | | | | | | For per-sample shading the mask needs to be forced for each iteration of the fragment shader. Just adds the API for now. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm: add sample id/pos intrinsic supportDave Airlie2020-05-063-0/+15
| | | | | | | | | | The sample position is looked up in an incoming array using the sample id. (These are mostly for ARB_sample_shading support) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* draw: disable point/line smoothing for multisample (v2)Dave Airlie2020-05-063-12/+12
| | | | | | | | | | When MSAA is enabled smoothing is ignored v2: As pointed out by Roland I got this completely wrong, fix this to work the other way Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallium/util: split out zstencil clearing code.Dave Airlie2020-05-062-89/+123
| | | | | | | llvmpipe will want to reuse this for it's multisample clears. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* util: add a resource wrapper to get resource samplesDave Airlie2020-05-061-0/+5
| | | | | | | This return 1 as a baseline and should be used in allocator paths. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* draw: add support for num_samples + sample_stride to the image pathsDave Airlie2020-05-065-6/+33
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* draw: introduce sampler num samples + stride membersDave Airlie2020-05-065-2/+27
| | | | | | | | This adds the num samples + sampler stride into the texture mapping paths, currently drivers just pass 0 for now. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/nir: add multisample image operationsDave Airlie2020-05-061-0/+6
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/nir: add multisample support to image sizeDave Airlie2020-05-061-0/+3
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/nir/tgsi: add multisample texture sampling.Dave Airlie2020-05-062-1/+13
| | | | | | | | | Both paths are required as u_blitter needs the TGSI path. This just hooks the instructions up to the sampling code. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/sample: add multisample image operation supportDave Airlie2020-05-062-0/+18
| | | | | | | Just adds in the sample stride. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* gallivm/sample: add multisample support for texel fetchDave Airlie2020-05-062-2/+52
| | | | | | | | | | | | | This adds a new callback to get the stride between the per-sample images, adds a new value for the per-sample index to lookup, and a flag to use multisampling. gallivm/sample: add num samples interface for dynamic samplers This will be used for getting number of samples in jit code. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
* draw/tess: free tessellation control shader i/o memory.Dave Airlie2020-05-061-0/+3
| | | | | | | Fixes: 0d02a7b8ca79 (draw: add main tessellation code) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4899>
* gallium: add a new cap PIPE_CAP_GLSL_ZERO_INITPierre-Eric Pelloux-Prayer2020-05-051-0/+1
| | | | | | | Allows driver to select a zero init mode between the 3 possible values. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
* driconf: add force_integer_tex_nearest optionPierre-Eric Pelloux-Prayer2020-05-051-0/+1
| | | | | | | | | | And enable it for "GRID Autosport" and "DIRT: Showdown" games. CC: 20.1 <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1258 Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
* tgsi_to_nir: handle TGSI_OPCODE_BARRIERMarek Olšák2020-04-301-0/+12
| | | | | Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761>
* tgsi_to_nir: handle TGSI_SEMANTIC_BLOCK_SIZEMarek Olšák2020-04-301-0/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4761>
* gallium: extract out logicop helperRob Clark2020-04-301-0/+26
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4826>
* gallivm: fix half to float conversions with llvm 11Roland Scheidegger2020-04-301-10/+24
| | | | | | | | | | | | | | LLVM 11 removes the intrinsic for half to float conversion, so use the fpext function instead. This function actually works now with half to float, albeit a quick experiment showed at least the x86 backend cannot lower it itself if the cpu doesn't support it natively and tries to call external library, which crashes (and would be very slow anyway as it would be lowered to scalar code), so for now only use it where we previously used the f16c intrinsic. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2603 Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4800>
* gallium: add pipe cap for scissored clears and pass scissor state to clear() ↵Mike Blumenkrantz2020-04-2910-9/+27
| | | | | | | | | | | | | | | | hook this adds a new pipe cap that drivers can support which enables passing buffer clears with scissor test enabled through to be handled by the driver instead of having mesa draw a quad also adjust all existing clear() hooks to have the new parameter Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4310>
* gallium/pipebuffer: Use persistent maps for slabsThomas Hellstrom2020-04-292-4/+12
| | | | | | | | | | | | | | | Instead of the ugly practice of relying on the provider caching maps, introduce and use persistent pipebuffer maps. Providers that can't handle persistent maps can't use the slab manager. The only current user is the svga drm winsys which always maps persistently. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4804>
* gallium/gallivm: remove unused header include for newer LLVMJan Zielinski2020-04-271-0/+2
| | | | | | | | | | In the top of the trunk LLVM (11) llvm/IR/CallSite.h header has been removed. The file compiles without this include also for LLVM 8, but I'm not sure about 9, 10, and older versions so I disable it only for the latest LLVM Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4748>
* gallium/gallivm: fix compilation issues with llvm 11Jan Zielinski2020-04-278-19/+26
| | | | | | | | | | | | Top of the trunk LLVM removes old vector type and introduces two new ones - one for fixed-width and one for scalable vectors. This commit fixes compilation issues by switching from LLVMVectorTypeKind to LLVMFixedVectorTypeKind for new LLVM. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4748>
* gallium: add PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE for glthreadMarek Olšák2020-04-271-0/+1
| | | | | | | and add radeonsi support. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* gallivm: fix stencil borderDave Airlie2020-04-271-2/+10
| | | | | | | | | Fixes: dEQP-GLES31.functional.texture.border_clamp.unused_channels.depth32f_stencil8_sample_stencil dEQP-GLES31.functional.texture.border_clamp.sampler.uint_stencil Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* llvmpipe: fix d32 unorm depth conversions.Dave Airlie2020-04-271-1/+4
| | | | | | | | | | | | | When the depth value was 1.0 and was being converted to Z32_UNORM the conversion would scale it up to INT32_MAX + 1 which would cause FPToSI to give incorrect results, changing it to use FPToUI for the unsigned 32-bit case only fixes it. Fixes: GTF-GL45.gtf30.GL3Tests.depth_texture.depth_texture_fbo_clear Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* draw/tess: fix TES patch vertices in.Dave Airlie2020-04-273-5/+11
| | | | | | | Fixes CTS KHR-GL45.tessellation_shader.single.max_patch_vertices Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* llvmpipe: bump max images to 16Dave Airlie2020-04-271-1/+1
| | | | | | | This is needed to make some tests run, and helps for vulkan later. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* util/indirect: handle stride less than number of parameters.Dave Airlie2020-04-271-1/+3
| | | | | | | | | | | It's legal to have a stride less than the num of parameters, in this case no need to try and over map the buffer which asserts Fixes: GTF-GL45.gtf43.GL3Tests.multi_draw_indirect.multi_draw_indirect_stride Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* gallivm/nir: add helper invocation supportDave Airlie2020-04-273-0/+13
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* gallivm/nir: fix image store conversionsDave Airlie2020-04-271-7/+13
| | | | | | | | | | | | This fixes a few of the image store paths, to do the correct clamping of unsigned/signed values Fixes: KHR-GLES31.core.layout_binding.block_layout_binding_block_ComputeShader KHR-GL45.shader_image_load_store.basic-allFormats-store KHR-GL46.shader_image_load_store.multiple-uniforms Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
* gallium: Fix setup of pstipple frag coord var.Eric Anholt2020-04-231-5/+1
| | | | | | | | | If the last input was a struct or matrix, we would have overlapped driver locations for our new position var. Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Jose Maria Casanova Crespo <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4670>
* gallium: prepare framework for supporting AlphaToCoverageDitherControlNVIndrajit Kumar Das2020-04-231-0/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4543>
* gallium: add # of MRT to blend stateRob Clark2020-04-233-2/+4
| | | | | | | | | | | | To make it possible for drivers to avoid unnecessary blend state change for unused MRTs. Otherwise the driver would have to manage different blend CSOs for different potential #s of render targets. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
* mesa/st: avoid u_vbuf for GLESRob Clark2020-04-234-3/+11
| | | | | | | | | | | 64b VBO types are not required for GLES. So avoid u_vbuf if that was otherwise the only reason it was used. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4619>
* gallium/utils: silence strncpy warningPierre-Eric Pelloux-Prayer2020-04-211-1/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4584>
* gallium/u_threaded: flush batch when hitting mapping limitPierre-Eric Pelloux-Prayer2020-04-162-0/+24
| | | | | | | | | | | | | | | tc_transfer_map maps buffers directly, but the unmap operation is executed in the driver thread. When an application does a lot of map/unmap operations, without flushing, this increase the RAM used (and eventually get the app killed by the oom-killer). This commit allows tc to keep track of how many bytes were mapped during the current batch. When this estimation becomes higher than a threshold, we flush the batch. See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2735 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4508>
* st/mesa: add support for GL_NV_viewport_array2Ilia Mirkin2020-04-151-0/+4
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4529>
* gallium: add PIPE_CAP_VIEWPORT_MASKIlia Mirkin2020-04-151-0/+1
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4529>
* gallium: add TGSI_PROPERTY_LAYER_VIEWPORT_RELATIVEIlia Mirkin2020-04-151-0/+1
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4529>
* gallium: add TGSI_SEMANTIC_VIEWPORT_MASKIlia Mirkin2020-04-151-0/+1
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4529>
* draw/tess: free the NIRDave Airlie2020-04-161-1/+5
| | | | | | Fixes: 0d02a7b8ca794 (draw: add main tessellation code) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4563>
* draw: free the NIR IR.Dave Airlie2020-04-162-4/+11
| | | | | | | | | Not sure how I missed this, the ownership was a bit blurry, free the NIR. Fixes: bf12bc2dd7a2 (draw: add nir info gathering and building support) Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4563>
* gallium: initialize viewport swizzle in cso_set_viewport_dimsKarol Herbst2020-04-151-0/+4
| | | | | | | | Fixes: dEQP-GLES2.functional.fragment_ops.depth_stencil.stencil_* and more Fixes: 4137a79c2a7e ("gallium: add viewport swizzling state and cap") Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4567>
* gallium: add PIPE_CAP_SYSTEM_SVMKarol Herbst2020-04-151-0/+3
| | | | | | | | | v2: split enum in specific caps to abstract the CL enum v3: remove BUFFER_SVM caps Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>