JellyBoonz review#3
Draft
pbantolas wants to merge 4 commits into
Draft
Conversation
pbantolas
commented
Jun 10, 2026
pbantolas
left a comment
Owner
Author
There was a problem hiding this comment.
Great job and the separation makes sense mostly
The main notes I have:
- Renderer doesn't have a lot of app policy for the input, but consider how we could keep the renderer agnostic of what input is: the renderer just needs to know the view transform (a matrix), doesn't need to know we can pan/zoom. E.g. can the visual runtime keep track of that logic, and just set the relevant state to the renderer?
- Ideally rectangle API needs some parameters to allow for rectangles to be customised
- Be careful with error accumulating in the input and view matrices: constantly updating the existing matrix with the new input can create instability
|
|
||
| void (*pan)(VisualRuntimeState *, float dx, float dy); | ||
| void (*zoom)(VisualRuntimeState *, float delta); | ||
| void (*addRectangle)(); |
Owner
Author
There was a problem hiding this comment.
Needs some parameters to customise the rectangle (position, size, color)
| } | ||
|
|
||
| void RendererBackend::zoom(float delta) { | ||
| float factor = 1.0f + delta * 0.02f; |
Owner
Author
There was a problem hiding this comment.
This introduces app-side policy (how quickly the world is scaled) in the renderer. Also, this function continuously updates the camera_transform and will start losing precision (aka user cannot set a specific zoom level if they wanted).
Comment on lines
+325
to
+330
| if (vertex_buffer_) { | ||
| vertex_buffer_->release(); | ||
| vertex_buffer_ = nullptr; | ||
| } | ||
| vertex_buffer_ = device_->newBuffer(geometry_.data(), geometry_.size() * sizeof(Vertex), MTL::ResourceStorageModeShared); | ||
| vertex_count_ = geometry_.size(); |
Owner
Author
There was a problem hiding this comment.
This reallocates the entire GPU buffer every time a new rectangle is added. Can you think of a way to avoid doing that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
code review