platform/upstream/mesa.git
3 years agoasm: Fix x86 assembly for inverse matrix operations
Kenneth Graunke [Wed, 2 Dec 2020 22:38:07 +0000 (14:38 -0800)]
asm: Fix x86 assembly for inverse matrix operations

In commit 3175b63a0dfa290430f9f7eb651387788933a02b, Marek stopped
allocating the GLmatrix::inv field with malloc, instead embedding
it directly in the structure.  So, we need to drop a level of
indirection here and use (matrix pointer + MATRIX_INV) as the
inverse matrix array directly, rather than reading a pointer at
that offset and chasing it.

Fixes: 3175b63a0df ("mesa: don't allocate matrices with malloc")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7889>

3 years agodocs: add release schedule for 20.3
Dylan Baker [Thu, 3 Dec 2020 18:30:04 +0000 (10:30 -0800)]
docs: add release schedule for 20.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: update calendar and link releases notes for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 18:28:25 +0000 (10:28 -0800)]
docs: update calendar and link releases notes for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: Add sha256 sums for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 18:22:55 +0000 (10:22 -0800)]
docs: Add sha256 sums for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agodocs: add release notes for 20.3.0
Dylan Baker [Thu, 3 Dec 2020 17:49:56 +0000 (09:49 -0800)]
docs: add release notes for 20.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7906>

3 years agoturnip: implement z-scaling and z-mirroring BlitImage
Jonathan Marek [Thu, 26 Nov 2020 01:54:32 +0000 (20:54 -0500)]
turnip: implement z-scaling and z-mirroring BlitImage

Z scaling case without nearest filter needs a 3D texture, so add a 3D
texture path and use it to cover all scaling/mirroring cases.

The "rotation" argument for the clear/blit "setup" function is replaced
with a more generic "blit_param", which has a different meaning for the
3D blit path. (to avoid having too many arguments)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7781>

3 years agomeson.build: Order the flex/bison by odds of them working
Zack Rusin [Thu, 26 Nov 2020 16:50:06 +0000 (08:50 -0800)]
meson.build: Order the flex/bison by odds of them working

Some flex/bison installs on windows include yacc and lex
as bash scripts that call bison/flex binaries. That creates
an extra layer of dependencies because those won't work from
plain cmd.exe/powershell. Lets switch the lookup order so that
by default we pickup vanilla binaries instead of scripts.

Reviewd-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson.build: Disable zlib as per -Dzlib option
Neha Bhende [Thu, 26 Nov 2020 16:48:38 +0000 (08:48 -0800)]
meson.build: Disable zlib as per -Dzlib option

Disable use of zlib as per -Dzlib option.
Default value is true. To disable zlib usage, specify -Dzlib=false

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson.build: Use SSE math for MinGW X86 build as per sse2 option
Neha Bhende [Thu, 26 Nov 2020 16:47:10 +0000 (08:47 -0800)]
meson.build: Use SSE math for MinGW X86 build as per sse2 option

This patch adds missing compiler flags to build 32bit driver. It helps to build 32bit
using mingw successfully

Generated GL driver is tested using piglit, glretrace, conform and
some opengl apps

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agomeson: Don't build svgadrm on windows
Neha Bhende [Thu, 26 Nov 2020 16:45:54 +0000 (08:45 -0800)]
meson: Don't build svgadrm on windows

Building svgadrm module on window platform is not required.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7806>

3 years agogallium/targets/libgl-gdi: prefer d3d12 driver
Erik Faye-Lund [Sun, 26 May 2019 08:43:57 +0000 (10:43 +0200)]
gallium/targets/libgl-gdi: prefer d3d12 driver

Unlike the other drivers, the D3D12 driver is hardware accelerated, so
it's going to be a more reasonable choice. So let's prefer it.

This only matters for people who build with the D3D12 driver. And they
can set the GALLIUM_DRIVER environment variable as appropriate to
override it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7534>

3 years agolavapipe: set some basic usage-flags
Erik Faye-Lund [Wed, 2 Dec 2020 16:18:21 +0000 (17:18 +0100)]
lavapipe: set some basic usage-flags

Setting these avoids a few warnings while running glxgears on Zink on
Lavapipe. There's a lot more flags to set here, but this is better than
nothing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7879>

3 years agonir/opt_sink: use common instruction removal/insertion helpers
Rhys Perry [Wed, 2 Dec 2020 16:03:32 +0000 (16:03 +0000)]
nir/opt_sink: use common instruction removal/insertion helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7880>

3 years agogallium/u_threaded: disable forced staging upload at runtime
Pierre-Eric Pelloux-Prayer [Fri, 27 Nov 2020 14:14:07 +0000 (15:14 +0100)]
gallium/u_threaded: disable forced staging upload at runtime

