Commit Graph

137069 Commits

Author SHA1 Message Date
Mike Blumenkrantz bbe5eb43c7 zink: don't generate sampled image type for non-sampled images
this creates validation errors

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9802>
2021-03-24 19:54:20 +00:00
Mike Blumenkrantz 674132dee8 compiler/spirv: use undefs when extending image coords
we need 4 components for the nir ops, but swizzling one value to multiple
channels like this gets confusing when trying to debug image ops that don't
require 4 channels

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9723>
2021-03-24 19:07:19 +00:00
Eric Anholt 52e7297f9c ci/android: Build the v3dv driver.
We want to make sure that this keeps working on Android.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9764>
2021-03-24 17:25:07 +00:00
Eric Anholt 6d43955941 ci/android: Make sure we don't detect system libexpat.
There may be some more elegant way to do things, but the important thing
is that android builds don't have any .pc files we should be using, other
than what our CI generated for zlib.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9764>
2021-03-24 17:25:07 +00:00
Eric Anholt 3cc390bf7d broadcom: Disbale CLIF dumping when libexpat isn't available.
Given what a niche developer tool CLIF dumps are, no sense requiring
libexpat just for that.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9764>
2021-03-24 17:25:07 +00:00
Eric Anholt 6eee6769e9 turnip: Fix KGSL build since common dispatch rework.
Fixes: 59d70c47c7 ("turnip: Use the common dispatch framework")
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9764>
2021-03-24 17:25:07 +00:00
Mike Blumenkrantz de9f04ca66 zink: add more rp cache asserts
ensure that any discrepencies are immediately detected

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9784>
2021-03-24 17:14:59 +00:00
Mike Blumenkrantz 7892b18acf zink: remove unnecessary flush during image maps
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9786>
2021-03-24 16:45:41 +00:00
Mike Blumenkrantz 6c35b4c771 zink: remove handling for resource flushing between compute/gfx batches
this is no longer a thing

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9786>
2021-03-24 16:45:41 +00:00
Mike Blumenkrantz 9871c883cc zink: avoid unnecessary resource refs during descriptor update
this was necessary if resources could be on both gfx and compute batches,
but now there's only one type of batch

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9786>
2021-03-24 16:45:41 +00:00
Tapani Pälli 87de6c3c7d mesa: check cube completeness for cube fbo attachments
When checking framebuffer completeness, we must verify that each cube
attachment is cube complete, e.g. format and size needs to match.

This fixes upcoming CTS framebuffer completeness tests for cubemaps.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9748>
2021-03-24 16:20:20 +00:00
Mike Blumenkrantz 3d94144d38 zink: add buffer_subdata hook
this just sets some flags to help optimize mapping

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9790>
2021-03-24 16:11:30 +00:00
Mike Blumenkrantz 8dd8754238 zink: explicitly use stream uploader for staging buffers
this requires adding an offset member to the transfer struct

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9789>
2021-03-24 16:00:28 +00:00
Mike Blumenkrantz a3c65ffa3f zink: create separate upload mgr for constants
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9789>
2021-03-24 16:00:28 +00:00
Rhys Perry a6b367a5af aco/tests: add tests for denormal-aware propagation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9079>
2021-03-24 14:02:41 +00:00
Rhys Perry e3c283e0bc aco: use -1.0*x and 1.0*|x| for fneg/fabs
Besides -1.0*x being 1 dword smaller than x^0x80000000, this commit also
improves generated code when the application requires that denormals are
flushed.

Future versions of DXVK will require that 32-bit denormals are flushed.

fossil-db (GFX8):
Totals from 21021 (14.22% of 147787) affected shaders:
SGPRs: 1288960 -> 1288944 (-0.00%); split: -0.01%, +0.01%
VGPRs: 792672 -> 792848 (+0.02%); split: -0.01%, +0.03%
CodeSize: 62439228 -> 62403552 (-0.06%); split: -0.11%, +0.05%
MaxWaves: 136182 -> 136181 (-0.00%); split: +0.00%, -0.00%
Instrs: 12230882 -> 12239927 (+0.07%); split: -0.01%, +0.08%

fossil-db (GFX10.3):
Totals from 20191 (13.80% of 146267) affected shaders:
VGPRs: 799992 -> 800032 (+0.01%)
CodeSize: 59763656 -> 59715484 (-0.08%); split: -0.12%, +0.03%
MaxWaves: 525378 -> 525376 (-0.00%)
Instrs: 11511082 -> 11517419 (+0.06%); split: -0.00%, +0.06%

