#what is the difference between these two?

1 messages · Page 1 of 1 (latest)

midnight elm
#

a [*]T is a pointer-to-a-sequence of (mutable) Ts

#

contrast with *T: a pointer-to-a-single (mutable) T

stone lava
#

The incompatiblity here is that in your slice of pointers, the vk.DescriptorSet objects don't need to be contiguous, wheras in the many-item pointer, they are. So you either need

  1. A guarantee that these objects are contiguous, in which you can get the pointer to the first object in the array and convert it to a many-item pointer
  2. A new allocation to store all the vk.DescriptorSet objects
#

[*]T is a pointer to the first element of an array of T

#

If you need to make them contiguous yourself, then you need to allocate it

#

Or perhaps change some design choice so you don't have this requirement

#

It's a pointer to multiple of that object in a row. If you know C, it's similar to how char *a = "meow" is actually a pointer to 5 char contiguous objects, 'm', 'e', 'o', 'w', 0

#

A slice is a many item pointer and a length. The issue here is that your slice contains *vk.Descriptor, so you basically have [*]*vk.Descriptor

#

Now that I think about it with 5 am brain-- Is this a 2d array from C? If so, maybe your original typeshould be [][*]vk.DescriptorSet