If a conflict caused by the forced staging optimization is detected,
disable it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agogallium/u_threaded: fix staging and non-staging conflicts
Pierre-Eric Pelloux-Prayer [Mon, 12 Oct 2020 11:28:37 +0000 (13:28 +0200)]
gallium/u_threaded: fix staging and non-staging conflicts

In the following sequence:
  - transfer_map(buffer, DISCARD) // use staging upload
  - memcpy(...)
  - transfer_unmap
  - draw
  - transfer_map(buffer, UNSYNCHRONIZED) // non-staging upload
  - memcpy(...)
  - draw

Currently the order of operations is:
  - map#1 - staging buffer
  - memcpy to staging buffer
  - map#2
  - memcpy to buffer
  - staging buffer copy to real buffer
  - draw#1
  - draw#2

When the 2nd map operation doesn't use UNSYNCHRONIZED, the tc_sync_msg() call
will make sure that the bo is unused before mapping it.

But, if it does use UNSYNCHRONIZED and the mapped intervals overlap this commit
clears the UNSYNCHRONIZED to make sure ordering is maintained.

This will affect performance, but correct output is better than fast output.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/3611.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agoRevert "Revert "radeonsi: use staging buffer uploads for most VRAM buffers""
Pierre-Eric Pelloux-Prayer [Mon, 16 Nov 2020 14:29:15 +0000 (15:29 +0100)]
Revert "Revert "radeonsi: use staging buffer uploads for most VRAM buffers""

This reverts commit af0435cbfe61632407ce135fbea9cab6fe1e4fb6.

This optimization is useful for some applications (eg: issue 3759), so re-enable it.

The next 2 commits will address 2 short comings of this optimization.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3759
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7098>

3 years agonir: gather if a fragment shader uses sample shading
Samuel Pitoiset [Wed, 2 Dec 2020 15:18:13 +0000 (16:18 +0100)]
nir: gather if a fragment shader uses sample shading

This introduces a new flag in shader_info to know if a fragment
shader uses sample shading, even if there is no inputs.

During NIR linking, constants varyings are optimized and the
per-sample interpolation info (ie. the sample qualifier) might
be removed if nir_shader_gather_info() is called again.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7876>

3 years agoglx: Claim to support more GL versions in __glX_send_client_info
Adam Jackson [Thu, 29 Oct 2020 18:29:49 +0000 (14:29 -0400)]
glx: Claim to support more GL versions in __glX_send_client_info

It's a little unclear from the GLX_ARB_create_context spec whether the
list of supported extensions means what the client supports at all, or
what it knows an indirect GLX encoding for. You'd think it could only
really matter for indirect, since the only way the server would know
about GL commands (as opposed to GLX commands) is if the context was
indirect. And indeed for Xorg's GLX it doesn't matter, because it
doesn't check this, assuming that anything a direct client says works
works, and clamping the GL version based on the protocol it has code
for.

