Giter VIP home page Giter VIP logo

Comments (4)

ravi688 avatar ravi688 commented on August 16, 2024

I think it is not valid to reference a destroyed image by a descriptor.
Also I've tried descriptor sets in which none of the descriptors in it were written/updated, that was working just fine no validation errors.

from amdvlk.

xatian avatar xatian commented on August 16, 2024

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDescriptorBindingFlagBits.html
It says in part:

VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT indicates that descriptors in this binding that are not dynamically used need not contain valid descriptors at the time the descriptors are consumed. A descriptor is dynamically used if any shader invocation executes an instruction that performs any memory access using the descriptor. If a descriptor is not dynamically used, any resource referenced by the descriptor is not considered to be referenced during command execution.

To me that sounds as if destroyed ImageViews referenced by descriptors is fine, as long as they are not dynamically used by the shader.
Empty descriptors work without issue. My issue is about destroyed ones.

from amdvlk.

xatian avatar xatian commented on August 16, 2024

With help I found some more language in the spec that sounds like this should work:
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAllocateDescriptorSets.html

When a descriptor set is allocated, the initial state is largely uninitialized and all descriptors are undefined, with the exception that samplers with a non-null pImmutableSamplers are initialized on allocation. Descriptors also become undefined if the underlying resource or view object is destroyed. Descriptor sets containing undefined descriptors can still be bound and used, subject to the following conditions:

For descriptor set bindings created with the VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT bit set, all descriptors in that binding that are dynamically used must have been populated before the descriptor set is consumed.

from amdvlk.

xatian avatar xatian commented on August 16, 2024

I made a test application with these basic steps:

  1. create all needed VulkanHandles
  2. activate descriptorBindingPartiallyBound
  3. create a basic pipeline with a texture2DArray[2] as the only binding
  4. set VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT when creating the vkCreateDescriptorSetLayout
  5. create 2 VkImages + VkImageViews and wrote both to a vkDescriptorSet
  6. destroyed the second one (VkImage, VkImageView and freed VkMemory)
  7. recording into command buffer -> vkBeginCommandBuffer, vkCmdBeginRenderPass, vkCmdBindPipeline, vkCmdBindDescriptorSets, vkCmdEndRenderPass, vkEndCommandBuffer, vkQueueSubmit.

This would draw a frame containing nothing yet it does what I stated in the initial post --> it gets rejected.
If I skip 6.) all works fine (--> the crucial part in 6. is the vkFreeMemory)
Including with the relevant parts from the spec I strongly believe this should work and it is in fact a bug in the driver.

from amdvlk.

Related Issues (20)

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.