Git Product home page Git Product logo

vulkan_test_applications's Introduction

Vulkan Test Applications

License C++ Version CMake Version Build

Vulkan Test Applications is a repository that contains several sets of Vulkan applications.

The goals of this project are to maintain a repository of accessible test applications for Vulkan tool developers to leverage, as well as expose interesting or non-obvious implications of the API.

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.

Test Types

Sample applications

These are a set of sample applications that either uses the API in a way that is interesting for tools or use some functionality of the API that has not been exposed to other samples.

GAPID command tests

These tests are designed to test the functionality of GAPID for Vulkan. They can also be used to expose a variety of function call permutations for any layers. As a group, they attempt to call all Vulkan functions with all permutations of valid inputs. See gapid_tests for more information.

Checking out / Building

To clone:

git clone --recursive path/to/this/repository

This will ensure that you have all of the dependencies checked out.

To build for Windows (NOTE: see Windows Dependencies).

cmake -G "Visual Studio 14 2015 Win64" /path/to/source
open VulkanTestApplications.sln

or if you want to use Ninja

From a Visual Studio command-prompt
cmake -GNinja /path/to/source -DCMAKE_BUILD_TYPE=Release
ninja

To build for Linux.

cmake -GNinja /path/to/source
ninja

To build for Android.

cmake -GNinja {root} -DBUILD_APKS=ON -DANDROID_SDK=path/to/android/sdk
ninja

This assumes the Android ndk is installed in the default location of path/to/android/sdk/ndk-bundle.

If it is installed elsewhere, use

cmake -GNinja {root} -DBUILD_APKS=ON -DANDROID_SDK=path/to/android/sdk -DANDROID_NDK=path/to/ndk -DCMAKE_GLSL_COMPILER=path/to/glslc

To build only for 32-bit ARM platform.

cmake -GNinja {root} -DBUILD_APKS=ON -DANDROID_SDK=path/to/android/sdk -DANDROID_ABIS=armeabi-v7a -DCMAKE_GLSL_COMPILER=path/to/glslc

glslc is required to compile GLSL shaders to SPIR-V. If it is not on your path, its location should be specified through -DCMAKE_GLSL_COMPILER option.

Compilation Options

The only specific other compilation options control default behavior for all applications. See entry for more information on these flags.

Support Functionality

Standard Assets

Dependencies

These should be checked out into third_party.

Windows Dependencies

To build on Windows the following tools and libraries are required:

vulkan_test_applications's People

Contributors

aellem avatar apazylbe avatar awoloszyn avatar bjoeris avatar devikakrishnadas avatar dneto0 avatar ehsannas avatar elviscapiaq avatar ethan-conffx avatar hevrard avatar hysw avatar khans218 avatar krmoule avatar michaelanttila avatar ndeakin avatar nipung314 avatar qining avatar renfengliu avatar sean-purcell avatar yalcinmelihyasin avatar zakerinasab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vulkan_test_applications's Issues

Transform Feedback

Transform Feedback sample crashes on a supported device.

Stack:

art_sigsegv_fault 0x0000007047a3d1c0
art::FaultManager::HandleFault(int, siginfo*, void*) 0x0000007047a3d6d4
art::SignalChain::Handler(int, siginfo*, void*) 0x0000005d77531e64
0x00000072df8f1678
vkCmdBeginTransformFeedbackEXT 0x0000007024d8bb38
vkCmdBeginTransformFeedbackEXT 0x0000007024d8bb38
std::__ndk1::result_of<void (* (vulkan::VkCommandBuffer, int, int, std::nullptr_t, std::nullptr_t))(VkCommandBuffer_T*, unsigned int, unsigned int, VkBuffer_T* const*, unsigned long const*)>::type LazyFunction<void ()(VkCommandBuffer_T, unsigned int, unsigned int, VkBuffer_T* const*, unsigned long const*), VkDevice_T*, vulkan::DeviceFunctions>::operator()<vulkan::VkCommandBuffer, int, int, std::nullptr_t, std::nullptr_t>(vulkan::VkCommandBuffer const&, int const&, int const&, std::nullptr_t const&, std::nullptr_t const&) 0x0000006fd2502dc8
TransformFeedbackSample::Render(vulkan::VkQueue*, unsigned long, TransformFeedbackFrameData*) 0x0000006fd24d7eb8
sample_application::Sample::ProcessFrame() 0x0000006fd24d640c
main_entry(entry::EntryData const*) 0x0000006fd24d4f60
0x0000006fd2563f78
0x0000006fd2563ddc
0x0000006fd2563d3c
0x0000006fd25636d4
__pthread_start(void*) 0x00000072da80a12c
__start_thread 0x00000072da7aa610

`async_compute` sample submit command buffer to a queue which didn't create the command buffer

The sample got stuck and when validation is enabled, printed out following errors:

VUID-vkQueueSubmit-pCommandBuffers-00074(ERROR / SPEC): msgNum: 832569492 - vkQueueSubmit: Primary command buffer 0x7f9a9c7c0a68 created in queue family 0 is being submitted on queue 0x7f9a9c6e9e70 from queue family 2. The spec valid usage text states 'Each element of the pCommandBuffers member of each element of pSubmits must have been allocated from a VkCommandPool that was created for the same queue family queue belongs to.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00074)
    Objects: 1
       [0] 0x7f9a9c7c0a68, type: 6, name: (null)
