-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
WIP: fix: correct SSBO/UBO binding point resolution in material system #2647
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
base: master
Are you sure you want to change the base?
Changes from all commits
b1cbcc7
0a76df2
775d769
d706616
efbb280
3f5c986
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,6 +158,7 @@ public void initializeEmpty(int length) { | |
| BufferUtils.destroyDirectBuffer(data); | ||
| } | ||
| this.data = BufferUtils.createByteBuffer(length); | ||
| setUpdateNeeded(); | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -167,11 +168,12 @@ public void initializeEmpty(int length) { | |
| * @param data ByteBuffer containing the data to pass | ||
| */ | ||
| public void setData(ByteBuffer data) { | ||
| if (data != null) { | ||
| BufferUtils.destroyDirectBuffer(data); | ||
| if (this.data != null) { | ||
| BufferUtils.destroyDirectBuffer(this.data); | ||
| } | ||
| this.data = BufferUtils.createByteBuffer(data.limit() - data.position()); | ||
| this.data.put(data); | ||
| setUpdateNeeded(); | ||
| } | ||
|
Comment on lines
170
to
177
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method will throw a Also, using public void setData(ByteBuffer data) {
if (this.data != null) {
BufferUtils.destroyDirectBuffer(this.data);
}
if (data != null) {
this.data = BufferUtils.createByteBuffer(data.remaining());
this.data.put(data);
} else {
this.data = null;
}
setUpdateNeeded();
} |
||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve performance and reduce garbage collection, you can avoid re-allocating
IntBuffers on every call to this method. Thepropsbuffer is constant and can be astatic finalfield inGLRenderer. Theparamsbuffer can be a reusable member field.For example, you could add these fields to
GLRenderer:Then this method would become: