-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add RenderTarget|null typing + remove dead code #5704
Conversation
We have in some functions strict "no-undefined-allowed" assertions: function drawQuadWithShader(device, target, shader, rect, scissorRect) {
// a valid target or a null target (framebuffer) are supported
Debug.assert(target !== undefined); But then we still have places where Should we try to keep it |
Probably a question for @mvaligursky |
|
Interesting, so I tried to find the these methods called with I found these two: engine/src/platform/graphics/render-pass.js Lines 188 to 221 in bbb7961
engine/src/framework/components/camera/component.js Lines 905 to 917 in bbb7961
If these are called correctly, I can just mark them as I feel uncertain here though, in first code snippet, line 197: this.renderTarget = renderTarget || null; So it could be called with |
So the so only renderTarget needs to have all 3 types allowed, but init function only needs two. |
Hm, we still call (this happens in |
perfect! Go for it. |
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.
Nice one, thanks!
This fixes a few of type issues, since
RenderTarget
isnull
in many situations, and then it goes on and on to e.g.drawQuadWithShader
which doesn't need atarget
, e.g. example with bloom:I confirm I have read the contributing guidelines and signed the Contributor License Agreement.