Skip to content

update xgpu::Instance type erasure#1

Open
raustin9 wants to merge 3 commits intov0.1from
v0.1-backend-obj-api-refactor
Open

update xgpu::Instance type erasure#1
raustin9 wants to merge 3 commits intov0.1from
v0.1-backend-obj-api-refactor

Conversation

@raustin9
Copy link
Contributor

Update the type erasure implementation for the graphics API wrapper objects.

We want to make sure that wrapper objects (especially ones that might be in the rendering loop hot path) have as little overhead as possible. We also want to make working on these objects manageable.

The current idea is using a manual vtable for an interface combined with an object held in a buffer inside the wrapper rather than on the heap.

class Wrapper
{
private:
  struct VTable
  {
    std::function<auto(void*)->void> destroy;
  };
  char8_t buffer[BacknedObjectBufferSize];
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant