Commit Graph

279 Commits

Author SHA1 Message Date
Danylo Piliaiev fd31989ecb turnip: add support for dirconf
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13367>
2021-10-18 17:26:41 +00:00
Hyunjun Ko 30b4911031 turnip: enable strictLines
Now we can enable strictLines as we set rectangular lines by default.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
2021-10-13 12:18:01 +00:00
Hyunjun Ko 542211676c turnip: enable VK_EXT_line_rasterization
By default line mode is VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT,
when lineRasterizationMode is VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT
and primtype is line - we enable bresenham line mode.

We have to disable MSAA when bresenham lines are used, this is
a hardware limitation and spec allows it:

  "When Bresenham lines are being rasterized, sample locations may
   all be treated as being at the pixel center (this may affect
   attribute and depth interpolation)."

This forces us to re-emit msaa state when line mode is changed.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6020>
2021-10-13 12:18:01 +00:00
Jason Ekstrand 531437d7f6 turnip: Use the common WSI wrappers
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Connor Abbott 0450c1b8a2 tu: Expose VK_KHR_shader_subgroup_extended_types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13271>
2021-10-11 11:00:56 +00:00
Connor Abbott 4537814349 tu: Implement VK_KHR_imageless_framebuffer
This is mostly a matter of auditing uses of
cmd->state.framebuffer and replacing every use of fb->attachments with
cmd->state.attachments. We already weren't using the attachments
anywhere outside of the render pass, so this is pretty straightforward.
We also don't have any use for anything in
VkFramebufferAttachmentImageInfo so we can just ignore it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13228>
2021-10-08 15:09:59 +00:00
Jason Ekstrand a1ac8234ec turnip: Plumb non-startup errors through the new vk_error helpers
Also, change every vk_error to use the closest object instead of
fetching all the way back to the instance.

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13045>
2021-10-07 20:51:36 +00:00
Emma Anholt 591afd1d52 turnip: Free disk cache on pdev init failure.
Noticed while debugging test failure under valgrind (the disk cache
doesn't come from the vulkan allocator, so we could leak it and not fail
the test).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>
2021-10-06 16:49:03 +00:00
Emma Anholt 36d761f2a5 turnip: Fix allocation failure handling around device->name.
Fixes regressions in dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail

Fixes: 5116388e0b ("turnip: Expose a device name similar to the blob.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13200>
2021-10-06 16:49:03 +00:00
Danylo Piliaiev d2543658ef turnip: clamp per-tile scissors to max viewport size in binning pass
Tiles on the edge may cross maximum viewport size, we have to clamp
per-tile scissor to maximum allowed viewport dimensions.

Add MAX_VIEWPORT_SIZE constant along the way.

Fixes vkd3d test "test_draw_uav_only"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13197>
2021-10-05 14:27:44 +00:00
Emma Anholt 5116388e0b turnip: Expose a device name similar to the blob.
We add "Turnip" so that users (and vulkan.gpuinfo.org) can distinguish us
without requiring VK_KHR_driver_properties.  This will be a lot more
user-friendly than "FD618", though.

I made some little vk_asprintf helpers, because I figure other drivers
setting up deviceName's will want them too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13041>
2021-10-01 22:32:10 +00:00
Emma Anholt 7e471541e0 turnip: Match the blob's format for vendorID and deviceID.
This should hopefully cause us the least trouble with apps tuning for
device performance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13041>
2021-10-01 22:32:10 +00:00
Tapani Pälli 40c798c6bc turnip: remove feature checks from device creation
This is already handled by vk_device_init(); drivers no longer
need to do it themselves.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12867>
2021-10-01 17:37:02 +00:00
Jason Ekstrand c6210d5aa9 turnip: Switch to common GetDeviceQueues2 and DeviceWaitIdle
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:26 +00:00
Jason Ekstrand 8619c6df62 turnip: Drop tu_queue::flags/queue_family_index/queue_idx
They're now part of vk_queue.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:25 +00:00
Jason Ekstrand b2313b6884 vulkan: Add the pCreateInfo to vk_queue_init()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
2021-09-28 21:08:25 +00:00
Emma Anholt c0142ddf3a turnip: Disable VK_EXT_display_control.
The common code fails dEQP-VK.wsi.display_control.register_device_event
due to having a stub NOT_IMPLEMENTED return, and thus fails the CTS.  This
is one of our last failures, so disable the extension until it can get
finished off, so we can unblock passing the CTS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13010>
2021-09-27 17:41:43 +00:00
Emma Anholt 61b7ca2a1f turnip: Set the VK_DRIVER_ID to our new enum.
This hasn't been exposed yet, but would be with vulkan 1.2 or
VK_KHR_driver_properties

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13007>
2021-09-24 17:55:10 +00:00
Emma Anholt 2fb68f74c4 turnip: Use the shared now-in-core feature/prop extension helper functions.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12967>
2021-09-23 16:19:47 +00:00
Yevhenii Kolesnikov 37d32dcce3 turnip: Use a common vk_queue structure
Switch to using common structure.

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13000>
2021-09-23 15:57:46 +00:00
Emma Anholt 8a3e94c619 turnip: Move physical device 1.2 properties to a helper function.
Again, while we don't do 1.2 yet (and we have some properties to fill out
to do so), this prevents value duplication when we do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Emma Anholt c0c5c0d557 tu: Support VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES.
We had missed this struct previously, causing a CTS fail.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Emma Anholt fa5cc38f5b tu: Move VK 1.1 core properties to a helper function and use macros for exts.
This struct is exposed in VK 1.2, and using the macros means we don't have
to duplicate the values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Eric Anholt 24a539e94c tu: Add GetPhysicalDeviceFeatures2() support for more VK 1.2 core features.
You can get them from the big blob of features, or through
extension-specific structs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Eric Anholt ab5e77d854 tu: Deduplicate extension/core feature flags.
Copied this pattern from the anv driver.  Now it's harder to desynchronize
your features.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Eric Anholt 14eb5ca3cd tu: Move core features definitions to a helper function.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12944>
2021-09-21 22:43:43 +00:00
Danylo Piliaiev 4092d5f0d8 u_trace: pass command stream through tracing functions
Allows writing timestamps into different command streams.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10969>
2021-09-10 14:58:28 +03:00
Danylo Piliaiev 5c6f0d46e7 turnip/perfetto: reusable command buffers support
The limitation is that the reusable command buffer should be created
when perfetto is already connected in order to write timestamps.
Otherwise such cmd buffer won't be traces.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10969>
2021-09-10 14:58:28 +03:00
Danylo Piliaiev 3dd1bb6355 turnip: implement basic perfetto support
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10969>
2021-09-10 14:58:28 +03:00
Matt Turner c600494a8e tu: Enable VK_KHR_uniform_buffer_standard_layout
This extension relaxes the alignment requirements to allow the GL std430
layout to be used. freedreno/ir3 already supports this (via
PIPE_CAP_LOAD_CONSTBUF).

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12495>
2021-08-23 18:30:22 +00:00
Matt Turner e0bc11d9d2 tu: Free device->bo_idx and device->bo_list on init failure
Two related changes:

- in tu_device.c:tu_CreateDevice we need to free both pointers in the
  teardown path after tu_bo_finish(global_bo), which uses the pointers.
  They are allocated in the first call to tu_bo_init(), which happens
  when global_bo is allocated.

- in tu_drm.c:tu_bo_init we need to free bo_list if the bo_idx
  allocation fails. Convert to the goto teardown pattern as well.

Fixes the following dEQP-VK tests:
  dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
  dEQP-VK.api.object_management.alloc_callback_fail.device
  dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12481>
2021-08-20 20:30:14 +00:00
Danylo Piliaiev fd62e0b799 tu: enable VK_EXT_extended_dynamic_state2
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10434>
2021-08-12 08:01:30 +00:00
Danylo Piliaiev 804f1b5664 tu: declare VK_EXT_extended_dynamic_state2 but leave it disabled
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10434>
2021-08-12 08:01:30 +00:00
Danylo Piliaiev 4f9ac2f737 tu: add "flushall" and "syncdraw" debug options
They will be useful to check whether some issue is due to the lack
of flushing or waiting.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12283>
2021-08-10 20:08:58 +00:00
Rob Clark 7806843866 freedreno/all: Introduce fd_dev_id
Move away from using gpu_id as the primary means to identify which
adreno we are running on, as future GPUs (starting with 7c3) stop
providing a gpu_id as a new naming scheme is introduced.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>
2021-08-06 18:51:50 +00:00
Matt Turner 0165fde82c tu: Raise maxDescriptorSetUpdateAfterBindUniformBuffersDynamic to 16
... and reduce maxDescriptorSetUpdateAfterBindStorageBuffersDynamic from 12 to
8.

MAX_DYNAMIC_BUFFERS is MAX_DYNAMIC_UNIFORM_BUFFERS +
MAX_DYNAMIC_STORAGE_BUFFERS. We set

maxDescriptorSetUniformBuffersDynamic = MAX_DYNAMIC_UNIFORM_BUFFERS
maxDescriptorSetStorageBuffersDynamic = MAX_DYNAMIC_STORAGE_BUFFERS
maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = MAX_DYNAMIC_BUFFERS / 2
maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = MAX_DYNAMIC_BUFFERS / 2

The CTS test checks that

maxDescriptorSetUpdateAfterBindUniformBuffersDynamic
	- is at least 8; and
	- is at least maxDescriptorSetUniformBuffersDynamic
maxDescriptorSetUpdateAfterBindStorageBuffersDynamic
	- is at least 4; and
	- and is at least maxDescriptorSetStorageBuffersDynamic

Prior to this patch maxDescriptorSetUpdateAfterBindUniformBuffersDynamic was 12
but maxDescriptorSetUniformBuffersDynamic was 16, thus causing the CTS failure
in
  dEQP-VK.api.info.vulkan1p2_limits_validation.ext_descriptor_indexing

