Commit Graph

55 Commits

Author SHA1 Message Date
Jesse Natalie 944832d3d7 d3d12: Cache a modifyable copy of the nir options in d3d12_screen
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie d6daa1cc7a d3d12: Use a constant define for max anisotropy
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie bcfac68ce9 d3d12: Update max input, output, and varying caps
The simple-varyings piglit test attempts to use GL_MAX_VARYING_FLOATS
varyings, PLUS one additional vector for position (which is not used
as input to the PS). "Reserve" that additional position vector by
removing it from the max varyings and max PS inputs.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14837>
2022-02-04 00:07:53 +00:00
Jesse Natalie f7ed838a49 d3d12: ARB_transform_feedback3
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>
2022-01-31 13:34:28 -08:00
Jesse Natalie db77360796 d3d12: ARB_transform_feedback2
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>
2022-01-31 13:32:10 -08:00
Jesse Natalie ed42b129ef d3d12: Set caps for tesselation
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>
2022-01-26 01:31:35 +00:00
Jesse Natalie 22156821ea d3d12: Enable PIPE_CAP_TGSI_TEXCOORD
This is required to be able to use the necessary number of varyings,
otherwise we hit asserts because mesa/st starts assigning varyings
locations above 64 due to the +9 reserving these texcoords.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>
2022-01-26 01:31:35 +00:00
Jesse Natalie 75e1948b23 d3d12: Set sample-rate shading and GLSL 400 caps
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
2022-01-21 23:08:26 +00:00
Jesse Natalie bcbfbb8efd d3d12: Report number of GS streams
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
2022-01-21 23:08:26 +00:00
Jesse Natalie 14b1319f29 d3d12: Support ARB_framebuffer_no_attachments
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14504>
2022-01-14 08:36:13 -08:00
Jesse Natalie c6e7cdcf38 d3d12: Enable draw and multi-draw indirect
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14486>
2022-01-14 15:54:33 +00:00
Jesse Natalie 529b078718 d3d12: Enable base instance and draw params extensions
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14486>
2022-01-14 15:54:33 +00:00
Jesse Natalie a98508d092 d3d12: Declare support for inverted conditional render
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14486>
2022-01-14 15:54:33 +00:00
Juan A. Suarez Romero d9bc018854 d3d12: enable PIPE_CAP_IMAGE_STORE_FORMATTED
Required to expose ARB_shader_load_image_store and thus
ARB_compute_shader, which are supported by the driver.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14288>
2022-01-13 09:12:35 +00:00
Jesse Natalie cc8219d1b4 d3d12: Enable compute
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14367>
2022-01-11 01:36:56 +00:00
Jesse Natalie 6d38a35afb d3d12: Compile, bind, and cache compute PSOs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14367>
2022-01-11 01:36:56 +00:00
Jesse Natalie 166cd05071 d3d12: Limit sampler view count to 32
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14367>
2022-01-11 01:36:56 +00:00
Jesse Natalie 2bb2219aa7 d3d12: Set appropriate caps for shader images
Note that currently there's no emulation if the D3D12 driver doesn't
support the "UAV typed load" feature for all of the GL required formats.
This is not a required D3D12 feature, so this support won't light up
on all D3D12 hardware.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
2022-01-07 03:31:16 +00:00
Jesse Natalie 5e82a2ff2b d3d12: Init null UAVs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
2022-01-07 03:31:16 +00:00
Jesse Natalie 9b62f88cf8 d3d12: Handle format support queries for shader images
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
2022-01-07 03:31:16 +00:00
Jesse Natalie 951f6f2dba d3d12: Figure out if we can support GL shader images
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
2022-01-07 03:31:16 +00:00
Jesse Natalie d1a5250c10 d3d12: Shrink 2D array size so that max-layer cube arrays can be created
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
2022-01-07 03:31:16 +00:00
Jesse Natalie 8926cfc9f7 d3d12: Enable texture gather
The CI changes are because WARP fails really hard at gather,
with crashes when doing it on a 1x1 or Nx1 texture, and incorrectly
applying swizzling to the result vector instead of the actual texture
accesses.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14161>
2021-12-30 09:50:17 -08:00
Jesse Natalie fe963f336c d3d12: Enable cubemap arrays
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14161>
2021-12-30 08:14:11 -08:00
Jesse Natalie 5b32915055 d3d12: Replace pipe cap literals with D3D12 defines when available
Also remove references to feature levels < 11.0, D3D12 doesn't support those

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14161>
2021-12-30 08:13:30 -08:00
Jesse Natalie 0c5fde39e4 d3d12: Set SSBO support caps
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14294>
2021-12-27 23:40:25 +00:00
Jesse Natalie fb6479544b d3d12: Force emulation of all YUV formats using per-plane formats
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14123>
2021-12-08 20:46:22 +00:00
Jesse Natalie c3e014670f d3d12: Support compat level 330
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14001>
2021-12-01 23:48:57 +00:00
Jesse Natalie ab9948997a d3d12: Support PIPE_CAP_MIXED_COLOR_DEPTH_BITS
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13054>
2021-11-19 22:54:46 +00:00
Mike Blumenkrantz c9a47c85da gallium: rename PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER
this is now a bitfield enum for more functionality

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>
2021-11-18 07:58:29 -05:00
Jesse Natalie c151e9d087 d3d12: Hook up threaded context
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13670>
2021-11-09 00:44:52 +00:00
Marek Olšák cf9afc7b0c gallium: add missing point and line CAPs
The returned values are the same as the GL frontend.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13676>
2021-11-08 14:37:49 +00:00
Marek Olšák b80dca86c3 gallium: rename PIPE_CAPF_MAX_POINT_WIDTH -> MAX_POINT_SIZE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13676>
2021-11-08 14:37:49 +00:00
Mike Blumenkrantz c011e6061d d3d12: explicitly advertise index buffer format support
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11132>
2021-06-04 17:57:03 +00:00
Marek Olšák eb74f97769 gallium: split transfer_(un)map into buffer_(un)map and texture_(un)map
The u_resource_vtbl indirection is going to be removed.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>
2021-05-21 17:38:04 +00:00
Jesse Natalie bd64669fa7 d3d12: Use compact arrays for clip/cull distance
This puts us more in line with other drivers, and matches what
SPIR-V would produce rather than the GLSL compiler. It also means
we can delete the current fixup pass, since previously clip distance
was always float4s but some components could go unused. Now, clip
distance is an array that's appropriately sized for what's actually
written.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie c022c9603d d3d12: Use ID3D12Device9::CreateCommandQueue1 when available
This lets us provide a creator ID, which lets us tag GLOn12 work
and separate it from other D3D12 work on the same singleton device.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3859
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9776>
2021-03-23 22:11:19 +00:00
Jesse Natalie 6db28f5201 d3d12: Move descriptor pools to screen, and add lock
Surfaces can be shared across contexts, and can even outlive the
original context that created them, so move the pools to the screen.
Since they no longer belong to a single context, they need a lock now.

v2: Samplers moved back to the context
v3: Fix Linux build

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3812
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9349>
2021-03-16 15:22:35 +00:00
Eric Anholt 175c827e72 gallium: Flip the default value of PIPE_CAP_SHAREABLE_SHADERS.
We should be exposing it in every driver, since it's required eventually
to reduce jank.  Make drivers have to explicitly opt out instead of opt
in.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9088>
2021-02-17 19:31:07 +00:00
Jesse Natalie 2ddafc2676 d3d12: Fail screen creation if a shader validator is needed and can't be created
Also fail screen creation if experimental shader models are requested, but can't be enabled

Fixes: 2ea15cd6 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4022
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8865>
2021-02-12 17:00:38 +00:00
Jesse Natalie 0034f7b209 d3d12: Don't allocate mappable textures
There's not really a reason to directly map textures. Doing so
requires the texture to be allocated in system RAM instead of
video RAM, which means all GPU access to it would be needlessly slow.

Notably, the one texture type that was allocated this way is the
display target texture for the software driver path. Instead, use
pipe_transfer_map to be able to copy the texture to system RAM.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>
2021-01-05 14:51:00 -08:00
Jesse Natalie ee1463db3c d3d12: Use buffer pipe usage to inform allocation
For non-CPU-accessible pipe resource types (DEFAULT/IMMUTABLE),
allocate non-CPU-accessible buffers directly from the cache_bufmgr.
Update the d3d12_bo creation to handle nonmappable buffers.

For CPU-write-only (DYNAMIC/STREAM), use the upload slab_bufmgr.
Update this slab manager to use CPU_WRITE | GPU_READ PB usage.

For CPU-read-write (STAGING), use the readback_slab_bufmgr.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>
2021-01-05 14:51:00 -08:00
Jesse Natalie be19eb771a d3d12: Add a slab bufmgr for readback buffers
Readback (GPU write, CPU read) should use different CPU page
properties compared to upload (write-back vs write-combined).

A future commit will start to respect these PB usage flags.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>
2021-01-05 22:25:41 +00:00
Adam Jackson 8ddddfb516 treewide: Disambiguate various variables named "debug_options"
Name them after what they control so 'vi -t' can take you somewhere
useful.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8165>
2021-01-04 20:51:28 +00:00
Jesse Natalie 2d78e28ba7 d3d12: Flush and wait in flush_frontbuffer
If we have a context, make sure any work on it's done before
reading from the render target. There may even be pending
MSAA resolves that haven't been submitted yet.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie eb4353838d d3d12: Don't require DXIL for WSL
Always use the experimental shader models feature, which allows
unsigned DXIL to be used, so we don't need a libdxil for WSL.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie ee4c80f77d d3d12: Only support DXGI and GDI APIs on Windows
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie dfeb5ecd4a d3d12: Use u_dl instead of Windows DLL APIs
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie af2e212c59 d3d12: Use IID_PPV_ARGS instead of __uuidof
We've been inconsistent between IID_PPV_ARGS,
__uuidof(var), and __uuidof(type). Since Linux doesn't
support the latter of these, they need to be changed.
While we're at it, switch all __uuidof to the more terse
IIV_PPV_ARGS option.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie e1e05ad772 d3d12: Include dxguids/dxguids.h in files that need __uuidof
MSVC has an extension for getting IIDs (GUIDs) from types. Other
compilers can support this extension when targeting Windows, but
don't support it when targeting Linux. Instead, winadapter.h
defines __uuidof(var) to uuidof<decltype(var)>. Then dxguids.h
provides inline specialized definitions for the known D3D types.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00