Jesse Natalie
a041cd48f4
dzn: Support more subgroup/quad ops
...
See the comment around supported shader stages - to avoid
introducing CTS failures, vertex/geometry support for
subgroups are turned off since they cannot support quads.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
9d26aa99d5
spirv2dxil: Support subgroup SPIR-V caps
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
a8329595fa
spirv2dxil: Lower some wave op properties
...
DXIL has no concept of subgroup mask ops, relative
shuffle ops, and everything is scalar.
Most wave broadcast ops support i1 overloads, except
for quad swap operations. Go figure. Use lower_bit_size
to promote those to i32 instead.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
f58d763363
microsoft/compiler: Support emitting the SM6.6 wave size tag
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
2c5d96bb58
microsoft/compiler: Implement more wave/quad ops
...
This handles ballot, vote, shuffle, broadcast, and quads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
a318c101bb
microsoft/compiler: Handle i1 overloads
...
Some wave ops can have bool/i1 overloads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
e1b6e0748f
microsoft/compiler: Handle i2i1 and u2u1
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:05 -08:00
Jesse Natalie
1ef9ba9166
microsoft/compiler: Don't emit threadgroup barriers for graphics shaders
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801 >
2023-01-24 11:00:04 -08:00
Pedro J. Estébanez
e07e9a08cb
spirv_to_dxil: Unify spirv_to_nir_options
...
Beyond the pure refactoring, this fixes spirv2dxil, which was using outdated values.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20884 >
2023-01-24 18:07:18 +00:00
Jesse Natalie
12a471afac
dzn: Enable Vulkan 1.1
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
3f0bbb19de
dzn: Fix independent blend check
...
Memcmp returns 0 on equal, so !memcmp means equal.
Fixes: c92729c3 ("dzn: Enable independent blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
602a54a083
dzn: Don't expose variable pointers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
ad7157c1e8
dzn: A single sampler descriptor set needs to support 1024 samplers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
884d870929
dzn: Descriptor limits are based on binding tier, not heap tier
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
9f13a4a10a
dzn: Usage MULTISAMPLE_LOAD support instead of RT/DS support for MSAA
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
29a0bcdd84
dzn: Support EXTENDED_USAGE bit
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
c0d8838c30
dzn: Usage image view usage instead of image usage
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
1041e0d281
dzn: Use SHADER_LOAD to indicate SAMPLED_IMAGE support
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfc05566ab
dzn: Move patched vertex buffer capability check up a level
...
Some of these patched formats are also needed as (trivial) image
formats, so we can't just report vertex buffer as the only supported
operation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
ceb287a509
dzn: When rendering to 3D, don't treat layers as subresources for barriers
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
232c598e79
dzn: Set dynamic rendering caps
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
c8b9f70fca
dzn: Respect suspending/resuming flags to omit clears/resolves
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfa260cd27
dzn: Use common physical device list/enumeration helpers
...
Implements EnumeratePhysicalDeviceGroups for us for free
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
0bae7a307c
dzn: Support vkCmdDispatchBase
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
296ad630db
spirv2dxil: Support dispatches with base group indices
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
6bb765f3d1
microsoft/compiler: Lower device index to zero
...
Maybe we'll support actual device groups at some point, but today
is not that day.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
725948c6c9
microsoft/compiler: Fix atomic image umax
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823 >
2023-01-24 17:22:25 +00:00
Jesse Natalie
bfd891fe66
dzn: Support basic subgroups
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
33f59578fa
spirv2dxil: Support basic subgroups
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
8872d5d1dc
spirv2dxil: Use 32-bit shared offsets
...
nir_build_deref_var assumes that you're going to do so, and
there's no reason to use 64-bit types for Vulkan compute.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
2f8a8b5949
microsoft/compiler: Add lowering passes for basic subgroup vars
...
DXIL doesn't have a "subgroup ID" or "num subgroups" construct,
so add lowering to construct them. Subgroup ID is done using
once-per-subgroup atomics on a workgroup-shared variable, and
then broadcasting that (using read_first_invocation) to the other
threads. Num subgroups is just a division with the workgroup size.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
a422df4b61
microsoft/compiler: Implement a few basic wave/subgroup intrinsics
...
These are the ones that map perfectly between SPIR-V and DXIL that
are in the "basic" extension group (except for read-lane-first,
but we'll use with some lowering shortly).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
142faf894b
microsoft/compiler: Add an overload param to unary function helpers
...
Subgroup ops aren't i32, they use none.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777 >
2023-01-20 18:50:57 +00:00
Jesse Natalie
e8c8a94c2e
dzn: Rework meta blit VS
...
Some D3D12 drivers, like my PC's AMD driver, don't like using a
dynamic index to load from a constant buffer that's bound via
root constants. Instead, just go ahead and load the full set of
vertex data and just bcsel which one to use.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778 >
2023-01-20 00:35:59 +00:00
Jesse Natalie
8de0c23ac9
dzn: Delete an unnecessary assert
...
As far as I can tell, having multiple levels in the view for a
color target just means to target the first one.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778 >
2023-01-20 00:35:59 +00:00
Jesse Natalie
c92729c3ce
dzn: Enable independent blending
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778 >
2023-01-20 00:35:59 +00:00
Dylan Baker
7aca37fc28
meson: use [] instead of 'lib for !windows name_prefix
...
This is a poorly documented value that uses the default value, but
doesn't emit a warning. In the future Meson will fix this.
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752 >
2023-01-19 23:06:07 +00:00
Dylan Baker
c31629ee78
meson: remove version checks for < 0.59
...
Which is now required, so these are useless
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752 >
2023-01-19 23:06:07 +00:00
Jesse Natalie
8c0531cf91
dzn: Enable multiview
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
ebf2604562
dzn: Implement multiview queries
...
This is a weird way to do queries, but in multiview, each query
takes up N slots, where N is the number of views. D3D doesn't do
it that way, and only has one result, which fortunately is a valid
way to do Vulkan queries. We just need to take care to zero out
the other view results, and make sure they get "signaled" when
the cmdbuf is submitted.
Note that it is invalid in D3D to use ResolveQueryData on query
slots that have never actually been begun/ended, so we zero out
the data by copying zeroes into the buffer. This probably could
be optimized but oh well.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
4586b308d8
dzn: Handle draws and clears for multiview rendering
...
For draws, when we're emulating multiview, we need to loop them
and set up the right sysval. For clears, we always need to loop.
When not emulating, we also need to set up the right view instance
mask.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
6fca32cb38
dzn: Handle multiview pipeline creation
...
This handles both native and emulated pipeline creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
ea9d092655
dzn: Put nir compilation options in a struct
...
The function signatures are getting unwieldly...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
3299ab04cb
spirv2dxil: Claim multiview support
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
95a90b359a
spirv2dxil: Implement lowering for multiview
...
D3D's view instancing is an optional feature, and even when it's
supported, it only goes up to 4 views, where Vulkan requires a
minimum of 6 supported views. So, we need to have a path for handling
the cases where we can't use the native feature.
In this mode, pass the view ID as a runtime var. The caller is then
responsible for looping the draw calls and filling out the constant
buffer value correctly for each draw. When we get to the last pre-rast
stage, we'll additionally want to write out gl_Layer to select the
right RTV array slice. Lastly, for the fragment shader, if there's
any input attachments, those get loaded using the RTV slice instead
of the view ID. RTV slice input into the PS is done with a signature
entry (which must be output from the previous stage) rather than a
system value.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
2d56b3214d
spirv2dxil: Pass runtime conf struct to lower_shader_system_values
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
58488b9d85
microsoft/compiler: Support view instancing
...
This adds support for D3D12-native view instancing to the compiler.
Essentially, it's just the ability to load SV_ViewID (dx.op.viewID),
set the right capability, and fill out some more PSV data. Note that
the PSV data is currently garbage. Ideally, we'd fill out a proper
input -> output and viewID -> output dependency table, but AFAIK
this is only used to enforce D3D API validation, and drivers ignore
it, so it's less critical to get it right.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
4a440889a8
microsoft/compiler: Delete stale TODO comment
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
e0024a844c
microsoft/compiler: Subpass textures are supposed to be arrays
...
When doing multiview subpass rendering, they get loaded with the
view/layer index.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00
Jesse Natalie
8924fe9fc3
microsoft/compiler: Delete incorrect implementation for load_layer_id
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650 >
2023-01-19 21:14:50 +00:00