Validation(ERROR): msg_code: 832569492:  [ VUID-vkQueueSubmit-pCommandBuffers-00074 ] Object: 0x7f9a9c7c0a68 (Type = 6) | vkQueueSubmit: Primary command buffer 0x7f9a9c7c0a68 created in queue family 0 is being submitted on queue 0x7f9a9c6e9e70 from queue family 2. The spec valid usage text states 'Each element of the pCommandBuffers member of each element of pSubmits must have been allocated from a VkCommandPool that was created for the same queue family queue belongs to.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkQueueSubmit-pCommandBuffers-00074)
vkQueueWaitIdle for instance 0x7f9a9c595710 resolved
vkFreeCommandBuffers for instance 0x7f9a9c595710 resolved
VUID-vkFreeCommandBuffers-pCommandBuffers-00047(ERROR / SPEC): msgNum: 675283038 - Attempt to free command buffer (0x7f9a9c7c0a68) which is in use. The spec valid usage text states 'All elements of pCommandBuffers must not be in the pending state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
    Objects: 1
       [0] 0x7f9a9c7c0a68, type: 6, name: (null)
Validation(ERROR): msg_code: 675283038:  [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object: 0x7f9a9c7c0a68 (Type = 6) | Attempt to free command buffer (0x7f9a9c7c0a68) which is in use. The spec valid usage text states 'All elements of pCommandBuffers must not be in the pending state' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
vkFlushMappedMemoryRanges for instance 0x7f9a9c595710 resolved
vkBindImageMemory for instance 0x7f9a9c595710 resolved
vkCreateImageView for instance 0x7f9a9c595710 resolved
vkCmdCopyBufferToImage for instance 0x7f9a9c595710 resolved
vkCreateSampler for instance 0x7f9a9c595710 resolved
vkCreateRenderPass for instance 0x7f9a9c595710 resolved
vkCreateGraphicsPipelines for instance 0x7f9a9c595710 resolved
UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled(ERROR / SPEC): msgNum: -1 - Shader requires vertexPipelineStoresAndAtomics but is not enabled on the device
    Objects: 1
       [0] 0x0, type: 0, name: (null)
Validation(ERROR): msg_code: -1:  [ UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled ] Object: VK_NULL_HANDLE (Type = 0) | Shader requires vertexPipelineStoresAndAtomics but is not enabled on the device

The parameter list to VulkanApplication is completely unwieldy.

This parameter list has gotten out of control. This should be reworked.

I propose an Options object to pass in, so that the usage will be something more similar to:

vulkan::VulkanAppliaction(
     data->allocator(), data->logger(), data,
     vulkan::VulkanApplication::Options()
              .SetHostBufferSize(1024*128)
              .SetDevicePNext(&pipeline_executable_info_features)
              .SetVulkanLevel(1.1));

This would prevent users from having to care about EVERY possible parameter.

Some sample applications do not exit cleanly

Some sample applications (e.g. timeline_semaphore_simple) crash on exit. It looks like part of what is going on is that the main loop has no exit condition, but changing this to match other samples is insufficient (e.g. I tried to change the while (true) to while (!app.should_exit() && !data->WindowClosing()) in "application_sandbox/timeline_semaphore_simple/main.cpp", but this application still crashes, so more investigation is needed.

Just based on the presence of a main loop that never terminates, I think this may impact the following samples (I have not verified that all of these actually crash):

  • external_buffer
  • external_image
  • foreign_buffer
  • present_region
  • synchronization2_timeline_semaphore_simple
  • timeline_sempahore_cross_queue
  • timeline_semaphore_host_signal_after_submit
  • timeline_semaphore_simple

Not able to run the tests

Step 1: Build for android:

cmake -GNinja D:\vulkan_test_applications -DBUILD_APKS=ON -DANDROID_SDK=C:\Users\mtk33092\AppData\Local\Android\Sdk
ninja

APK folders created

Step 2: Fire command to test

D:\vulkan_test_applications\gapid_tests\null_destruction_tests\vkDestroyNullHandles>D:\vulkan_test_applications\tools\gapit_test_framework.py
Warning: Could not parse D:\vulkan_test_applications\gapid_tests\null_destruction_tests\vkDestroyNullHandles\vkDestroyNullHandles_tests.py for tests.
Running tests in C:\Users\abhijeet\AppData\Local\Temp\GAPID-pwxo0mdc
Total Tests Run: 0
Total Tests Passed: 0

Not able to run tests

Split out all of our delete nullptr tests into a single test

Right now we have many tests that VkDestroy(VK_NULL_HANDLE). They are spread out based on the types.

However, there are some drivers that fail on these tests. It stands to reason, that failing on one of the Destroy(VK_NULL_HANDLE) means that most of then will fail.

Instead of having to hunt down all of the places that have these issues, we should instead move all of the tests to a single place, and then we only have one place to update when these issues occur.

Support for VkPhysicalDeviceProtectedMemoryFeatures should be properly queried before being used

The device creation in CreateDeviceForSwapchain seems to assume that the extension offering VkPhysicalDeviceProtectedMemoryFeatures is always supported:

https://github.com/google/vulkan_test_applications/blob/master/vulkan_helpers/helper_functions.cpp#L643-L651

I think the support for this extension should be queried with vkGetPhysicalDeviceFeatures2, and it should not be used unless it is supported. Swiftshader reports that it does not support this extension, and fails when a CreateDeviceInfo has a pNext with a VkPhysicalDeviceProtectedMemoryFeatures struct.

`passthrough` sample destroys bound vertex buffers prematurely

Based on a Gapid trace of the passthrough sample, it looks like the vertex buffers are destroyed immediately after recording the command buffer, before submitting to the queue. They should not be destroyed until after all uses of the buffer have completed. Because it looks like these command buffers are submitted repeatedly, these buffers should not be destroyed at all.

This causes the passthrough sample to replay incorrectly with the new dependency graph-based dead code elimination going into Gapid.

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.