Git Product home page Git Product logo

vk_callback_swapchain's Introduction

Vulkan Callback Swapchain

Vulkan Callback Swapchain is a Vulkan layer.

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google. See the CONTRIBUTING.md file for more information. See also the AUTHORS and CONTRIBUTORS files.

If an application inserts this layer, either by explicitly enabling this layer, or through environment variables, the default swapchain mechanism is replaced. All of the existing platform-specific swapchain and surface calls remain valid. However instead of creating a swapchain that renders to the given native surface, a virtual swapchain will be created.

The following calls are intercepted.

vkGetPhysicalDeviceSurfaceSupportKHR
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
vkGetPhysicalDeviceSurfaceFormatsKHR
vkGetPhysicalDeviceSurfacePresentModesKHR
vkCreateSwapchainKHR
vkDestroySwapchainKHR
vkGetSwapchainImagesKHR
vkAcquireNextImageKHR
vkQueuePresentKHR
vkDestroySurfaceKHR
vkCreateAndroidSurfaceKHR
vkCreateMirSurfaceKHR
vkCreateStreamDescriptorSurfaceGGP
vkCreateWaylandSurfaceKHR
vkCreateWin32SurfaceKHR
vkCreateXcbSurfaceKHR
vkCreateXlibSurfaceKHR

It follows that a Valid native surface is not required. Any window/module/connection parameters are ignored. This can be used for example to allow an application that typically renders to a window to be run without a window.

The following method is additionally exported by the layer.

VKAPI_ATTR void VKAPI_CALL
vkSetSwapchainCallback(VkSwapchainKHR swapchain,
                    void callback(void*, uint8_t*, size_t), void* user_data);

This function allows the user to set a callback function to be called when a swapchain image has been scheduled for presentation. The parameters to the provided callback are the originally supplied user_data, a pointer to the bytes that would have been output, and the number of bytes provided.

Building

This project is a standard CMake project. Example using ninja:

mkdir build
cd build
cmake -GNinja ..
cmake --build .

If the Vulkan headers are not located in a standard location, they can be specified by setting the CMake variable VULKAN_INCLUDE_LOCATION.

vk_callback_swapchain's People

Contributors

awoloszyn avatar ehsannas avatar hevrard avatar krmoule avatar kuhar avatar qining avatar renfengliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.