-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
The following fields are part of the contentHashCode() computation:
hash = 79 * hash + this.frontStencilMask;
hash = 79 * hash + this.frontStencilReference;
hash = 79 * hash + this.backStencilMask;
hash = 79 * hash + this.backStencilReference;However, their corresponding setters do not set cachedHashCode = -1:
public void setFrontStencilMask(int frontStencilMask) {
this.frontStencilMask = frontStencilMask;
}
public void setBackStencilMask(int backStencilMask) {
this.backStencilMask = backStencilMask;
}
public void setFrontStencilReference(int frontStencilReference) {
this.frontStencilReference = frontStencilReference;
}
public void setBackStencilReference(int backStencilReference) {
this.backStencilReference = backStencilReference;
}Since these fields directly contribute to the hash, modifying them without invalidating the cached hash results in an inconsistent RenderState.
Expected Fix
Each setter should follow the same pattern used in correctly implemented methods such as setColorWrite:
public void setColorWrite(boolean colorWrite) {
applyColorWrite = true;
this.colorWrite = colorWrite;
cachedHashCode = -1;
}This ensures that contentHashCode() always reflects the actual state of the object.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status