-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Primitive submission to renderer #13
Comments
The renderer must be able to return a value back to whatever submits the data, in some way, as it needs to return a unique ID to allow primitive deletion. If we're going to be using channels for this, there really is no guarantee on when the data will be read, so the best way I can think of doing this would be to generate a unique ID in the primitive submission function and write this to the channel along with the primitives, in addition to returning it to the callee. If there's a better way to do this, I'm open to suggestions, but I'll begin working on this pretty soon. |
To recap, the current plan to resolve this issue is as follows.
|
Additionally, the unique ID referring to a primitive batch should be a |
Regarding my previous comment, I've discovered that this safety restriction can actually more easily be achieved simply through a new data type such as the following: data UniqueKey = UniqueKey This would be used as the lookup key and still doesn't need to be exported from the module. |
This patch first adds a new module `Polar.Unique` that can generate unique IDs for any type with an instance of `Enum`. This is based around engine storage and the initial ID is set as `toEnum 0` of the type in question. `succ` is used to increment the ID. Additionally, this patch implements a basic message queue for the renderer, built on top of engine storage with a `TChan` channel as the actual queue. This issue partially addresses #13.
This patch first adds a new module `Polar.Unique` that can generate unique IDs for any type with an instance of `Enum`. This is based around engine storage and the initial ID is set as `toEnum 0` of the type in question. `succ` is used to increment the ID. Additionally, this patch implements a basic message queue for the renderer, built on top of engine storage with a `TChan` channel as the actual queue. This issue partially addresses #13.
This patch removes the hardcoded triangle primitive from the OpenGL renderer and instead submits it via the updated message queue from example-basic. Addresses #13 partially.
This patch removes the hardcoded triangle primitive from the OpenGL renderer and instead submits it via the updated message queue from example-basic. Addresses #13 partially.
We need to devise a method of submitting primitives (triangles, etc) to the low-level renderer such as
OpenGL_3_2
in a renderer-agnostic, efficient manner.The immediate conclusion for this would be to use the existing storage implementation; however, this may not be suited to such a task where an infinite stream of data is incoming and must be handled in sequence.
One possibility would be to store a concurrent channel for each data type, expanding the current storage data structure to include a channel in its now-named
VectorStorage
. However, this may also present issues when multiple channels of the same type are required in various places across the engine.A solution to this may be to store the channels themselves in storage, allowing them to benefit from key lookup in constant time, as well as the other benefits of the storage structure like the ability to lookup the entire set of channels as a list.
The text was updated successfully, but these errors were encountered: