Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Overloading methods taking arrays of elements to also take single elements #39

Closed
TillAlex opened this issue Aug 23, 2016 · 4 comments
Closed

Comments

@TillAlex
Copy link
Contributor

There are lots of functions taking arrays as arguments, which I often use with single elements.

For example vkCmdBindDescriptorSets takes an array of descriptor sets, but in most cases I only pass a single one. In all this cases I have to create an array for a single element. I guess this leads to lots of unnecessary array constructions and garbage collector runs.

Perhaps its possible to overload this functions to also take single elements.

@radekdoulik
Copy link
Contributor

@TillAlex
Copy link
Contributor Author

First, thanks for implementing this so quickly!

However, there are some problems with the new overloads in the moment:

CmdPipelineBarrier, UpdateDescriptorSets and possibly others take multiple array arguments. The count for these array arguments currently always is one even if null is passed.

The non array overload of CmdBindDescriptorSet can not be called without passing an pDynamicOffset. I think there are two solutions:

  1. Create an additional overload without pDynamicOffset
  2. Make pDynamicOffset nullable

@radekdoulik
Copy link
Contributor

Hopefully this fixes it.

I have tested it with CmdBindDescriptorSet. Please let me know whether it works right with your code.

@TillAlex
Copy link
Contributor Author

TillAlex commented Aug 26, 2016

Thanks! All single element methods I am using work correctly now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants