Comments (2)
Could you post either example code or an overview of relevant steps that lead to bad layout handling (and where the layout must be set manually to fix it)?
from auto-vk.
Example
The problem already occurs when you try to perform an image barrier on a framebuffer image that is used in the current renderpass, as the layout of the attachment images is apparently not set when creating the attachment.
Perform the following patch to the framebuffer example and you'll get multiple validation errors, most are unrelated an can be ignored for now. The important validation error is the one talking about the image being in the wrong layout (cause the wrong layout got provided to the barrier call).
examples/framebuffer/source/framebuffer.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/examples/framebuffer/source/framebuffer.cpp b/examples/framebuffer/source/framebuffer.cpp
index 4653cc22..0dc32c4b 100644
--- a/examples/framebuffer/source/framebuffer.cpp
+++ b/examples/framebuffer/source/framebuffer.cpp
@@ -184,6 +184,10 @@ public: // v== xk::invokee overrides which will be invoked by the framework ==v
cmdBfr->begin_render_pass_for_framebuffer(mPipeline->get_renderpass(), mOneFramebuffer);
cmdBfr->handle().bindPipeline(vk::PipelineBindPoint::eGraphics, mPipeline->handle());
cmdBfr->draw_indexed(avk::const_referenced(mIndexBuffer), avk::const_referenced(mVertexBuffers[inFlightIndex]));
+
+ cmdBfr->establish_image_memory_barrier_rw(mOneFramebuffer->image_at(1).get(), avk::pipeline_stage::color_attachment_output, avk::pipeline_stage::fragment_shader,
+ avk::memory_access::color_attachment_write_access, avk::memory_access::color_attachment_read_access);
+
cmdBfr->end_render_pass();
cmdBfr->end_recording();
The validation error is the following:
ERR: Debug utils callback with Id[947939354|VUID-VkImageMemoryBarrier-newLayout-01198] and Message[Validation Error: [ VUID-VkImageMemoryBarrier-newLayout-01198 ] Object 0: handle = 0x11b9b9af378, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x3880681a | vkCmdPipelineBarrier(): Image Layout cannot be transitioned to UNDEFINED or PREINITIALIZED. The Vulkan spec states: newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED (https://vulkan.lunarg.com/doc/view/1.2.141.0/windows/1.2-extensions/vkspec.html#VUID-VkImageMemoryBarrier-newLayout-01198)]
Proposed tasks/changes:
- Review Vulkan Spec to find out where the layouts are transitionen either implicitly or explicity. Some examples:
- For example when starting a renderpass, Images should be in the specified layout (some attachment_optimal, or depth stencil layout), but it is currently undefined
- Going to the next subpass transitions images according to the subpass dependencies similar to an image barrier
- Perfoming image memory barriers with layout transitions
- Track these transitions per thread (or per command buffer), as multiple threads could record a command buffer in parallel
from auto-vk.
Related Issues (20)
- C++20: Replace all SFINAE with Concepts
- Make descriptor_cache usable from parallel threads
- Add support for host-builds and "array of pointers" when building/updating real-time ray tracing acceleration structures
- Uniformly return by value
- Add .gitignore HOT 2
- Filling staging buffers should not be waited-idle HOT 1
- Base conditional compilation on Vulkan SDK version for things that were added to the standard with SDK 1.2
- create_renderpass does not natively support subpass self-dependencies
- eShaderDeviceAddressKHR or eShaderDeviceAddress
- Add meta data for new ray tracing buffer usages HOT 1
- Deprecate VK_HEADER_VERSION 135 Ray Tracing functionality and clean up code!
- For reading back data to the host, a barrier is required
- 1080 vk
- Refactor avk::image_usage
- Add support for memory region which is BOTH: DeviceLocal AND HostCoherent
- Use Vulkan Memory Allocator (VMA) from the Vulkan SDK HOT 1
- Some examples to get auto vk running for people wanting to use this instead of auto-vk toolkit HOT 1
- can't compile with -Wall flag
- MoltenVK support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-vk.