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

Refactor shader source classes, in order to work around a Firefox bug. #2214

Merged
merged 8 commits into from
Oct 23, 2014

Commits on Oct 22, 2014

  1. Refactor shader source classes, in order to work around a Firefox bug.

    The Firefox bug prevents shaders from compiling with the CORDIC algorithm, so we detect Firefox and fall back to the original algorithm.  Issue #2197.
    
    The overall goal of the refactoring is to allow `#defines` to affect built-in functions, which was not possible before.  In order to do this, we need the `#defines` to appear at the top of the source, so I've merged the procedural shader generation previously done in `ShaderProgram` with the generation done in `createShaderSource`.
    
    * `createShaderSource` (private) is removed and replaced by `ShaderSource`. `ShaderSource` now manages an array of `#defines`, concating source shaders, and automatically including built-in functions, keeping everything in the correct order.
    * `ShaderCache` (and by extension `Context.createShaderProgram` and `Context.replaceShaderProgram`) now accept either `ShaderSource` objects, or a single string, for vertex and fragment shaders.
    * `ShaderProgram` constructor (private) now takes an options object.  It also exposes the vertex and fragment shaders as `ShaderSource` objects instead of strings.  External code can still clone the `ShaderSources` and then screw around with the implementation to make new shaders procedurally, as `OIT` does.
    shunter committed Oct 22, 2014
    Configuration menu
    Copy the full SHA
    3d19ddb View commit details
    Browse the repository at this point in the history
  2. sort requires

    shunter committed Oct 22, 2014
    Configuration menu
    Copy the full SHA
    bbddac4 View commit details
    Browse the repository at this point in the history
  3. remove unused modules

    shunter committed Oct 22, 2014
    Configuration menu
    Copy the full SHA
    45471c4 View commit details
    Browse the repository at this point in the history
  4. fix typo

    shunter committed Oct 22, 2014
    Configuration menu
    Copy the full SHA
    123d0c7 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2014

  1. Remove unused modules

    shunter committed Oct 23, 2014
    Configuration menu
    Copy the full SHA
    698c960 View commit details
    Browse the repository at this point in the history
  2. Changes after review.

    shunter committed Oct 23, 2014
    Configuration menu
    Copy the full SHA
    c1e0d00 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4310574 View commit details
    Browse the repository at this point in the history
  4. Fix after merge.

    shunter committed Oct 23, 2014
    Configuration menu
    Copy the full SHA
    f5e05da View commit details
    Browse the repository at this point in the history