Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Don't validate/delete shaders #2147

Merged
merged 2 commits into from
Sep 14, 2015
Merged

Conversation

kkaefer
Copy link
Contributor

@kkaefer kkaefer commented Aug 21, 2015

Some GPU drivers, such as the Tegra 3 (used in the Nexus 7) seem to have issues with our call to glValidateProgram. They are technically right about not validating since the time when we validate our shaders, we don't have the correct OpenGL state (e.g. textures) set yet.

Similarly, we're calling glDeleteShader in the shader object constructor, after the shader has been attached to the program. While this is technically correct according to the spec, this particular driver seems to crash when doing deleting the shader object. Instead, we can just hold off on deleting the shader object until the shader destructor.

@kkaefer kkaefer self-assigned this Aug 21, 2015
@mb12
Copy link

mb12 commented Aug 21, 2015

Is it ensured that Shader Destructor is called on map Thread?

@kkaefer
Copy link
Contributor Author

kkaefer commented Aug 21, 2015

@mb12 yeah; the shader objects are owned by the Painter object, which is owned by the MapContext object, which gets destructed on the Map thread.

@kkaefer kkaefer force-pushed the 2147-dont-validate-delete-shaders branch from dde8507 to d3c7173 Compare August 21, 2015 19:21
@mb12 mb12 mentioned this pull request Aug 24, 2015
@ljbade
Copy link
Contributor

ljbade commented Aug 27, 2015

Interesting, is not not possible to tweak when we do validate program?

@kkaefer kkaefer force-pushed the 2147-dont-validate-delete-shaders branch from d3c7173 to 65087d5 Compare September 14, 2015 13:14
it's not in a state where validation always succeeds with all drivers, e.g. because textures might not be attached yet
some GPU drivers have issues with deleting shader objects that are attached to programs. while this is allowed by the spec, it seems that some drivers are crashing nonetheless.
@kkaefer kkaefer force-pushed the 2147-dont-validate-delete-shaders branch from 65087d5 to 5ef7011 Compare September 14, 2015 13:16
@kkaefer kkaefer merged commit 5ef7011 into master Sep 14, 2015
@kkaefer kkaefer deleted the 2147-dont-validate-delete-shaders branch September 14, 2015 13:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants