Dave Airlie
ef3303385d
glsl/linker: remove a bunch more gl_context references.
...
This leaves only one reference used for the ctx->Driver.NewProgram
hook, this should likely be revisited.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
636b07943e
glsl/linker: drop unused gl_context.
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
32702047d8
glsl/linker/uniform_blocks: don't pass gl_context around.
...
just pass the constants
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
e943af6a55
glsl/nir/linker: avoid passing gl_context inside gl_nir linker
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
7c8017bbd1
glsl/linker: remove gl_context usage from more places.
...
Just pass in consts, exts, api
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
34090712c6
glsl/linker: remove gl_context from check image resources
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
4d6e866b7b
glsl/linker: get rid of gl_context from atomic counters paths
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
e9ec1429ba
glsl/linker: get rid of gl_context from uniform assign paths
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
adbbee980d
glsl/linker: get rid of gl_context from link varyings
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
98f665e613
glsl/linker: remove direct gl_context usage in favour of consts/exts/api
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
d5e7c7351a
glsl/linker: move more ctx->Consts to consts.
...
Don't pass gl contexts around as much
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
eb811bdaf4
glsl/linker: don't pass gl_context just for constants in xfb code
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
e83f0fc620
glsl: don't pass gl_context to lower shared references.
...
this uses the consts only
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Dave Airlie
ff0771e253
glsl/linker: cleanup passing gl_context unnecessarily
...
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14433 >
2022-01-07 06:19:49 +00:00
Jesse Natalie
c09c0b351f
nir_opt_dead_cf: Remove dead ifs
...
An if that looks like:
if (x) { } else { }
That has no phis following it is dead. Currently these are only
removed by peephole select, but that means that 'x' is considered
used until that pass is run, which can make it difficult to apply
sane lowering in the case where loading 'x' requires complex or
expensive transformations, but 'x' is *really* unused.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14400 >
2022-01-07 05:15:48 +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
0f8213cb10
d3d12: Handle bitcasting of shader images
...
This is handled in 2 ways:
* For casts in the same "class," we can just do the cast. There's also
limited support for 4x8 => 1x32 and 2x16 => 1x32.
* For casts that are just by size, use a lowering pass. This reads the
data in the appropriate UINT format (except R11G11B10), retrieves
the original bits, re-packs it into the dest, and returns it to the
app for loads. For stores, the process is done in reverse - bits
for the final format are computed and re-expanded to the format that
should be used for the store.
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
156ef05ec7
d3d12: Handle memory barriers
...
This is a bit fragile. The algorithm is essentially:
- Let the driver track state for non-dual-bound resources.
- For resources that are dual-bound as SSBO/image and a second
bind point, assume they're being used as UAVs.
- When a MemoryBarrier is issued, dirty all destination bind points
so they re-assert their state, and if the destination is not UAV,
temporarily suppress UAV state re-assertion.
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
63fe4888ea
d3d12: Lower cube images to 2D arrays via existing int cubemap lowering pass
...
Note that the coordinates are not lowered, just types.
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
d0a3794d6d
d3d12: Fill out shader image descriptor tables
...
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
ef44b93914
d3d12: Create textures as UAV-capable when appropriate
...
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
23f0c924cf
d3d12: Handle set_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
5192c8dd1d
d3d12: Handle images in the root signature
...
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
def1f0743c
d3d12: Retrieve shader image dimensions during shader compiles
...
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
f7e50c8cf2
d3d12: Add missed SSBO binding enum value
...
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
6620c342ac
d3d12: Rename UAV -> SSBO to disambiguate with image 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
aa73203850
d3d12: Fix format table typeless-ness for A8 and RGBA1010102
...
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
02fc28625f
microsoft/compiler: Fix handling of fp16-in-32bit-val ops to handle high bits
...
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
20e374f4a3
microsoft/compiler: Hook up memory/control barriers
...
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
5d33a9fa47
microsoft/compiler: Handle forced early depth
...
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
0b88600a64
microsoft/compiler: Implement atomic image ops
...
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
1b62c86eb1
microsoft/compiler: Handle images as derefs for GL
...
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
a7311ceafe
microsoft/compiler: Fix array-of-array handling for derefs of textures/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
c9719b6d2e
microsoft/compiler: Emit SRVs/UAVs as arrays
...
This is done regardless of size so that "dynamic" indexing with a
uniform can work even on arrays of size 1.
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
e3c14cf718
microsoft/compiler: Unify handle retrieval between images and UBO/SSBO
...
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
61872b5240
microsoft/compiler: Emit GL images in descriptor space 1 with driver_location instead of binding
...
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
83ed626b76
microsoft/compiler: Put SSBO and image handles in separate arrays
...
In a future change, the bindings for images and SSBOs will start to
overlap in GL (using a separate space to disambiguate them)
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
8a4b443c5b
microsoft/compiler: Change vulkan_environment bool to an enum
...
There are currently 3 different "environments" supported by this backend,
and they have slightly different semantics for how resources are accessed,
which is only going to get a little weirder when GL images start getting
supported. To try to make things less confusing, use an explicit enum
with heavy documentation on what's different between them.
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
Caio Oliveira
87e2d2249d
anv/blorp: Apply pending pipe flushes after PIPELINE_SELECT
...
Allows the PIPELINE_SELECT change to consume any outstanding flushes.
In case it doesn't, we still apply the pipe flushses afterwards.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14301 >
2022-01-07 03:14:55 +00:00
Caio Oliveira
313aeee84b
anv: Use pending pipe control mechanism in flush_pipeline_select()
...
This removes the repeated implementation of a workaround and a
per-platform case.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14301 >
2022-01-07 03:14:55 +00:00
Caio Oliveira
9ba7bc17d3
anv: Add another case to INTEL_DEBUG=pc output
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14301 >
2022-01-07 03:14:55 +00:00
Bas Nieuwenhuizen
85ca7fab29
radv: Add common entrypoint dependency.
...
To ensure we have the header. The revert likely reintroduced compilation flakiness due
to missing dependencies.
Fixes: a255f6f823 ("radv: do not use the common entrypoint for the Metro Exodus layer")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14430 >
2022-01-07 02:21:36 +00:00
Bas Nieuwenhuizen
63101914f8
radv: Set optimal copy alignment to 1.
...
I think we set it to 128 for no reason at all. The app is still
required to align to the texel size.
Note that we prefer 4 bytes for non-formatted buffer->buffer copy,
but that isn't in scope for these properties according to the
Vulkan spec.
It also happens to help hide what looks like an application bug at
this point with Baldurs Gate 3.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5509
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14415 >
2022-01-07 01:59:13 +00:00
Mike Blumenkrantz
05a5e5a2bc
radv: fix xfb query copy param ordering
...
Fixes: afff9dd0f0 ("radv: Use correct buffer size for query pool result copies.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14422 >
2022-01-06 17:44:09 +00:00
Samuel Pitoiset
f43b0d5cdc
radv/winsys: remove unused syncobj functions
...
The vulkan common runtime code uses the drm functions directly.
Fixes: 91fe0b5629 ("radv: Delete lots of sync code.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14375 >
2022-01-06 09:13:50 +00:00
Samuel Pitoiset
da0c708d79
radv: remove remaining dead code related to the old sync code
...
Fixes: 91fe0b5629 ("radv: Delete lots of sync code.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14375 >
2022-01-06 09:13:50 +00:00