Commit Graph

132208 Commits

Author SHA1 Message Date
Erik Faye-Lund 8955980f17 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>
2020-12-03 11:55:47 +00:00
Erik Faye-Lund 843a56324a 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>
2020-12-03 11:27:53 +00:00
Rhys Perry 870724d43b 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>
2020-12-03 11:00:16 +00:00
Pierre-Eric Pelloux-Prayer 45e43445ce 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>
2020-12-03 10:40:23 +01:00
Pierre-Eric Pelloux-Prayer 2900f82e19 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>
2020-12-03 10:40:15 +01:00
Pierre-Eric Pelloux-Prayer a5e0a2e101 Revert "Revert "radeonsi: use staging buffer uploads for most VRAM buffers""
This reverts commit af0435cbfe.

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>
2020-12-03 10:40:06 +01:00
Samuel Pitoiset 128b2de63b 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>
2020-12-03 08:24:05 +01:00
Adam Jackson c0aa3c8323 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>
2020-12-03 04:40:28 +00:00
Adam Jackson f39fd3dce7 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>
2020-12-03 04:40:28 +00:00
Dave Airlie 6a265420dd 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>
2020-12-03 13:19:17 +10:00
Dave Airlie f65b1d22f2 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>
2020-12-03 13:19:13 +10:00
Dave Airlie 0a6e1971ea 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>
2020-12-03 13:19:08 +10:00
Daniel Stone d302481751 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>
2020-12-03 02:03:18 +00:00
Daniel Stone 2609fe3452 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>
2020-12-03 02:03:18 +00:00
Daniel Stone 220a467b7f 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>
2020-12-03 02:03:18 +00:00
Daniel Stone 5673322745 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>
2020-12-03 02:03:18 +00:00
Daniel Stone 343705a9cf 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>
2020-12-03 02:03:18 +00:00
Daniel Stone d5bf4c99f6 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>
2020-12-03 02:03:18 +00:00
Daniel Stone 4d7c848053 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>
2020-12-03 02:03:18 +00:00
Jan Beich 18f6bd676d 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: cdf3a6a83b ("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>
2020-12-03 00:50:20 +00:00
Eric Anholt d3c67d7e7e 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: 6de01faac5 ("freedreno/a6xx: invalidate tex state cache entries on rebind")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
2020-12-02 20:43:33 +00:00
Eric Anholt daaf5f1d18 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>
2020-12-02 20:43:33 +00:00
Eric Anholt d90107a200 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: 1d35f77228 ("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>
2020-12-02 20:43:33 +00:00
Eric Anholt 634384e4a0 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>
2020-12-02 20:43:33 +00:00
Eric Anholt 311470fa64 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>
2020-12-02 20:43:33 +00:00
Eric Anholt 661b292834 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>
2020-12-02 20:43:33 +00:00
Eric Anholt 9cc8fc7bbc freedreno: Fix leak of u_transfer_helper.
Fixes: d1465b3aee ("freedreno: use u_transfer_helper")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
2020-12-02 20:43:33 +00:00
Eric Anholt 0626e3a950 gallium: Fix leak of the merged driconf options.
Fixes: 8a05d6ffc6 ("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>
2020-12-02 20:43:33 +00:00
Eric Anholt 06f2516696 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>
2020-12-02 20:43:33 +00:00
Rob Clark 9cb6e693c9 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>
2020-12-02 20:02:47 +00:00
Rob Clark d49e66c3ca 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>
2020-12-02 20:02:47 +00:00
James Park 7a57acad87 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>
2020-12-02 19:35:59 +00:00
Michel Dänzer 2f2c4a4764 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>
2020-12-02 19:15:42 +00:00
Erik Faye-Lund 59a6705cce 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: f1432fd3e2 ("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>
2020-12-02 18:54:07 +00:00
Jesse Natalie b1224143aa 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>
2020-12-02 10:13:34 -08:00
Jesse Natalie 474baa04ed 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>
2020-12-02 10:13:34 -08:00
Jesse Natalie f88347cd22 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>
2020-12-02 10:13:34 -08:00
Jesse Natalie 4cfd57dd48 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>
2020-12-02 10:13:34 -08:00
Jesse Natalie 149a036825 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>
2020-12-02 10:13:33 -08:00
Jesse Natalie 80817b6e34 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>
2020-12-02 10:12:28 -08:00
Jesse Natalie 959e017799 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>
2020-12-02 10:12:28 -08:00
Jesse Natalie 72566fd92c 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie 425cfcafb2 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie 60454a4e99 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie bb7eee8b40 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie a5de2bc229 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie cdf3a6a83b 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>
2020-12-02 10:12:27 -08:00
Jesse Natalie 852d91edcd 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>
2020-12-02 10:12:25 -08:00
Caio Marcelo de Oliveira Filho 0a7abee60b 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>
2020-12-02 08:30:46 -09:00
Daniel Schürmann e60fcf0a87 nir/opt_sink: return early when trying to sink unused instructions
Fixes: 5f6c5e5b86 ('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>
2020-12-02 17:12:44 +00:00