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>
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>
[[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>
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>
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>
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>
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>
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>
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>
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>
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>
computerator depends on ir3_parser.h, which is a generated file, but
this dependency is not expressed in the build.
Fixes: 1e8808a4a0 ("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>
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>
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>
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: ff05da7f8d ("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>
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: ff05da7f8d ("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>
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>
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>
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>
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>