facebook/igl

BufferAPIHintBits questions

tksuoran opened this issue · 5 comments

  • Why is BufferAPIHintBits::Ring buffer specific to Metal? Functionality similar to Ring could be implemented on top of IBuffer API, so I wonder, are there some benefits of having it directly in IBuffer? But why only Metal?
  • Is BufferAPIHintBits::Bone used for anything? I did one super quick search in igl repo and I did not find any uses.

Looks like igl::vulkan::Buffer::upload() at least references Ring buffer. So I guess references to metal BufferAPIHintBits is outdated, and Ring can be used with other APIs as well?

Yes, IGL/Vulkan supports the BufferAPIHintBits::Ring flag. IGL/OpenGL does not support this flag and does not require it.

BufferAPIHintBits::Bone is for internal use. Thanks for pointing this out.

It would be great if the documentation comments would be updated:

  enum BufferAPIHintBits : uint8_t {
    Atomic = 1 << 0,
    UniformBlock = 1 << 1, // Enforces UBO for OpenGL
    Query = 1 << 2,
    Bone = 1 << 3,
    Ring = 1 << 4, // Metal: Ring buffers with memory for each swapchain image
    NoCopy = 1 << 5, // Metal: The buffer should re-use previously allocated memory.
  };

I would make a fix for this one. Many thanks for reporting.