By raising maxDescriptorSetUpdateAfterBindUniformBuffersDynamic to the same
value as maxDescriptorSetUniformBuffersDynamic, we bring the limits into the
appropriate ranges. We do the same thing for
maxDescriptorSetUpdateAfterBindStorageBuffersDynamic by assigning it the same
value as maxDescriptorSetStorageBuffersDynamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12193>
2021-08-06 16:46:55 +00:00
Danylo Piliaiev ea7a42775b turnip: reduce maxComputeWorkGroupSize
Blob advertises { 1024, 1024, 64 }, but from tests they all
could be 1024.

Fixes tests:
 dEQP-VK.compute.basic.max_local_size_x
 dEQP-VK.compute.basic.max_local_size_y
 dEQP-VK.compute.basic.max_local_size_z

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9409>
2021-08-02 20:19:18 +03:00
Connor Abbott fc0c0e9d45 tu: Use NIR for clear/blit shaders
This is much more maintainable, extensible, and easy to read than
hand-rolled structs approximating assembly. This also removes the last
use of the old hand-written packing structs. There are a few minor
differences:

- The shaders are larger because ir3 currently doesn't support (rpt),
  which means that some shaders are larger than one instrlen and the
  current logic has to be extended to allow for that. This seems a small
  price to pay, ir3 will gain support for (rpt) eventually, and we
  shouldn't have limitations like this baked in anyway. For example some
  GL blob r8g8 <-> r16 copy shaders are apparently quite large.
- Due to the inability to switch inputs/outputs on the fly, we need to
  split the VS into two variants. I made the layer-writing variant also
  used for other clears, because the old method of overloading c0.z/c1.z
  to mean both "src x coordinate" and "z clear value" in the same shader
  seemed too clever and I didn't want to add yet another variant. This
  means that non-layered clears will also write the layer (to 0), but
  that shouldn't be a big deal performance-wise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12079>
2021-07-29 23:20:18 +00:00
Eduardo Lima Mitev ee3495e465 turnip: Add support for VK_VALVE_mutable_descriptor_type
v1.  Hyunjun Ko <zzoon@igalia.com>
- Add to hanlde VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE
- Don't support VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER

v2.  Hyunjun Ko <zzoon@igalia.com>
- Fix some indentations and nitpicks.
- Add the extension to features.txt

v3.  Hyunjun Ko <zzoon@igalia.com>
- Remove unnecessary asserts.

Signed-off-by: Eduardo Lima Mitev <elima@igalia.com>
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9322>
2021-07-27 04:53:02 +00:00
Rob Clark 7c7722304b freedreno+turnip: Get device name from device-info table
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark f74d0bf05e turnip: Get has_sample_locations from fd_dev_info
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 3f1c4a86bb turnip: Get has_tex_filter_cubic from fd_dev_info
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 06000f42ed turnip: Get storage_16bit from fd_dev_info
Removing more gpu_id checks that will become bogus as we add more a6xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark c9bcd835fa turnip: Convert fd_dev_info to const pointer
Split out from earlier patch to reduce churn.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 78c8a8af80 freedreno: Generate device-info tables at build time
This way we can make the tables const.  At the same time, for a6xx, this
introduces a "sub-generation template" to reduce the copy/paste for
parameters which are keyed to the sub-generation.  It also explicitly
lists every supported GPU, to get rid of duplicate lists of supported
gpus between the device-info and drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 0eda0188aa freedreno: Rename *_dev_info
Everywhere else symbols/types/etc are shortend to "fd_*", so lets do the
same here for consistency.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Jonathan Marek 1a6dd7f9b1 freedreno/common: unhardcode CCU color cache offset
Replace it with a calculation which works for all current GPUs.

Duplicated the calculation in both drivers because freedreno_dev_info isn't
meant for derived parameters (and drivers might want to just calculate on
the fly instead).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Connor Abbott 266d3d5814 tu: Update subgroup properties
Everything should be in place for this to actually work. Support a size
of 128, unlike the blob. I've also plumbed through ballot support, so
enable that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6752>
2021-07-08 16:02:41 +00:00
Hyunjun Ko 9507705693 turnip/kgsl: new flag TU_USE_KGSL
There are some cases using kgsl backend on linux that is still not usual
setup though, we need to consider too.

Regarding the timeline semaphore feature, we could implement it for
the kgsl backend in the future, and probalby it should be using the
existing code in tu_drm.

See #4738, #4907

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11488>
2021-07-01 04:22:55 +00:00
Matt Turner ed77bf3c4e ci: Unify on MESA_VK_IGNORE_CONFORMANCE_WARNING
Move and rename warn_non_conformant_implementation() to common location
of src/vulkan/util/vk_util.c as vk_warn_non_conformant_implementation().

In freedreno/ci,  move MESA_VK_IGNORE_CONFORMANCE_WARNING to common
location of .baremetal-deqp-test-freedreno-vk.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11563>
2021-06-25 19:45:38 +00:00