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

[Fix] Fix the shader linking after the lost context has been restored. #6146

Merged
merged 1 commit into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/platform/graphics/webgl/webgl-graphics-device.js
Expand Up @@ -1360,7 +1360,7 @@ class WebglGraphicsDevice extends GraphicsDevice {
this.initializeRenderState();
this.initializeContextCaches();

// Recompile all shaders (they'll be linked when they're next actually used)
// Recompile all shaders
for (const shader of this.shaders) {
shader.restoreContext();
}
Expand Down
1 change: 1 addition & 0 deletions src/platform/graphics/webgl/webgl-shader.js
Expand Up @@ -96,6 +96,7 @@ class WebglShader {
*/
restoreContext(device, shader) {
this.compile(device, shader);
this.link(device, shader);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/scene/skybox/sky-mesh.js
Expand Up @@ -31,6 +31,7 @@ class SkyMesh {
constructor(device, scene, node, texture, type) {

const material = new Material();
material.name = 'SkyMaterial';

material.getShaderVariant = function (dev, sc, defs, unused, pass, sortedLights, viewUniformFormat, viewBindGroupFormat) {

Expand Down