Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3ca472d authored by Chris Forbes's avatar Chris Forbes Committed by Android (Google) Code Review
Browse files

Merge changes from topic "vulkan-1.4" into main

* changes:
  Update libvulkan linker map for 1.4
  Add feature xml for Vulkan version 1.4
  Add support for Vulkan 1.4 core entrypoints to nulldrv
  Allow vkjson to report on 1.4 instances
  Add support for vulkan api level 1.4 in loader
  Regenerate vulkan-loader for 1.4
parents 3a57dcd7 4d74653b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2024 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- This is the standard feature indicating that the device has a Vulkan
     driver that supports API version 1.4 (0x00404000) -->
<permissions>
    <feature name="android.hardware.vulkan.version" version="4210688" />
</permissions>
+4 −1
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@
#include "driver.h"
#include "layers_extensions.h"

#include <com_android_graphics_libvulkan_flags.h>

using namespace com::android::graphics::libvulkan;

namespace vulkan {
namespace api {
@@ -1473,7 +1476,7 @@ VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) {
    if (!EnsureInitialized())
        return VK_ERROR_OUT_OF_HOST_MEMORY;

    *pApiVersion = VK_API_VERSION_1_3;
    *pApiVersion = flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3;
    return VK_SUCCESS;
}

+228 −0

File changed.

Preview size limit exceeded, changes collapsed.

+19 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ struct DeviceDispatchTable {
    PFN_vkCreateRenderPass CreateRenderPass;
    PFN_vkDestroyRenderPass DestroyRenderPass;
    PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
    PFN_vkGetRenderingAreaGranularity GetRenderingAreaGranularity;
    PFN_vkCreateCommandPool CreateCommandPool;
    PFN_vkDestroyCommandPool DestroyCommandPool;
    PFN_vkResetCommandPool ResetCommandPool;
@@ -196,6 +197,7 @@ struct DeviceDispatchTable {
    PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
    PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
    PFN_vkQueuePresentKHR QueuePresentKHR;
    PFN_vkCmdPushDescriptorSet CmdPushDescriptorSet;
    PFN_vkTrimCommandPool TrimCommandPool;
    PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures;
    PFN_vkBindBufferMemory2 BindBufferMemory2;
@@ -208,6 +210,7 @@ struct DeviceDispatchTable {
    PFN_vkCreateDescriptorUpdateTemplate CreateDescriptorUpdateTemplate;
    PFN_vkDestroyDescriptorUpdateTemplate DestroyDescriptorUpdateTemplate;
    PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
    PFN_vkCmdPushDescriptorSetWithTemplate CmdPushDescriptorSetWithTemplate;
    PFN_vkGetBufferMemoryRequirements2 GetBufferMemoryRequirements2;
    PFN_vkGetImageMemoryRequirements2 GetImageMemoryRequirements2;
    PFN_vkGetImageSparseMemoryRequirements2 GetImageSparseMemoryRequirements2;
@@ -232,11 +235,13 @@ struct DeviceDispatchTable {
    PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress;
    PFN_vkGetBufferDeviceAddress GetBufferDeviceAddress;
    PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress;
    PFN_vkCmdSetLineStipple CmdSetLineStipple;
    PFN_vkCmdSetCullMode CmdSetCullMode;
    PFN_vkCmdSetFrontFace CmdSetFrontFace;
    PFN_vkCmdSetPrimitiveTopology CmdSetPrimitiveTopology;
    PFN_vkCmdSetViewportWithCount CmdSetViewportWithCount;
    PFN_vkCmdSetScissorWithCount CmdSetScissorWithCount;
    PFN_vkCmdBindIndexBuffer2 CmdBindIndexBuffer2;
    PFN_vkCmdBindVertexBuffers2 CmdBindVertexBuffers2;
    PFN_vkCmdSetDepthTestEnable CmdSetDepthTestEnable;
    PFN_vkCmdSetDepthWriteEnable CmdSetDepthWriteEnable;
@@ -263,8 +268,22 @@ struct DeviceDispatchTable {
    PFN_vkCmdPipelineBarrier2 CmdPipelineBarrier2;
    PFN_vkQueueSubmit2 QueueSubmit2;
    PFN_vkCmdWriteTimestamp2 CmdWriteTimestamp2;
    PFN_vkCopyMemoryToImage CopyMemoryToImage;
    PFN_vkCopyImageToMemory CopyImageToMemory;
    PFN_vkCopyImageToImage CopyImageToImage;
    PFN_vkTransitionImageLayout TransitionImageLayout;
    PFN_vkCmdBeginRendering CmdBeginRendering;
    PFN_vkCmdEndRendering CmdEndRendering;
    PFN_vkGetImageSubresourceLayout2 GetImageSubresourceLayout2;
    PFN_vkGetDeviceImageSubresourceLayout GetDeviceImageSubresourceLayout;
    PFN_vkMapMemory2 MapMemory2;
    PFN_vkUnmapMemory2 UnmapMemory2;
    PFN_vkCmdBindDescriptorSets2 CmdBindDescriptorSets2;
    PFN_vkCmdPushConstants2 CmdPushConstants2;
    PFN_vkCmdPushDescriptorSet2 CmdPushDescriptorSet2;
    PFN_vkCmdPushDescriptorSetWithTemplate2 CmdPushDescriptorSetWithTemplate2;
    PFN_vkCmdSetRenderingAttachmentLocations CmdSetRenderingAttachmentLocations;
    PFN_vkCmdSetRenderingInputAttachmentIndices CmdSetRenderingInputAttachmentIndices;
    // clang-format on
};

+8 −2
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ CreateInfoWrapper::CreateInfoWrapper(const VkInstanceCreateInfo& create_info,
                                     const VkAllocationCallbacks& allocator)
    : is_instance_(true),
      allocator_(allocator),
      loader_api_version_(VK_API_VERSION_1_3),
      loader_api_version_(flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3),
      icd_api_version_(icd_api_version),
      physical_dev_(VK_NULL_HANDLE),
      instance_info_(create_info),
@@ -410,7 +410,7 @@ CreateInfoWrapper::CreateInfoWrapper(VkPhysicalDevice physical_dev,
                                     const VkAllocationCallbacks& allocator)
    : is_instance_(false),
      allocator_(allocator),
      loader_api_version_(VK_API_VERSION_1_3),
      loader_api_version_(flags::vulkan_1_4_instance_api() ? VK_API_VERSION_1_4 : VK_API_VERSION_1_3),
      icd_api_version_(icd_api_version),
      physical_dev_(physical_dev),
      dev_info_(create_info),
@@ -552,6 +552,10 @@ VkResult CreateInfoWrapper::SanitizeExtensions() {
        is_instance_ ? loader_api_version_
                     : std::min(icd_api_version_, loader_api_version_);
    switch (api_version) {
        case VK_API_VERSION_1_4:
            hook_extensions_.set(ProcHook::EXTENSION_CORE_1_4);
            hal_extensions_.set(ProcHook::EXTENSION_CORE_1_4);
            [[clang::fallthrough]];
        case VK_API_VERSION_1_3:
            hook_extensions_.set(ProcHook::EXTENSION_CORE_1_3);
            hal_extensions_.set(ProcHook::EXTENSION_CORE_1_3);
@@ -701,6 +705,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
            case ProcHook::EXTENSION_CORE_1_1:
            case ProcHook::EXTENSION_CORE_1_2:
            case ProcHook::EXTENSION_CORE_1_3:
            case ProcHook::EXTENSION_CORE_1_4:
            case ProcHook::EXTENSION_COUNT:
                // Device and meta extensions. If we ever get here it's a bug in
                // our code. But enumerating them lets us avoid having a default
@@ -766,6 +771,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
            case ProcHook::EXTENSION_CORE_1_1:
            case ProcHook::EXTENSION_CORE_1_2:
            case ProcHook::EXTENSION_CORE_1_3:
            case ProcHook::EXTENSION_CORE_1_4:
            case ProcHook::EXTENSION_COUNT:
                // Instance and meta extensions. If we ever get here it's a bug
                // in our code. But enumerating them lets us avoid having a
Loading