But if you're NVIDIA, apparently, you check this even for direct
contexts. And since drisw creates a nominally "direct" context, this
means llvmpipe and friends get clamped to 3.0 for desktop GL (since
that's as far as the protocol is defined) and can't do GLES at all.

So, whatever, just go ahead and claim to support everything. The wire
representation of the supported versions is strange (see comments in the
code) but it matches what NVIDIA does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7369>

3 years agoglx/indirect: Validate the context version in CreateContextAttribs
Adam Jackson [Tue, 10 Nov 2020 21:23:23 +0000 (16:23 -0500)]
glx/indirect: Validate the context version in CreateContextAttribs

This is Sort Of handled by nerfing GL_VERSION in __indirect_glGetString,
but that doesn't cover GLES contexts which we also don't have any
indirect support for. Xorg's GLX would reject this for us since it has
the same limitation, but NVIDIA's GLX seems to interpret a request for
ES 2.0 as desktop, despite having the ES2 profile bit set, leading to a
very confusing GL_VERSION string and probably not the ES2-compatible
context you were hoping for.

Since we may now return NULL from indirect_create_context_attribs for
reasons other than malloc failure, we need to reasonably handle the case
where gc == NULL by the time we get to the XCB call. We rely on the
server to generate correct return values in this case, but if it
succeeds despite our client-side failure we just throw GLXBadFBConfig
(chosen to keep piglit/glx-create-context-core-profile happy, since
nothing else seems to hit it).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7369>

3 years agolavapipe: add support for VK_KHR_indirect_draw_count
Dave Airlie [Fri, 27 Nov 2020 08:21:17 +0000 (18:21 +1000)]
lavapipe: add support for VK_KHR_indirect_draw_count

Just hooks up the new cmds to the gallium draw API

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agolavapipe: enable post depth coverage
Dave Airlie [Mon, 23 Nov 2020 19:43:48 +0000 (05:43 +1000)]
lavapipe: enable post depth coverage

This just works.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agolavapipe: enable VK_EXT_shader_stencil_export
Dave Airlie [Mon, 23 Nov 2020 07:28:07 +0000 (17:28 +1000)]
lavapipe: enable VK_EXT_shader_stencil_export

This should just work.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7888>

3 years agoCI: Add llvmpipe- prefix to Piglit jobs
Daniel Stone [Wed, 2 Dec 2020 14:01:17 +0000 (14:01 +0000)]
CI: Add llvmpipe- prefix to Piglit jobs

To make it easier to differentiate now that llvmpipe & softpipe are
lumped into the same stage.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Reorder non-hardware stages last
Daniel Stone [Wed, 2 Dec 2020 13:57:47 +0000 (13:57 +0000)]
CI: Reorder non-hardware stages last

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse lima & panfrost stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse lima & panfrost stages into one

This is now called 'arm'; even though they're two separate drivers, it
does help cut down on some of the more egregious horizontal scrolling.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse virgl & d3d12 stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse virgl & d3d12 stages into one

This is now called 'layered-backends'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse radv & radeonsi stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse radv & radeonsi stages into one

This is now called 'amd'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse llvmpipe & softpipe stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse llvmpipe & softpipe stages into one

This is now called 'software-renderer'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoCI: Collapse SCons & meson-misc stages into one
Daniel Stone [Wed, 2 Dec 2020 13:50:38 +0000 (13:50 +0000)]
CI: Collapse SCons & meson-misc stages into one

This is now called 'build-misc'.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7873>

3 years agoutil: unbreak on BSDs after MSVC changes
Jan Beich [Thu, 3 Dec 2020 00:22:38 +0000 (00:22 +0000)]
util: unbreak on BSDs after MSVC changes

src/util/os_misc.c:352:2: error: unexpected platform in os_sysinfo.c
 #error unexpected platform in os_sysinfo.c
  ^

Fixes: cdf3a6a83b50 ("util: Add os_get_page_size query")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7887>

3 years agofreedreno: Break out of "should we free the entry" loop once we've freed.
Eric Anholt [Tue, 1 Dec 2020 21:47:28 +0000 (13:47 -0800)]
freedreno: Break out of "should we free the entry" loop once we've freed.

Fixes a use-after-free of the state on the next iteration when it was
probably just destroyed.

Fixes: 6de01faac5a2 ("freedreno/a6xx: invalidate tex state cache entries on rebind")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of currently bound UBOs at CSO context destruction.
Eric Anholt [Wed, 18 Nov 2020 19:31:33 +0000 (11:31 -0800)]
gallium: Fix leak of currently bound UBOs at CSO context destruction.

Cc: mesa-stable
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallivm: Fix max const buffer count.
Eric Anholt [Mon, 30 Nov 2020 23:23:04 +0000 (15:23 -0800)]
gallivm: Fix max const buffer count.

llvmpipe was reporting 32 max const buffers, while sizing its arrays to 16
according to gallivm's #define.

Fixes: 1d35f77228ad ("gallivm,llvmpipe,draw: Support multiple constant buffers.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of bound SSBOs at CSO context destruction.
Eric Anholt [Wed, 18 Nov 2020 19:23:30 +0000 (11:23 -0800)]
gallium: Fix leak of bound SSBOs at CSO context destruction.

Cc: mesa-stable
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agomeson: Remove old todo comment about pthread stubs.
Eric Anholt [Wed, 18 Nov 2020 18:18:21 +0000 (10:18 -0800)]
meson: Remove old todo comment about pthread stubs.

Noticed while making my last change.  pthread stubs are long dead, we
actually use threads all over now.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agoegl: Skip closing drivers when building with AddressSanitizer.
Eric Anholt [Wed, 18 Nov 2020 00:50:36 +0000 (16:50 -0800)]
egl: Skip closing drivers when building with AddressSanitizer.

If you dlclose your driver, the leak reports look like:

    #0 0xffff9c7e5e7c in malloc (/lib/aarch64-linux-gnu/libasan.so.6+0x9ee7c)
    #1 0xffff94aaaa48  (<unknown module>)
    #2 0xffff94aa5ff4  (<unknown module>)
    #3 0xffff94d1867c  (<unknown module>)
    #4 0xffff94d184f0  (<unknown module>)
    #5 0xffff94c9a990  (<unknown module>)
    #6 0xffff94c92e30  (<unknown module>)
    #7 0xffff94c91d48  (<unknown module>)
    #8 0xffff946eb800  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0xfe800)
    #9 0xffff94c72874  (<unknown module>)
    #10 0xffff946ede68  (/home/anholt/src/mesa/build-aarch64-asan/src/egl/libEGL.so.1.0.0+0x100e68)
    #11 0xffff94bf7134  (<unknown module>)
    #12 0xffff9c686450 in dri2_create_screen ../src/egl/drivers/dri2/egl_dri2.c:1079

which is not terribly useful.  Probe if we're building with asan and just
skip closing the driver in the happy path (which seems to be the standard
practice for loadable modules with this tool).

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agofreedreno: Fix leak of u_transfer_helper.
Eric Anholt [Wed, 18 Nov 2020 00:42:00 +0000 (16:42 -0800)]
freedreno: Fix leak of u_transfer_helper.

Fixes: d1465b3aeee3 ("freedreno: use u_transfer_helper")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agogallium: Fix leak of the merged driconf options.
Eric Anholt [Wed, 18 Nov 2020 00:37:41 +0000 (16:37 -0800)]
gallium: Fix leak of the merged driconf options.

Fixes: 8a05d6ffc65d ("driconf: Make the driver's declarations be structs instead of XML.")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agofreedreno/afuc: Fix up some sprintf format security warnings.
Eric Anholt [Tue, 17 Nov 2020 23:48:48 +0000 (15:48 -0800)]
freedreno/afuc: Fix up some sprintf format security warnings.

Showed up when I tried enabling asan.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>

3 years agoegl/dri2: Drop some pointless ifdeffery
Rob Clark [Wed, 2 Dec 2020 17:08:41 +0000 (09:08 -0800)]
egl/dri2: Drop some pointless ifdeffery

The fallback is already `return true;`

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7864>

3 years agoegl/surfaceless: glthread support
Rob Clark [Wed, 25 Nov 2020 19:38:00 +0000 (11:38 -0800)]
egl/surfaceless: glthread support

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7864>

3 years agoutil: Disable [[fallthrough]] for C17
James Park [Tue, 1 Dec 2020 19:12:56 +0000 (11:12 -0800)]
util: Disable [[fallthrough]] for C17

[[fallthrough]] is not a C17 feature, and MSVC does not support it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7862>

3 years agoci: Go back to previous ci-templates commit for debian.yml
Michel Dänzer [Wed, 2 Dec 2020 16:37:16 +0000 (17:37 +0100)]
ci: Go back to previous ci-templates commit for debian.yml

The newer commit broke the arm64_test container build.

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

v2:
* Also bump all image tags which had been bumped in the meantime

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7883>

3 years agozink: do not require VK_KHR_external_memory
Erik Faye-Lund [Wed, 2 Dec 2020 16:21:12 +0000 (17:21 +0100)]
zink: do not require VK_KHR_external_memory

This is only required for the DRI-path. For the swrast code-path, we
don't need this.

We also don't need to explicitly test for it in the DRI-path, because we
test for KHR_external_memory_fd, which depends on KHR_external_memory. So
no implementation will expose the former without the latter.

Fixes: f1432fd3e2d ("zink: generate extension infrastructure using a python script")
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7882>

3 years agoclover: Use .def files for exports on Windows
Jesse Natalie [Thu, 19 Nov 2020 16:47:02 +0000 (08:47 -0800)]
clover: Use .def files for exports on Windows

v2: Move .def files to opencl target

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/api: Support MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:37:54 +0000 (18:37 -0800)]
clover/api: Support MSVC

Three things:
1. MSVC dislikes mismatching declaration/definition of __declspec(dllexport).
   Since CL headers don't have the declspec, the implementations should't either.
2. An unnamed brace-initialization gets deduced as an initializer list, instead
   of a brace-constructed string. Just add the type name.
3. posix_memalign doesn't exist on Windows.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/core: Support MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:37:03 +0000 (18:37 -0800)]
clover/core: Support MSVC

Constructing a class where the class name is wrapped in parens
doesn't work with MSVC. I see no good reason to do that so drop
the parens. Also, use a generic page size helper instead of hardcoding
something OS-specific.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover/llvm: Work around MSVC quirks
Jesse Natalie [Thu, 19 Nov 2020 02:34:07 +0000 (18:34 -0800)]
clover/llvm: Work around MSVC quirks

Two things:
1. While instantiating a template where clover::llvm and ::llvm are
   both resolvable for unscoped llvm, MSVC complains about ambiguity.
   Resolve by not using namespace clover, leaving only ::llvm as a
   valid namespace.
2. LLVM headers (specifically Allocator.h) use __declspec(restrict),
   but Mesa's util headers #define restrict to __restrict for C++.
   Since __declspec(__restrict) is invalid, make sure we always include
   Allocator.h first before the util header.
3. Change a uint/int to uint64_t to match the type returned from LLVM.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Fix property_element::as for MSVC
Jesse Natalie [Thu, 19 Nov 2020 02:32:27 +0000 (18:32 -0800)]
clover: Fix property_element::as for MSVC

MSVC doesn't like reinterpret_cast<T>(val) where neither T nor val
are pointers. It needs to be a static cast instead.

v2: Update assert to static_assert

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agomeson: Adjust Clover's required LLVM modules
Jesse Natalie [Thu, 19 Nov 2020 02:30:30 +0000 (18:30 -0800)]
meson: Adjust Clover's required LLVM modules

When coming from CMake, all-targets doesn't exist, and Clover's
mechanism for finding Clang apparently requires the OpenMP frontend
lib but doesn't automatically pull it in.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Add version.lib dependency for Clang on Windows
Jesse Natalie [Thu, 19 Nov 2020 02:29:25 +0000 (18:29 -0800)]
clover: Add version.lib dependency for Clang on Windows

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Support LLVM coming from CMake instead of config-tool
Jesse Natalie [Thu, 19 Nov 2020 02:28:49 +0000 (18:28 -0800)]
clover: Support LLVM coming from CMake instead of config-tool

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoclover: Add opencl-native build flag
Jesse Natalie [Thu, 19 Nov 2020 02:27:07 +0000 (18:27 -0800)]
clover: Add opencl-native build flag

This flag controls whether to include native codegen functionality
for the AMD backend

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agogallium: Remove unnecessary forward declaration of swrast_driver_descriptor
Jesse Natalie [Thu, 19 Nov 2020 02:19:13 +0000 (18:19 -0800)]
gallium: Remove unnecessary forward declaration of swrast_driver_descriptor

MSVC complains that the definition has __declspec(dllexport) but the
forward declaration doesn't. I can't find any users of this decl in
the header.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agogallium: Include winsock lib as a dependency for Windows
Jesse Natalie [Thu, 19 Nov 2020 02:17:45 +0000 (18:17 -0800)]
gallium: Include winsock lib as a dependency for Windows

The gallium aux lib includes code that calls socket APIs. On Windows,
these APIs come from ws2_32.lib/dll (winsock2), so make sure consumers
link against that lib.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agodriconf: Avoid empty macro resulting in empty initializer braces
Jesse Natalie [Thu, 19 Nov 2020 02:16:10 +0000 (18:16 -0800)]
driconf: Avoid empty macro resulting in empty initializer braces

MSVC is unhappy with empty initializer braces while compiling C

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoutil: Add os_get_page_size query
Jesse Natalie [Thu, 19 Nov 2020 02:15:22 +0000 (18:15 -0800)]
util: Add os_get_page_size query

No Apple/BSD implementation yet, I have no idea how to do that

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agowindows: Always set NOMINMAX to remove min/max macros
Jesse Natalie [Thu, 19 Nov 2020 02:14:41 +0000 (18:14 -0800)]
windows: Always set NOMINMAX to remove min/max macros

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>

3 years agoanv: Avoid a couple of warnings related to vk_error macros
Caio Marcelo de Oliveira Filho [Tue, 1 Dec 2020 17:45:35 +0000 (08:45 -0900)]
anv: Avoid a couple of warnings related to vk_error macros

When DEBUG is not defined, no error reporting is done, the error is
just returned back.  The current definition a couple of warnings in
anv_formats.c.  First when the return value is intentionally ignored

  ../src/intel/vulkan/anv_formats.c:989:48: warning: statement with no effect [-Wunused-value]
    989 |          vk_errorfi(instance, physical_device, VK_ERROR_FORMAT_NOT_SUPPORTED,
        |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../src/intel/vulkan/anv_private.h:486:55: note: in definition of macro ‘vk_errorfi’
    486 | #define vk_errorfi(instance, obj, error, format, ...) error
        |                                                       ^~~~~

and also when an argument is used only

  ../src/intel/vulkan/anv_formats.c:908:25: warning: unused variable ‘instance’ [-Wunused-variable]
    908 |    struct anv_instance *instance = physical_device->instance;
        |                         ^~~~~~~~
  ../src/intel/vulkan/anv_formats.c: In function ‘anv_GetPhysicalDeviceImageFormatProperties2’:
  ../src/intel/vulkan/anv_formats.c:1231:25: warning: unused variable ‘instance’ [-Wunused-variable]
   1231 |    struct anv_instance *instance = physical_device->instance;
        |                         ^~~~~~~~

to avoid both issues, use a static inline function that just returns
it's argument but can consume other input. Ignoring the return value
of a function is OK, and the extra input can be tagged as UNUSED
getting rid of both warnings.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7860>

3 years agonir/opt_sink: return early when trying to sink unused instructions
Daniel Schürmann [Wed, 2 Dec 2020 14:34:26 +0000 (15:34 +0100)]
nir/opt_sink: return early when trying to sink unused instructions

Fixes: 5f6c5e5b86f366c6fe0a0911fdc1926f1e0d1d5f ('nir: don't sink instructions into loops')

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7874>

3 years agov3dv: fix early return from failed drmGetMagic
Iago Toral Quiroga [Wed, 2 Dec 2020 06:57:32 +0000 (07:57 +0100)]
v3dv: fix early return from failed drmGetMagic

v2: Log more detail to stderr upon failure (Chema)

Fixes: b14679ab226 ('v3dv: check return value of drmGetMagic')
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7865>

3 years agofreedreno: Add missing dependency to build
Daniel Stone [Wed, 2 Dec 2020 13:10:21 +0000 (13:10 +0000)]
freedreno: Add missing dependency to build

computerator depends on ir3_parser.h, which is a generated file, but
this dependency is not expressed in the build.

Fixes: 1e8808a4a0f ("freedreno/ir3: refactor out helper to compile shader from asm")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7870>

3 years agoglx: Fix the generated error when indirect contexts are not supported
Adam Jackson [Tue, 1 Dec 2020 15:53:41 +0000 (10:53 -0500)]
glx: Fix the generated error when indirect contexts are not supported

When the server doesn't support indirect contexts it will generate a
BadValue error, since the CreateContext request's isDirect field will
have specified an unsupported value of False. We attempt to verify that
context creation succeeded by asking whether the context's XID is direct
or not after we create it. Due to the details of XCB error handling, if
the context wasn't successfully created, the GLXBadContext error from
the GLXIsDirect request will get raised first, hiding the BadValue from
the application.

To fix this, we change the behavior of __glXIsDirect based on the
`error` outparameter. If it is NULL we still raise the error generated
from the GLXIsDirect request, but if it is non-NULL we now just inform
the caller that the request failed and silently eat the error. By doing
this the BadValue (or whatever else) from the CreateContext request will
bubble up to the application as expected.

This is admittedly a bit subtle but it's the simplest way to get to the
fix here. A better solution would be to convert all of CreateContext to
XCB, but XCB doesn't have protocol for GLX_SGIX_fbconfig yet so we'd
lose glXCreateContextWithConfigSGIX.

Fixes: mesa/mesa#3907
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7859>

3 years agoglx: Simplify error handling in glXImportContextEXT
Adam Jackson [Tue, 1 Dec 2020 15:49:03 +0000 (10:49 -0500)]
glx: Simplify error handling in glXImportContextEXT

The GLXIsDirect request will throw GLXBadContext for us if it needs to,
so we can avoid synthesizing an error on the client side.

Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7859>

3 years agomicrosoft/clc: increase test-timeout
Erik Faye-Lund [Wed, 2 Dec 2020 13:45:20 +0000 (14:45 +0100)]
microsoft/clc: increase test-timeout

The test "clc_compiler_test" is kinda nasty in packing too many things
into a single test, making it awkwardly long. We should really consider
splitting it up into multiple tests instead.

But right now, it's sometimes timing out on CI, which is bad, so here's
a quick band-aid to prevent this from happening.

The previous timeout of two minutes seems to not always be sufficient
under various loads, so let's add another minute just to be sure.

Here's an example of a failure with the current timeout:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/5918980#L1589

Fixes: ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7872>

3 years agoegl: fix typo in wl_drm error message
Simon Ser [Tue, 1 Dec 2020 13:21:56 +0000 (14:21 +0100)]
egl: fix typo in wl_drm error message

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7854>

3 years agoetnaviv: update fallthrough comments
Christian Gmeiner [Tue, 1 Dec 2020 11:17:13 +0000 (12:17 +0100)]
etnaviv: update fallthrough comments

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7849>

3 years agomicrosoft/clc: add missing dependency
Erik Faye-Lund [Wed, 2 Dec 2020 12:20:58 +0000 (13:20 +0100)]
microsoft/clc: add missing dependency

We include git_sha1.h in clc_compiler.c, so we should also make sure we
depend on the header being generated in time. This fixes a spurious
build error when compiling with many cores, like we do on CI.

Fixes: ff05da7f8dc ("microsoft: Add CLC frontend and kernel/compute support to DXIL converter")
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7869>

3 years agomicrosoft/clc: use files-function for source-list
Erik Faye-Lund [Wed, 2 Dec 2020 12:18:48 +0000 (13:18 +0100)]
microsoft/clc: use files-function for source-list

This makes things a bit more explicit, and is generally what we seem to
do around in the source-tree.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7869>

3 years agozink: moved vkEnumerateInstanceVersion to create_instance
Duncan Hopkins [Tue, 10 Nov 2020 15:07:07 +0000 (15:07 +0000)]
zink: moved vkEnumerateInstanceVersion to create_instance

Moved the call to vkEnumerateInstanceVersion() into the create_instance() function,
so the result can be passed into the application apiVersion.
Will stop drivers from limiting a devices supported api version.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7533>

3 years agogitlab-ci: do not clone git-repo for test-job
Erik Faye-Lund [Wed, 2 Dec 2020 10:28:31 +0000 (11:28 +0100)]
gitlab-ci: do not clone git-repo for test-job

The only thing we really need from the git-repo is the piglit_run.ps1
script, so let's upload that into our artifacts instead.

Fixes: d560addc30e ("gitlab-ci: run piglit on windows")
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7867>

3 years agomeson: Add build option to specify default shader disk cache max-size
Yevhenii Kharchenko [Sat, 17 Oct 2020 20:43:59 +0000 (23:43 +0300)]
meson: Add build option to specify default shader disk cache max-size

Added an optional 'shader-cache-max-size' build option to meson,
which sets default value of max disk cache size for compiled
GLSL programs. Can be overriden by 'MESA_GLSL_CACHE_MAX_SIZE'
environment variable.
Syntax is the same as environment variable has: a number optionally
followed by K, M, G to specify a size in kilobytes, megabytes, or
gigabytes. By default, gigabytes will be assumed.

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

Signed-off-by: Yevhenii Kharchenko <yevhenii.kharchenko@globallogic.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7217>

3 years agoradv: Use portable ffs and util_bitcount macros
James Park [Fri, 27 Nov 2020 03:33:58 +0000 (19:33 -0800)]
radv: Use portable ffs and util_bitcount macros

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Replace pthread thread with thrd_t
James Park [Fri, 27 Nov 2020 03:31:42 +0000 (19:31 -0800)]
radv: Replace pthread thread with thrd_t

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Replace pthread mutex with mtx_t
James Park [Fri, 27 Nov 2020 03:30:47 +0000 (19:30 -0800)]
radv: Replace pthread mutex with mtx_t

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Use unsigned with u_bit_scan for MSVC
James Park [Fri, 27 Nov 2020 03:28:32 +0000 (19:28 -0800)]
radv: Use unsigned with u_bit_scan for MSVC

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Create shader cache if ENABLE_SHADER_CACHE
James Park [Fri, 27 Nov 2020 03:16:51 +0000 (19:16 -0800)]
radv: Create shader cache if ENABLE_SHADER_CACHE

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Use standard __VA_ARGS__ macro
James Park [Fri, 27 Nov 2020 03:15:26 +0000 (19:15 -0800)]
radv: Use standard __VA_ARGS__ macro

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Fix function parameter types
James Park [Tue, 1 Dec 2020 19:08:50 +0000 (11:08 -0800)]
radv: Fix function parameter types

Avoids unnecessary type aliasing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Fix leak in radv_amdgpu_winsys_destroy()
James Park [Fri, 27 Nov 2020 03:12:26 +0000 (19:12 -0800)]
radv: Fix leak in radv_amdgpu_winsys_destroy()

Fixes: fa97061a823 ("radv/winsys: Add binary syncobj ABI changes for timeline semaphores.")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Fix callback signatures
James Park [Fri, 27 Nov 2020 03:11:33 +0000 (19:11 -0800)]
radv: Fix callback signatures

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Update radv_assert for MSVC
James Park [Fri, 27 Nov 2020 03:08:57 +0000 (19:08 -0800)]
radv: Update radv_assert for MSVC

MSVC hates parentheses in radv_assert, so replace with do/while(0).

Also switch nonstandard DEBUG with standard NDEBUG, which Aco uses.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Ignore radv_printflike on Windows
James Park [Fri, 27 Nov 2020 03:07:56 +0000 (19:07 -0800)]
radv: Ignore radv_printflike on Windows

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Don't return value in void function
James Park [Fri, 27 Nov 2020 03:03:49 +0000 (19:03 -0800)]
radv: Don't return value in void function

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Use os_localtime instead of localtime_r
James Park [Fri, 27 Nov 2020 03:00:01 +0000 (19:00 -0800)]
radv: Use os_localtime instead of localtime_r

Cross-platform abstraction that works with MSVC.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Wrap pragmas with __GNUC__ to fix MSVC
James Park [Fri, 27 Nov 2020 02:57:47 +0000 (18:57 -0800)]
radv: Wrap pragmas with __GNUC__ to fix MSVC

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Replace VLAs with alloca
James Park [Fri, 27 Nov 2020 02:47:02 +0000 (18:47 -0800)]
radv: Replace VLAs with alloca

MSVC does not support VLAs.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Update build defines for Windows
James Park [Fri, 27 Nov 2020 02:44:46 +0000 (18:44 -0800)]
radv: Update build defines for Windows

Add VK_USE_PLATFORM_WIN32_KHR.

Use VK_NO_PROTOTYPES to deal with __declspec(dllexport) mismatch.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agoradv: Exclude amdgpu driver files for Windows
James Park [Fri, 27 Nov 2020 02:43:11 +0000 (18:43 -0800)]
radv: Exclude amdgpu driver files for Windows

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>

3 years agogitlab-ci: ignore nv_copy_depth_to_color
Erik Faye-Lund [Tue, 1 Dec 2020 16:10:06 +0000 (17:10 +0100)]
gitlab-ci: ignore nv_copy_depth_to_color

This seems to be spuriously changing between crash and fail, so let's
skip it for now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>

3 years agogitlab-ci: run piglit on windows
Erik Faye-Lund [Wed, 3 Jun 2020 16:06:56 +0000 (18:06 +0200)]
gitlab-ci: run piglit on windows

This tests the D3D12 driver on Windows during CI, to prevent accidental
breakage.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>

3 years agogitlab-ci: build piglit in mesa_deps.ps1
Erik Faye-Lund [Wed, 3 Jun 2020 16:06:56 +0000 (18:06 +0200)]
gitlab-ci: build piglit in mesa_deps.ps1

This will allow us to run Piglit on Windows during CI.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>

3 years agogitlab-ci: build zlib statically on windows
Erik Faye-Lund [Mon, 30 Nov 2020 16:02:15 +0000 (17:02 +0100)]
gitlab-ci: build zlib statically on windows

This avoids having to copy the DLL around when testing.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>

3 years agogitlab-ci: store build-artifacts from building mesa
Erik Faye-Lund [Thu, 4 Jun 2020 20:55:52 +0000 (22:55 +0200)]
gitlab-ci: store build-artifacts from building mesa

GitLab CI doesn't allow us to store artifacts from outside the
build-directory, so let's create an install-directory and install there
instead.

To do this properly, we need to expand a variable inside the
command-line, so we need to change to a double-quoted string.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7857>

3 years agoci: build the Vulkan device select layer
Samuel Pitoiset [Tue, 1 Dec 2020 09:19:57 +0000 (10:19 +0100)]
ci: build the Vulkan device select layer

To avoid breaking the build.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7843>

3 years agovulkan: add missing src_inc to the device select layer
Samuel Pitoiset [Tue, 1 Dec 2020 09:15:40 +0000 (10:15 +0100)]
vulkan: add missing src_inc to the device select layer

Fixes: f86668f487b ("vulkan/util: Consolidate typed_memcpy")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3901
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7843>

3 years agointel/fs: Implement nir_jump_halt
Jason Ekstrand [Thu, 19 Nov 2020 16:16:27 +0000 (10:16 -0600)]
intel/fs: Implement nir_jump_halt

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>

3 years agointel/fs: Emit HALT_TARGET in emit_nir_code()
Jason Ekstrand [Thu, 19 Nov 2020 16:26:44 +0000 (10:26 -0600)]
intel/fs: Emit HALT_TARGET in emit_nir_code()

Instead of making it a fragment-specific thing based on uses_kill, track
whether or not we need one in fs_visitor and emit HALT_TARGET at the end
of emit_nir_code() if needed.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>

3 years agointel/fs: Remove unnecessary HALT_TARGET in opt_redundant_halt()
Jason Ekstrand [Tue, 1 Dec 2020 15:48:30 +0000 (09:48 -0600)]
intel/fs: Remove unnecessary HALT_TARGET in opt_redundant_halt()

This means the pass has to walk all the instructions but it was doing
that in a bunch of cases anyway when it didn't have a HALT_TARGET.
However, removing HALT_TARGET frees up the scheduler a bit because
HALT_TARGET is considered a scheduling barrier.  The shader-db results
are kind-of a wash but we're about to add HALT_TARGET unconditionally so
we want to be able to get rid of it.

Shader-db results on Ice Lake:

    total instructions in shared programs: 19935623 -> 19935623 (0.00%)
    instructions in affected programs: 0 -> 0
    helped: 0
    HURT: 0

    total cycles in shared programs: 976758472 -> 976766135 (<.01%)
    cycles in affected programs: 11097707 -> 11105370 (0.07%)
    helped: 1750
    HURT: 875
    helped stats (abs) min: 1 max: 866 x̄: 26.39 x̃: 4
    helped stats (rel) min: <.01% max: 39.24% x̄: 1.25% x̃: 0.46%
    HURT stats (abs)   min: 1 max: 1678 x̄: 61.54 x̃: 10
    HURT stats (rel)   min: <.01% max: 65.69% x̄: 1.86% x̃: 0.42%
    95% mean confidence interval for cycles value: -2.48 8.32
    95% mean confidence interval for cycles %-change: -0.40% -0.03%
    Inconclusive result (value mean confidence interval includes 0).

    LOST:   62
    GAINED: 46

All of the lost/gained programs are SIMD32 fragment shaders.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>

3 years agointel/fs: Use BRW_OPCODE_HALT for discards
Jason Ekstrand [Mon, 30 Nov 2020 23:24:51 +0000 (17:24 -0600)]
intel/fs: Use BRW_OPCODE_HALT for discards

We're about to start using it to implement nir_jump_halt which has
nothing inherently to do with fragment shaders or discards.  May as well
name it for the HW instruction it generates.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>