Commit Graph

134801 Commits

Author SHA1 Message Date
Alejandro Piñeiro f758b1a25b v3dv: support for depthBiasClamp
Gets tests like the following working:
dEQP-VK.dynamic_state.rs_state.depth_bias_clamp

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8928>
2021-02-10 10:29:09 +00:00
Rhys Perry f7575fa71f aco: fix adjust_vertex_fetch_alpha
These offsets were wrong and didn't match the old behaviour.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: e8220e106b ("aco: optimize AC_FETCH_FORMAT_SNORM alpha adjust")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8935>
2021-02-10 09:37:17 +00:00
Samuel Pitoiset 19711b0f44 radv: stop allocating useless ESGS scratch BO on GFX10+
On GFX10+, the ESGS ring is allocated in LDS. This saves one BO
when geometry shaders are used, and possibly two BOs if nothing
else (tess, scratch, etc) is used.

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/8926>
2021-02-10 08:45:35 +00:00
Samuel Pitoiset caafedf38f radv: fix double free when creating a fence failed
It's already freed in radv_destroy_fence().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8938>
2021-02-10 08:45:49 +01:00
Eric Anholt cd03f1c6f6 gallium: Document behavior of more lowering pipe caps.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt bcb5f9f94a v3d: Stop advertising support for flat shading.
The GL frontend can lower this weird GL feature away for us.  This should
fix redeclaration of the gl_Color/SecondaryColor as centroid, since that
case had been missed in the !flat special case here.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt ff805f8ac7 v3d: Stop advertising support for PIPE_CAP_*_COLOR_CLAMPED.
The GL frontend can lower away this deprecated GL feature for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt 2992dc7386 v3d: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.
The GL frontend can lower away this deprecated GL feature for us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt 5ddc2f916f v3d: Clean up vestiges of alpha test lowering.
We had an unnecessary case in our uniforms upload switch statement, since
we no longer advertise the cap.

Fixes: 8ad931808e ("v3d: do not report alpha-test as supported")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt b9a9cd59ff vc4: Stop advertising support for VS color clamping.
This is special GL behavior that the frontend is now able to handle for
us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt e584d4f6dd vc4: Stop advertising support for PIPE_CAP_TWO_SIDED_COLOR.
The GL frontend is perfectly able to handle this for us.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt cc0841c82a vc4: Remove vestiges of alpha test lowering.
We stopped reporting the alpha test screen cap, and stopped using the
value in the key, so now shrink the key.  This gets another switch case
out of the hot uniforms upload path.

Fixes: 1404b8b1e5 ("vc4: do not report alpha-test as supported")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt 9aa7a2d10c mesa/st: Assume that the default variant is always first in the list.
Since we always precompile now, we can remove some checks for presence of
the first variant or for it being the wrong key.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt 1d5ce66b02 mesa/st: Always precompile the first shader variant.
Every driver wants the chance to see the default variant of the shader in
the hopes of avoiding draw-time shader compiles, even if they have some
NOS compiled into the shader by st/mesa.  Before, every driver had to
avoid st/mesa lowering options to get this behavior, even if they would
like to have the shared lowering code, and some drivers were just missing
the behavior because nobody had debugged that it was missing yet.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8601>
2021-02-09 20:06:48 -08:00
Eric Anholt 659916d674 freedreno/a5xx: Don't forget to count our custom blits against queries.
Noticed when comparing the a5xx and a6xx paths.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>
2021-02-10 03:46:25 +00:00
Eric Anholt 881ce0f0a4 freedreno: Remove FD_STAGE_* in favor of a "disable_all" flag.
The only paths are "prepare queries for rendering" and "finish all
queries", everything else is handled by set_active_query_state().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>
2021-02-10 03:46:25 +00:00
Eric Anholt 4cc3956193 freedreno: Force updating active queries on batch reordering.
The state of queries for the batch we've just switched to may not reflect
the current active flag, so make sure that we update at the start of the
next draw.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8873>
2021-02-10 03:46:25 +00:00
Eric Anholt 1bab56e1ba ci/virgl: Fix GLES31 testing on desktop GL.
The version overrides leaked into the virglrenderer server, breaking
compiling of all sorts of shaders.  We already get GLES3.1 when running
virgl on llvmpipe GL without doing any overrides.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8854>
2021-02-10 03:31:56 +00:00
Mike Blumenkrantz 697fb11cfc features: mark off GL 4.3 for zink
\o/

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8941>
2021-02-09 19:26:47 -05:00
Mike Blumenkrantz cb80609bb0 zink: GLSL 430
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8941>
2021-02-09 19:25:53 -05:00
Mike Blumenkrantz 7909c642b1 zink: enable compute
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz c5cf5ad6f0 zink: export compute-specific shader/compute caps
this doesn't enable the compute cap itself, it just handles all the other
caps

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz a2771967cb zink: add launch_grid pipe_context hook for compute handling
we're reusing update_descriptors, so this is trivial

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz ce6d08a0e7 zink: flush gfx/compute batches when the other pipeline needs resource sync
if compute or gfx use a resource which is already in use by the other pipeline,
we need to ensure tha we flush that pipeline now in order to have commands execute
in the expected order

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz dac99517ff zink: handle descriptor set updates for compute operations
this is almost identical, the difference being that we need to explicitly
use the compute batch/program in a few places

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz e20a43ec35 zink: handle memory barriers for compute batch
this is a bit different since the regular functions cycle the gfx batch
array, but the compute batch isn't in an array

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz e3633ed12b zink: setup compute batch and add handling
this is separate to the gfx batch array,
so we need separate struct members in zink_context for it

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz fa555772b9 zink: break out descriptor updating into separate function
this is a massive block of code that we need to reuse for compute shaders
because we absolutely don't want to be copying it around

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:39 +00:00
Mike Blumenkrantz b2247a3724 zink: add compute programs and pipelines
these are similar to the gfx variants, but mostly smaller

some things are implemented as placeholders for now to make the code
similar to gfx programs/pipelines and thus easier to read/review

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 6c50b12b9e zink: rename pipeline_cache_entry -> gfx_pipeline_cache_entry
prep for compute pipelines

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 79613650b3 zink: explicitly get shader stage from shader during binding setup in draw
the iterator matches the shader stage currently, but this won't always be the
case

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 184d773d0f zink: make allocate_descriptor_set() take more params instead of a gfx_program
this makes the function reusable between different types of programs

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz c9aee1165b zink: refactor batch creation
by moving this into its own function, we can reuse it for creating a compute
batch, which will not be part of the gfx batch array

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz dcab2ca6b1 zink: take a pipe_reference param in zink_batch_reference_program
this lets us reuse the function for gfx and compute programs without much
churn, since in C we can use a pointer to the first member of a struct and
a pointer to the struct interchangeably

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz f32891b159 zink: ignore compute batch when starting/ending batches
compute batches don't have queries

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 8f6ffc5543 zink: handle nir_intrinsic_memory_barrier_shared in ntv
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz d2b6e10882 zink: add handling for shared atomic ops in ntv
these are mostly the same as ssbo except they use the shared block variable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz deff4c220b zink: implement shared load/store nir ops in ntv
these access the data in the shared block variable at an offset

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 36cdcbe092 zink: handle COMPUTE glsl variables
we can just use existing helpers for these

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 2d65c7cc0a zink: handle COMPUTE setup in ntv
addressing mode, shared block, and execution modes all need to be handled
here

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz d9122c0417 zink: handle COMPUTE bindings in compiler/ntv
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz a5ff286992 zink: add spirv_builder function for emitting a 3word literal exec mode
used by compute

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 813c361fe0 zink: wait on compute batch when necessary during transfer map
now that we have the capability to wait on specific batches, we can
check whether we need to sync with the compute queue here before trying
to map resources

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 261058f277 zink: make zink_batch_reference_resource_rw return usage info
now this provides some info regarding which batches need to be flushed,
allowing gfx batches and compute batches to share resources

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz e196c471a4 zink: make get_resource_usage() public
also cover compute batch id (still not yet used)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 079fae8822 zink: bump resource usage flags to allow 5 batches
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Mike Blumenkrantz 36ee845cd4 zink: add defines for compute batch and gfx batch count
this will be used for handling batch usage with compute

also bump some struct field sizes based on this

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8781>
2021-02-10 00:19:38 +00:00
Lionel Landwerlin 6c489dfefc intel/stub: plug some gaps in our ioctl faking
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8934>
2021-02-09 21:08:52 +00:00
Lionel Landwerlin c4c642a7b4 drm-shim: report support for timeline semaphores
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8934>
2021-02-09 21:08:52 +00:00
Lionel Landwerlin 64cb03a52d anv: only signal wsi fence BO on last command buffer
I'm pretty sure this doesn't fix anything because the WSI code only
use a single VkSubmitInfo, but better be safe.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ccb7d606f1 ("anv: Use submit-time implicit sync instead of allocate-time")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8934>
2021-02-09 21:08:52 +00:00