Commit Graph

232 Commits

Author SHA1 Message Date
Boris Brezillon e9c69fe39a dzn: 3D array images don't exist
Let's force maxArrayLayers to one in that case.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon ad0ac592be dzn: Set bufferFeatures to zero on depth/stencil formats
Those are not supposed to advertise buffer features.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 8dfab9b382 dzn: Make sure the properties are all zero when the format is not supported
Move one of the is_supported() check before we start filling the
structure so we don't end up with a partially filled object when
we return VK_ERROR_FORMAT_NOT_SUPPORTED (which deqp doesn't seem to like,
so it's probably coming from a spec requirement).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon dc3dd9690b dzn: Return a valid imageFormatProperties.maxMipLevels
maxMipLevels is encoding the maximum number of MIP levels, but
dzn_physical_device_get_max_mip_levels() return the maximum MIP level.
Let's rename the function and add one to the returned value to fix
the problem.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon cfd3dfc074 dzn: Fix 3D <-> 2D image copies
We just need to treat layers as slices when manipulating 3D resources
whose slices are coming from/going to 2D array layers.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 94923021d7 dzn: Support 2Darray views on 3D images for color attachments
Those are declared as 3D RTVs in D3D12, and layers are treated as
slices.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 3684cae58c dzn: Fix dzn_image_get_rtv_desc() for 3D views
VK_REMAINING_ARRAY_LAYERS maps to -1 in the D3D12 world. Let's make sure
we set WSize to -1 in that case, because the layer_count calculated by
dzn_get_layer_count() won't work for 3D images which never have more
than one layer (in case of 3D images, we treat slices as layers).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 9f5831bbec dzn: Replace C++ references by pointers
Let's keep as much as we can in plain C.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 1401f62069 dzn: Align the default case in dzn_image_view_prepare_dsv_desc()
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 1692d8f0f6 dzn: Don't crash when EndCommandBuffer() returns an error
Leftover from a debug session.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon c937152756 dzn: Fix dzn_translate_viewport() when height < 0
Since negative height is not a thing in D3D12, we need to adjust the
TopLeftY accordingly.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Boris Brezillon 05b6c1ed84 dzn: Fix pipeline creation when rasterization is disabled
We use some of the VkGraphicsPipelineCreateInfo fields that should
be ignored when rasterization in disabled, assuming those who be set
to NULL by the caller in that case, which is not mandated by the
Vulkan specification.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
2022-04-08 11:54:43 +00:00
Erik Faye-Lund 31824d4213 dzn: add missing space
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 08e4b28a05 dzn: drop unused include
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 4ae6c34a5a dzn: drop incorrect return statement
We're returning nothing here. Let's not do that.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 600d99650b dzn: drop unused header
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 76b0023c06 dzn: remove unused variable
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 96bbcb1e48 dzn: fixup indent
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund f3ce7d8561 dzn: add D3D12_IGNORE_SDK_LAYERS define
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund 659e26285a dzn: drop needless includes
These include either dzn_nir.h or dzn_internal.h which already includes
this header.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund bda5852846 dzn: remove unused struct
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Erik Faye-Lund f7b0cfe04a dzn: remove needless using
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>
2022-04-07 19:53:03 +00:00
Boris Brezillon 07af51da9d dzn: Pass a NULL ralloc context to dxil_create_validator()
instance is not allocated with ralloc, we can't pass it as a ralloc
context to dxil_create_validator().

Fixes: 09c2016d6b ("dzn: use dxil_validator")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15787>
2022-04-07 16:55:02 +00:00
Erik Faye-Lund 09c2016d6b dzn: use dxil_validator
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15751>
2022-04-07 00:00:45 +00:00
Erik Faye-Lund f607db2689 dozen: require c++20 for designated initializers
We do require C++20 still, because designated initializers is part of
that standard. This is almost a revert, but conditionally selecting
between c++latest or c++20 when available, as that's what we really want.

Fixes: 55ca1c8db3 ("vulkan/microsoft: Remove `override_options: ['cpp_std=c++latest']` option for visual studio")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>
2022-04-05 16:58:56 +00:00
Boris Brezillon 23bd889541 dzn: Properly support static blend constants
The current code was assuming blend constants to be passed dynamically,
which is wrong. Let's handle both the dynamic and static cases.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>
2022-03-31 12:21:35 +00:00
Boris Brezillon f16a7aa9d6 dzn: Fix alpha blend factor translation
When VK_BLEND_FACTOR_xxx_COLOR is passed to an alpha equation what we
really want is the alpha component replicated on the RGBA channels,
which has dedicated enums in D3D12. Let's make sure we use the right
definition depending on the equation we're translating.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>
2022-03-31 12:21:35 +00:00
Boris Brezillon 329f16fffc dzn: Make a bunch of functions private
Looks like some functions that should have been marked static when
transitioning from C++ methods to plain C where forgotten. Let's fix that
now.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>
2022-03-31 09:46:36 +00:00
Boris Brezillon 4194c89ed8 dzn: Remove the dzn_cmd_exec_functions file
That's a leftover from a previous version of the secondary command
buffer implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>
2022-03-31 09:46:36 +00:00
Boris Brezillon b402cff591 dzn: Add Missing return type to dzn_translate_sampler_filter()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15607>
2022-03-31 09:46:36 +00:00
Yonggang Luo 55ca1c8db3 vulkan/microsoft: Remove `override_options: ['cpp_std=c++latest']` option for visual studio
The project no longer uses c++20 features

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15595>
2022-03-31 09:16:27 +00:00
Erik Faye-Lund a012b21964 microsoft: Initial vulkan-on-12 driver
This is Dozen, the Vulkan on DirectX 12 driver. Not to be confused with
DirectEggs.

This is an early prototype, and not meant to be upstreamed as-is.

Co-Authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-Authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Co-Authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Co-Authored-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14766>
2022-03-25 16:21:45 +00:00