Commit Graph

130198 Commits

Author SHA1 Message Date
Thong Thai 354e375c9c frontends/va/postproc: Un-break field flag
Fixes an issue where deinterlaced videos would play at half the
framerate, since only one field was repeated, instead of using both
fields. Reverts a change I made previously which broke this.

Fixes: 78786a219e ("frontends/va: Fix deinterlace bottom field first flag")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3621
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7194>
2020-10-21 10:13:52 +00:00
Tony Wasserka fd038132de aco/isel: Miscellaneous cleanups using the new Stage API
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>
2020-10-21 09:49:38 +00:00
Tony Wasserka 34bc9477de aco: Clean up symbol names and comments related to NGG
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>
2020-10-21 09:49:38 +00:00
Tony Wasserka 86c227c10c aco: Use strong typing to model SW<->HW stage mappings
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>
2020-10-21 09:49:38 +00:00
Eric Anholt fdbc45d1d4 nir: Only validate in passes that might have changed things.
If a pass returning boolean progress reports no change, we shouldn't need
to re-validate.  If a pass breaks the NIR but also fails to report
progress correctly, it would be up to the next pass to catch that.

This should hopefully help with test timeouts on
KHR-GL33.texture_swizzle.functional since switching softpipe to
nir-to-tgsi and enabling NIR validation in CI (27s to 20s on my system).

Suggested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7239>
2020-10-21 05:00:17 +00:00
Timothy Arceri c54c42321e glsl: relax rule on varying matching for shaders older than 4.00
Please see new code commment for full justification.

Fixes: 18004c338f ("glsl: fail when a shader's input var has not an equivalent out var in previous")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3648

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7184>
2020-10-21 15:00:47 +11:00
Icecream95 c97e82bab5 panfrost: Only enable occlusion queries when active
Fixes piglit tests:
 - occlusion_query_meta_fragments
 - occlusion_query_meta_save

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7074>
2020-10-21 01:27:45 +00:00
Icecream95 04e955f19b panfrost: Precise occlusion query support
In the "counter" occlusion query mode, each shader core has a separate
counter.

When MSAA is disabled, counter values need to be divided by four.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7074>
2020-10-21 01:27:45 +00:00
Eric Anholt 584b107037 st/mesa: Drop the TGSI paths for drawpixels and use nir-to-tgsi if needed.
Now that we have a NIR translator in gallium, we can drop this duplicated
code in the API implementation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6477>
2020-10-20 23:32:26 +00:00
Eric Anholt 57effa342b st/mesa: Drop the TGSI paths for PBOs and use nir-to-tgsi if needed.
Now that we have a NIR translator in gallium, we can drop this duplicated
code in the API implementation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6477>
2020-10-20 23:32:26 +00:00
Eric Anholt da4c4c0e67 gallium/ntt: Add default compiler options for non-native-NIR drivers.
For using NIR internally in mesa/st, we need some compiler options.  This
is the options wrote for softpipe, which should be enough for whatever NTT
we do.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6477>
2020-10-20 23:32:26 +00:00
Vinson Lee f5841c343b v3dv: Fix assert using assign instead of compare.
Fix defect reported by Coverity Scan.

Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been intended

Fixes: ca86c7c65a ("v3dv: assert command buffers are executable when submitting to a queue")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7156>
2020-10-20 23:05:17 +00:00
Bas Nieuwenhuizen e7ce74497e radv: Advertise VK_KHR_shader_terminate_invocation.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7226>
2020-10-20 22:53:08 +00:00
Bas Nieuwenhuizen bf955d5f0a amd/llvm: Add VK_KHR_shader_terminate_invocation support.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7226>
2020-10-20 22:53:08 +00:00
Bas Nieuwenhuizen 76421667ec aco: Add VK_KHR_shader_terminate_invocation support.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7226>
2020-10-20 22:53:08 +00:00
Eric Anholt 22a6396340 ci: Enable Werror on meson-arm64-build-test.
I found that it was warnings-clean already, let's make sure it stays that
way.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt b03fdca2e0 turnip: Add error path handling for descriptor pool init.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt d384f3be4c turnip: Handle the error path for tu/drm's vkResetFences().
OUT_OF_MEMORY is the only valid error code from this function, but this
error is more of a "things went horribly wrong, you can't talk to the GPU"
case.  Set the device to be in error.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt 296468ef1a turnip: Handle some error paths in allocating CS space from a command buffer.
Fixes some release-build warnings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt 9b156ef57b freedreno/fdperf: Silence a compiler warning about current counter.
It seems like selecting the first here is a fine choice if we can't
find the counter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt a512e9eecd freedreno/tools: Fix compiler warnings about using sz in the error paths.
If we don't check for a NULL str, then sz might be undefined (as was
happening in the match_compatible path, and returning 0 makes us not match
as we should).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt 91c5bbc128 freedreno/cffdec: Fix format overflow warning.
../src/freedreno/decode/cffdec.c: In function ‘reg_disasm_gpuaddr’:
../src/freedreno/decode/cffdec.c:404:29: error: ‘sprintf’ writing a
terminating nul past the end of the destination [-Werror=format-overflow=]
  404 |   sprintf(filename, "%04d.%s", n++, ext);
../src/freedreno/decode/cffdec.c:404:3: note: ‘sprintf’ output between
9 and 16 bytes into a destination of size 8
  404 |   sprintf(filename, "%04d.%s", n++, ext);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Karol Herbst e4dba528ca llvmpipe: enable CL images
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:43 +02:00
Dave Airlie cda192dc15 llvmpipe: fix sampler/image binding for clover.
Clover uses these APIs a bit different, avoid crashes

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:43 +02:00
Karol Herbst 874371876e nvc0/CL: enable images
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:43 +02:00
Karol Herbst ee035c75d4 nouveau: hide SVM support behing a variable for now as kernel space is broken
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Karol Herbst 1a775b71ca clover/nir: set kernel_image cap
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand 4f24dee22a clover/nir: Add an image lowering pass
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand 5e31fad8c9 clover/nir: Calculate sizes of images and samplers properly
Clover uses very specific sizes and alignments for images and samplers
to pass various bits of data.  We need to add a new size/align helper
for inputs which matches the standard CL size/align for most types but
also has the right size/align for images and samplers.

v2 (Karol): use sizeof(cl_mem) instead of 8 to fix 32 bit runtimes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Karol Herbst f6c46e8408 clover/device: use PIPE_MAX_SHADER_SAMPLER_VIEWS for max_images_read
Read images are really just normal textures and OpenCL requires 128 anyway.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Serge Martin 43a42b6e1d clover: clCreateImage: calculate image row_pitch and slice_pitch when not provided
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Karol Herbst f2bdb69218 clover: support custom driver strides
This is required by llvmpipe as it sets explicit strides on buffers and
textures.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Serge Martin 9583ce04db clover: validate image_row_pitch and image_slice_pitch in clEnqueueMapImage
v2 (Karol Herbst): remove filling values as it was incorrect.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Aaron Watry 1ff4db1935 clover: Fix incorrect error check in clGetSupportedImageFormats
From CL1.2 Section 5.3.2:
  returns CL_INVALID_VALUE ... if num_entries is 0 and image_formats is not NULL.

We were checking the num_image_formats param, not num_entries.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Karol Herbst 3aead7198b clover: use pipe_image_view for images instead of set_compute_resources
Long term we want to git rid of set_compute_resources, this is just one
piece. The other bit would be to use the proper const buffer interfaces,
but because that path is only hit with r600/radeonsi I won't touch it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand eb965719ab compiler/types: Allow images and samplers in get_explicit_type_for_size_align
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand 0021d3ae87 compiler/types: Assert non-zero alignments in get_explicit_type_for_size_align
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand ef68f740a6 nir/lower_io: Assert non-zero power-of-two alignments
The way the ALIGN_POT macro works, an alignment of 0 may cause
ALIGN_POT(x, 0) to return 0 for any x.  Throw in an assert to guard
against this case.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand 589d918a4f spirv: Add 0.5 to integer coordinates for OpImageSampleExplicitLod
Just casting to a float is insufficient because that gives us the upper-left corner
of the texel rather than the center.

Fixes: 701cb9d60c "nir/vtn: Handle integer sampling coordinates"

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
2020-10-20 23:46:42 +02:00
Jason Ekstrand 2015a109ff anv,iris: Use the data cache for UBO pulls on Gen12+
Now that we have the HDC, using the data cache for UBO pulls seems to
help things quite a bit:

    GTA V DXVK              104.0%
    Talos Principle GL      102.8%
    Rise of Tomb Raider VK  102.8%
    Dark Souls 3 DXVK       101.4%
    Witcher3 DXVK           101.3%
    Bioshock Infinite GL    100.5%
    Doom 2016 VK            97.7%

Doom is a bit of a loss but it helps enough other stuff, it's probably
worth the hit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7230>
2020-10-20 19:54:29 +00:00
Jason Ekstrand cdc546ae7f iris: Flush caches based on brw_compiler::indirect_ubos_use_sampler
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7230>
2020-10-20 19:54:29 +00:00
Marijn Suijten fa483d8cd1 android: gallium/auxiliary: Deduplicate nir_to_tgsi.c inclusion
Both commits add nir_to_tgsi.c to a different variable, causing a
build-time error when compiling in an AOSP tree:

    build/make/core/binary.mk:970: error: overriding commands for target `..../obj/STATIC_LIBRARIES/libmesa_gallium_intermediates/nir/nir_to_tgsi.o', previously defined at build/make/core/binary.mk:970

Move all sources into NIR_SOURCES to resolve this issue.

Fixes: d0f8fe5909 ("softpipe: Switch to using NIR as the shader format from mesa/st.")
Fixes: 34cc6a804e ("gallium: Add a nir-to-TGSI pass.")

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7237>
2020-10-20 19:17:52 +00:00
Eric Anholt 0f82c99c4e docs: Document how to build and install Android drivers.
This is what I've been using so far.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt c4f8d421df meson: Don't enable libunwind by in 'auto' mode on Android.
On Android we're expected to use their backtrace library.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt f2a27d72de meson: Don't try to build GLX by default on Android.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt e3c330c7b2 freedreno: Use Android's libsync instead of libdrm's.
This should be equivalent, given that we only support the DRM backend so
far, but we'll want to have the compatibility for future KGSL freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7227>
2020-10-20 18:29:38 +00:00
Eric Anholt 81a0f1eca2 meson: Only require libexpat when a part of the build needs it.
Now that xmlconfig can be built without libexpat on Android, we can make
android builds not require the presence of libexpat for many drivers.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7223>
2020-10-20 18:16:26 +00:00
Michael Olbrich 442a769600 meson.build: xxf86vm is not needed for -Dglx-direct=false
It is only used in src/glx/glxcmds.c and when GLX_DIRECT_RENDERING is
defined.
So only depend on it if GLX direct rendering is actually enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1905>
2020-10-20 17:58:45 +00:00
Eric Anholt d0f8fe5909 softpipe: Switch to using NIR as the shader format from mesa/st.
This causes our TGSI to use far more temps, since NTT is currently not
releasing temps from registers.  On the other hand, this interpreter is
already spectacularly slow, and if we wanted to go fast we should probably
write a scalar NIR intrepeter.

For now, using NTT means that we test that codepath in preparation for
switching TGSI-consuming HW drivers over, so that we can eventually
garbage collect st_glsl_to_tgsi.

As this is a major restructuring, there are some impacts on piglit:

- Several tests start assert failing about 64-bit NIR registers for temp
  arrays not getting split to vec2s:
  - fs-frexp-dvec4-variable-index.shader_test
  - arb_gpu_shader_fp64/uniform_buffers/{vs,fs,gs}-array-copy.shader_test
  - arb_gpu_shader_int64/execution/indirect-array-two-accesses.shader_test
- dEQP-GLES31.functional.primitive_bounding_box.wide_points.global_state.vertex_geometry_fragment.fbo_bbox_larger
  starts crashing depending on various bits of state (previous tests run
  before it, presence of valgrind, presence of glib's memcheck).  Doesn't
  seem really NTT-specific, added to flakes list with other GS flakes.
- Almost 200 fp64/int64-related tests start passing, mostly around i/o loayout.

shader-db:
total instructions in shared programs: 3492656 -> 3081674 (-11.77%)
total loops in shared programs: 1418 -> 1387 (-2.19%)
total temps in shared programs: 340041 -> 615527 (81.02%)
total const in shared programs: 3158970 -> 1528630 (-51.61%)
total imm in shared programs: 117586 -> 101349 (-13.81%)
Total CPU time (seconds): 430.36 -> 900.94 (109.35%)

FPS results:
glmark2 texture               +7.32484% +/- 3.76528% (n=10)
glmark2 desktop:effect=shadow +20%      +/- 0% (n=10)
glmark2 shadow                +6.49351% +/- 3.65335% (n=7)
glmark2 conditionals          +18.75%   +/- 2.74658% (n=9)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3395>
2020-10-20 08:54:06 -07:00
Eric Anholt 6444f5702d softpipe: Fix buffer overflows in SSBO atomics.
SSBO atomics are always to the .x channel, but we were doing reads on
.xyzw and writes to whatever the writemask was.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3395>
2020-10-20 08:54:06 -07:00