Commit Graph

72 Commits

Author SHA1 Message Date
Iago Toral Quiroga cfc0e15b9b v3dv: make sure we only expose transfer features for formats we can use
We were already doing this, but this makes it more explicit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:28 +00:00
Iago Toral Quiroga 19841fd550 v3dv: check support for transfer usage flags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:28 +00:00
Iago Toral Quiroga ebbd326472 v3dv: only expose blending on formats that support it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:28 +00:00
Iago Toral Quiroga d71a5af723 v3dv: don't support image formats that we can rendet to or texture from
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:27 +00:00
Iago Toral Quiroga c4f745527e v3dv: meet requirements for supported format features and properties
For now this is only about advertising what is required, many things
here still lack an implementation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:27 +00:00
Iago Toral Quiroga 18824bf23b v3dv: don't advertise texel buffer support yet.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:27 +00:00
Iago Toral Quiroga c7404f4e2d v3dv: Add more supported formats to our format table
Some of these may need additional work to work for real, but we should
be able to support them.

We also include some formats that are not supported for images, but
that we want to support for buffers, such as R32G32B32 for a vertex
buffer.  In the future we might want to expand the format table to
specify which formats are supported for buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:27 +00:00
Iago Toral Quiroga bb6e9d26dc v3dv: support depth testing on combined depth/stencil formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:27 +00:00
Iago Toral Quiroga 4d0e497a3e v3dv: implement support for depth testing
This ignores stencil for now and focuses on depth testing without
support for early depth testing.

To implement this we need to start considering how many of our
framebuffer attachments are color attachments, since some of the
computations we use to determine tile sizes and binning configuration
depend on this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga 6ab4c51d5c v3dv: hook up WSI support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga c75846e674 v3dv: implement DRM modifier setup for WSI
This is only really relevant when running on real hardware, since
when we run on the simulator we don't care about the format of the
swapchain images.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga beee18103e v3dv: implement VK_KHR_external_memory{_fd,_dma_buf}
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga 0fd434d977 v3dv: implement VK_KHR_external_memory_capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Alejandro Piñeiro 931b247a7c v3dv/format: add R32G32B32A32_SFLOAT format
This is clearly supported, and we already confirmed that work with
some of our tests.

Needed to avoid an assertion of such tests when validation layers are
enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga 0fd72b6ac4 v3dv: implement VK_KHR_get_physical_device_properties2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Iago Toral Quiroga 5935ef098d v3dv: implement vkGetPhysicalDeviceSparseImageFormatProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:26 +00:00
Alejandro Piñeiro 6cb24a3b39 v3dv/format: add v3dv_get_format_swizzle
Heavily based on the equivalent v3d v3d_get_formar_swizzle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga 291cd6e77b v3dv: implement vkGetPhysicalDeviceImageFormatProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga dee9976200 v3dv: implement vkCreateImageView
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga 0fcce6c319 v3dv: implement vkCreateImage
This relies heavily in infrastructure taken from the v3d driver. We should
probably look for ways to share the code between both drivers by creating
a surface layout library that we can use from both, or at least moving
parts of the v3d driver to broadcom/common. Specifically:

We take v3d_tiling.c, which requires gallium's pipe_box type for some
helper functions that we don't quite need yet.

We copied and adapted bits of v3d_resource.c into v3dv_image.c, however,
it should be possible to look for ways to reuse the code instead of
duplicating it.

Pre-compute UIF padding into the slice setup. This is different from
what we do in v3d (we do this at cerate_surface time), but it is
more convenient for us to pre-calculate it here for all mipmap
slices.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga 871ac1ed33 v3dv: add some basic support for format properties
This takes a subset of vk_format_info.h from Anvil which has some
Intel specific elements. At some point we might want to discuss
if we want to make the file reusable and move the intel bits to
some other place, but it is not a lot of code and for now this works,
so we keep going.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00
Iago Toral Quiroga 63e23a9b2a v3dv: add stubs for the format table and vkGetPhysicalDeviceFormatProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
2020-10-13 21:21:25 +00:00