Alyssa Rosenzweig [Tue, 7 Feb 2023 05:15:23 +0000 (00:15 -0500)]
panfrost: Preprocess shaders at CSO create time
Now the only passes that depend on the shader key can run late, so we can
preprocess ahead-of-time once and throw away the original shader. This reduces
the cost of shader variants, as well as deduplicates some lowering for
transform feedback shaders.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Tue, 7 Feb 2023 05:02:51 +0000 (00:02 -0500)]
panfrost: Effectively lower gl_FragColor late
nir_lower_fragcolor takes the number of colour buffers as input, but it's an
early pass, so we don't want to use the key for it. Instead, we can overestimate
and then optimize out late with an easy pass.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Tue, 7 Feb 2023 04:54:42 +0000 (23:54 -0500)]
panfrost: Lower texcoords late
Use the _late version of this lowering instead of the early one.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Tue, 7 Feb 2023 04:53:35 +0000 (23:53 -0500)]
panfrost: Lower clip_fs late
This pass works both early and late, so this is an easy one to sink down.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Tue, 7 Feb 2023 04:38:12 +0000 (23:38 -0500)]
pan/lower_framebuffer: Lower MSAA blend shaders
Do it explicitly in NIR rather than implicitly in the Midgard compiler. This
avoids a nasty sideband input for the render target formats and sample count,
for blend shaders on midgard only.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 22:23:19 +0000 (17:23 -0500)]
panfrost: Preprocess shaders in the driver
This is a flag-day change to how we compile. We split preprocessing NIR into a
separate step from compiling, giving the driver a chance to apply its own
lowerings on the preprocessed NIR before the final optimization loop. During
that time, the different producers of NIR (panfrost, panvk, blend shaders, blit
shaders...) will be able to (differently) lower system values.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Tue, 7 Feb 2023 04:23:59 +0000 (23:23 -0500)]
pan/blit: Lower load_sampler_lod_parameters_pan
This will be needed to decouple the lowering in the Midgard compiler from the
specific sampler descriptors used in the blit code.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 16:37:13 +0000 (11:37 -0500)]
pan/lower_framebuffer: Use nir_shader_instructions_pass
Removes a lot of indentation, and improves metadata handling.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 16:34:02 +0000 (11:34 -0500)]
pan/lower_framebuffer: Only call for FS
It doesn't make sense for shader stages other than fragment (and blend which is
fragment-like), assert this.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 16:11:10 +0000 (11:11 -0500)]
pan/mdg: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 16:16:08 +0000 (11:16 -0500)]
pan/bi: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:58:33 +0000 (10:58 -0500)]
pan/mdg: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:57:15 +0000 (10:57 -0500)]
pan/bi: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:50:00 +0000 (10:50 -0500)]
panfrost: Remove unused inputs.nr_cbufs
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:58 +0000 (10:49 -0500)]
panfrost: Remove inputs->blend.rt
This sideband input is now unused, as the information is available locally
within the NIR as it should be.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:57 +0000 (10:49 -0500)]
pan/mdg: Use I/O semantics for MRT blend stores
This avoids the silly reliance on the sideband.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:56 +0000 (10:49 -0500)]
pan/bi: Remove bi_load_sysval
It is unused and should stay unused, as any use is a violation of Ekstrand's
rule.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:54 +0000 (10:49 -0500)]
pan/bi: Lower gl_VertexID in NIR
This gets rid of the hidden gl_BaseVertex system value which violates Ekstrand's
rule.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:52 +0000 (10:49 -0500)]
pan/bi: Allow specializing bifrost_nir_options by arch
We need different settings for Bifrost and Valhall. Keeping everything static
simplifies lifetimes.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:50 +0000 (10:49 -0500)]
pan/bi: Lower load_output to make sysval explicit
See previous commits for justification. Later, we'll split up NIR processing in
a few steps to give the caller a chance to lower the sysval, at which point the
goofy inputs here will go away.
v2: Only lower in fragment shaders. Likely harmless to run elsewhere but still
wrong because the location enum is defined per-stage.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:47 +0000 (10:49 -0500)]
pan/bi: Lower sample mask writes in NIR
This uses the new NIR sysvals to avoid materializing magic sysvals in the
driver, getting us closer to the Ekstrand Rule.
v2: Only lower for fragment shaders. Lowering in vertex shaders should be a
no-op, except that FRAG_RESULT_SAMPLE_MASK shadows a VARYING_SLOT for fog
coords, causing v1 of this patch to regress fog. Caught by the G52 piglit job in
CI. Thank you, Marge.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:44 +0000 (10:49 -0500)]
pan/bi: Don't duplicate texture op cases
These two switches are redundant.
Furthermore, bi_tex_op could previously assume its input was a supported texop,
so it returned undefined values for unsupported texops. Now, without the guard
in front of it, bi_tex_op should check for supported texops, so we need to drop
the unsupported texops from the switch.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:38 +0000 (10:49 -0500)]
panfrost: Use 0/~0 boolean for MSAA sysval
For consistency with NIR.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:32 +0000 (10:49 -0500)]
nir: Add Mali load_output taking converison
Mali's LD_TILE instruction (mapping to NIR's load_output) requires a "conversion
descriptor" specifying how to convert from the register foramt to the tilebuffer
format. To implement framebuffer fetch on OpenGL without shader variants, we
generate these descriptors in the driver and pass them in a uniform. However, to
comply with the Ekstrand Rule, we can't have magically materialized system
values -- they should come only from the NIR where the driver can lower as it
pleases (e.g. PanVK can lower to a constant because it knows the framebuffer
format at pipeline create time). Add intrinsics to model this.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Alyssa Rosenzweig [Mon, 6 Feb 2023 15:49:29 +0000 (10:49 -0500)]
nir: Add Panfrost intrinsics to lower sample mask
We want to lower this in NIR instead of the backend IR to give the driver a
chance to lower the "is multisampled?" system value, which makes more sense to
do in NIR. This gets rid of one of the magic compiler materialized sysvals.
Plus, this will let us constant fold away the lowering in Vulkan when we know
that the pipeline is single-sampled / multi-sampled.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
Mark Janes [Wed, 15 Mar 2023 20:45:22 +0000 (13:45 -0700)]
intel/dev: use GFX_VERx10 to detect genX compilation
Depending on the ordering of includes, GFX_VER may not defined for
intel_device_info.h. The failure mode of this case is silent:
BITSET_TEST will be called when it could be compiled out.
GFX_VERx10 should be used in place of GFX_VER. GFX_VERx10 is defined
by a compiler flag, and is always present for genX compilation units.
Fixes:
3c9a8f7a6d2 ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
Mark Janes [Wed, 15 Mar 2023 20:53:29 +0000 (13:53 -0700)]
intel/dev: fix macro naming convention in gen_wa_helpers.py
intel_device_info.h tests macros in the form `INTEL_WA_{id}_GFX_VER`.
gen_wa_helpers.py produced macros in the form `INTEL_GFX_VER_WA_{id}`
Change the generated code to follow intel_device_info.h
Fixes:
3c9a8f7a6d2 ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
Mark Janes [Tue, 14 Mar 2023 17:19:17 +0000 (10:19 -0700)]
intel/dev: fix macro string concatenation for INTEL_WA_{id}_GFX_VER
`INTEL_WA_##id_GFX_VER` evaluates to `INTEL_WA_id_GFX_VER`
instead of numbered identifiers like `INTEL_WA_220579888_GFX_VER`.
Fixes:
3c9a8f7a6d2 ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
Jesse Natalie [Thu, 23 Mar 2023 15:41:00 +0000 (08:41 -0700)]
dzn: Use mesa_loge for DXIL validation errors
This allows them to be printed to OutputDebugString
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 17 Mar 2023 15:18:45 +0000 (08:18 -0700)]
dzn: Enable variable size bindings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 21:36:20 +0000 (14:36 -0700)]
dzn: Support descriptor indexing via bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 19:45:15 +0000 (12:45 -0700)]
dzn: Add a debug option for enabling bindless mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 19:44:43 +0000 (12:44 -0700)]
dzn: Apply bindless lowering when compiling pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 23 Mar 2023 15:33:18 +0000 (08:33 -0700)]
dzn: Only bind descriptor sets up to the used amount of the current layout
Prevents setting a root SRV into a slot that's not declared as an SRV
in the root signature if a set is bound into a higher slot from a previous
draw/dispatch op.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 23 Mar 2023 15:32:12 +0000 (08:32 -0700)]
dzn: Ensure root signatures are re-bound after a meta op
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 19:44:26 +0000 (12:44 -0700)]
dzn: When binding a bindless root signature, bind descriptor heaps first
The D3D spec says it must be so, and not doing this causes problems
on some hardware.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 19:43:45 +0000 (12:43 -0700)]
dzn: Add a binding classification in the pipeline layout remapping
This is needed so that we can handle two special cases:
* Dynamic buffer data is allocated out of a command-buffer-owned buffer,
rather than a descriptor-set-owned buffer, so the remapping puts them
in their own register space.
* Static samplers should be left alone and not converted to bindless.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 3 Mar 2023 16:49:08 +0000 (08:49 -0800)]
dzn: Bind buffers for bindless descriptor sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 3 Mar 2023 16:48:39 +0000 (08:48 -0800)]
dzn: Use separate dirty bits for descriptor sets/dynamic buffers
We'll be able to take advantage of this granularity in bindless mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 3 Mar 2023 16:47:32 +0000 (08:47 -0800)]
dzn: Don't dirty bindings if root signature doesn't change
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 3 Mar 2023 03:58:09 +0000 (19:58 -0800)]
dzn: Allocate descriptor sets in buffers for bindless mode
Modify the root signature stored in the pipeline layout too.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 3 Mar 2023 00:12:01 +0000 (16:12 -0800)]
dzn: Delete unused function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 2 Mar 2023 23:14:29 +0000 (15:14 -0800)]
dzn: Remove defragmenting of descriptor pools
Rather than trying to perfectly defrag, let's just allow re-use.
When a set is allocated for the first time, it locks in its range of
the heap that it'll use. If the last set in the heap is used, then
those descriptors go back to being free, but if a set in the middle
of the heap is freed, those descriptors remain assigned to that set.
A later allocation attempt can reclaim them, as long as the new set
fits.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 2 Mar 2023 21:06:22 +0000 (13:06 -0800)]
dzn: When bindless, only allocate one descriptor per layout entry
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 2 Mar 2023 18:06:13 +0000 (10:06 -0800)]
dzn: Add initial bindless infrastructure
When operating in "bindless" mode, the device will own 2 descriptor
heaps, one for views, and one for samplers. Every time a view is
created (image view, buffer view), a slot is allocated for it out
of the device view heap for each usage type (sampled vs storage).
Then, in a future change, descriptor sets will just contain view/
sampler indices instead of actual descriptors. Instead of copying
these to a cmdbuf-owned descriptor heap, we can directly bind the
descriptor set as a buffer. We'll also modify shaders to perform
an indirection and index into the device heap.
Buffers also get views set up on creation. In a perfect world, we
could just put addresses/sizes in the descriptor set, but DXIL
doesn't support loading from addresses, we need descriptors. When
robust buffer access is disabled *or* descriptor set buffer views
reference the remainder of the buffer, we can just re-use a view
from the buffer and use an offset.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 16 Mar 2023 20:08:42 +0000 (13:08 -0700)]
dzn: Skip setting up UAVs for depth resources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 16 Mar 2023 20:08:33 +0000 (13:08 -0700)]
dzn: Set up SRV descs for 3D textures correctly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 15 Mar 2023 14:46:06 +0000 (07:46 -0700)]
dzn: Don't use plane slice 1 for depth+stencil SRVs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 15 Mar 2023 16:41:55 +0000 (09:41 -0700)]
dzn: Consistently order depth formats before stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 2 Mar 2023 17:58:47 +0000 (09:58 -0800)]
dzn: Put UAVs first for storage images/buffers in descriptor tables
When running in a bindless mode, we won't ever be using SRVs for these.
Change terminology for determining descriptor offsets from "writable"
to "alt" to match naming already used elsewhere.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 2 Mar 2023 16:49:35 +0000 (08:49 -0800)]
dzn: Add some docs around descriptor sets and remove redundant/unused data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 1 Mar 2023 23:47:20 +0000 (15:47 -0800)]
dzn: Fix a leak in descriptor set layout creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 1 Mar 2023 21:59:33 +0000 (13:59 -0800)]
dzn: Remove descriptor heap type from descriptor heap wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Tue, 28 Feb 2023 21:54:18 +0000 (13:54 -0800)]
dzn: Remove device pointers from descriptor heaps
A future change is going to add descriptor heaps *to* the dzn_device,
and having 3x ID3D12Device pointers in a single object just seems
wrong. All of the callers already had a device, so just pass it
along where needed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Fri, 17 Mar 2023 15:18:24 +0000 (08:18 -0700)]
spirv2dxil: Support descriptor indexing capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 15 Mar 2023 15:48:35 +0000 (08:48 -0700)]
spirv2dxil: Only lower readonly images to SRVs when the option is set
This handles the case where readonly is explicitly marked in the shader,
rather than just inferred based on opt_access.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 21:55:20 +0000 (13:55 -0800)]
spirv2dxil: Add a pass to lower deref tex/image and vulkan ubo/ssbo to bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 21:57:35 +0000 (13:57 -0800)]
microsoft/compiler: Update header docs for binding modes supported by compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Thu, 16 Mar 2023 20:26:17 +0000 (13:26 -0700)]
microsoft/compiler: Use store_dest instead of store_dest_value more
The 16bit SSBO load support missed setting the 16bit shader flag.
Make it harder to miss that by only using store_dest_value for things
that don't have a type.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 19:22:35 +0000 (11:22 -0800)]
microsoft/compiler: Support descriptor heap indexing for UBO/SSBO
Treat load_vulkan_descriptor on an input that didn't come from
vulkan_resource_index as a descriptor heap index instead of a
binding index.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 19:20:38 +0000 (11:20 -0800)]
microsoft/compiler: Handle "bindless" image/tex sources as heap indices
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 18:33:32 +0000 (10:33 -0800)]
microsoft/compiler: Split handle annotation into two parts
The first part gets the resource props struct, and the second
actually emits the annotate instruction. Later changes will
get the resource props struct from different sources.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 18:32:14 +0000 (10:32 -0800)]
microsoft/compiler: Add helpers for getting res_props structs
Currently we can get one by looking up already-emitted resource
metadata, but in the future we'll want to be able to get this
info from a call site alone. Depending on the type of call site,
we'll have different sets of info, so add helpers for the
various different kinds of call sites we can support.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 27 Feb 2023 18:29:58 +0000 (10:29 -0800)]
microsoft/compiler: Refactor type -> resource kind helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Wed, 15 Mar 2023 16:58:10 +0000 (09:58 -0700)]
microsoft/compiler: Only set typed UAV load feature bit for multi-comp loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Jesse Natalie [Mon, 13 Mar 2023 18:22:27 +0000 (11:22 -0700)]
microsoft/compiler: Fix setting bit 31 in feature flags
Fixes:
a84208ee ("microsoft/compiler: Fill out and sort the shader/module flags")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
Mark Janes [Wed, 8 Feb 2023 03:08:47 +0000 (19:08 -0800)]
intel/fs: use generated helpers for Wa_14013363432 / Wa_14012688258
Wa_14013363432 is a clone of Wa_14012688258. It does not apply to all
gfx 12.5 platforms.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21745>
David Heidelberg [Mon, 20 Mar 2023 23:24:43 +0000 (00:24 +0100)]
freedreno/decode: fix possible overflow
```
../src/freedreno/decode/rddecompiler.c:242:65: error: 'sscanf' may overflow; destination buffer in argument 3 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
if (sscanf(info->name, "%32[A-Z0-6_][%32[x0-9]].%32s", reg_name,
^
../src/freedreno/decode/rddecompiler.c:243:21: error: 'sscanf' may overflow; destination buffer in argument 4 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
reg_idx, field_name) != 3) {
^
../src/freedreno/decode/rddecompiler.c:243:30: error: 'sscanf' may overflow; destination buffer in argument 5 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
reg_idx, field_name) != 3) {
^
```
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
David Heidelberg [Sun, 19 Mar 2023 14:37:11 +0000 (15:37 +0100)]
ci/freedreno: do not build tools executables without explicitly enabling them
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
Jesse Natalie [Thu, 23 Mar 2023 16:31:56 +0000 (09:31 -0700)]
d3d12: Remove now-unused UAV format from shader info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
Jesse Natalie [Thu, 23 Mar 2023 16:31:11 +0000 (09:31 -0700)]
d3d12: Fix buffer SRV/UAV creation
Get the format right for UAVs (using the image view instead of
relying on the shader having a format specified) and limit the size
to the API-reported size.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
Jesse Natalie [Thu, 23 Mar 2023 16:30:30 +0000 (09:30 -0700)]
d3d12: Report correct texel buffer max size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
Jesse Natalie [Wed, 15 Mar 2023 16:59:10 +0000 (09:59 -0700)]
microsoft/compiler: Handle writable buffer UAV size queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
Sil Vilerino [Thu, 23 Mar 2023 15:31:32 +0000 (11:31 -0400)]
d3d12: Encode - Only upload headers when written headers size is > 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
Sil Vilerino [Thu, 23 Mar 2023 14:56:14 +0000 (10:56 -0400)]
d3d12: Encode H264/HEVC - Do not write PPS unless different from active
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
Sil Vilerino [Thu, 23 Mar 2023 12:47:56 +0000 (08:47 -0400)]
d3d12: H264/HEVC Encode - Set both VBV InitialCapacity/Size in CBR Rate Control to same value when requested
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
Rob Clark [Mon, 20 Mar 2023 21:54:16 +0000 (14:54 -0700)]
freedreno/rnn: Fix reg names for regs with variants
Fixes reg names with headergen2, so that if we have separate a6xx and
a7xx variants for a register we get REG_A6XX_foo and REG_A7XX_foo
instead of both being REG_A6XX_foo. Otherwise generated headers for the
kernel wouldn't compile.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22035>
Amber [Thu, 2 Mar 2023 16:45:30 +0000 (17:45 +0100)]
freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
Amber [Thu, 2 Mar 2023 16:42:57 +0000 (17:42 +0100)]
nir: Add memory coherency information to shaders.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
Amber [Thu, 9 Feb 2023 13:04:46 +0000 (14:04 +0100)]
nir: allow nir_lower_fb_read to support multiple render targets
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
Connor Abbott [Thu, 23 Mar 2023 15:10:59 +0000 (16:10 +0100)]
tu: Fix tile_align_h on a650
This matches what the blob on a650 does and fixes errors when
calculating the tile size due to tile_align_h not being a power of two.
Fixes:
60bc7c0e ("freedreno: Specify GMEM tile alignment per GPU")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22088>
Eric Engestrom [Thu, 23 Mar 2023 15:04:54 +0000 (15:04 +0000)]
v3d: add link to issue investigating failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22089>
Boyuan Zhang [Thu, 23 Mar 2023 13:34:55 +0000 (09:34 -0400)]
frontends/va: check decoder in va surface call
Add a check to see if decoder is valid before using it. Currently we
only support decode and encode operations, return unsupported error
for all other entrypoints.
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21905>
José Roberto de Souza [Fri, 10 Feb 2023 15:50:30 +0000 (07:50 -0800)]
anv: Implement Xe version of execute_simple_batch()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
José Roberto de Souza [Thu, 9 Feb 2023 20:46:33 +0000 (12:46 -0800)]
anv: Handle Xe queue/engine priority
As Xe requires engine info, it is not possible to fetch max priority
from anv_physical_device_get_parameters() call chain, so here
anv_xe_physical_device_max_priority_update() was added.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
José Roberto de Souza [Thu, 9 Feb 2023 20:34:50 +0000 (12:34 -0800)]
anv: Implement Xe version of check_status()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
José Roberto de Souza [Mon, 20 Mar 2023 18:19:13 +0000 (11:19 -0700)]
anv: Create Xe engines
Xe engine is not equal to hardware engine, it is just a submission
queue that will be scheduled in the hardware engine during process
time slice of the GPU.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
José Roberto de Souza [Fri, 17 Mar 2023 16:24:51 +0000 (09:24 -0700)]
anv: Replace I915_ENGINE_CLASS_VIDEO by INTEL_ENGINE_CLASS_VIDEO
Using the value that is not dependent on the KMD uapi.
Not marking as a fixes because both have the same value, so we
don't need a backport.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
Timur Kristóf [Wed, 15 Mar 2023 20:07:15 +0000 (13:07 -0700)]
radv: Enable mesh shading on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 22:56:55 +0000 (23:56 +0100)]
ac/nir/ngg: Store special MS outputs in attribute ring for PS to read.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 22:42:13 +0000 (23:42 +0100)]
ac/nir/ngg: Fix mesh shader layer on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 12:55:38 +0000 (13:55 +0100)]
ac/nir/ngg: Split legacy workgroup index function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 12:13:02 +0000 (13:13 +0100)]
ac/nir/ngg: Use attribute ring for mesh shader params.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Thu, 16 Feb 2023 13:41:36 +0000 (14:41 +0100)]
ac/nir/ngg: Clarify mesh shader scratch ring.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 21:40:43 +0000 (22:40 +0100)]
radv: Adjust mesh draw packets for GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 12:00:44 +0000 (13:00 +0100)]
radv: Include per-prim params in NUM_INTERP on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 11:59:40 +0000 (12:59 +0100)]
radv: Use PRIM_ATTR for PS inputs on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 11:59:08 +0000 (12:59 +0100)]
radv: Add extra offset to per-prim params.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 11:58:07 +0000 (12:58 +0100)]
radv: Use per-prim params in has_param_exports.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
Timur Kristóf [Fri, 17 Feb 2023 11:57:26 +0000 (12:57 +0100)]
radv: Add per-prim attributes to ring_attr stride.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>