Pierre Moreau [Tue, 5 May 2020 11:13:19 +0000 (13:13 +0200)]
clover/nir: Check the result of spirv_to_nir
Fixes: deb04adf2ae ("clover: add support for passing kernels as nir to the driver")
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4901>
Rhys Perry [Mon, 3 Feb 2020 21:19:52 +0000 (21:19 +0000)]
nir: make fsat return 0.0 with NaN instead of passing it through
This is how lower_fsat and ACO implements fsat and is a more useful
definition since it can be exactly created from fmin(fmax(a, 0.0), 1.0).
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3716>
Rhys Perry [Mon, 3 Feb 2020 21:18:42 +0000 (21:18 +0000)]
compiler/spirv: flag nclamp/nmin/nmax as exact
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3716>
Elie Tournier [Mon, 16 Mar 2020 10:05:33 +0000 (10:05 +0000)]
docs/features: Add ARB_clear_texture to virgl
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4345>
Elie Tournier [Fri, 13 Mar 2020 11:26:04 +0000 (11:26 +0000)]
virgl: Enable CAP_CLEAR_TEXTURE if host supports it
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4345>
Elie Tournier [Fri, 20 Mar 2020 11:50:06 +0000 (11:50 +0000)]
virgl: implement ARB_clear_texture
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4345>
Gert Wollny [Wed, 6 May 2020 16:48:35 +0000 (18:48 +0200)]
r600: Fix warning regarding mixing enums and unsigned in ?: expression
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4939>
Gert Wollny [Wed, 6 May 2020 16:48:05 +0000 (18:48 +0200)]
r600: remove some unused variables to silence warnings
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4939>
Gert Wollny [Wed, 6 May 2020 16:29:44 +0000 (18:29 +0200)]
r600/sb: replace memset by using member initialization/assignment
Closes #2860
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4939>
Gert Wollny [Wed, 6 May 2020 16:10:39 +0000 (18:10 +0200)]
r600: remove unused static functions
Related #2860
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4939>
Gert Wollny [Wed, 6 May 2020 16:09:52 +0000 (18:09 +0200)]
r600: Annotate some case fallthroughs
Also fix indentions where aproprate
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4939>
Samuel Pitoiset [Mon, 4 May 2020 09:48:46 +0000 (11:48 +0200)]
ci: run radv-fossils with Pitcairn (GFX6) and Bonaire (GFX7) too
This job is really small and it shouldn't hurt to cover two more
generations. This will prevent breaking the world on GFX6-GFX7
because we don't regularly test these chips.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4873>
Samuel Pitoiset [Mon, 4 May 2020 09:44:45 +0000 (11:44 +0200)]
ci: set ACO_DEBUG=validateir,validatera global for RADV testing
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4873>
Samuel Pitoiset [Mon, 4 May 2020 09:43:26 +0000 (11:43 +0200)]
ci: remove unused .test-radv-fossilize rule
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4873>
Arcady Goldmints-Orlov [Wed, 29 Apr 2020 00:46:48 +0000 (19:46 -0500)]
anv: increase minUniformBufferOffsetAlignment to 64
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4904>
Rob Clark [Thu, 27 Feb 2020 18:24:49 +0000 (10:24 -0800)]
freedreno/a6xx: enable tiled compressed textures
I wasn't expecting this to be too useful, since compressed textures are
already block based.. but gfxbench gl_fill says otherwise.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4868>
Rob Clark [Thu, 27 Feb 2020 18:16:43 +0000 (10:16 -0800)]
freedreno/a6xx: compressed blit fixes
width/height are not necessarily aligned to block boundaries, so we need
to round up.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4868>
Kristian H. Kristensen [Tue, 5 May 2020 07:18:35 +0000 (00:18 -0700)]
freedreno/a6xx: Set tfetch correctly for compressed formats
The fetchsize is just the blocksize for compressed formats, which gets
rid of the ASTC special cases add handles ETC1/2 as well.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4868>
Kristian H. Kristensen [Tue, 5 May 2020 07:03:18 +0000 (00:03 -0700)]
freedreno/fdl: Align after dividing by block size
For compressed formats, we need to align the number of blocks, not the
logical number of pixels in the texture. Only compressed formats have
block width/height > 1, so we can just unconditionally multiply the
alignment by the block width/height.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4868>
Eric Engestrom [Wed, 6 May 2020 21:48:26 +0000 (23:48 +0200)]
docs: update calendar for 20.1.0-rc2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4927>
Eric Anholt [Tue, 5 May 2020 19:17:49 +0000 (12:17 -0700)]
ci: Fix the nick used in IRC reporting.
robclark found that we needed unique IDs when multiple runners were trying
to report flakes at the same time, but it turns out due to nick limits (16
chars on freenode) we were just getting all the runners appended with
"-142" (or whatever the prefix of the pipelines are these days). And, for
the new flake reporting from baremetal, all the runners ended up being
just "google-freedreno".
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4896>
Eric Anholt [Tue, 5 May 2020 17:44:46 +0000 (10:44 -0700)]
ci: Improve the flakes reports on IRC.
We were incorrectly taking the merge-request on non-MR pipelines (the
master build after merge) due to a missing '$'. And, for those pipelines,
it would be nice to note whether they're for master or a stable branch.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4896>
Eric Anholt [Fri, 1 May 2020 16:57:00 +0000 (09:57 -0700)]
ci: Enable IRC flake reporting on freedreno baremetal boards.
The IRC channel is useful for me to track and ban flaky tests before they
irritate people too much.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2654
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4896>
Eric Anholt [Mon, 4 May 2020 20:42:41 +0000 (13:42 -0700)]
ci: Clean up setup of the job-specific env vars in baremetal testing.
Avoids copy and paste errors when adding more vars.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4896>
Marek Olšák [Wed, 6 May 2020 13:42:55 +0000 (09:42 -0400)]
radeonsi: fix compilation of monolithic PS
This was totally broken. Monolithic PS is only used if FBFETCH or
interpolateAtSample are used.
When the PS prolog was built, it overwrote ctx->main_fn.
Discovered by @eefano.
Fixes: 8832a884345686e6a8b2c0c8aa7515ad3f775b9e "radeonsi: move PS LLVM code into si_shader_llvm_ps.c"
Closes: #2814
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4918>
Marek Olšák [Tue, 5 May 2020 16:44:54 +0000 (12:44 -0400)]
tgsi_to_nir: translate non-vec4 image stores correctly
set the correct number of components for src data and the intrinsic
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4908>
Danylo Piliaiev [Fri, 27 Mar 2020 14:55:52 +0000 (16:55 +0200)]
i965: Fix out-of-bounds access to brw_stage_state::surf_offset
../src/mesa/drivers/dri/i965/brw_wm_surface_state.c:1378:32: runtime error: index
3503345872 out of bounds for type 'uint32_t [149]'
brw_assign_common_binding_table_offsets has the following comment:
"Unused groups are initialized to 0xd0d0d0d0 to make it obvious that they're
unused but also make sure that addition of small offsets to them will
trigger some of our asserts that surface indices are < BRW_MAX_SURFACES."
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4350>
Erik Faye-Lund [Tue, 5 May 2020 15:04:46 +0000 (17:04 +0200)]
zink: lower b2b to b2i
Zink requires 1-bit booleans, but this requirement was missed before
b2b1s started getting automatically inserted. Let's lower these away, to
avoid piglit regressions.
Fixes the following piglits:
- shaders@glsl-vs-if-bool
- spec@!opengl 2.0@vertex-program-two-side
Fixes: c217ee8d35f ("nir: Insert b2b1s around booleans in nir_lower_to")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2902
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4903>
Samuel Pitoiset [Thu, 30 Apr 2020 16:42:27 +0000 (18:42 +0200)]
radv/winsys: do not count visible VRAM buffers twice in the budget
The VRAM size returned to apps is computed as follows:
vram_size = real_hw_vram_size - visible_vram_size.
Visible VRAM buffers should be counted only in the visible VRAM
counter and not twice. Buffers with the NO_CPU_ACCESS flag are
known to not be mappable, so they are counted in the VRAM counter.
Other buffers, with the CPU_ACCESS flag, or without any of both
(imported buffers) are counted in the visible VRAM counter because
they are mappable.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4834>
Samuel Pitoiset [Wed, 29 Apr 2020 12:09:10 +0000 (14:09 +0200)]
radv: display an error message if the winsys init failed
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 29 Apr 2020 11:53:35 +0000 (13:53 +0200)]
radv: use a linked list for physical devices
Instead of a static array inside the instance object.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 29 Apr 2020 11:23:22 +0000 (13:23 +0200)]
radv: don't report error with other vendor DRM devices
Enumeration should just skip unsupported DRM devices.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 29 Apr 2020 11:24:36 +0000 (13:24 +0200)]
radv: report INITIALIZATION_FAILED when the amdgpu winsys init failed
The driver should be capable if it reaches the winsys initialization.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 29 Apr 2020 12:03:24 +0000 (14:03 +0200)]
radv: fix a memleak if the physical device initialization failed
The disk cache object should be freed.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 29 Apr 2020 09:56:50 +0000 (11:56 +0200)]
radv: rename radv_devices() to radv_enumerate_physical_devices()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Samuel Pitoiset [Wed, 6 May 2020 06:25:38 +0000 (08:25 +0200)]
radv: cleanup radv_CreateInstance()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
Dave Airlie [Tue, 24 Mar 2020 22:01:27 +0000 (08:01 +1000)]
llvmpipe: enable ARB_sample_shading
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 24 Mar 2020 21:57:33 +0000 (07:57 +1000)]
llvmpipe: add min samples support to the fragment shader.
This isn't enabled yet until the state gets hooked up
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 21:48:31 +0000 (07:48 +1000)]
llvmpipe: enable GL_ARB_shader_texture_image_samples
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 21:47:56 +0000 (07:47 +1000)]
gallivm/nir: hooks up texture samples queries
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 21:47:16 +0000 (07:47 +1000)]
gallivm/sample: add num samples query for txqs (v2)
v2: add false to the existing users (Roland)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:40:48 +0000 (07:40 +1000)]
llvmpipe: enable 4x sample MSAA + texture multisample
This enables proper support for 4xMSAA and for texture mulitsample
extension.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Wed, 25 Mar 2020 02:47:20 +0000 (12:47 +1000)]
drisw: add multisample support to sw dri layer.
This allocates the msaa resources like the dri2 layer
and adds the flushes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:38:13 +0000 (07:38 +1000)]
llvmpipe: don't choose pixel centers for multisample
Don't pick the pixel centers for multisample rendering, fix
the setup program.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:36:35 +0000 (07:36 +1000)]
llvmpipe: choose correct position for multisample
For multisample we don't want pixel centers at this stage,
so don't add them in for that case.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:34:53 +0000 (07:34 +1000)]
llvmpipe: choose multisample rasterizer functions per triangle (v2)
This just picks the correct cmds to add to the scene.
v2: drop using 32-bit ms (Roland)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:29:04 +0000 (07:29 +1000)]
llvmpipe: generate multisample triangle rasterizer functions (v2)
This uses the templating to generate multisample version of the
tri plane raster functions
This doesn't generate any optimised version for lower plane numbers,
maybe this is worth doing in the future.
v2: drop generating 32-bit msaa (Roland)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:16:35 +0000 (07:16 +1000)]
llvmpipe: fixup multisample coverage masks for covered tiles
For fully covered tiles just pass in the filled out mask.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:09:15 +0000 (07:09 +1000)]
llvmpipe: build 64-bit coverage mask in rasterizer
This adds the logic to build the per-sample masks at the lowest
level of the rasterizer block hierarchy
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:11:39 +0000 (07:11 +1000)]
llvmpipe: add fixed point sample positions to scene.
These will be used in the rasterizer to generate the coverage masks
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 21:07:53 +0000 (07:07 +1000)]
llvmpipe: add new rast api to pass full 64-bit mask.
The 64-bit mask is a 16-bit mask per sample for up to 4 samples.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 20:58:01 +0000 (06:58 +1000)]
llvmpipe: disable opaque variant for multisample
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 24 Mar 2020 02:54:52 +0000 (12:54 +1000)]
llvmpipe: fix multisample occlusion queries.
This needs to check the per-sample mask inside the loop if
multisample is enabled.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 20:54:26 +0000 (06:54 +1000)]
llvmpipe: move color storing earlier in frag shader
Move the color storage before the late Z test as for sample
shading it needs to be inside a loop with the fragment shader.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 20:50:48 +0000 (06:50 +1000)]
llvmpipe: pass mask store into interp for centroid interpolation
This enables centroid interpolation to work, using the current
coverage masks.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 20:47:31 +0000 (06:47 +1000)]
llvmpipe: don't allow branch to end for early Z with multisample
Don't allow the branching optimisation with multisample enabled
as we have to check all samples.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 09:38:50 +0000 (19:38 +1000)]
llvmpipe: handle gl_SampleMask writing.
This is using a load/store to make it easier to add sample shading later.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 09:30:06 +0000 (19:30 +1000)]
llvmpipe: add multisample alpha to one support
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 09:28:59 +0000 (19:28 +1000)]
llvmpipe: add multisample alpha to coverage support.
Converts alpha into coverage mask.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 04:29:46 +0000 (14:29 +1000)]
llvmpipe: hook up sample position system value
This creates a global static with the current sample positions,
and passes it to the fragment shader which uses it for interpolation
and sample position support.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 04:10:48 +0000 (14:10 +1000)]
llvmpipe: handle multisample color stores.
Extract the final per-sample masks and store to the multisample
color buffers using them.
This retypes the pointer to a uint8_t at entry to make the
GEP simpler, then recasts to the blend type.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Wed, 25 Mar 2020 02:47:53 +0000 (12:47 +1000)]
llvmpipe: interpolate Z at sample points for early depth test.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 04:01:54 +0000 (14:01 +1000)]
llvmpipe: handle multisample early depth test/late depth write
A set of values have to be passed from the early depth test to the
late depth write, when multisampling is enabled, a range of those
values have to be stored between stages, so create storage for them
and pass the values through the storage.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 03:48:08 +0000 (13:48 +1000)]
llvmpipe: multisample sample mask + early/late depth pass
Start adding support for multisample masks and the depth passes
The depth passes have to run per-sample, this isn't complete support
it adds the loops, and handles the execution masks.
One mask is stored per sample, they are combined post the early Z
pass into a single shader execution mask, and then the resulting
shader execution mask is anded back in for the late Z pass.
Init the vars to NULL to avoid gcc warnings
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Fri, 20 Mar 2020 03:29:13 +0000 (13:29 +1000)]
llvmpipe: move some fs code around
this just moves the num_fs loop around for follow on refactors
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 05:54:08 +0000 (15:54 +1000)]
llvmpipe: add per-sample depth/stencil test
The current depth stencil test code has some optimisations using
the mask when there is only one depth value, multisample requires
per-sample zstencil testing, and for that case just pass in the
mask that needs updating.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 05:47:14 +0000 (15:47 +1000)]
llvmpipe: move getting mask value out of depth code. (v2)
In order to add per-sample support to this code, the mask
value is needed not the value from the exec mask.
v2: update comment
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 05:40:31 +0000 (15:40 +1000)]
llvmpipe: add per-sample interpolation.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 05:24:11 +0000 (15:24 +1000)]
llvmpipe: add centroid interpolation support.
This just adds the implementation and API to the interpolation builders.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:41:22 +0000 (14:41 +1000)]
llvmpipe: pass interp location into interpolation code.
This just tracks the attribute interpolation location into the
interp code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:25:25 +0000 (14:25 +1000)]
nir/tgsi: translate the interp location
translate sample and centroid locations.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:10:31 +0000 (14:10 +1000)]
gallivm: add mask api to force mask
For per-sample shading the mask needs to be forced for each
iteration of the fragment shader.
Just adds the API for now.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:04:47 +0000 (14:04 +1000)]
gallivm: add sample id/pos intrinsic support
The sample position is looked up in an incoming array using the
sample id.
(These are mostly for ARB_sample_shading support)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:44:40 +0000 (08:44 +1000)]
llvmpipe: add cbuf/zsbuf + coverage samples to the fragment shader key.
These will cause different fragment shaders to be generated.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:23:10 +0000 (08:23 +1000)]
llvmpipe: change mask input to fragment shader to 64-bit.
In order to handle a 4xMSAA mask (16-bits per sample) increase
the fragment shader API to be 64-bit.
v2: drop pointless if (Roland)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:11:31 +0000 (08:11 +1000)]
llvmpipe: add multisample bit to fragment shader key.
The fragment shader needs to be regenerated when multisample changes.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:09:22 +0000 (08:09 +1000)]
llvmpipe: plumb multisample state bit into setup code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 05:28:02 +0000 (15:28 +1000)]
llvmpipe/rast: fix tile clearing for multisample color and depth tiles
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 05:09:37 +0000 (15:09 +1000)]
llvmpipe: record sample info for color/depth buffers in scene
This adds the nr_samples + sample_stride to the scene records
for cbufs and zsbuf.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 7 Apr 2020 23:49:47 +0000 (09:49 +1000)]
llvmpipe: pass color and depth sample strides into fragment shader.
This just adds the interface and passes the depth and sample strides
into the fragment shader, nothing uses them yet.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:51:24 +0000 (13:51 +1000)]
draw: disable point/line smoothing for multisample (v2)
When MSAA is enabled smoothing is ignored
v2: As pointed out by Roland I got this completely wrong,
fix this to work the other way
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 24 Mar 2020 06:18:46 +0000 (16:18 +1000)]
llvmpipe: handle multisample render target clears
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:37:07 +0000 (13:37 +1000)]
llvmpipe: add clear texture support for multisample textures.
This adds the clear paths for multisample textures.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:36:36 +0000 (13:36 +1000)]
llvmpipe: add multisample resource copy region support.
This allows direct copies of all samples between two resources.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:34:33 +0000 (13:34 +1000)]
llvmpipe: add internal multisample texture mapping path.
For clearing and copying textures llvmpipe needs to internally
access the per-sample data.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:21:48 +0000 (13:21 +1000)]
llvmpipe: pass incoming sample_mask into fragment shader context.
This links up the api changing the sample mask to passing it into
the fragment shader.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:06:30 +0000 (13:06 +1000)]
llvmpipe/jit: pass fragment sample mask via jit context.
The incoming sample mask for the fragment shader can be passed
via the jit context
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:04:01 +0000 (13:04 +1000)]
llvmpipe: add get_sample_position support (v2)
This just adds the sample values for 4xmsaa, and hooks them
up to the get_sample_position API
v2: move to vulkan standard sample positions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 02:55:31 +0000 (12:55 +1000)]
llvmpipe: fix race between draw and setting fragment shader.
There is a race with u_blitter shaders + pipeline shaders (aaline/aapoint)
where the draw bind can cause a pipeline flush which can use bind_fs_state to
be reenters and llvmpipe->fs gets the wrong value. Fix this by only
setting the llvmpipe->fs value after the draw binding is complete.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 02:46:02 +0000 (12:46 +1000)]
gallium/util: split out zstencil clearing code.
llvmpipe will want to reuse this for it's multisample clears.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:50:49 +0000 (10:50 +1000)]
llvmpipe: add a max samples define set to 4.
I doubt I'll care about much higher MSAA levels, so 4 it is.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:30:13 +0000 (10:30 +1000)]
llvmpipe: add multisample support to texture allocator.
This adds a sample stride field and allocates enough memory for
each sample storage. Hook up the sample_stride field to draw
and jit textures and images
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 30 Dec 2019 21:03:26 +0000 (07:03 +1000)]
util: add a resource wrapper to get resource samples
This return 1 as a baseline and should be used in allocator paths.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:11:37 +0000 (15:11 +1000)]
llvmpipe: add samples support to image jit
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:22:49 +0000 (10:22 +1000)]
llvmpipe: add num_samples/sample_stride support to jit textures
This adds the support for num_samples/sample_stride retrieval to the
jit texture infrastructure.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:07:11 +0000 (15:07 +1000)]
draw: add support for num_samples + sample_stride to the image paths
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:15:21 +0000 (10:15 +1000)]
draw: introduce sampler num samples + stride members
This adds the num samples + sampler stride into the texture mapping paths,
currently drivers just pass 0 for now.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:15:51 +0000 (15:15 +1000)]
gallivm/nir: add multisample image operations
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 03:55:08 +0000 (13:55 +1000)]
gallivm/nir: add multisample support to image size
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 9 Mar 2020 23:51:17 +0000 (09:51 +1000)]
gallivm/nir/tgsi: add multisample texture sampling.
Both paths are required as u_blitter needs the TGSI path.
This just hooks the instructions up to the sampling code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>