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

const vectors are not removed from shaders that don't use them #14

Closed
jlfwong opened this issue May 2, 2019 · 0 comments
Closed

const vectors are not removed from shaders that don't use them #14

jlfwong opened this issue May 2, 2019 · 0 comments

Comments

@jlfwong
Copy link

jlfwong commented May 2, 2019

The following shaders:

const vec4 someConst = vec4(3.0);

export void vertex() {
  gl_Position = vec4(0.0);
}

export void colorFragment() {
  gl_FragColor = vec4(0.0);
}

Include a constant declaration for someConst in every output shader, even though it's unused:

{
  "shaders": [
    {
      "name": "vertex",
      "contents": "const vec4 a=vec4(3.);void main(){gl_Position=vec4(0.);}"
    },
    {
      "name": "colorFragment",
      "contents": "const vec4 a=vec4(3.);void main(){gl_FragColor=vec4(0.);}"
    }
  ],
  "renaming": {}
}

The expected output in this case should be:

{
  "shaders": [
    {
      "name": "vertex",
      "contents": "void main(){gl_Position=vec4(0.);}"
    },
    {
      "name": "colorFragment",
      "contents": "void main(){gl_FragColor=vec4(0.);}"
    }
  ],
  "renaming": {}
}
@evanw evanw closed this as completed in 6afae07 Dec 19, 2020
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

No branches or pull requests

1 participant