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

Commit c78fa706 authored by Jesse Hall's avatar Jesse Hall Committed by Android (Google) Code Review
Browse files

Merge changes I9453454c,I872fcb4a,I441a2ddf,Iddc28080,If8041fb1, ...

* changes:
  vulkan: Update from version 0.221.0 to 1.0!
  vulkan: Update from version 0.213.0 to 0.221.0
  vulkan: Update from version 0.210.1 to 0.213.0
  vkinfo: print device layers and extensions
  vkinfo: Refactor to separate info gather from print stages
  vulkan: Implement layer and extension enumeration
  vkinfo: print instance layers and extensions
  vulkan: Implement new vkGet*ProcAddrBehavior
  libvulkan: Update global layer loading rules
  vknulldrv: Change module name to not clash with real drivers
  vulkan: Update DevelopersGuide for SDK 0.10
  vulkan: remove patches/frameworks_native-sdk_0.10
  libvulkan: Add missing instance entry point dispatch init
  vknulldrv: Fix 64-bit build
  libvulkan: Implement new VkFence parameter in vkAcquireNextImageKHR
  vulkan: Add acquire fence fix to sdk-0.10 patch stack
  vulkan: Add vkAllocateCommandBuffers fix to sdk-0.10 patch stack
  libvulkan: Fix missed vkAllocateCommandBuffers renames
  vulkan: Fixes to the SDK-0.9->0.10 patch stack
parents 1052e5fd 3dd678a6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -216,7 +216,8 @@
{{define "Vtbl"}}
  {{AssertType $ "Function"}}

  {{range $i, $p := $.CallParameters}}
    {{if not $i}}{{Node "Vtbl" $p}}{{end}}
  {{if gt (len $.CallParameters) 0}}
    {{Node "Vtbl" (index $.CallParameters 0)}}
  {{else}}Global
  {{end}}
{{end}}
+237 −119

File changed.

Preview size limit exceeded, changes collapsed.

−1 KiB (152 KiB)

File changed.

No diff preview for this file type.

+24 −5
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
= Vulkan on Android Implementor's Guide =
:toc: right
:numbered:
:revnumber: 3
:revnumber: 4

This document is intended for GPU IHVs writing Vulkan drivers for Android, and OEMs integrating them for specific devices. It describes how a Vulkan driver interacts with the system, how GPU-specific tools should be installed, and Android-specific requirements.

@@ -99,7 +99,9 @@ When creating a gralloc-backed image, the +VkImageCreateInfo+ will have:
  .pQueueFamilyIndices = VkSwapChainCreateInfoWSI::pQueueFamilyIndices
----

+vkAcquireImageANDROID+ acquires ownership of a swapchain image and imports an externally-signalled native fence into an existing +VkSemaphore+ object:
+vkAcquireImageANDROID+ acquires ownership of a swapchain image and imports an
externally-signalled native fence into both an existing VkSemaphore object
and an existing VkFence object:

[source,c]
----
@@ -107,12 +109,26 @@ VkResult VKAPI vkAcquireImageANDROID(
    VkDevice            device,
    VkImage             image,
    int                 nativeFenceFd,
    VkSemaphore         semaphore
);
    VkSemaphore         semaphore,
    VkFence             fence
);
----

This function is called during +vkAcquireNextImageWSI+ to import a native fence into the +VkSemaphore+ object provided by the application. The driver may also use this opportunity to recognize and handle any external changes to the gralloc buffer state; many drivers won't need to do anything here. This call puts the +VkSemaphore+ into the same "pending" state as +vkQueueSignalSemaphore+, so queues can wait on the semaphore. The +VkSemaphore+ signals when the underlying native fence signals; if the fence has already signalled, then the semaphore will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the +VkSemaphore+ is destroyed, when a different native fence is imported, or any other condition that replaces the +VkSemaphore+'s underlying synchronization object. If +fenceFd+ is -1, the +VkSemaphore+ will be considered signalled immediately, but it can still be passed to +vkQueueWaitSemaphore+.
This function is called during +vkAcquireNextImageWSI+ to import a native
fence into the +VkSemaphore+ and +VkFence+ objects provided by the
application. Both semaphore and fence objects are optional in this call. The
driver may also use this opportunity to recognize and handle any external
changes to the gralloc buffer state; many drivers won't need to do anything
here. This call puts the +VkSemaphore+ and +VkFence+ into the same "pending"
state as +vkQueueSignalSemaphore+ and +vkQueueSubmit+ respectively, so queues
can wait on the semaphore and the application can wait on the fence. Both
objects become signalled when the underlying native fence signals; if the
native fence has already signalled, then the semaphore will be in the signalled
state when this function returns. The driver takes ownership of the fence fd
and is responsible for closing it when no longer needed. It must do so even if
neither a semaphore or fence object is provided, or even if
+vkAcquireImageANDROID+ fails and returns an error. If +fenceFd+ is -1, it
is as if the native fence was already signalled.

+vkQueueSignalReleaseImageANDROID+ prepares a swapchain image for external use, and creates a native fence and schedules it to be signalled when prior work on the queue has completed.

