Jason Ekstrand [Mon, 4 Jul 2022 14:49:02 +0000 (09:49 -0500)]
vulkan: Add standard sample locations
This looks a bit funny because we define the struct in the .c file but
that will be fixed in the next commit.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
Jason Ekstrand [Mon, 27 Jun 2022 14:03:02 +0000 (09:03 -0500)]
vulkan: Add an enum for all dynamic graphics states
Also, add a helper function to turn VkPipelineDynamicStateCreateInfo
into a bitset.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
Jason Ekstrand [Wed, 29 Jun 2022 18:42:26 +0000 (13:42 -0500)]
vulkan: Add a vk_limits.h file for runtime limits
Individual driver limits may be smaller than these.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17328>
Samuel Pitoiset [Mon, 18 Jul 2022 08:10:26 +0000 (10:10 +0200)]
aco: requires Exact for p_jump_to_epilog
Otherwise, in presence of p_exit_early_if the main FS will always
jump to the PS epilog regardless the exact mask.
This fixes dEQP-VK.draw.renderpass.shader_invocation.helper_invocation
and few vkd3d-proton regressions when PS epilogs are forced.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17617>
Juan A. Suarez Romero [Tue, 19 Jul 2022 14:25:21 +0000 (16:25 +0200)]
v3d/v3dv/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17632>
Daniel Schürmann [Thu, 7 Jul 2022 17:05:43 +0000 (19:05 +0200)]
aco: fix assertion in insert_exec_mask
The exec mask might also be of type mask_type_loop.
Fixes:
d068eb53e84ca1e44ad96c31dab63476880b3c72 ('aco/insert_exec_mask: optimize top-level transition to exact before demote')
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17402>
Daniel Schürmann [Fri, 11 Mar 2022 18:12:50 +0000 (19:12 +0100)]
aco: Avoid live-range splits in Exact mode
Because the data register of atomic VMEM instructions
is shared between src and dst, it might be necessary
to create live-range splits during RA.
Make the live-range splits explicit in WQM mode.
Totals from 7 (0.01% of 134913) affected shaders: (GFX10.3)
Latency: 17209 -> 17210 (+0.01%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15347>
Daniel Schürmann [Fri, 11 Mar 2022 16:14:38 +0000 (17:14 +0100)]
aco: avoid unnecessary copies in emit_wqm()
No fossil-db changes.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15347>
Hyunjun Ko [Fri, 15 Jul 2022 08:06:09 +0000 (17:06 +0900)]
turnip: expose VK_EXT_shader_module_identifier
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17614>
Hyunjun Ko [Fri, 15 Jul 2022 08:04:17 +0000 (17:04 +0900)]
turnip: Remove an unnecessary assert.
The assertion is already in the common implementation.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17614>
Konstantin Seurer [Thu, 14 Jul 2022 12:01:19 +0000 (14:01 +0200)]
ac/llvm: Remove load_vertex_id handling
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17539>
Konstantin Seurer [Thu, 14 Jul 2022 11:58:54 +0000 (13:58 +0200)]
aco: Remove dead nir_intrinsic_load_vertex_id case
This intrinsic is lowered in NIR.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17539>
Konstantin Seurer [Thu, 14 Jul 2022 11:56:05 +0000 (13:56 +0200)]
radeonsi: Set vertex_id_zero_based
Let NIR lower load_vertex_id instead of LLVM.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17539>
Konstantin Seurer [Thu, 14 Jul 2022 09:16:22 +0000 (11:16 +0200)]
v3dv: Use nir_gen_rect_vertices
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17535>
Konstantin Seurer [Thu, 14 Jul 2022 09:13:18 +0000 (11:13 +0200)]
radv: Use nir_gen_rect_vertices
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17535>
Konstantin Seurer [Thu, 14 Jul 2022 09:09:38 +0000 (11:09 +0200)]
nir: Add a common gen_rect_vertices implementation
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17535>
Samuel Pitoiset [Thu, 5 May 2022 14:53:13 +0000 (16:53 +0200)]
radv: disable viewport depth clamping only when necessary
When the application uses depth values outside of the [0.0,1.0] range
with VK_EXT_depth_range_unrestricted, or when explicitly disabled.
Otherwise, the driver can clamp to [0.0,1.0] internally for optimal
performance.
From the Vulkan spec "in 28.10.1. Depth Clamping and Range Adjustment":
"If depth clamping is not enabled and zf is not in the range [0, 1]
and either VK_EXT_depth_range_unrestricted is not enabled, or the
depth attachment has a fixed-point format, then zf is undefined
following this step."
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16349>
Iago Toral Quiroga [Mon, 27 Jun 2022 12:12:25 +0000 (14:12 +0200)]
v3dv: implement VK_KHR_buffer_device_address
This feature allows shaders to use pointers to buffers which may
not be bound via descriptor sets. Access to these buffers is done
via global intrinsics.
Because the buffers are not accessed through descriptor sets, any
live buffer flagged with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR
can be accessed by any shader using global intrinsics, so the driver
needs to make sure all these buffers are mapped by the kernel when
it submits the job for execution.
We handle this by tracking if any draw call or compute dispatch in
a job uses a pipeline that has any such shaders. If so, the job is
flagged as using buffer device address and the kernel submission
for that job will add all live BOs bound to buffers flagged with the
buffer device address usage flag.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17275>
Iago Toral Quiroga [Mon, 27 Jun 2022 12:09:47 +0000 (14:09 +0200)]
broadcom/compiler: track if a shader uses global intrinsics
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17275>
Iago Toral Quiroga [Mon, 27 Jun 2022 12:09:28 +0000 (14:09 +0200)]
broadcom/compiler: implement 2x32 global intrinsics
Notice we ignore the high 32-bit component of the address because
we know it must be 0.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17275>
Iago Toral Quiroga [Wed, 22 Jun 2022 09:28:53 +0000 (11:28 +0200)]
nir: add nir_address_format_2x32bit_global
This adds support for global 64-bit GPU addresses as a pair of
32-bit values. This is useful for platforms with 32-bit GPUs
that want to support VK_KHR_buffer_device_address, which makes
GPU addresses explicitly 64-bit.
With the new format we also add new global intrinsics with 2x32
suffix that consume the new address format.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17275>
Iago Toral Quiroga [Fri, 15 Jul 2022 03:29:39 +0000 (05:29 +0200)]
v3dv: remove duplicate condition
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Fri, 15 Jul 2022 03:27:04 +0000 (05:27 +0200)]
v3dv: explain why we clear certain state after a draw call
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Fri, 15 Jul 2022 03:01:22 +0000 (05:01 +0200)]
v3dv: add a dirty state for pending push constants UBO updates
If we have 2 pipelines that consume the same push constant data
but where one of them only uses direct access and the other has
indirect access, a draw with the first pipeline would clear the
dirty flag without updating the UBO and by the time we bind and
draw with the second pipeline we won't upload the constants either
because the first draw cleared the dirty flag.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Thu, 14 Jul 2022 09:15:22 +0000 (11:15 +0200)]
v3dv: allocate more push constant buffers if needed
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Thu, 14 Jul 2022 09:08:49 +0000 (11:08 +0200)]
v3dv: stop tracking push constant buffer references
Since we allocate this ourselves we can immediately add it to the
job at the time we allocate it.
This also fixes a bug we introduced when we implemented inline
uniforms because since that commit, if we had an inline uniform
buffer at index 1 which happend to have indirect access we would
track it in slot 0 instead of slot 1, potentially overwriting
the push constant buffer reference.
Fixes:
ea3223e7a46 ('v3dv: implement VK_EXT_inline_uniform_block')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Thu, 14 Jul 2022 06:58:06 +0000 (08:58 +0200)]
v3dv: don't allocate MAX_PUSH_CONSTANTS_SIZE bytes for the push constants UBO
We have code in there to allocate various segments of MAX_PUSH_CONSTANTS_SIZE
to handle the case of various draw calls in the same command buffer requiring
different push constants, so we are implicitly expecting it to be larger than
this. In fact, this only works now because when we allocate a BO we are always
at least allocating a full page, so the least we ever allocate is 4096 bytes,
so be explicit about it to avoid confusion.
Also, since we were always mapping MAX_PUSH_CONSTANTS_SIZE and the mapping
always starts at the beginning of the BO, it looks like after the first copy
when the resource offset is not zero, we would be writing outside the mapped
range. Always map the full size of the BO instead to ensure this doesn't
happen.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Thu, 14 Jul 2022 08:29:36 +0000 (10:29 +0200)]
v3dv: limit upload of indirect push constant data
We have been always uploading MAX_PUSH_CONSTANTS_SIZE but now that
we track the actual size of the push constant buffer we can use
this instead.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Wed, 13 Jul 2022 10:44:45 +0000 (12:44 +0200)]
v3dv: move push constant data to the command buffer state
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Iago Toral Quiroga [Wed, 13 Jul 2022 09:29:02 +0000 (11:29 +0200)]
v3dv: only save/restore push constant data for meta operations if needed
If the command buffer didn't have any push constants or the meta
operation didn't write any new constants we don't need to restore
the state.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17536>
Jason Ekstrand [Tue, 19 Jul 2022 04:48:59 +0000 (23:48 -0500)]
Revert "vulkan: Detect pNext chain loops in vk_foreach_struct()"
This reverts commit
4c56b535f5b415c24805dccc8d147a60af3f03e3.
Lionel Landwerlin [Mon, 4 Jul 2022 07:05:21 +0000 (10:05 +0300)]
anv: move restart index to gfx state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sat, 2 Jul 2022 19:29:41 +0000 (22:29 +0300)]
anv: fix primitive topology dynamic state emission on gfx7
This dynamic state uses the pipeline information so it needs to be
reemitted whenever the pipeline changes.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sun, 23 Jan 2022 14:20:46 +0000 (16:20 +0200)]
anv: name non dynamic state fields correctly
Those fields have confusing names. They hold non dynamic state,
specified at pipeline creation that we copy into the dynamic state of
the command buffer whenever we bind a pipeline. This non dynamic state
might get picked up in the dynamically emitted instructions of the 3D
pipeline because our HW packets are not exactly splitted like the
Vulkan API.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sun, 23 Jan 2022 14:15:10 +0000 (16:15 +0200)]
anv: reorder & document fields of anv_graphics_pipeline
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Fri, 28 Jan 2022 11:22:26 +0000 (13:22 +0200)]
anv: move CreateRayTracingPipelines to common code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sat, 22 Jan 2022 20:33:35 +0000 (22:33 +0200)]
anv: move CreateComputePipelines to common code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sat, 22 Jan 2022 20:26:46 +0000 (22:26 +0200)]
anv: move CreateGraphicsPipelines to common code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Sat, 22 Jan 2022 12:47:59 +0000 (14:47 +0200)]
anv: rename internal function for consistency
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Jason Ekstrand [Fri, 15 Jul 2022 10:19:12 +0000 (05:19 -0500)]
anv: Don't use the wrong ARRAY_SIZE
Even though this doesn't change anything, it's not good to use an
ARRAY_SIZE for one array to iterate over another.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Fri, 21 Jan 2022 22:35:24 +0000 (00:35 +0200)]
anv: split graphics nir loading
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Fri, 21 Jan 2022 12:36:34 +0000 (14:36 +0200)]
anv: break up anv_pipeline_compile_graphics()
This function is pretty overwhelming.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Wed, 23 Mar 2022 15:05:15 +0000 (17:05 +0200)]
anv: simplify dynamic buffer count in pipeline layout
anv_descriptor_set_layout already has the information we're gather
here.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Lionel Landwerlin [Fri, 21 Jan 2022 12:35:04 +0000 (14:35 +0200)]
anv: remove local computation of dynamic states
This bit mask is already computed in
anv_graphics_pipeline::dynamic_states in anv_graphics_pipeline_init().
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
Jason Ekstrand [Mon, 18 Jul 2022 14:05:59 +0000 (09:05 -0500)]
vulkan: Detect pNext chain loops in vk_foreach_struct()
This implements the "tortoise and the hare" algorithm for detecting
cycles in graphs. We use the caller's iterator as the hare and our own
internal copy as the tortoise. Conveniently, VkBaseOutStructure (and
VkBaseInStructure which is identical except the pointer type on pNext)
have a pointer we can use for the tortoise and an sType which we can use
for a counter to ensure we only increment the tortose every other loop
iteration.
There are more efficient algorithms than tortoise and hare but they
require allocating memory for something like a hash set of seen nodes.
Since this for debug purposes only, it's ok for it to be a bit
inefficient in the case where it hits the assert. In the usual case of
no loops, it's the same runtime efficiency as the unchecked version
except that it does a tiny bit of math and 50% more pointer chases.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17596>
Emma Anholt [Wed, 6 Jul 2022 20:01:24 +0000 (13:01 -0700)]
intel/fs: Simplify brw_barycentric_mode() args.
Reduce a bit of mode lookup noise I was tracing through trying to resolve
the previous bug.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17381>
Lionel Landwerlin [Thu, 7 Jul 2022 09:24:38 +0000 (12:24 +0300)]
intel/fs: Set NonPerspectiveBarycentricEnable when the interpolator needs it.
[anholt: changed to make all drivers do the right thing by moving the
payload barycentric check into the compiler]
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17381>
David Heidelberg [Sat, 16 Jul 2022 13:21:38 +0000 (15:21 +0200)]
ci: move apitrace instalation outside of x86_test-vk
It'll be re-used by piglit traces.
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17573>
Emma Anholt [Thu, 14 Jul 2022 18:33:19 +0000 (11:33 -0700)]
freedreno/ir3: Enable core NIR's 16-bit ALU optimizations.
In addition to hopefully generating shorter code, this optimizes out a
comparison of a mediump-cast value in
dEQP-GLES2.functional.shaders.algorithm.rgb_to_hsl_fragment passed
through ANGLE, and allows the test to pass. We believe it to be a
test bug, but emitting better code like apparently everyone else does
is also a fine result.
No change on GLES gfxbench shaders.
Fixes: #6585
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17546>
Konstantin Seurer [Wed, 13 Jul 2022 12:20:36 +0000 (14:20 +0200)]
vulkan: Common vk_format_get_component_bits
RADV and PowerVR use the same implementation.
Turnip does use a slightly modified version but the helper only has one
use -> just inline it and get rid of turnip's vk_format.h.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17515>
jheaff1 [Sun, 17 Jul 2022 22:04:23 +0000 (23:04 +0100)]
build(glx): Fix build by adding missing deps
dri3_glx.c includes xshmfence and glxcmds.c includes xf86vm, neither of
which are listed as dependencies of the glx lib in the meson.build file.
Consequently, those files would fail to compile on machines that did not
have xshmfence and xf86vm installed globally. This commit rectifies the
issue by adding the missing dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17585>
Mike Blumenkrantz [Tue, 12 Jul 2022 17:57:31 +0000 (13:57 -0400)]
mesa/st: add implicit zeroing of clipdistance array
GL drivers have an implicit default of "in bounds" for unwritten clipdistance
values, but some (layered) drivers have to deal with api mismatch which
prevents that implicit value from being used after the shader
gets mangled by various compiler passes
to avoid issues here, write out all members of the clipdistance array
with zeroes at the very start of the shader such that any values the
shader actually writes will naturally overwrite the implicit zero and
any unwritten values will now be written as zero
fixes #6845
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17498>
Mike Blumenkrantz [Wed, 13 Jul 2022 22:00:13 +0000 (18:00 -0400)]
zink: tu a630 baseline update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17606>
Mike Blumenkrantz [Wed, 13 Jul 2022 22:00:04 +0000 (18:00 -0400)]
zink: nv baseline update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17606>
Adam Jackson [Tue, 12 Jul 2022 18:26:15 +0000 (14:26 -0400)]
kopper: Implement {EGL,GLX}_EXT_buffer_age
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17527>
Mike Blumenkrantz [Fri, 15 Jul 2022 12:26:04 +0000 (08:26 -0400)]
zink: break out tc/trace context unwrapping
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17527>
Yiwei Zhang [Mon, 18 Jul 2022 04:48:29 +0000 (04:48 +0000)]
venus: filter out VK_EXT_physical_device_drm on the driver side
Fixes:
a1a22862c62 ("venus: implement VK_EXT_physical_device_drm")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17591>
Dave Airlie [Thu, 14 Jul 2022 00:34:04 +0000 (10:34 +1000)]
kms/dri: add mutex lock around map/unmap
this can get called from multiple threads with the recent llvmpipe
overlapping rendering changes, so make sure to lock around the
map/unmapping so they can't race.
This should fixes some crashes seen with kwin.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tested-by: Adam Williamson (Fedora)
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17531>
Samuel Pitoiset [Thu, 14 Jul 2022 16:54:20 +0000 (18:54 +0200)]
radv: implement PS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Thu, 14 Jul 2022 16:53:46 +0000 (18:53 +0200)]
aco: add support for compiling PS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 15 Jul 2022 06:28:58 +0000 (08:28 +0200)]
aco: refactor export_fs_mrt_color() for PS epilogs preparation
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Tue, 12 Jul 2022 09:24:23 +0000 (11:24 +0200)]
radv,aco: rename radv_aco_build_prolog to radv_aco_build_shader_part
Will be re-used for PS epilogs.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 24 Jun 2022 14:17:07 +0000 (16:17 +0200)]
aco: add aco_postprocess_shader() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 24 Jun 2022 12:38:59 +0000 (14:38 +0200)]
aco: prevent adding DONE/VM to the last export if the FS has an epilog
If the fragment shader exports MRTZ and the epilog some color exports,
DONE/VM should be added to the last export.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 24 Jun 2022 12:39:10 +0000 (14:39 +0200)]
aco: do not abort if the FS doesn't export anything but has an epilog
The main fragment shader can only export MRTZ (if present) and the
epilog will export colors.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 24 Jun 2022 14:03:52 +0000 (16:03 +0200)]
aco: emit p_jump_to_epilog if the main fragment shader has an epilog
MRTZ is still exported from the main shader.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 24 Jun 2022 12:17:29 +0000 (14:17 +0200)]
aco: add new pseudo instruction p_jump_to_epilog
The first operand of this new pseudo-instruction is a 64-bit SGPR for
the continue PC, followed by a variable list of fixed VGPRS for the
color exports which are the PS epilog inputs.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 17 Jun 2022 14:28:31 +0000 (16:28 +0200)]
radv: add a function that declares PS epilog shader arguments
The PS epilog would be a "normal" compiled shader using RA, etc. It
will declare up to 8x4 VGPRs for all color exports.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 17 Jun 2022 14:22:18 +0000 (16:22 +0200)]
radv: declare a new user SGPR arg in FS for the epilog PC
The main FS would have to jump to the PC of the PS epilog. Given that
shaders are allocated in the 32-bit addr space, one user SGPR is fine.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 17 Jun 2022 14:27:33 +0000 (16:27 +0200)]
radv,aco: introduce {radv,aco}_ps_epilog_key
To pass the necessary pipeline information for compiling PS epilogs.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Samuel Pitoiset [Fri, 17 Jun 2022 14:26:32 +0000 (16:26 +0200)]
radv,aco: track if a fragment shader needs an epilog
This is currently disabled but it will be used for testing first,
and then for graphics pipeline libraries.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17485>
Ruijing Dong [Tue, 12 Jul 2022 18:40:19 +0000 (14:40 -0400)]
frontends/va: WA for ffmpeg 10bit encoding crash
When doing 10bit encoding in ffmpeg it uses
VaDeriveImage, and that could result in missing
mapping the chroma buffer of the input frame.
This WA to disallow ffmpeg using VaDeriveImage
function, so that VaCreateImage and VaPutImage can
be used and WA the chroma buffer mapping issue.
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17472>
Ruijing Dong [Tue, 12 Jul 2022 13:42:58 +0000 (09:42 -0400)]
frontends/va: do texture_map when needed
When map buffer, and its target is texture,
texture_map/unmap need to be used.
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17472>
Erik Faye-Lund [Mon, 13 Jun 2022 11:48:22 +0000 (13:48 +0200)]
dzn: expose VK_KHR_driver_properties
We're not quite conformant with the extension, because we don't have
a valid conformance version.
That's not a quick-fix, so we should probably just accept some failures
for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:37:27 +0000 (14:37 +0200)]
dzn: fill misc props
This is just a bag of misc properties that we should fill in.
Not all of them are filled out super accurately, but this is the best we
can do for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:37:05 +0000 (14:37 +0200)]
dzn: fill in minmax props
This should be possible to support, but we don't support minmax blending
at all yet, so let's leave these as unsupported for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:33:35 +0000 (14:33 +0200)]
dzn: fill in depth/stencil resolve props
Before enabling Vulkan 1.2 support, we need to fix the TODO in here.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:29:42 +0000 (14:29 +0200)]
dzn: fill in bindless props
These might not be exactly right, but they are good enough for now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:09:12 +0000 (14:09 +0200)]
dzn: fill in non-uniform-indexing props
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 12:03:46 +0000 (14:03 +0200)]
dzn: fill in float-control details
We can do better here in the future, but this is what's supported right
now.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Erik Faye-Lund [Mon, 13 Jun 2022 11:47:51 +0000 (13:47 +0200)]
dzn: fill in driver name and info
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16998>
Konstantin Seurer [Sun, 17 Jul 2022 09:20:23 +0000 (11:20 +0200)]
radv: Only set rt stack size for dynamic stacks
When using a static callable stack, the required scratch has already
been allocated.
Dynamic stacks are located at the end of scratch memory
and are allocated on demand using radv_set_rt_stack_size.
Static stacks live at the start of scratch memory and are allocated in
create_rt_shader by setting scratch_size.
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17579>
Qiang Yu [Tue, 28 Jun 2022 08:18:21 +0000 (16:18 +0800)]
ac/nir/ngg: add a barrier before prim id export
When culling enabled, it will use LDS space, which overlap with
the prim id export.
Fixes:
e97f0463a8f ("ac/nir: Implement NGG deferred attribute culling in NIR.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17593>
Qiang Yu [Thu, 7 Jul 2022 11:40:48 +0000 (19:40 +0800)]
ac/nir/ngg: fix nogs culling scratch size
Should be in bytes not dwords.
Fixes:
e97f0463a8f ("ac/nir: Implement NGG deferred attribute culling in NIR.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17593>
Timur Kristóf [Sun, 17 Jul 2022 16:02:57 +0000 (18:02 +0200)]
radv: Remove trailing whitespace introduced by DGC commits.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17580>
Timur Kristóf [Sun, 17 Jul 2022 16:01:34 +0000 (18:01 +0200)]
radv: Only initialize DGC state when DGC is enabled.
This function causes a crash with RADV_DEBUG=llvm and this commit
works around that crash.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17580>
Mike Blumenkrantz [Wed, 13 Jul 2022 16:17:29 +0000 (12:17 -0400)]
zink: inject a 0,0,0,1 clear for RGBX formats
this ensures the alpha component is full if it must be read for fbfetch
fixes (RGBX swapchain config):
KHR-GL46.blend_equation_advanced*
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 14:38:42 +0000 (10:38 -0400)]
zink: simplify zink_framebuffer_clear_data union
no functional changes
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 14:37:33 +0000 (10:37 -0400)]
zink: delete srgb tracking for clears
no longer used
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 14:35:03 +0000 (10:35 -0400)]
zink: delete zink_fb_clear_util_unpack_clear_color
no longer used
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 12:46:38 +0000 (08:46 -0400)]
zink: remove out-of-renderpass clears
these are only ever going to hurt tiler perf, so remove the footgun
this also means there's no more srgb format conversion needed, so delete
all of that too
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 18:24:27 +0000 (14:24 -0400)]
zink: lift clearing on fb state change up a level
in the scenario where:
* at least 1 color buffer was bound and a depth buffer was bound
* no color clear was enabled
* a zs clear was enabled
* the zs clear was never flushed
* the zs clear needs a renderpass
* the fb state changes
the color buffer(s) would be unbound, following which the depth buffer unbind
would trigger a renderpass, which would utilize the just-unbound color buffers,
which have no batch tracking, thus creating a case where the surface was destroyed
while it was still in use
cc: mesa-stable
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Fri, 8 Jul 2022 14:49:54 +0000 (10:49 -0400)]
zink: clamp color clear values based on format
formats like GL_RGB10_A2UI can be cleared with out of range values,
so to ensure consistent driver behavior, pre-clamp to the valid range
affects:
KHR-GL46.direct_state_access.renderbuffers_storage_multisample
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Fri, 8 Jul 2022 15:47:56 +0000 (11:47 -0400)]
zink: add explicit (awful) handling for fb layer mismatch clears
this is terrible and (hopefully?) rare, so just force it out early to
avoid any kind of issue
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Fri, 8 Jul 2022 15:35:39 +0000 (11:35 -0400)]
zink: track a bitmask of fb attachments with mismatched layer counts
these need special handling for clears
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Fri, 8 Jul 2022 12:29:03 +0000 (08:29 -0400)]
zink: always use storeOp=STORE for depth renderpass
it's unknown whether there may be clears to the depth attachment at the start of
a renderpass, so always assume there will be
Fixes:
c132a287455 ("zink: use store op NONE when necessary for depth usage")
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 12:43:56 +0000 (08:43 -0400)]
zink: remove u_blitter usage from zink_clear_render_target
this is more operations than needed
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 12:40:50 +0000 (08:40 -0400)]
zink: remove non-renderpass clear path from zink_clear_texture
this should always be faster
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 12:39:44 +0000 (08:39 -0400)]
zink: massively simplify zink_clear_depth_stencil
this now just uses renderpass clears
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>
Mike Blumenkrantz [Wed, 6 Jul 2022 12:29:30 +0000 (08:29 -0400)]
zink: improve zink_clear_depth_stencil check for current attachment
this is technically more correct since it accounts for multi-context usage
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>