Skip to content

Various rendering improvements#134

Merged
RecursivePineapple merged 8 commits intomasterfrom
rendering-improvements
Dec 17, 2025
Merged

Various rendering improvements#134
RecursivePineapple merged 8 commits intomasterfrom
rendering-improvements

Conversation

@RecursivePineapple
Copy link
Owner

  • Optimize BoxRenderer
  • VBO improvements + use SharedDrawable
  • Pull VertexBuffer into its own class and improve it

@mitchej123
Copy link

Would highly encourage some unit tests to ensure these function as expected. Also some of the improvements might make sense to make available in gtnhlib (now or later)

Comment on lines 24 to 37
@Getter
protected volatile int id;
@Getter
protected volatile int vertexCount;

@Getter
protected volatile long length;
@Getter
protected volatile int bufferFlags;

@Getter
protected volatile ByteBuffer mappedBuffer;
@Getter
protected volatile boolean mapped;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need to make sure multiple fields are synchronized across threads, wrap accesses to them in a proper lock as volatile does not give the appropriate thread safety guarantees

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added proper synchronization. Hopefully it's in the correct locations, I'm not sure what should be synchronized.

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.

3 participants