fossil-db (GFX8, d3d float controls):
Totals from 87160 (58.98% of 147787) affected shaders:
SGPRs: 5395072 -> 5408480 (+0.25%); split: -0.06%, +0.31%
VGPRs: 3596716 -> 3581592 (-0.42%); split: -0.55%, +0.13%
CodeSize: 271347396 -> 266814460 (-1.67%); split: -1.67%, +0.00%
MaxWaves: 539669 -> 540400 (+0.14%); split: +0.15%, -0.02%
Instrs: 53395194 -> 52257505 (-2.13%); split: -2.13%, +0.00%

fossil-db (GFX10.3, d3d float controls):
Totals from 82306 (56.27% of 146267) affected shaders:
VGPRs: 3572312 -> 3558848 (-0.38%); split: -0.44%, +0.06%
CodeSize: 273494748 -> 269648968 (-1.41%); split: -1.41%, +0.00%
MaxWaves: 2007156 -> 2009950 (+0.14%); split: +0.15%, -0.01%
Instrs: 52251568 -> 51356424 (-1.71%); split: -1.71%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9079>
2021-03-24 14:02:41 +00:00
Rhys Perry 561fcfb50f aco: don't optimize min(a*1.0, ...) to min(a, ...) on GFX8
fossil-db (GFX8):
Totals from 2 (0.00% of 147787) affected shaders:
VMEM: 662 -> 642 (-3.02%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9079>
2021-03-24 14:02:41 +00:00
Mike Blumenkrantz 5313ad8e45 zink: handle gallium multi draws more effectively
there's no need to actually call through the whole function, only the
draw calls need to be looped

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9785>
2021-03-24 12:46:32 +00:00
Mike Blumenkrantz 0daacd1347 zink: ci updates
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9783>
2021-03-24 12:35:18 +00:00
Mike Blumenkrantz 40cc265888 zink: toggle conditional render when beginning/ending a renderpass
this resumes the same conditional render which was previously active

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9783>
2021-03-24 12:35:18 +00:00
Mike Blumenkrantz 4e23816243 zink: only update conditional render buffer when it needs to be updated
avoid re-fetching data

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9783>
2021-03-24 12:35:18 +00:00
Mike Blumenkrantz cc90a0c3da zink: store conditional render predicate to query and split out start/stop
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9783>
2021-03-24 12:35:18 +00:00
Mike Blumenkrantz cce1f22ef3 zink: isolate gfx stage bits when updating shader modules
ensure that we don't overflow the array here

Fixes: b2247a3724 ("zink: add compute programs and pipelines")

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9798>
2021-03-24 12:22:56 +00:00
Samuel Pitoiset 50b5a9a4a0 anv: use common entrypoints for VK_KHR_create_renderpass2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9601>
2021-03-24 11:21:53 +00:00
Samuel Pitoiset d7c5b7398b lavapipe: use common entrypoints for VK_KHR_create_renderpass2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9601>
2021-03-24 11:21:53 +00:00
Samuel Pitoiset 2c2ea54020 turnip: use common entrypoints for VK_KHR_create_renderpass2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9601>
2021-03-24 11:21:53 +00:00
Samuel Pitoiset 5cb6999bc3 radv: use common entrypoints for VK_KHR_create_renderpass2
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/9601>
2021-03-24 11:21:53 +00:00
Samuel Pitoiset 0ce6b625a2 vulkan: add common entrypoints for VK_KHR_create_renderpass2
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/9601>
2021-03-24 11:21:53 +00:00
Rhys Perry 453a97b2cf ci: add expected fail for RADV
This fails for me. It looks like it was missed in d8fa93a707.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9778>
2021-03-24 10:58:25 +00:00
Mike Blumenkrantz 12dfba1951 zink: unify gfx and compute batches
now that batches aren't limited and flushing is less costly, there's no
reason to keep these separate

the primary changes here are removing the zink_queue enum and collapsing
related arrays which used it as an index, e.g., zink_batch_usage into single
members

remaining future work here will include removing synchronization flushes which
are no longer necessary and (eventually) removing batch params from a number of
functions since there is now only ever a single batch

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Mike Blumenkrantz fcf0eab8a0 zink: call clear() instead of reset() for batch states on context destroy
this avoids (future) issues with desync due to long-lived fences which
may not yet have completed at the time the context is destroyed

upcoming changes will not allow resetting uncompleted batch states, so
this avoids any sort of conflict as such changes are introduced

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Mike Blumenkrantz e89f674c83 zink: add wrapper to reset batch state structs
this will be useful in the future when we need additional work to handle
resets of states that aren't detected as being "completed"

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Vinson Lee d7f7045108 ac: Fix emit_split_buffer_store modulus operation.
Fix defect reported by Coverity Scan.

Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: start_byte % 2 == 2 is always
false regardless of the values of its operands. This occurs as the
logical operand of if.

Fixes: 3185cb7dbf ("ac: Add NIR passes to lower ES->GS I/O to memory accesses.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9730>
2021-03-23 19:48:15 -07:00
Bas Nieuwenhuizen d248c91162 radv: Allow DCC for images with modifiers that are read-only.
If we avoid writing anything or decompressing this should be fine,
and allows gamescope to work without nodcc for radeonsi.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
2021-03-24 00:28:26 +00:00
Bas Nieuwenhuizen b5ecf0748a radv: Ensure we never decompress or FCE read-only textures.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
2021-03-24 00:28:26 +00:00
Bas Nieuwenhuizen 66e17b410a radv: Enable sharing with DCC with modifiers.
Also disable any heuristics.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
2021-03-24 00:28:26 +00:00
Bas Nieuwenhuizen 85e5bbd11c radv: Allow extra planes for DCC.
plane_count is only the format plane count.

Fixes: 7f7da82dbb ("radv: Add image layout with drm format modifiers.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
2021-03-24 00:28:25 +00:00
Jesse Natalie c022c9603d d3d12: Use ID3D12Device9::CreateCommandQueue1 when available
This lets us provide a creator ID, which lets us tag GLOn12 work
and separate it from other D3D12 work on the same singleton device.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3859
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9776>
2021-03-23 22:11:19 +00:00
Eric Anholt 8120871b8d freedreno/a5xx: Switch to using ir3_cache for looking up our VS/FS
Saves the lock/unlock to get the variants for VS/BS/FS programs, gives us
a place we could hang future linked program state, and gives us safe
constlen handling that fixes a couple of our piglits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt ce36e60b18 freedreno/a4xx: Switch to using ir3_cache for looking up our VS/FS
Saves the lock/unlock to get the variants for VS/BS/FS programs, and gives
us a place we could hang future linked program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt b44d52f62b freedreno/a3xx: Switch to using ir3_cache for looking up our VS/FS.
Saves the lock/unlock to get the variants for VS/BS/FS programs, and gives
us a place we could hang future linked program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt 6941cd5c98 freedreno: Move the ir3 linked shader cache to the context.
The other ir3 backends would love to have it to reduce lookups and to be
able to cache linked-program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Mauro Rossi cd1d8b4371 android: vulkan/util: add vk_descriptors.{c,h} to Makefile.sources
Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
...
ld.lld: error: undefined symbol: vk_create_sorted_bindings
>>> referenced by radv_descriptor_set.c:158 (external/mesa/src/amd/vulkan/radv_descriptor_set.c:158)
...
ld.lld: error: undefined symbol: vk_create_sorted_bindings
>>> referenced by radv_descriptor_set.c:340 (external/mesa/src/amd/vulkan/radv_descriptor_set.c:340)

Fixes: ad241b15a9 ("vk: consolidate dynamic descriptor binding sorting")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9766>
2021-03-23 20:29:55 +01:00
Mauro Rossi cd135b877d android: r600/sfn: fix sfn_nir_algebraic.c gen rules
Changelog:
- Correct typo in generator name which is sfn_nir_algebraic.py
- Rename variables for the gen rules according to meson rules
- Align python command and options according to meson rules

Fixes the following building error:

FAILED: ninja: 'external/mesa/src/gallium/drivers/r600/sfn/r600_nir_algebraic.py',
needed by 'out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_pipe_r600_intermediates/sfn_nir_algebraic.c',
missing and no known rule to make it

Fixes: 195952786b ("r600/sfn: Add algebraic lowering for fsin and fcos")
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9766>
2021-03-23 20:29:55 +01:00
Erik Faye-Lund ccb50f8ad3 zink: emit all interpolation modes
It's not just flat-shading that matters in the case of fragment outputs.
Let's play nicely and emit any interpolation mode instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9775>
2021-03-23 17:22:09 +00:00
Erik Faye-Lund 80c3a53927 zink: factor out interpolation to helper
We actually need to set all of these for fragment inputs as well, so
let's make a helper for this that we can reuse.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9775>
2021-03-23 17:22:09 +00:00
Mike Blumenkrantz 277ea7a015 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz 116811e963 zink: trigger pending clears during flush
this applies all pending fb clears at the time of flush to handle the scenario
of start -> clear() -> flush() properly

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz 6d138b5f92 zink: refactor clears a little to track a bitfield of enabled clears on the context
this makes the state of 'are there clears pending?' more accessible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz a1d03cd031 zink: simplify some queue-related query code
we can collapse these conditionals now that things are more unified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00