Samuel Pitoiset [Mon, 2 Nov 2020 15:44:04 +0000 (16:44 +0100)]
aco: optimize v_mad_u32_u16 with acc=0 to v_mul_u32_u24
v_mad_u32_u16 will be selected by isel to keep the range analysis
information around and to combine more v_add_u32+v_mad_u32_u16
together. When it's not possible to optimize that pattern, fallback
to v_mul_u32_u24 which is VOP2 instead of VOP3.
No fossils-db changes.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7425>
Samuel Pitoiset [Fri, 6 Nov 2020 07:49:12 +0000 (08:49 +0100)]
aco: add a new Operand flag to indicate that is 16-bit
To indicate that the upper 16-bits are always 0 and that optimizing
v_mad_u32_u16 to v_mul_u32_u24 is valid.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7425>
Samuel Pitoiset [Wed, 11 Nov 2020 14:13:08 +0000 (15:13 +0100)]
aco: introduce a generic label for labelling instructions
When one instruction doesn't fit into the existing labels, use
the generic one.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7425>
Erik Faye-Lund [Wed, 11 Nov 2020 14:46:14 +0000 (15:46 +0100)]
util/u_process: implement util_get_process_name for Windows
There's not yet any users of this function on Windows, but it prints a
warning during builds, and seems easy enough to implement. So let's add
a trivial implementation.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7548>
Christian Gmeiner [Wed, 11 Nov 2020 16:15:25 +0000 (17:15 +0100)]
ci: sort packages installed via apt-get
Also remove duplicates.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7553>
Iago Toral Quiroga [Wed, 11 Nov 2020 08:45:33 +0000 (09:45 +0100)]
v3dv: move authenticated display fd acquisition to swapchain creation time
So far, we have only been supporting X11, so we assumed that we were running
inside X11 and would always try to get an authenticated fd from Xorg during
device initialization. While this works for desktop Raspbian, it is not
really correct and it is not what we want to do when we start considering
other WSIs.
Initially, one could think we can still do this by guarding the WSI code
under the proper instance extension check. This, however, doesn't work
reliably, as the Vulkan loader can call vkEnumerateDevices without enabling
surface extensions on the instance, which then can lead to us not
initializing any display_fd and failing with VK_ERROR_INITIALIZATION_FAILED,
which is not correct, so while we can try to acquire the display_fd here,
it might not always work, and we should definitely not fail initialization
of the physical device for that.
Instead, with this change we move acquisition of display_fd to swapchain
creation time where required extensions need to be enabled in the instance.
This was also suggested by Daniel Stone during review of a work-in-progress
implementation for the Wayland WSI.
There is a special case to consider though: applications like Zink that
don't use Vulkan's swapchains at all but still allocate images that they
intend to use for WSI. We need to handle these by checking that we have
indeed acquired a display_fd before doing any memory allocation for WSI,
and acquiring one at that time if that's not the case.
This change also removes the render_fd and display_fd fields from the
logical device (which we were copying from the physical device), because
now there is no guarantee that we have acquired a display_fd at the
time we create a logical device. Instead, we now put a reference to the
physical device on the logical device from which we can access these.
Finally, this also fixes a regression introduced with VK_KHR_display, where
if that extension is enabled but we are running inside a compositor, we would
acquire a display_fd that is not authenticated and try to use that instead
of acquiring an authenticated display_fd from the display server.
Fixes:
b1188c9451 (v3dv: VK_KHR_display extension support)
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7546>
Iago Toral Quiroga [Wed, 11 Nov 2020 08:46:51 +0000 (09:46 +0100)]
v3dv: fix typo
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7546>
Samuel Pitoiset [Tue, 10 Nov 2020 10:20:18 +0000 (11:20 +0100)]
aco: combine more s_add+s_lshl to s_lshl<n>_add by ignoring uses
Even if the s_lshl is used more that once, it can still be combined.
fossils-db (Vega10):
Totals from 771 (0.55% of 139517) affected shaders:
SGPRs: 46216 -> 46304 (+0.19%); split: -0.02%, +0.21%
VGPRs: 38488 -> 38464 (-0.06%)
SpillSGPRs: 1894 -> 1875 (-1.00%); split: -3.12%, +2.11%
CodeSize: 5681856 -> 5679844 (-0.04%); split: -0.07%, +0.03%
MaxWaves: 5320 -> 5323 (+0.06%)
Instrs: 1093960 -> 1093474 (-0.04%); split: -0.09%, +0.05%
Cycles:
47198380 ->
47258872 (+0.13%); split: -0.06%, +0.19%
VMEM: 176036 -> 176283 (+0.14%); split: +0.16%, -0.02%
SMEM: 53397 -> 53255 (-0.27%); split: +0.03%, -0.30%
VClause: 23156 -> 23152 (-0.02%); split: -0.03%, +0.01%
SClause: 35716 -> 35726 (+0.03%); split: -0.00%, +0.03%
Copies: 139395 -> 139871 (+0.34%); split: -0.04%, +0.39%
Branches: 33808 -> 33798 (-0.03%); split: -0.04%, +0.01%
PreSGPRs: 35381 -> 35331 (-0.14%); split: -0.20%, +0.06%
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7539>
Samuel Pitoiset [Tue, 10 Nov 2020 09:24:36 +0000 (10:24 +0100)]
aco/tests: add some tests for combining s_add+s_lshl to s_lshl<n>_add
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7539>
Kenneth Graunke [Wed, 11 Nov 2020 21:44:47 +0000 (13:44 -0800)]
prog_to_nir: Revert name initialization change
Commit
eda3e4e055e240a14c6ad4bdbde544c6348fc01d moved the creation of
s->info.name to shader creation time, rather than after the compile.
A few lines after creating the shader, prog_to_nir clobbers s->info
entirely, losing the name.
This dropped the "ARB" indicator that iris uses to switch math to the
legacy non-IEEE mode used by ARB_vertex_program/fragment_program.
Revert that hunk and go back to doing things the way they were.
Fixes:
eda3e4e055e ("nir/builder: Add a name format arg to nir_builder_init_simple_shader().")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3777
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7564>
Kenneth Graunke [Wed, 11 Nov 2020 20:17:50 +0000 (12:17 -0800)]
intel/compiler: Fix passthrough TCS regressions from program rename
In commit
eda3e4e055e240a14c6ad4bdbde544c6348fc01d, Eric added names
to various programs. In that patch, he also renamed our passthrough
TCS shader from "passthrough" to "passthrough TCS". The passthrough
TCS directly supplies the VUE headers rather than doing the whole
"patch parameters are in backwards order" reswizzling dance.
We failed to detect this and started trying to supply vec4s starting
at component 3, leading to a stack smash on an array of 7 sources,
not to mention the values were being put in the wrong place.
Easy fix: update the code for the new name.
Fixes:
eda3e4e055e ("nir/builder: Add a name format arg to nir_builder_init_simple_shader().")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3777
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7564>
Vinson Lee [Wed, 11 Nov 2020 19:49:50 +0000 (11:49 -0800)]
microsoft/compiler: Add dxil_nir_lower_16bit_conv prototype.
Fix missing-prototypes build error.
src/microsoft/compiler/dxil_nir_algebraic.c:5761:1: error: no previous prototype for ‘dxil_nir_lower_16bit_conv’ [-Werror=missing-prototypes]
5761 | dxil_nir_lower_16bit_conv(nir_shader *shader)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Fixes:
b9c61379ab4 ("microsoft/compiler: translate nir to dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7559>
Vinson Lee [Tue, 3 Nov 2020 02:24:37 +0000 (18:24 -0800)]
glsl: Fix typos in comments.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7415>
Vinson Lee [Tue, 3 Nov 2020 02:17:13 +0000 (18:17 -0800)]
glsl: Initialize ir_variable member field data.is_xfb.
Fix defect reported by Coverity Scan.
Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member field data.is_xfb is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7414>
Vinson Lee [Sat, 31 Oct 2020 02:29:39 +0000 (19:29 -0700)]
draw: Clean up single-use goto statements.
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7389>
Jason Ekstrand [Tue, 10 Nov 2020 16:13:53 +0000 (10:13 -0600)]
intel/fs: Fix use of undefined value in fixup_nomask_control_flow
Fixes:
a8ac0bd759cbf "intel/fs/gen12: Workaround unwanted SEND execution..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7536>
Eric Anholt [Sat, 7 Nov 2020 17:32:02 +0000 (09:32 -0800)]
ci/db410c: Fix networking so we get artifacts from our jobs.
Seems some sort of linux change (bugfix?) resulted in the db410cs
selecting device mode for the db410cs due to the micro cable being
plugged in (fastboot runs them in device mode), so we weren't finding
the network and getting artifacts out.
Closes: #3728
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Thu, 1 Oct 2020 22:28:38 +0000 (15:28 -0700)]
ci: Re-enable the clip_three test on non-freedreno ARMs.
I'm surprised these were listed as flaky instead of xfails, since I would
have expected them to always fail given my experience on freedreno and
broadcom. But let's try turning them back on and see if it's actually
flaky since the test has been fixed.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Wed, 30 Sep 2020 17:20:22 +0000 (10:20 -0700)]
ci: Bump deqp to current vulkan-cts-1.2.4
I want the new version to show the fix in the fd-largeconsts branch (and
make sure the pass keeps working, and make sure other drivers get around
to fixing the issue). While I'm here, cherry-pick in the VK test along
with the GLES one, and also the fix for clip_three on ARMs.
Since the VK and GL test lists were changing, I took the opportunity to
reset freedreno xfails lists to just the tests that are being run with the
CTS uprev, and increase its coverage to 1/10th of the CTS across two
boards (since we just freed up a bunch of runtime with the grouped gles
"other" job).
For panfrost, I didn't spend the time characterizing the t720 fragment_ops
flakes like I did for the deqp-runner change. Given that the random
behavior changes between CTS versions, it doesn't seem to be worth the
time to do so.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Fri, 6 Nov 2020 23:55:24 +0000 (15:55 -0800)]
ci/deqp: Allow specifying the caselist fraction separate from CI_NODE_INDEX.
To increase our VK coverage on a630, we want to have two jobs in parallel,
but we still can't hit full coverage so we need the fractional setting to
be separate from gitlab CI's flags for setting up parallel jobs.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Fri, 6 Nov 2020 22:06:26 +0000 (14:06 -0800)]
ci/freedreno: Group the short a630 dEQP runs into one test job.
This saves the minute and a half boot time on each of these minute-or-less
test jobs. The whole job was 3.5 minutes in my last run.
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Mon, 9 Nov 2020 23:06:38 +0000 (15:06 -0800)]
ci: Only install kernel modules for LAVA devices.
The recent change to install kernel modules for AMD included a sed job to
disable kernel modules in the defconfig. This somehow broke booting on
a307, except the commit failed to bump the arm64_test tag so it wasn't
noticed until the next uprev. (I didn't notice when landing the next
change to that container to add the deqp runner, because I didn't get a
git conflict on rebasing my tag bump so I didn't bump the tag again to
pull in the kernel changes and catch the fail).
I've spent a while trying to debug what's happened (including what
*should* be a replication of the kernel build on my local db410c) and come
up empty. Just punt and disable the AMD kernel module changes on
baremetal to fix it. Bump every container using lava_build.sh to make
sure we don't screw anything up with the script changes.
Fixes:
60c5729d1669 ("ci: Distribute ADMGPU driver to LAVA as a module")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Sat, 7 Nov 2020 17:25:37 +0000 (09:25 -0800)]
ci: Move the rust cleanup in lava_build out of the middle of kernel build.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6971>
Eric Anholt [Mon, 26 Oct 2020 18:37:25 +0000 (11:37 -0700)]
nir/builder: Add a name format arg to nir_builder_init_simple_shader().
This cleans up a bunch of gross sprintfs and keeps the caller from needing
to remember to ralloc_strdup. I added a couple of '"%s", name ? name :
""' to radv where I didn't fully trace through whether a non-null name was
being passed in.
I also took the liberty of adding a basic name to a few shaders (pan_blit,
unit tests)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Eric Anholt [Mon, 26 Oct 2020 18:28:33 +0000 (11:28 -0700)]
nir/builder: Drop the mem_ctx arg from nir_builder_init_simple_shader().
This looks a lot more simple now!
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Eric Anholt [Mon, 26 Oct 2020 18:25:08 +0000 (11:25 -0700)]
intel: Drop the last uses of a mem_ctx in nir_builder_init_simple_shader().
These two consumers were the only ones out of the ~65 calls to
init_simple_shader, so there's a pretty clear consensus on how to allocate
simple shaders. I suspect that actually these would be just fine with
b.shader being the mem_ctx, but that would take a bit more rework.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Eric Anholt [Mon, 26 Oct 2020 18:22:49 +0000 (11:22 -0700)]
nir/tests: Simplify the mem_ctx setup in our unit tests.
These all make a simple shader and free it at the end, that can be our
mem_ctx.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Eric Anholt [Mon, 26 Oct 2020 18:20:30 +0000 (11:20 -0700)]
nir/builder_tests: Drop unused lin_ctx.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Eric Anholt [Mon, 26 Oct 2020 17:44:53 +0000 (10:44 -0700)]
nir_builder: Return a new builder from nir_builder_init_simple_shader().
It's a little inline function, so we can just RAII it for better
ergonomics.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7323>
Samuel Pitoiset [Tue, 10 Nov 2020 13:10:35 +0000 (14:10 +0100)]
nir/algebraic: optimize bitfield_select(a, iand(a, b), c)
fossils-db (Vega10):
Totals from 242 (0.17% of 139517) affected shaders:
CodeSize: 853752 -> 852752 (-0.12%)
Instrs: 165944 -> 165694 (-0.15%)
Cycles: 855720 -> 854528 (-0.14%)
VMEM: 83772 -> 83668 (-0.12%); split: +0.13%, -0.25%
SMEM: 12360 -> 12316 (-0.36%)
SClause: 8222 -> 8238 (+0.19%)
Only helps Control.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7531>
James Jones [Mon, 3 Feb 2020 21:17:01 +0000 (13:17 -0800)]
gallium: Add format modifier plane count query
Rather than hard-code a list of all the format
modifiers supported by any gallium driver and the
number of aux planes they require in the dri state
tracker, add a screen proc that queries the number
of planes required for a given modifier+format
pair.
Since the only format modifiers that require
auxiliary planes currently are the iris driver's
I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, and
I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS, the absence
of the screen proc implies zero aux planes for all
of the screen's supported modifiers. Hence, when
a driver does not expose the proc, derive the
number of planes directly from the format.
Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>
James Jones [Thu, 6 Aug 2020 23:13:07 +0000 (16:13 -0700)]
gallium: Add pipe_screen::is_dmabuf_modifier_supported
Add a "do you support this modifier?" query to all
drivers which support format modifiers. This will
be used in a subsequent change to fully
encapsulate modifier validation and auxiliary plane
count calculation logic behind the driver
abstraction, which will in turn simplify the
addition of device-class-specific format modifiers
in the nouveau driver.
Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>
Duncan Hopkins [Wed, 26 Aug 2020 16:39:56 +0000 (17:39 +0100)]
mesa: Undefine ALIGN macro before it is used as a function name. Issues on MacOS.
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7469>
Steven Houston [Wed, 4 Nov 2020 17:45:10 +0000 (17:45 +0000)]
v3dv: VK_KHR_display extension support
When VK_KHR_display is enabled it needs to open the primary
node on the vc4/vc5 display device, so pass it to
physical_device_init().
Extension functions call through to the wsi_common_display.c
implementations.
v2: Follow Mesa conventions for comments and char *
Refer to vc4 display device in comments.
v3: Added Copyright © 2020 Raspberry Pi
v4: Test device has primary node when using simulator.
v5: Assert that we have a primary device. Fix trailing blank space.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3692
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7515>
Dave Airlie [Mon, 9 Nov 2020 06:49:44 +0000 (16:49 +1000)]
llvmpipe: just use draw_regions in draw/line setup.
This fixes:
dEQP-VK.draw.scissor*
Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
Dave Airlie [Thu, 5 Nov 2020 03:18:57 +0000 (13:18 +1000)]
lavapipe: disable SNORM blending for now
dEQP-VK.pipeline.blend.dual_source.format.r16g16b16a16_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_1msc_1ms1a_add_alpha_1mdc_1msa_sub-color_dc_1ms1c_rsub_alpha_z_1mdc_sub-color_ca_1ms1c_min_alpha_sas_ca_rsub-color_1ms1c_s1c_add_alpha_z_1mda_add,Fail
dEQP-VK.pipeline.blend.dual_source.format.r8g8b8a8_snorm.states.color_z_sc_add_alpha_1ms1c_sa_min-color_dc_1mca_add_alpha_z_1mca_max-color_1ms1c_sa_max_alpha_1mcc_sc_sub-color_s1c_1mda_add_alpha_s1c_1mda_add,Fail
dEQP-VK.pipeline.blend.format.r16g16b16a16_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail
dEQP-VK.pipeline.blend.format.r8g8b8a8_snorm.states.color_ca_1mca_rsub_alpha_1mda_z_sub-color_sc_sc_add_alpha_1mca_sa_max-color_sa_1msa_min_alpha_1msc_sa_sub-color_dc_sc_add_alpha_1mdc_1mca_add,Fail
All fail due to the 1 - mdc or 1 - mca alpha channel in the last quadrant.
Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
Dave Airlie [Tue, 3 Nov 2020 22:59:53 +0000 (08:59 +1000)]
lavapipe: enable alpha to one.
CTS seems fine with this.
Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
Dave Airlie [Mon, 9 Nov 2020 01:06:27 +0000 (11:06 +1000)]
u_blitter: port radv 3D blit coords logic.
The current code fails a lot of VK CTS tests, this fixes them all:
dEQP-VK*blit_image*3d*
Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
Dave Airlie [Wed, 4 Nov 2020 19:42:34 +0000 (05:42 +1000)]
gallium: handle empty cbuf slots in framebuffer samples helper
If we have cbufs but they are all empty, default
to returning the fb->samples.
Fixes:
dEQP-VK.pipeline.multisample.mixed_count.1_4_unused
on lavapipe
v2:
drop unneeded chunk (Roland)
Cc: 20.3 <mesa-stable>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7499>
Iago Toral Quiroga [Fri, 6 Nov 2020 08:20:42 +0000 (09:20 +0100)]
zink: only add MESA WSI structs for specific devices
Some drivers will drop warnings about seeing these structs in the
pNext chain and not handling them. This change makes it so we
only include the structs with Vulkan drivers that are known to
require them for proper behavior (v3dv only for now) to avoid the
warnings.
It should be noted that here we are only supressing the messages
from Zink. Since the Mesa Vulkan WSI code will include these structs,
when native Vulkan Mesa drivers are used without Zink they might
still dump these messages.
Requested by Mike Blumenkrantz.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7523>
Eric Anholt [Tue, 20 Oct 2020 21:32:28 +0000 (14:32 -0700)]
nir/validate: Size the set of blocks to avoid rehashing.
We can use num_blocks (if it's been initialized by some pass indexing
blocks) to pre-size our table, which helps on validating shaders with many
blocks which would otherwise reallocate the set several times.
No statistically significant performance difference on softpipe
KHR-GL33.texture_swizzle.functional runtime (n=15). A previous, similar
variant of this patch cut .3% of instructions in softpipe shader-db ./run
shaders/closed/steam/borderlands-2/35* (an arbitrary set of shaders that
completed in reasonable amount of time) according to callgrind.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>
Eric Anholt [Tue, 20 Oct 2020 21:37:10 +0000 (14:37 -0700)]
util/set: Fix the _mesa_set_clear function to not leave tombstones.
This implementation was broken and should have just been the same as the
hash_table_clear() one, which I copied over here. It was setting all
formerly-present entries to deleted, yet also setting deleted_entries to
0. This meant that all new searches or additions after clearing would
have to reprobe the whole table until a rehash happened, and that rehash
would be delayed because we violated the deleted_entries invariant.
No statistically significant performance difference on softpipe
KHR-GL33.texture_swizzle.functional runtime (n=18)
Fixes:
5c075b085585 ("util/set: add a set_clear function")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>
Eric Anholt [Tue, 20 Oct 2020 22:04:27 +0000 (15:04 -0700)]
util/hash_table: Clean up the _mesa_hash_table_clear() implementation.
Use the entry_is_present() helper to clarify what's going on with
deletion, and then we can remove the special continue for NULL since we're
just writing NULL anyway (which the CPU cache will elide for us).
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>
Eric Anholt [Tue, 20 Oct 2020 22:01:15 +0000 (15:01 -0700)]
util/hash_table: Handle NULL ht in _mesa_hash_table_clear().
This is the one useful bit of _mesa_set_clear() that wasn't in
_mesa_hash_table_clear().
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7244>
Dave Airlie [Tue, 10 Nov 2020 05:08:46 +0000 (15:08 +1000)]
clover: add support for opencl C features
This adds support to the compiler and api for this CL 3.0 feature.
fixes CTS compiler features_macro
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Pierre Moreau [Tue, 10 Nov 2020 01:44:45 +0000 (11:44 +1000)]
clover/spirv: avoid strings for version handling
This is extracted from Pierre's WIP versioning patch.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Pierre Moreau [Tue, 10 Nov 2020 01:39:08 +0000 (11:39 +1000)]
clover/llvm: don't use strings for version handling.
This is extracted from Pierre's WIP versioning patch.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Wed, 7 Oct 2020 03:35:13 +0000 (13:35 +1000)]
clover: add platform supported extensions with version
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Wed, 7 Oct 2020 03:42:26 +0000 (13:42 +1000)]
clover: add support for versioned device extensions
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Mon, 2 Nov 2020 05:54:11 +0000 (15:54 +1000)]
clover: report device CLC versions for 3.0
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Fri, 6 Nov 2020 06:37:19 +0000 (16:37 +1000)]
clover: add CL_PLATFORM_NUMERIC_VERSION support
This is part of CL 3.0
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Tue, 10 Nov 2020 00:07:44 +0000 (10:07 +1000)]
clover/platform: move versioning to core object.
This reads the env var once at constructor time and stores it
in the platform object.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Fri, 6 Nov 2020 00:52:18 +0000 (10:52 +1000)]
clover: add CL 3.0 CL_DEVICE_NUMERIC_VERSION support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Tue, 10 Nov 2020 00:03:47 +0000 (10:03 +1000)]
clover/device: store version in device at constructor.
This reads the env vars once and stores the value, and converts
to strings when needed
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Dave Airlie [Mon, 9 Nov 2020 23:56:21 +0000 (09:56 +1000)]
util: add a env getter for versions
This lets us parse a standard major.minor version.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Pierre Moreau [Mon, 9 Nov 2020 23:44:14 +0000 (09:44 +1000)]
clover: rename platform/device apis using strings
Just add as_string to these to faciliate the non-string ones.
(extracted by airlied from pmoreau patch).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7520>
Karol Herbst [Wed, 4 Nov 2020 22:05:51 +0000 (23:05 +0100)]
clover/queue: Flush automatically if applications do not flush themselves
With the image_read_write OpenCL CTS we can get a stack overflow handling
all the events as the application itself never flushes.
We need to address this in two ways:
1. flush the queue once an abritary amoung of events piled up.
2. Drop event deps once they get a fence assigned.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7460>
Rob Clark [Mon, 9 Nov 2020 21:58:42 +0000 (13:58 -0800)]
mesa/bufferobj: Fix valgrind complaints
==328537== Mutex reinitialization: mutex 0x1281afb0, recursion count 0, owner 0.
==328537== at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537== by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537== by 0x117DA107: mtx_init (threads_posix.h:207)
==328537== by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537== by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537== by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537== by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537== by 0x1173C323: st_create_context (st_context.c:1019)
==328537== by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537== by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537== by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537== by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537== by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281afb0 was first observed at:
==328537== at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537== by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537== by 0x117DA107: mtx_init (threads_posix.h:207)
==328537== by 0x117DA2BB: simple_mtx_init (simple_mtx.h:132)
==328537== by 0x117DB86B: _mesa_init_buffer_objects (bufferobj.c:878)
==328537== by 0x117E8C6F: init_attrib_groups (context.c:840)
==328537== by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537== by 0x1173C323: st_create_context (st_context.c:1019)
==328537== by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537== by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537== by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537== by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537== by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7517>
Rob Clark [Mon, 9 Nov 2020 21:55:14 +0000 (13:55 -0800)]
mesa/fbo: Fix valgrind complaints
Just statically initialize the dummy/incomplete framebuffer/renderbuffer
to avoid re-intializing their mutex.
==328537== Mutex reinitialization: mutex 0x1281bd28, recursion count 0, owner 0.
==328537== at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537== by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537== by 0x118F9727: mtx_init (threads_posix.h:207)
==328537== by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537== by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537== by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537== by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537== by 0x1173C323: st_create_context (st_context.c:1019)
==328537== by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537== by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537== by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537== by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537== by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
==328537== mutex 0x1281bd28 was first observed at:
==328537== at 0x486FD34: pthread_mutex_init_intercept (drd_pthread_intercepts.c:826)
==328537== by 0x486FD34: pthread_mutex_init (drd_pthread_intercepts.c:835)
==328537== by 0x118F9727: mtx_init (threads_posix.h:207)
==328537== by 0x118F983B: simple_mtx_init (simple_mtx.h:132)
==328537== by 0x118FA087: _mesa_init_fbobjects (fbobject.c:93)
==328537== by 0x117E8CB7: init_attrib_groups (context.c:849)
==328537== by 0x117E942F: _mesa_initialize_context (context.c:1225)
==328537== by 0x1173C323: st_create_context (st_context.c:1019)
==328537== by 0x11720A9F: st_api_create_context (st_manager.c:930)
==328537== by 0x1170E2CF: dri_create_context (dri_context.c:163)
==328537== by 0x11FB9DC3: driCreateContextAttribs (dri_util.c:480)
==328537== by 0x8E9D3DF: dri3_create_context_attribs (dri3_glx.c:316)
==328537== by 0x8E9D49B: dri3_create_context (dri3_glx.c:347)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7517>
Mike Blumenkrantz [Fri, 6 Nov 2020 15:48:46 +0000 (10:48 -0500)]
util/threaded_context: use driver's ubo alignment for constant buffer uploads
this is another case where the hardcoded value was specific to radeon drivers
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7475>
Rob Clark [Mon, 9 Nov 2020 22:11:09 +0000 (14:11 -0800)]
freedreno: Protect gmem_cache ralloc allocations
Since the ralloc context for cache_key allocation is shared between all
the contexts hanging off a screen, we need to allocate the key under the
screen->lock.
Fixes:
91f9bb99c5e ("freedreno: add gmem state cache")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Tue, 3 Nov 2020 18:18:33 +0000 (10:18 -0800)]
freedreno/drm: Rework APPEND() macro
In particular I wanted the nr_foo increment to be after assignment..
mostly just to track down a potential race. (This wasn't it, but I
like this color for the bikeshed better.)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Thu, 29 Oct 2020 22:28:11 +0000 (15:28 -0700)]
freedreno/batch: Cleanup submit immediately after flush
No reason to keep these around if the batch is not immediately unref'd.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Thu, 29 Oct 2020 22:23:21 +0000 (15:23 -0700)]
freedreno/drm: Drop growable submit_bos table
Since we are not tracking reloc flags per submit, we can just construct
this table at flush time, rather than using a second growable table that
is in sync with msm_submit->bos.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Wed, 28 Oct 2020 17:47:07 +0000 (10:47 -0700)]
freedreno: Add submit lock
Add a lock to synchronize batch flush (which can be triggered from a
different ctx) with cmdstream emit.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Wed, 28 Oct 2020 16:51:15 +0000 (09:51 -0700)]
freedreno: Make fd_context_batch() return a reference
This protects better against another context triggering a batch flush
and unref while the first context is doing resource tracking.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Wed, 28 Oct 2020 16:15:45 +0000 (09:15 -0700)]
freedreno/batch: Move fd_batch_get_prologue()
To keep fd_batch_flush() and it's internal helper batch_flush()
together. Also update an obsolete comment.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Sat, 24 Oct 2020 19:20:57 +0000 (12:20 -0700)]
freedreno/drm: Make ring refcnt atomic again
In general, rings are not shared across contexts/threads. But this
can happen with texture stateobjs, which can be invalidated by other
contexts.
And while we're here, lets convert the rest of freedreno/drm to
u_atomic
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Sat, 24 Oct 2020 19:09:12 +0000 (12:09 -0700)]
freedreno: Use ctx seqno in batch cache key
It is smaller than a pointer, and doesn't run into problems of context
destroy/create cycle ending up with the same address.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Fri, 23 Oct 2020 21:56:09 +0000 (14:56 -0700)]
freedreno/a6xx: Texture cache locking
Originally the tex cache was never touched from other contexts, but
rebind_resource() changed that. Add some locking to protect tex cache
against multi-threaded access.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Fri, 23 Oct 2020 19:46:47 +0000 (12:46 -0700)]
freedreno: batch-cache locking
Move the locking slightly to protect hashtable lookups as well.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Thu, 22 Oct 2020 21:43:35 +0000 (14:43 -0700)]
freedreno: Fix spurious flush
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Sun, 8 Nov 2020 19:14:22 +0000 (11:14 -0800)]
freedreno: Convert to mesa_log*()
debug_printf() isn't terribly great in multi-threaded situations.. but
since we now have a simple util/log.h, which even plays nicely with
logcat on android, lets use that instead.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Thu, 22 Oct 2020 21:43:10 +0000 (14:43 -0700)]
freedreno: debug cleanup
Fix an extra \n and remove a useless trace (I guess after 7yrs it is no
longer actually TODO)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Sat, 7 Nov 2020 19:50:18 +0000 (11:50 -0800)]
freedreno/drm: Convert to simple_mtx
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Rob Clark [Tue, 27 Oct 2020 23:44:38 +0000 (16:44 -0700)]
freedreno: Drop fd_context_lock() and friends
These were actually just wrappers for the screen->lock, left over from
moving things around a long time ago. Lets drop them to make things
more explicit (that we are locking the screen, not the context).
Involves a bit of shuffling things around to untangle header deps, but
no functional change.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
Marek Olšák [Mon, 9 Nov 2020 21:20:13 +0000 (16:20 -0500)]
st/mesa: fix use-after-free when updating shader info in st_link_nir
Fixes:
549ae5f8 "st/mesa: make sure prog->info is up to date for NIR (v2)"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3756
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3685
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7516>
Erik Faye-Lund [Mon, 9 Nov 2020 20:31:59 +0000 (21:31 +0100)]
d3d12: avoid searching twice for bos
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Thu, 5 Nov 2020 17:46:15 +0000 (18:46 +0100)]
d3d12: ensure all compoents of clip-distances are written
This fixes a regression that happened after rebasing on master, where we
end up not writing all components of the clip-distance array, which the
DXIL validation code in the D3D12 runtime treats as an error.
To ensure we don't end up overwriting a previous wrire, enable
nir_shader_compiler_options::lower_all_io_to_temps as well.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Sun, 26 May 2019 08:43:12 +0000 (10:43 +0200)]
d3d12: introduce d3d12 gallium driver
This driver will allow running OpenGL and OpenCL on top of Gallium
for any hardware supporting Microsoft's Direct3D 12 on Windows 10.
This is the combination of a lot of commits from our development branch,
containing code from several authors.
Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
BillKristiansen [Wed, 27 May 2020 15:23:16 +0000 (17:23 +0200)]
microsoft: add resource state manager utility code
The code originates from this repository:
https://github.com/microsoft/D3D12TranslationLayer
It will be used in the next commit.
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Wed, 4 Sep 2019 09:51:29 +0000 (11:51 +0200)]
microsoft/compiler: translate nir to dxil
Here's the code to emit DXIL code from NIR. It's big and bulky as-is,
and it needs to be split up a bit.
This is the combination of a lot of commits from our development branch,
containing code by several authors.
Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Wed, 4 Sep 2019 09:51:29 +0000 (11:51 +0200)]
microsoft/compiler: add dxil-util code
This is support-code to emit the DirectX Intermediate Language, which is
a dialect of LLVM 3.7 bitcode. Because modern versions of LLVM doesn't
support emitting bitcode for older versions, and we can't rely on an old
LLVM version because we need the OpenCL support from Clang later on, we
instead implement our own LLVM bitcode encoder as part of this work.
See the official DXIL documentation for more details on DXIL:
https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst
The reason this comes as a separate library, is because we're also using
this code as the basis for an OpenCL C compiler, which will follow as a
separate merge-request later.
This is the combination of more than 230 commits from our development
branch, including the work from several authors.
Co-authored-by: Bill Kristiansen <billkris@microsoft.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Gert Wollny <gert.wollny@collabora.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Co-authored-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Tue, 3 Nov 2020 09:40:23 +0000 (10:40 +0100)]
compiler: add SYSTEM_BIT_FRONT_FACE
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Louis-Francis Ratté-Boulianne [Wed, 22 Jul 2020 20:25:38 +0000 (16:25 -0400)]
gallium: Wrap some header files into "extern C"
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Gert Wollny [Wed, 17 Jun 2020 08:54:44 +0000 (10:54 +0200)]
nir/print: print GS extra info
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Gert Wollny [Wed, 10 Jun 2020 12:34:32 +0000 (14:34 +0200)]
util/format_zs: Add C++ include handling
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Louis-Francis Ratté-Boulianne [Wed, 4 Mar 2020 16:13:39 +0000 (11:13 -0500)]
gallium/util: Wrap suballoc.h into extern C
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Sun, 26 May 2019 08:42:10 +0000 (10:42 +0200)]
util/slab: allow usage from c++ code
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Louis-Francis Ratté-Boulianne [Tue, 10 Mar 2020 18:07:41 +0000 (14:07 -0400)]
gallium/nir: Wrap tgsi_to_nir header in extern C
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7477>
Erik Faye-Lund [Tue, 10 Nov 2020 08:38:45 +0000 (09:38 +0100)]
softpipe: correct signature of get_compiler_options
This gets rid of a harmless but annoying compiler warning on MSVC.
Fixes:
73bafb5ee38 ("gallium: s/unsigned/enum pipe_shader_type/ for get_compiler_options()")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7524>
Boris Brezillon [Tue, 10 Nov 2020 10:01:50 +0000 (11:01 +0100)]
panfrost: Fix ->reads_frag_coord assignment
Let's assign ->reads_frag_coord only once to handle the sysval case
(used on Bifrost) correctly.
Fixes:
f1de952b695b ("panfrost: Use shader_info harder")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
Boris Brezillon [Tue, 10 Nov 2020 08:57:24 +0000 (09:57 +0100)]
panfrost: Fix Bifrost blend descriptor emission
Format conversion only works if the num_comps field is set to 4,
probably because the tile buffer always store those 4 components
internally.
Fixes:
edd98aac3f16 ("panfrost: Add support for native wallpapering on Bifrost")
Fixes:
8389976b7c09 ("panfrost: XML-ify the blend descriptors")
Cc: 20.3 <mesa-stable>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
Alyssa Rosenzweig [Mon, 9 Nov 2020 18:44:07 +0000 (13:44 -0500)]
pan/bi: Model writemasks correctly
We don't handle partial write masks in the backend yet, so for now we
can't pretend we do, else we'll have RA bugs. Fixes
dEQP-GLES2.functional.fragment_ops.blend.rgb_func_alpha_func.src.constant_color_dst_alpha
Fixes:
b2c6cf2b6db1 ("pan/bi: Eliminate writemasks in the IR")
Cc: 20.3 <mesa-stable>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7527>
Lionel Landwerlin [Tue, 10 Nov 2020 13:03:23 +0000 (15:03 +0200)]
intel/dump_gpu: add support for MMAP_OFFSET ioctl
Our driver started using this method to mmap the BOs and we need to
hook it to track the dirtiness of the BO.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7528>
Icecream95 [Mon, 2 Nov 2020 07:32:18 +0000 (20:32 +1300)]
panfrost: Fix AFBC blits of resources with faked RGTC
Because u_transfer_helper changes resources back from the real format
to the emulated format after creation, we need to fix the format enum
for resources with fake compression when doing blits to/from AFBC.
Fixes:
acb8dcfebdd ("panfrost: Choose AFBC when available")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7400>
Duncan Hopkins [Sun, 8 Nov 2020 12:11:12 +0000 (12:11 +0000)]
zink: setup version dependent VkPhysicalDeviceVulkan*Features and VkPhysicalDeviceVulkan*Properties.
Adds template support to zink_device_info.py for setting up the VkPhysicalDeviceVulkan* version Features and Properties structures.
When the next Vulkan version with newer structure is released a single like should only need to be added.
Note, the 11 structures where not added until Vk 1.2, so that is not a typo.
This code does not stop the use of clonflicting extensions or other VkPhysicalDevice*Features structures with VkPhysicalDeviceVulkan*Features structures when calling vkCreateDevice()
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7496>
Icecream95 [Sun, 8 Nov 2020 10:52:23 +0000 (23:52 +1300)]
rbug: Handle non-TGSI shaders
NIR shaders aren't yet transferred over the wire, but at least they
don't cause a crash.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7495>
Icecream95 [Sun, 8 Nov 2020 10:50:59 +0000 (23:50 +1300)]
rbug: Forward get_compiler_options to pipe driver
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7495>
Samuel Pitoiset [Mon, 9 Nov 2020 18:42:22 +0000 (19:42 +0100)]
aco: fix combining add/sub to b2i if a new dest needs to be allocated
The uses vector needs to be expanded to avoid out of bounds access
and to make sure the number of uses is initialized to 0.
This fixes combining more v_and(a, v_subbrev_co_u32).
fossilds-db (Vega10):
Totals from 4574 (3.28% of 139517) affected shaders:
SGPRs: 291625 -> 292217 (+0.20%); split: -0.01%, +0.21%
VGPRs: 276368 -> 276188 (-0.07%); split: -0.07%, +0.01%
SpillSGPRs: 455 -> 533 (+17.14%)
SpillVGPRs: 76 -> 78 (+2.63%)
CodeSize:
23327500 ->
23304152 (-0.10%); split: -0.17%, +0.07%
MaxWaves: 22044 -> 22066 (+0.10%)
Instrs: 4583064 -> 4576301 (-0.15%); split: -0.15%, +0.01%
Cycles:
47925276 ->
47871968 (-0.11%); split: -0.13%, +0.01%
VMEM: 1599363 -> 1597473 (-0.12%); split: +0.08%, -0.19%
SMEM: 331461 -> 331126 (-0.10%); split: +0.08%, -0.18%
VClause: 80639 -> 80696 (+0.07%); split: -0.02%, +0.09%
SClause: 155992 -> 155993 (+0.00%); split: -0.02%, +0.02%
Copies: 333482 -> 333318 (-0.05%); split: -0.12%, +0.07%
Branches: 70967 -> 70968 (+0.00%)
PreSGPRs: 187078 -> 187711 (+0.34%); split: -0.01%, +0.35%
PreVGPRs: 244918 -> 244785 (-0.05%)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7513>