IntroductionToVulkan | Source code examples for `` API without Secrets | Learning library
kandi X-RAY | IntroductionToVulkan Summary
kandi X-RAY | IntroductionToVulkan Summary
Source code examples for "API without Secrets: Introduction to Vulkan" tutorial
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of IntroductionToVulkan
IntroductionToVulkan Key Features
IntroductionToVulkan Examples and Code Snippets
Community Discussions
Trending Discussions on IntroductionToVulkan
QUESTION
I ported most of Introduction to Vulkan - Tutorial 02 from C++ into a single Rust function to keep it simple. The function calls Vulkan through Rust FFI provided by ash.
I'm having an issue getting the pipeline barriers and semaphores to function correctly. As far as I can tell, this code seems to create the same validation debug log info as the C++ code.
When I run the C++ code with validation layers enabled, vkQueueSubmit
is successful. When I run the Rust function below (with validation layers enabled), queue_submit
fails and I receive
Cannot submit cmd buffer using image (0x6) [sub-resource: aspectMask 0x1 array layer 0, mip level 0], with layout VK_IMAGE_LAYOUT_UNDEFINED when first use is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL.
...which implies to me that there the image layout transition isn't taking place, so there may be something wrong with how I configure/submit my pipeline barriers.
...ANSWER
Answered 2017-Oct-10 at 17:18VK_ERROR_VALIDATION_FAILED_EXT
is often returned in the case when you return VK_TRUE
from your debug callback. The specification advises against doing that:
The callback returns a
VkBool32
that indicates to the calling layer the application’s desire to abort the call. A value ofVK_TRUE
indicates that the application wants to abort this call. If the application returnsVK_FALSE
, the command must not be aborted. Applications should always returnVK_FALSE
so that they see the same behavior with and without validation layers enabled.
The value VK_TRUE
is intended only for the purposes of layer development. Its current use is for unit testing of the layers, which requires the command to be aborted before it reaches the GPU driver (to prevent crashes the test is not interested in). It is common mistake to use it in applications. As the quote says applications are supposed to always use VK_FALSE
.
In your case the layer is behaving bit oddly, but what probably happened is:
- Both your app and the tutorial produce a benign warning on
vkCmdPipelineBarrier
. - Because you return
VK_TRUE
the barrier is aborted and does not count. vkCmdPipelineBarrier
returnsvoid
(i.e. cannot returnVK_ERROR_VALIDATION_FAILED_EXT
) so you never learned it was actually aborted.- Because the layout transition was aborted you have image in wrong layout on
vkQueueSubmit
and so you get an appropriate error.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install IntroductionToVulkan
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page