Dave Airlie [Tue, 21 Dec 2021 06:15:50 +0000 (16:15 +1000)]
mesa/st: fixup viewport drawable invalidation
This moves the code into more appropriate places
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 06:11:47 +0000 (16:11 +1000)]
mesa/st: move some fbo helpers around.
This inlines one, and moves the other to a more appropriate place
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 06:08:21 +0000 (16:08 +1000)]
mesa/st: move st_new_renderbuffer_fb to manager
This is st_manager code really.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 06:05:15 +0000 (16:05 +1000)]
mesa/st: move map/unmap renderbuffer code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 06:00:19 +0000 (16:00 +1000)]
mesa/st: move st renderbuffer code into mesa renderbuffer
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 05:52:17 +0000 (15:52 +1000)]
mesa/st: move DrawBufferAllocate into mesa.
Little bit of refactoring here.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 05:46:35 +0000 (15:46 +1000)]
mesa/st: move st_ReadBuffer functionality into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 05:43:45 +0000 (15:43 +1000)]
mesa/st: move validate/discard framebuffer into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Tue, 21 Dec 2021 05:38:18 +0000 (15:38 +1000)]
mesa/st: move render/finish_render texture in to mesa.
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Mon, 20 Dec 2021 06:56:41 +0000 (16:56 +1000)]
mesa/st: merge framebuffer objects from st to mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Mon, 20 Dec 2021 06:42:47 +0000 (16:42 +1000)]
mesa/st: move some renderbuffer code into mesa
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Dave Airlie [Thu, 9 Dec 2021 23:35:23 +0000 (09:35 +1000)]
mesa/st: merge st_renderbuffer into gl_renderbuffer.
This touches lots of places
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14675>
Jesse Natalie [Sat, 22 Jan 2022 22:35:16 +0000 (14:35 -0800)]
mesa/st: Lower user clip planes for tess eval too
The logic in st_atom_shader.c leads me to believe this was supposed
to work, but was incomplete to actually finish it. This fixes
compatibility tess tests on d3d12.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14662>
Alyssa Rosenzweig [Sat, 15 Jan 2022 15:06:37 +0000 (10:06 -0500)]
pan/decode: Fix missing newlines in error messages
Otherwise these error message lines end up truncated, which is a bit
annoying.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
Alyssa Rosenzweig [Sat, 15 Jan 2022 15:05:02 +0000 (10:05 -0500)]
pan/bi: Pull BLEND precolouring out of per-dest loop
Indentation fail. This should happen once per instruction, not once per
destination. In theory, this is a minor performance win; in practice,
it's simply less wrong.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
Alyssa Rosenzweig [Sat, 15 Jan 2022 14:48:02 +0000 (09:48 -0500)]
panfrost: Only cull polygons
The spec says only polygons, not points/lines, should be culled when
culling is enabled. The hardware does not make this distinction, so we
have to.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
Alyssa Rosenzweig [Sat, 15 Jan 2022 14:45:26 +0000 (09:45 -0500)]
panfrost: Use u_reduced_prim for primitive checks
Use a Gallium helper that papers over the differences between primitive
types, as required by hardware operation.
[Cc'd to mesa-stable for use in the next commit.]
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
Rob Clark [Thu, 20 Jan 2022 23:46:49 +0000 (15:46 -0800)]
freedreno/a5xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable
Fixes:
99838513aee ("freedreno/a5xx: Add support for clip distances and use them for userclip.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
Rob Clark [Thu, 20 Jan 2022 23:32:34 +0000 (15:32 -0800)]
freedreno/a6xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable
Fixes:
f2ae8d116ab ("freedreno/a6xx: Implement user clip/cull distances")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
Rob Clark [Fri, 21 Jan 2022 02:11:46 +0000 (18:11 -0800)]
freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE
Add a dirty bit for clip_plane_enable changes.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
Rob Clark [Thu, 20 Jan 2022 23:24:18 +0000 (15:24 -0800)]
freedreno: Pass shader cache key instead of shader key
We are going to need to extend the cache key to add state that effects
the program stateobj, but not necessarily the shader itself (ie. so
ir3_shader_key wouldn't be the correct place to add it).
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
Rob Clark [Fri, 21 Jan 2022 16:58:07 +0000 (08:58 -0800)]
mesa/st: Lowered ucp should still mark rast state dirty
Lowered clip planes should respect the enabled/disabled GL_CLIP_PLANEn
(aka GL_CLIP_DISTANCEn), which means updating the rast state as well.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
Alyssa Rosenzweig [Sun, 16 Jan 2022 19:41:22 +0000 (14:41 -0500)]
agx: Lower UBO loads to use per-element indexing
This lets us support indirect access to UBOs easily. The existing
constant special case disappears too, since the peephole optimizer can
inline the constant later. (note: this is too conservative since we can
go up to 16-bit immediates...)
Unfortunately, nir_opt_algebraic can't seem to optimize expressions like
"((a << 3) + 4) >> 2" to "(a << 1) + 1" which would be necessary for
reasonable perf out of this...
Fixes:
dEQP-GLES2.functional.shaders.indexing.uniform_array.float_dynamic_loop_read_fragment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14581>
Rohan Garg [Mon, 24 Jan 2022 13:30:00 +0000 (14:30 +0100)]
docs: Update features and new_features for anv
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14681>
Iago Toral Quiroga [Mon, 24 Jan 2022 10:36:37 +0000 (11:36 +0100)]
v3dv: implement VK_KHR_driver_properties
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14680>
Bas Nieuwenhuizen [Fri, 31 Dec 2021 14:18:44 +0000 (15:18 +0100)]
radv: Remove VK_EXT_display_control support in favor of common impl.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
Bas Nieuwenhuizen [Fri, 31 Dec 2021 14:17:48 +0000 (15:17 +0100)]
anv: Remove VK_EXT_display_control support in favor of common impl.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
Bas Nieuwenhuizen [Fri, 31 Dec 2021 14:16:24 +0000 (15:16 +0100)]
vulkan/wsi/display: Add common implementation of VK_EXT_display_control.
Based on the new vk_sync functions.
Copied the version from anv as that seemed more thorough by using the
temporary sync payload. However that does mean we have do use the vk_sync
functions instead of being able to layer it on top of the dispatch table.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14365>
Rohan Garg [Fri, 14 Jan 2022 14:02:17 +0000 (15:02 +0100)]
anv: Enable VK_VALVE_mutable_descriptor_type
This change introduces the anv_descriptor_size_for_mutable_type and
anv_descriptor_data_for_mutable_type helpers to compute the size and
data flags respectively for mutable descriptor types.
In order to make handling these types easier we now store a precomputed
descriptor stride for all types and use in the in appropriate places.
We also need to adjust the compiler to take into account this descriptor
stride. To that extent, we now pack the stride into the upper 16 bits
alongside the index and the dynamic offset index and use it later to
compute the correct offset.
Closes: #4250
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14633>
Jianxun Zhang [Thu, 13 Jan 2022 20:29:33 +0000 (12:29 -0800)]
anv: refactor queue chain
Simplify the buffer chaining process with a single loop and
a helper function from Lionel Landwerlin's input.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14578>
Iago Toral Quiroga [Mon, 24 Jan 2022 10:42:50 +0000 (11:42 +0100)]
broadcom/simulator: handle DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT
Without this the simulator wrapper will abort upon seeing this
query, rendering the driver unusable in that context.
Also, it seems the simulator environment doesn't quite work with
multisync at present, so do not enable it until we figure out what
the issue is.
Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14678>
Samuel Pitoiset [Wed, 19 Jan 2022 10:19:50 +0000 (11:19 +0100)]
radv: stop checking if pipelines are NULL during draws/dispatches
This can't happen.
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/14617>
Kenneth Graunke [Wed, 19 Jan 2022 15:20:57 +0000 (07:20 -0800)]
iris: Directly access BOs rather than using iris_resource_bo(...)
iris_resource_bo() is convenient when we only have a pipe_resource *
variable, and don't need to do a lot with it other than get at the BO.
When we need to do more with a resource, we usually cast it to
iris_resource *, at which point we can just use res->bo instead.
This patch updates iris_copy_region to use src_res->bo, dst_res->bo,
rather than iris_resource_bo(src) and iris_resource_bo(dst), since we
already have those cast versions on hand.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14667>
Iago Toral Quiroga [Mon, 24 Jan 2022 09:54:53 +0000 (10:54 +0100)]
docs/features: flag VK_KHR_create_renderpass2 as implemented for v3dv
This was implemented in
3c862923219.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14677>
Samuel Pitoiset [Wed, 19 Jan 2022 10:59:49 +0000 (11:59 +0100)]
radv: do not restore NULL compute pipelines after meta operations
This should be safe as long as the driver restores descriptors and
push constants correctly for compute pipelines.
This might also reduce the number of compute pipeline changes if eg.
consecutve subpass fast clears with compute.
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/14616>
Samuel Pitoiset [Wed, 19 Jan 2022 09:37:58 +0000 (10:37 +0100)]
radv/winsys: set GTT_WC flag for CS IBs on GFX6
It was missing it seems.
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/14612>
Samuel Pitoiset [Wed, 12 Jan 2022 16:19:26 +0000 (17:19 +0100)]
radv: fix copying VRS rates if the ds attachment uses mips
While the VRS image can't have mips (and no layers because still not
supported by RADV), applications might still want to bind a
depth/stencil attachment where the base level isn't 0.
Found by inspection.
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/14518>
Samuel Pitoiset [Fri, 7 Jan 2022 07:59:53 +0000 (08:59 +0100)]
radv: fix copying VRS rates to HTILE if the depth/stencil is cleared
If the application binds a fragment shading rate attachment to a
subpass and also clears the depth stencil attachment, the VRS rates
would have been reinitialized to 1x1 with fast clears. It makes more
sense to clear and then copy instead of the opposite.
Found by inspection.
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/14518>
Samuel Pitoiset [Wed, 12 Jan 2022 14:00:34 +0000 (15:00 +0100)]
radv: disable attachmentFragmentShadingRate for RADV_DEBUG=nohiz
Region based VRS can only work if HTILE is enabled.
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/14518>
Sagar Ghuge [Tue, 24 Aug 2021 01:05:50 +0000 (18:05 -0700)]
intel/genxml: Add Un-Typed Data-Port Cache Flush field to pipe control
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14676>
Sagar Ghuge [Thu, 12 Aug 2021 18:37:26 +0000 (11:37 -0700)]
intel/genxml: Add L1 Cache Control bit field
Add L1 cache control bit field to RENDER_SURFACE_STATE and
STATE_BASE_ADDRESS instruction.
v1: (Jason)
- Add prefix to bit field
- Don't miss out STATE_BASE_ADDRESS instruction
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14676>
Thomas H.P. Andersen [Thu, 20 Jan 2022 16:42:52 +0000 (17:42 +0100)]
ci: clean up debian-android no-error list
I see no warnings of these in the log of a recent CI build
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14638>
Bas Nieuwenhuizen [Sun, 23 Jan 2022 22:43:49 +0000 (23:43 +0100)]
util/fossilize_db: Fix double free in error handling.
If the file ptr is not NULL then foz_destroy will also try to destroy it.
Fixes:
eca6bb9540d ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14671>
Francisco Jerez [Wed, 20 Oct 2021 00:52:06 +0000 (17:52 -0700)]
iris/xehp: Implement workaround for 3D texturing+anisotropic filtering.
Implements a workaround for HSDES#
14014414195. Note that this change
deviates heavily from the workaround suggested in the HSDES, since all
of the suggestions are either costly at runtime or outright
non-compliant, so they would require us to apply the workaround
selectively for affected applications.
Instead of adding hacks to the compiler that manually implement the
LOD computation of 3D texturing operations in the shader, initialize
an extra sampler state structure in the driver that has anisotropic
filtering forced off, and use it instead of the normal sampler state
structure whenever a 3D texture is bound to the same sampler unit.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14489>
Jesse Natalie [Wed, 19 Jan 2022 19:22:29 +0000 (11:22 -0800)]
docs: Update d3d12 features
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Wed, 19 Jan 2022 19:19:16 +0000 (11:19 -0800)]
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>
Jesse Natalie [Mon, 17 Jan 2022 18:29:45 +0000 (10:29 -0800)]
d3d12: When mapping a non-directly-mappable resource for write, readback first
For non-discard writes, we need to make sure that the resource has valid contents
so they can be *updated*, not overwritten.
We have to skip this when doing asynchronous maps, but that should be okay, because
the threading context should only do asynchronous map-write when the resource is
known to be idle/empty.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 17 Jan 2022 15:31:53 +0000 (07:31 -0800)]
d3d12: Support dynamic UBO/SSBO indexing
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 21:43:15 +0000 (13:43 -0800)]
d3d12: Run point sprite lowering pass on multi-stream GS when safe
In the case of a multi-stream GS that is attempting to output wide
points to stream 0, we can support this by lowering stream 0 to
triangles and then removing the other streams. This is only valid
to do if the other streams are not being written to stream output,
either if they're not present in the SO info or no buffer is bound.
Fixes the arb_gpu_shader5/arb_gpu_shader5-emitstreamvertex_nodraw
piglit test which does this.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 21:32:26 +0000 (13:32 -0800)]
d3d12: Apply GS point sprite lowering to fixed-function point size too
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 21:32:09 +0000 (13:32 -0800)]
d3d12: Report number of GS streams
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 14:34:55 +0000 (06:34 -0800)]
d3d12: Temp resources for same-resource copies can be MSAA too
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 14:30:27 +0000 (06:30 -0800)]
d3d12: Relax multisampling direct copy requirements
D3D has supported partial copying of MSAA resources as as long as
the sample counts match since D3D10.1
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 00:44:32 +0000 (16:44 -0800)]
d3d12: Modify shaders when MSAA is disabled
I couldn't find this in a spec but the builtin-gl-sample-mask piglit
seems to expect writing to the output sample mask to do nothing when
max num samples == 0.
The ForcedSampleCount property should make everything appear as if
MSAA is disabled. However, it's undefined behavior if depth is
bound, so in that case, we can at least use a lowering pass to
make things *look* like MSAA is off, unless you use atomics to
count invocations.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 13 Jan 2022 20:37:10 +0000 (12:37 -0800)]
d3d12: Report sample positions
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 13 Jan 2022 19:17:17 +0000 (11:17 -0800)]
d3d12: Lower load_sample_pos to load_sample_pos_at_id
D3D doesn't have an intrinsic for loading the current sample's
position, only for loading a specific sample's intrinsic. Fortunately,
we can also just get the current sample. So do that.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 13 Jan 2022 17:44:26 +0000 (09:44 -0800)]
d3d12: Sample mask output needs to be uint-typed
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Wed, 19 Jan 2022 22:19:23 +0000 (14:19 -0800)]
microsoft/compiler: Lower helper invocations
DXIL adds this in SM6.6, so when we get around to being able to
emit SM6.6, we can conditionally turn this off and support emitting
the new intrinsic. Until then, this is easy.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 17 Jan 2022 21:54:25 +0000 (13:54 -0800)]
microsoft/compiler: Handle msb/lsb/bfrev
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 17 Jan 2022 21:38:36 +0000 (13:38 -0800)]
microsoft/compiler: Use ibfe/ubfe for bitfield extract instead of lowering to shifts
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 17 Jan 2022 21:20:53 +0000 (13:20 -0800)]
microsoft/compiler: Handle bitfield_insert
This *almost* matches what GLSL wants, except for the handling of
large widths. You can see this in the lowering algorithm:
(('bitfield_insert', 'base', 'insert', 'offset', 'bits'),
('bcsel', ('ult', 31, 'bits'), 'insert',
('bfi', ('bfm', 'bits', 'offset'), 'insert', 'base')),
'options->lower_bitfield_insert'),
DXIL's 'bfi' instruction is an inseparable pairing of NIR's 'bfi(bfm(...), ...)',
so we just apply the additional bcsel in the backend.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 17 Jan 2022 15:49:22 +0000 (07:49 -0800)]
microsoft/compiler: Emit samplers as array types
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Mon, 3 Jan 2022 12:58:17 +0000 (04:58 -0800)]
microsoft/compiler: Handle load_invocation_id for GS and HS
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Sat, 15 Jan 2022 01:33:05 +0000 (17:33 -0800)]
microsoft/compiler: Handle tex texture/sampler offset srcs
Note that these offsets are 0-based, so to make them binding IDs we
need to explicitly add the base ID to them.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Sat, 15 Jan 2022 00:16:31 +0000 (16:16 -0800)]
microsoft/compiler: Handle input coverage
Note that GL requires input coverage for sample execution mode to
be only the single bit corresponding to the executing sample, so
rearrange things to understand during shader emitting if we're
executing per-sample to emit the right coverage value.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 22:40:18 +0000 (14:40 -0800)]
microsoft/compiler: Handle textureGatherCmp
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Fri, 14 Jan 2022 22:23:17 +0000 (14:23 -0800)]
microsoft/compiler: Handle 'pull model' explicit interpolation intrinsics
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Sun, 21 Nov 2021 00:50:00 +0000 (16:50 -0800)]
microsoft/compiler: Always have at least one GS active stream
DXIL validation will fail if there's no stream that has a valid
primitive topology, which is what happens in the case of no
active streams.
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 13 Jan 2022 19:16:52 +0000 (11:16 -0800)]
microsoft/compiler: Handle load_sample_pos_at_id
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 13 Jan 2022 17:36:01 +0000 (09:36 -0800)]
microsoft/compiler: Handle variables declared per-sample
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14624>
Jesse Natalie [Thu, 20 Jan 2022 13:50:02 +0000 (05:50 -0800)]
ci/windows: Use 2 container stages
The first container stage ("build") is for dependencies of the build.
These are infrequently-changing things like Visual Studio, LLVM, git,
and also meson. The second container stage ("test") currently depends
on the first, and adds test dependencies like piglit.
This lets us rev piglit without having to rebuild LLVM.
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14637>
Ian Romanick [Wed, 15 Dec 2021 01:55:21 +0000 (17:55 -0800)]
mesa: OpenGL ES 1.1 is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:51:56 +0000 (17:51 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_point_parameters is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:47:55 +0000 (17:47 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_minmax is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:45:24 +0000 (17:45 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_func_separate is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:43:04 +0000 (17:43 -0800)]
mesa: OpenGL 1.4 feature GL_EXT_blend_color is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:41:31 +0000 (17:41 -0800)]
mesa: OpenGL 1.4 feature GL_ARB_texture_env_crossbar is not optional
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Ian Romanick [Wed, 15 Dec 2021 01:32:30 +0000 (17:32 -0800)]
mesa: OpenGL 1.4 feature GL_ARB_depth_texture is not optional
Cheatsheet:
_mesa_has_ARB_depth_texture() becomes (true && ctx->Extensions.Version
>= _mesa_extension_table[...].version[ctx->API]). The last value is 0
when ctx->API is API_OPENGL_COMPAT and ~0 otherwise. The whole function
effectively becomes (ctx->API == API_OPENGL_COMPAT).
_mesa_has_OES_depth_texture() becomes (true && ctx->Extensions.Version
>= _mesa_extension_table[...].version[ctx->API]). The last value is 0
when ctx->API is API_OPENGLES2 and ~0 otherwise. The whole function
effectively becomes (ctx->API == API_OPENGLES2).
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>
Jordan Crouse [Fri, 21 Jan 2022 18:26:12 +0000 (18:26 +0000)]
turnip: Update the msm_kgsl.h header with the sanitized 4.19 version
The current msm_kgsl.h header in the tree isn't sanitized and the kernel
specific macros will confuse a compiler. Copy in the sanitized version of
the header from the 4.19 kernel tree which also adds a few new API bits
that are currently unused but may be useful some day.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14651>
Connor Abbott [Wed, 19 Jan 2022 10:24:13 +0000 (11:24 +0100)]
tu/blit: Don't set CLAMPENABLE in sampler for 3d path
This was copied from the blob before we understood what it did, and it
has questionable utility: there's nothing in the GL, Vulkan, or D3D11
specs that require the result be clamped to the underlying range to
account for imprecision. And it doesn't make sense at all for cubic
filtering, because the result can legitimately be outside the range in
some scenarios. Just remove it.
This fixes a bunch of tests added in vulkan CTS 1.2.8 to test blitting
from compressed textures, which use random inputs and therefore are more
likely to hit the out-of-range condition. For example,
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.etc2_r8g8b8a8_unorm_block.r8g8b8a8_snorm.general_general_cubic.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14613>
Connor Abbott [Tue, 18 Jan 2022 17:46:49 +0000 (18:46 +0100)]
freedreno/a6xx: Name texture descriptor bit
This appears to do the same thing as CLAMPENABLE on a3xx. That is, it
clamps the result to [0, 1] for unorm formats and [-1, 1] for snorm
formats *after* filtering. In particular it's now more easily observable
with cubic filtering, because cubic filtering can produce values outside
the original range. Presumably this only matters with linear filtering
due to rounding errors when computing the weighted average.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14613>
Nanley Chery [Thu, 8 Nov 2018 00:39:54 +0000 (16:39 -0800)]
intel/isl: Allow creating MCS in Tile4 memory
This enables MCS support on XeHP, now that MCS can be created with a
tiling supported by that platform.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>
Nanley Chery [Mon, 29 Mar 2021 18:01:51 +0000 (11:01 -0700)]
intel/gen125.xml: Increase Auxiliary Surface Pitch
See Bspec 43862.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>
Nanley Chery [Wed, 8 Dec 2021 01:40:15 +0000 (20:40 -0500)]
Revert "intel/isl: Don't reconfigure aux surfaces for MCS"
This reverts commit
2f0fbe06e65c5ae6c3e9ab3943a4a7d01ae9dc2f.
We don't handle the reconfiguration of existing HiZ surfaces, nor do we
do so for CCS surfaces. This code path is unused, so we remove it.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>
Nanley Chery [Wed, 8 Dec 2021 02:23:35 +0000 (21:23 -0500)]
intel/isl: Strengthen MCS SINT format restriction
The gfx7 MCS restriction for SINT formats actually applies to
multisampling in general. Place the stronger restriction in the format
support check and assert this in isl_surf_get_mcs_surf.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>
Nanley Chery [Wed, 8 Dec 2021 01:37:25 +0000 (20:37 -0500)]
intel/isl: Don't check pitch in isl_surf_get_mcs_surf
The pitch check for 16x multisampled surfaces should already be covered
by the pitch_in_range check in isl_calc_row_pitch.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14464>
Samuel Pitoiset [Wed, 19 Jan 2022 12:40:06 +0000 (13:40 +0100)]
radv: optimize CPU overhead of si_cp_dma_prefetch() slightly
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5008
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/14618>
Adam Jackson [Wed, 27 Oct 2021 21:49:23 +0000 (17:49 -0400)]
wsi/x11: Avoid a class of deadlocks in the WSI queue thread
Here are two facts, each mildly unpleasant, quite nasty taken together:
- xcb_wait_for_special_event retries its poll() if the fd woke up but
no matching event arrived, without verifying that the special event
queue is still registered.
- Present gives no in-band notification of window destruction.
Now if the window is destroyed before the swapchain we're in trouble.
Our WSI thread might be stuck in xcb_wait_for_special_event as we're
awaiting a completion that won't come (the pixmap was being presented as
the window, and then the window was destroyed, so no more events can
happen on that window).
The solution is to use xcb_poll_for_special_event, which is
non-blocking, and handle the appropriate edge cases. If we've run the
event queue but we still don't have an image to acquire, we poke the X
server with a request that gently verifies that the window exists,
allowing the thread to exit gracefully in the above case. We detect
when we're busy-looping, and poll on the X connection for up to 1ms in
response to avoid burning the CPU.
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13564>
Bas Nieuwenhuizen [Thu, 13 Jan 2022 11:51:52 +0000 (12:51 +0100)]
Revert "nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants"
This reverts commit
a1af902531122464b0f4eb66a7c4bf207a8a69f1.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5423
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14532>
Charles Baker [Thu, 13 Jan 2022 07:19:33 +0000 (20:19 +1300)]
Revert "zink: handle vertex buffer offset overflows"
This reverts commit
9823b970fb51db21ac6ce29753eba82dc25f3072.
From VkPhysicalDeviceLimits [1]:
> maxVertexInputAttributeOffset is the maximum vertex input attribute
offset that can be added to the vertex input binding stride. The offset
member of the VkVertexInputAttributeDescription structure must be
less than or equal to this limit.
The maxVertexInputAttributeOffset is a limit on the offset of a vertex
attribute within a vertex rather than a limit on offsets for vertex
buffer bindings. The code to bind temporary buffers can be removed.
[1] https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceLimits.html
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14572>
Rhys Perry [Wed, 8 Dec 2021 12:31:21 +0000 (12:31 +0000)]
radv: use 8x4 workgroups for wave32 RT
Beginning of Quake II RTX, 50% resolution scale, RX 6800: 54 -> 56 FPS.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>
Rhys Perry [Thu, 2 Dec 2021 16:12:23 +0000 (16:12 +0000)]
radv: use wave32 for raytracing
Beginning of Quake II RTX, 50% resolution scale, RX 6800: 48 -> 54 FPS.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>
Rhys Perry [Thu, 2 Dec 2021 16:08:47 +0000 (16:08 +0000)]
radv: fix raytracing with wave32
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5452
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14011>
Charles Baker [Thu, 9 Dec 2021 20:22:28 +0000 (09:22 +1300)]
zink: Set vertex binding stride without dynamic state extensions
EXT_vertex_input_dynamic_state
When both EXT_vertex_input_dynamic_state and EXT_extended_dynamic_state
are not available stride is never set and nothing is rasterized as all
triangles are degenerate.
This fix copies stride into the VkVertexInputBindingDescription array
when the graphics pipeline is created when those extensions aren't
available.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14549>
Charles Baker [Fri, 14 Jan 2022 02:07:56 +0000 (15:07 +1300)]
zink: Avoid redundant cast to uint on PackHalf2x16 result
For example the previous code generates the following sequence of
SPIR-V instructions ending with a redundant cast to uint:
%2018 = OpExtInst %uint %1 PackHalf2x16 %2017
%2019 = OpBitcast %uint %2018
The new code generates:
%2018 = OpExtInst %uint %1 PackHalf2x16 %2017
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>
Charles Baker [Thu, 9 Dec 2021 20:22:28 +0000 (09:22 +1300)]
zink: Output PackHalf2x16 to uint not float
Fixes InconsistentSpirv validation errors reporting that PackHalf2x16
outputs uint rather than float.
For example the previous code generates the following SPIR-V with
PackHalf2x16 output as a float:
%2018 = OpExtInst %float %1 PackHalf2x16 %2017
%2019 = OpBitcast %uint %2018
The new code generates:
%2018 = OpExtInst %uint %1 PackHalf2x16 %2017
%2019 = OpBitcast %uint %2018
cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>
Rhys Perry [Thu, 6 Jan 2022 19:07:37 +0000 (19:07 +0000)]
ac/nir: use shorter builder names
This makes a lot of lines shorter.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>
Rhys Perry [Fri, 7 Jan 2022 16:06:11 +0000 (16:06 +0000)]
ac/nir: avoid providing an align_mul to intrinsic builders
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>
Rhys Perry [Fri, 7 Jan 2022 16:05:27 +0000 (16:05 +0000)]
ac/nir: avoid providing a write_mask to intrinsic builders
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>
Rhys Perry [Thu, 6 Jan 2022 19:03:00 +0000 (19:03 +0000)]
radv: avoid providing an align_offset to intrinsic builders
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>