@@ -140,3 +156,6 @@ This will be called during +vkQueuePresentWSI+ on the provided queue. Effects ar
   * Replaced vkImportNativeFenceANDROID and vkQueueSignalNativeFenceANDROID
     with vkAcquireImageANDROID and vkQueueSignalReleaseImageANDROID, to allow
     drivers to known the ownership state of swapchain images.
. *2015-12-03*
   * Added a VkFence parameter to vkAcquireImageANDROID corresponding to the
     parameter added to vkAcquireNextImageKHR.
+34 −5
Original line number Diff line number Diff line
@@ -843,7 +843,9 @@ http://www.gnu.org/software/src-highlite -->
  .queueFamilyCount    = VkSwapChainCreateInfoWSI::queueFamilyCount
  .pQueueFamilyIndices = VkSwapChainCreateInfoWSI::pQueueFamilyIndices</pre>
</div></div>
<div class="paragraph"><p><span class="monospaced">vkAcquireImageANDROID</span> acquires ownership of a swapchain image and imports an externally-signalled native fence into an existing <span class="monospaced">VkSemaphore</span> object:</p></div>
<div class="paragraph"><p><span class="monospaced">vkAcquireImageANDROID</span> acquires ownership of a swapchain image and imports an
externally-signalled native fence into both an existing VkSemaphore object
and an existing VkFence object:</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 3.1.6
by Lorenzo Bettini
@@ -853,10 +855,24 @@ http://www.gnu.org/software/src-highlite -->
    <span style="color: #008080">VkDevice</span>            device<span style="color: #990000">,</span>
    <span style="color: #008080">VkImage</span>             image<span style="color: #990000">,</span>
    <span style="color: #009900">int</span>                 nativeFenceFd<span style="color: #990000">,</span>
    VkSemaphore         semaphore
<span style="color: #990000">);</span>
    <span style="color: #008080">VkSemaphore</span>         semaphore<span style="color: #990000">,</span>
    VkFence             fence
<span style="color: #990000">);</span></tt></pre></div></div>
<div class="paragraph"><p>This function is called during <span class="monospaced">vkAcquireNextImageWSI</span> to import a native fence into the <span class="monospaced">VkSemaphore</span> object provided by the application. The driver may also use this opportunity to recognize and handle any external changes to the gralloc buffer state; many drivers won&#8217;t need to do anything here. This call puts the <span class="monospaced">VkSemaphore</span> into the same "pending" state as <span class="monospaced">vkQueueSignalSemaphore</span>, so queues can wait on the semaphore. The <span class="monospaced">VkSemaphore</span> signals when the underlying native fence signals; if the fence has already signalled, then the semaphore will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the <span class="monospaced">VkSemaphore</span> is destroyed, when a different native fence is imported, or any other condition that replaces the <span class="monospaced">VkSemaphore</span>'s underlying synchronization object. If <span class="monospaced">fenceFd</span> is -1, the <span class="monospaced">VkSemaphore</span> will be considered signalled immediately, but it can still be passed to <span class="monospaced">vkQueueWaitSemaphore</span>.</p></div>
<div class="paragraph"><p>This function is called during <span class="monospaced">vkAcquireNextImageWSI</span> to import a native
fence into the <span class="monospaced">VkSemaphore</span> and <span class="monospaced">VkFence</span> objects provided by the
application. Both semaphore and fence objects are optional in this call. The
driver may also use this opportunity to recognize and handle any external
changes to the gralloc buffer state; many drivers won&#8217;t need to do anything
here. This call puts the <span class="monospaced">VkSemaphore</span> and <span class="monospaced">VkFence</span> into the same "pending"
state as <span class="monospaced">vkQueueSignalSemaphore</span> and <span class="monospaced">vkQueueSubmit</span> respectively, so queues
can wait on the semaphore and the application can wait on the fence. Both
objects become signalled when the underlying native fence signals; if the
native fence has already signalled, then the semaphore will be in the signalled
state when this function returns. The driver takes ownership of the fence fd
and is responsible for closing it when no longer needed. It must do so even if
neither a semaphore or fence object is provided, or even if
<span class="monospaced">vkAcquireImageANDROID</span> fails and returns an error. If <span class="monospaced">fenceFd</span> is -1, it
is as if the native fence was already signalled.</p></div>
<div class="paragraph"><p><span class="monospaced">vkQueueSignalReleaseImageANDROID</span> prepares a swapchain image for external use, and creates a native fence and schedules it to be signalled when prior work on the queue has completed.</p></div>
<div class="listingblock">
<div class="content"><!-- Generator: GNU source-highlight 3.1.6
@@ -926,6 +942,19 @@ Replaced vkImportNativeFenceANDROID and vkQueueSignalNativeFenceANDROID
</li>
</ul></div>
</li>
<li>
<p>
<strong>2015-12-03</strong>
</p>
<div class="ulist"><ul>
<li>
<p>
Added a VkFence parameter to vkAcquireImageANDROID corresponding to the
     parameter added to vkAcquireNextImageKHR.
</p>
</li>
</ul></div>
</li>
</ol></div>
</div>
</div>
@@ -934,7 +963,7 @@ Replaced vkImportNativeFenceANDROID and vkQueueSignalNativeFenceANDROID
<div id="footer">
<div id="footer-text">
Version 3<br>
Last updated 2015-11-04 10:58:22 PST
Last updated 2015-12-03 15:47:36 PST
</div>
</div>
</body>
Loading