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 misleading warnings for OES_standard_derivatives #11308

Merged
merged 1 commit into from
May 24, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/engine/Source/Renderer/demodernizeShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ function demodernizeShader(input, isFragmentShader) {
// Replace gl_FragDepth with gl_FragDepthEXT.
output = output.replaceAll(/gl_FragDepth/g, `gl_FragDepthEXT`);
}

// Enable the OES_standard_derivatives extension
output = `#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n${output}`;
} else {
// Replace the in with attribute.
output = output.replaceAll(/(in)\s+(vec\d|mat\d|float)/g, `attribute $2`);
Expand Down
3 changes: 0 additions & 3 deletions packages/engine/Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,9 +1050,6 @@ function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) {
fs.defines = defined(fs.defines) ? fs.defines.slice(0) : [];
fs.defines.push("POLYGON_OFFSET");

fs.sources.unshift(
"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"
);
shader = context.shaderCache.createDerivedShaderProgram(
shaderProgram,
"zBackfaceLogDepth",
Expand Down
4 changes: 0 additions & 4 deletions packages/engine/Source/Shaders/BillboardCollectionFS.glsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif

uniform sampler2D u_atlas;

#ifdef VECTOR_TILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ in float v_depthFromNearPlusOne;

#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
#endif

#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif

uniform vec4 color;
uniform float spacing;
uniform float width;
Expand Down
4 changes: 0 additions & 4 deletions packages/engine/Source/Shaders/Materials/GridMaterial.glsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif

uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif

uniform vec4 color;

float getPointOnLine(vec2 p0, vec2 p1, float x)
Expand Down
6 changes: 0 additions & 6 deletions packages/engine/Source/Shaders/Model/ModelFS.glsl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT)
#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
#endif

czm_modelMaterial defaultModelMaterial()
{
czm_modelMaterial material;
Expand Down