-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Textures: Fix clearing of textures with integer type #14112
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/14112/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/14112/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/14112/merge#BCU1XR#0 |
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.
Sounds expensive and creating GC ? should we always call clearColor and clearBuffer ? But only on color change ?
I have removed the GC. I'm not sure to understand this part:
? |
To limit the branching within the function, as well as the gl calls, I was wondering whether we should check the current state (value wise) and always call clearColor… in this case so we end up with only one if preventing extra gl calls instead of the one branching on type. I am not sure it is necessary tbh :-) |
I don't think there are currently extra gl calls(?) We could call Note that We could make the test for an integer texture lighter if we add a getter property in |
Makes sense ! Thanks |
See https://forum.babylonjs.com/t/support-custom-outputs-for-shadermaterial/42835/3
It also fixes a couple of small bugs with WebGPU.
PG for WebGL: https://playground.babylonjs.com/#XSNYAU#47
PG for WebGPU: https://playground.babylonjs.com/#XSNYAU#50
WebGPU has a stricter limitation for the total number of components for the target render textures (it's limited to 32 bytes), so I had to make a different PG.