Konstantin Kharlamov
91362340f3
meson: remove source_root() call in nir compiler path
...
source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions. This also allows to deduplicate some code by declaring
commonly used string at the top meson.build file.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974 >
2022-08-12 13:11:03 +00:00
Michael Tang
a3bf0da1cb
microsoft/compiler: Change calls to NIR_INSTR_UNSUPPORTED to log to dxil_logger instead
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12510 >
2022-08-11 16:17:46 +00:00
Michael Tang
55b3980e78
microsoft/compiler: Add dxil_logger type and parameter to nir_to_dxil
...
v2 (jenatali): Add a default logger which aborts via unreachable,
and use NULL from GL/Vulkan to use the default logger.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12510 >
2022-08-11 16:17:46 +00:00
Pierre-Eric Pelloux-Prayer
70891edd97
nir: add a nir_opt_if_options enum
...
And don't enable nir_opt_if_optimize_phi_true_false on radeonsi with
LLVM 14 because it crashes Blender.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6976
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Acked-by: Emma Anholt <emma@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17949 >
2022-08-10 12:55:39 +00:00
Yonggang Luo
ecfda9a0fa
microsoft/clc: Fixes compiling errors with clang/mingw64 in clc/clc_compiler_test.cpp
...
clc_compiler_test.cpp:1322:67: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list
log(0.0f) / log(2), log(1.0f) / log(2), log(2.0f) / log(2), log(3.0f) / log(2)
clc_compiler_test.cpp:2306:25: error: non-constant-expression cannot be narrowed from type 'std::vector<unsigned int>::size_type' (aka 'unsigned long long') to 'unsigned int' in initializer list
CompileArgs args = { inout.size(), 1, 1 };
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17926 >
2022-08-09 16:47:24 +00:00
Yonggang Luo
c67e60ae8f
meson: clc compiler test only works on win32
...
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com >
Acked-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17934 >
2022-08-09 16:39:47 +00:00
Jesse Natalie
32d0dfc462
dzn: Use D3D12 constants instead of naked numbers for device limits
...
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17915 >
2022-08-08 21:49:42 +00:00
Jesse Natalie
d48ce281f8
dzn: Disable extensions that require multi-view
...
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17915 >
2022-08-08 21:49:42 +00:00
Karol Herbst
6b38114ed7
microsoft/clc: drop inline sampler reordering
...
nir_dedup_inline_samplers is now taking care of it.
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334 >
2022-08-04 23:53:50 +00:00
Karol Herbst
2b12985465
nir: extract the clc inline sampler dedup pass from clc
...
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334 >
2022-08-04 23:53:50 +00:00
pal1000
25e2c4d784
Microsoft clc: strip lib prefix
...
Otherwise OpenCLon12 ICD can't load it
Ref: https://github.com/microsoft/OpenCLOn12/search?q=clon12compiler
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17856 >
2022-08-04 04:13:51 +00:00
Jesse Natalie
bdf91b25d9
dzn: Retrieve validator version
...
For platforms where there's no validator available, leave the field zero-initialized
to let the DXIL backend choose whatever target validator version it wants.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
b8328c9664
microsoft/compiler: Blacklist DXIL validator 1.6 from 20348 SDK
...
This version claims to support validator version 1.6, but doesn't
actually have the 1.6 changes (PSV v2, PSV resource v1, barycentrics).
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
8fcd506178
microsoft/compiler: Add a getter for a validator version from DXIL.dll
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
46335debf6
microsoft/compiler: Support DXIL validator 1.7
...
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
4abe781a0b
microsoft/compiler: Support DXIL validator 1.6
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
9dbaece312
microsoft/compiler: DXIL validator 1.6 uses a new PSV resource struct
...
This is a huge pain because it's an array, meaning that accessing
an entry in the array now depends on the validator version to use
the right element stride.
We could always just store the v1 and downconvert if needed... but
this isn't *that* bad that I felt I had to do it that way.
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
d9e575d4d7
microsoft/compiler: DXIL validator 1.6 uses a new PSV struct version
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
4d257929da
microsoft/compiler: Set the barycentrics flag for attribute_at_vertex
...
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
271c8d7a8c
microsoft/compiler: DXIL validator 1.6 counts UAVs differently
...
Instead of counting the number of UAV arrays, it counts the
number of actual UAVs declared. This is more correct, but we
need to do the same accounting to set the 64 UAVs flag.
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
494af9db04
microsoft/compiler: Correctly compute dynamic indexing I/O masks
...
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
31d09d2f77
microsoft/compiler: Compute correct usage masks
...
This starts actually updating the always-read/never-written
masks while processing the shader. Note that we follow DXC's
lead here and treat "always read" as "sometimes read."
This isn't strictly required, but might help drivers out.
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
c26b28f711
microsoft/compiler: Support DXIL validator version 1.5
...
This version of the validator starts adding usage masks into
the DXIL, which then are expected to match the PSV and signature
data. The usage masks are "correct" meaning that the never-writes
mask no longer includes bits outside of components 0-3.
A future change will actually compute useful masks.
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
170d428887
microsoft/compiler: Lower I/O to scalar
...
A future change will start computing component masks while
processing I/O instructions, and only having to compute
a mask for one component per instruction simplifies things.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
80d35739ff
microsoft/compiler: Ensure 4-component position writes via NIR
...
We're about to lower I/O to scalar, which means we'll end up with
multiple writes to position, and none of them has enough info to
fill in the blanks.
This causes a test that previously crashed on WARP (due to
StoreOutput with an undef not being handled) to fail more
gracefully - but that failure means that the test spends
forever just outputting errors, so explicitly skip it.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
252c3c409d
microsoft/compiler: Split signature processing into two parts
...
First, preprocess the signatures, strictly based on the variables
in the nir shader. Then, later, after the actual shader contents
have been processed, we emit the metadata.
This lets shader processing rely on the pre-processed data (e.g.
the row -> ID mapping needed for large VS inputs) while also allowing
the signature data to rely on data gathered during the shader traversal
(e.g. which components are actually used).
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
e4c927545d
microsoft/compiler: Emit metadata based on long-lived signature data
...
Instead of using the short-lived semantic structure (that's used to
fill out the long-lived signature and PSV data), use the long-lived
ones. This is staging so we can hold off on emitting the metadata
until later.
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
6af22121cf
microsoft/compiler: Add a max validator version
...
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Jesse Natalie
c8f63e07da
microsoft/compiler: Add a max shader model option
...
Reviewed-by: Enrico Galli <enrico.galli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17603 >
2022-07-23 14:48:17 +00:00
Emma Anholt
f6c5b1d6c6
nir: Split usub_sat lowering flag from uadd_sat.
...
Intel vec4 would like to do uadd_sat, but use lowering for usub_sat.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637 >
2022-07-22 17:54:28 +00:00
Erik Faye-Lund
e630637eab
dzn: expose VK_KHR_driver_properties
...
We're not quite conformant with the extension, because we don't have
a valid conformance version.
That's not a quick-fix, so we should probably just accept some failures
for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 17:10:52 +02:00
Erik Faye-Lund
e5da067384
dzn: fill misc props
...
This is just a bag of misc properties that we should fill in.
Not all of them are filled out super accurately, but this is the best we
can do for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
053e2fd9d0
dzn: fill in minmax props
...
This should be possible to support, but we don't support minmax blending
at all yet, so let's leave these as unsupported for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
18c590e0b3
dzn: fill in depth/stencil resolve props
...
Before enabling Vulkan 1.2 support, we need to fix the TODO in here.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
141e715f29
dzn: fill in bindless props
...
These might not be exactly right, but they are good enough for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
34b0828cdc
dzn: fill in non-uniform-indexing props
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
8e9191cd24
dzn: fill in float-control details
...
We can do better here in the future, but this is what's supported right
now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Erik Faye-Lund
4d7403d4dc
dzn: fill in driver name and info
...
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998 >
2022-07-18 16:49:42 +02:00
Jesse Natalie
f4f1914cd2
microsoft/clc: Add helpers to build with correct ABI for MinGW
...
Reviewed-by: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Sil Vilerino <sivileri@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548 >
2022-07-15 16:27:11 +00:00
Jesse Natalie
489ab1aa3b
dzn: Remove the cast when the SDK version is high enough
...
Reviewed-by: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Sil Vilerino <sivileri@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548 >
2022-07-15 16:27:11 +00:00
Jesse Natalie
b9fb14da06
dzn: Missed ABI fixes for GetCustomHeapProperties
...
Reviewed-by: Bill Kristiansen <billkris@microsoft.com >
Reviewed-by: Sil Vilerino <sivileri@microsoft.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17548 >
2022-07-15 16:27:11 +00:00
Enrico Galli
1f0d27e45f
microsoft/spirv_to_dxil: Fix discard to demote + return pass
...
While SPIR-V's OpKill is block terminating, the converted discard
intrinsic is not block terminating. This can lead to issues where
instruction could be placed after discard.
This patch adds an extra pass that drops all instructions after discard
before we convert discards.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17474 >
2022-07-12 20:22:52 +00:00
Eric Engestrom
a96ddc3803
dzn: use updated tokens from vk.xml
...
Signed-off-by: Eric Engestrom <eric@igalia.com >
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342 >
2022-07-12 15:53:11 +00:00
Jesse Natalie
5a59211acd
dzn: Use fabs on floating point input
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
2ace7832f9
dzn: Re-order dzn_physical_device_desc so = { 0 } doesn't initialize a struct
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
e0ebae8dca
dzn: Fix comparison order for format enums
...
Fixes: 53a352e1 ("dzn: Provide a helper to check if 2 formats are compatible")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
6c1ab8fdeb
dzn: Disable Wunused-value for C++ files
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
10e8e0b9d6
dzn: Only add Werror flags that the compiler supports
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
4ea58cf35f
dzn: Re-order includes in dzn_nir to prevent TRUE redefinition
...
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423 >
2022-07-09 14:04:48 +00:00
Jesse Natalie
f7c741c058
dzn: Add for condition to break nested loop
...
Fixes: d132ec92 ("dzn: Support native image copies when formats are compatible")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17377 >
2022-07-08 19:17:53 +00:00