GPUOpen-Archive / Anvil

Anvil is a cross-platform framework for Vulkan
MIT License
594 stars 62 forks source link

What does the "in_releaseable_sets" parameter in DescriptorSetGroup::create do? #75

Closed Silverlan closed 5 years ago

Silverlan commented 6 years ago
/** Creates a new DescriptorSetGroup instance.
    *
    *  By using this function, you explicitly state you'd like this DescriptorSetGroup instance
    *  to re-use layout of another DSG. This is useful if you'd like to re-use the same layout with
    *  a different combination of descriptor sets.
    *
    *  @param in_parent_dsg_ptr   Pointer to a DSG without a parent. Must not be nullptr.
    *  @param in_releaseable_sets See the documentation above for more details.
    **/
static DescriptorSetGroupUniquePtr create(const DescriptorSetGroup* in_parent_dsg_ptr,
                                            bool                      in_releaseable_sets);

The description for the second parameter of this function states "See the documentation above for more details.", however, the description in the function above makes no mention of the parameter:

/** Creates a new DescriptorSetGroup instance.
    *
    *  Apart from the usual stuff, this function also preallocates memory for a number of
    *  helper arrays
    *
    *  By using this function, you're explicitly stating you'd like the instance to maintain
    *  its own copy of DescriptorSetLayout and DescriptorSet objects. Such object can then be used
    *  as a parent to other DescriptorSetGroup class instances, initialized with another constructor that
    *  takes a ptr to DescriptorSetGroup instance, causing objects created in such fashion to treat the
    *  specified DescriptorSetGroup instance as a parent.
    *
    *  @param in_device_ptr   Device to use.
    *  @param in_ds_info_ptrs TODO.
    */
static Anvil::DescriptorSetGroupUniquePtr create(const Anvil::BaseDevice*                        in_device_ptr,
                                                    std::vector<Anvil::DescriptorSetInfoUniquePtr>& in_ds_info_ptrs,
                                                    bool                                            in_releaseable_sets,
                                                    MTSafety                                        in_mt_safety                = MT_SAFETY_INHERIT_FROM_PARENT_DEVICE,
                                                    const std::vector<OverheadAllocation>&          in_opt_overhead_allocations = std::vector<OverheadAllocation>() );
DominikWitczakAMD commented 6 years ago

My first thought was that making Anvil leverage the releasability of descriptor sets remains a TODO but I really need to double-check this on Monday.

DominikWitczakAMD commented 5 years ago

Addressed internally. DSG create info now takes an optional list of descriptor pool create flags that should be used when creating a descriptor pool to back the baked descriptor sets with.

DominikWitczakAMD commented 5 years ago

Fixed in the latest version.