Skip to content
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

Update checking support for rendering to float textures #1257

Merged
merged 4 commits into from Sep 24, 2019

Conversation

1chandu
Copy link
Contributor

@1chandu 1chandu commented Sep 24, 2019

For #1256

Background

More details in above issue.

Change List

  • Update checking support for rendering to float textures

@coveralls
Copy link

coveralls commented Sep 24, 2019

Coverage Status

Coverage increased (+0.06%) to 67.269% when pulling f30ab3e on FloatTargetCheck into e61fae2 on master.

if (status !== gl.FRAMEBUFFER_COMPLETE) {
throw new Error(_getFrameBufferStatus(status));
}
return this;
}

getStatus() {
const {gl} = this;
const prevHandle = gl.bindFramebuffer(GL.FRAMEBUFFER, this.handle);
Copy link
Contributor

Choose a reason for hiding this comment

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

bindFramebuffer doesn't return anything. This logic should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed, but still re-binding to null to match the old behavior, we can clean it up in a different PR to avoid any regressions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

bindFramebuffer doesn't return anything. This logic should be removed.

It is hacky, but the previous value is indeed returned, through the polyfill. It should have been mentioned in comment.

IIRC, it was done like this to avoid fouling up global state.

Copy link
Contributor

Choose a reason for hiding this comment

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

I find that very confusing. I don't think the polyfills should be introducing new behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

restored the old behavior for now, should be addressed separately #1259

modules/webgl/src/features/webgl-features-table.js Outdated Show resolved Hide resolved
modules/webgl/src/features/webgl-features-table.js Outdated Show resolved Hide resolved
@@ -39,6 +42,26 @@ export const FEATURES = {
GLSL_TEXTURE_LOD: 'GLSL_TEXTURE_LOD'
};

// function to test if Float 32 bit format texture can be bound as color attachment
function checkFloat32ColorAttachment(gl) {
Copy link
Contributor

@tsherif tsherif Sep 24, 2019

Choose a reason for hiding this comment

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

The result of this check will never change, so store it somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is geFeatures method that will add results at a global scope gl.luma.caps. One solution is have users call getFeatures. But ideally, hasFeature and hasFeatures should also add the result back to this global scope and check only if not already cached.

This PR is fixing a release blocker for 7.3, and hasFeature only called during layer initialization, this can be addressed in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can just store it has a global in this file for now. This is an expensive check and shouldn't be repeated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, more thorough solution : #1258

@1chandu 1chandu merged commit f1f0047 into master Sep 24, 2019
@1chandu 1chandu deleted the FloatTargetCheck branch September 24, 2019 23:18
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.

None yet

4 participants