Coder Social home page Coder Social logo

cocos2d / glsl-optimizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aras-p/glsl-optimizer

10.0 10.0 10.0 154.49 MB

GLSL optimizer based on Mesa's GLSL compiler. Used in Unity for mobile shader optimization.

License: Other

CMake 0.06% Shell 0.03% Python 0.34% C++ 76.67% Makefile 0.10% C 17.22% Lex 0.47% Yacc 4.37% LLVM 0.70% JavaScript 0.04%

glsl-optimizer's People

Contributors

agd5f avatar airlied avatar anholt avatar aras-p avatar brianpaul avatar chrisforbes avatar curro avatar cworth-gh avatar evelikov avatar freedreno-zz avatar ianromanick avatar imirkin avatar jljusten2 avatar jrfonseca avatar kaydenl avatar krh avatar luca-barbieri avatar marekolsak avatar mattst88 avatar mcencora avatar mostawesomedude avatar nhaehnle avatar olvaffe avatar stereotype441 avatar tstellaramd avatar versalinyaa avatar vinsonlee avatar wallbraker avatar xhaihao avatar zackr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

glsl-optimizer's Issues

No support variables in global scope when converting es shader to msl

Here is a simple fragment shader:

vec3 redColor = vec3(1.0, 0.0, 0.0);

vec3 getColor()
{
    return redColor;
}
void main(void) {
    vec3 color = getColor();
    gl_FragColor = vec4(color, 1.0);
}

When we use the global variable redColor in getColor() method, after translated it to metal shader language, all variables defined in global scope will be skipped. It will make redColor undefined in getColor() method in msl:
float3 getColor () { return redColor; }

It is a bit complicate and will take more time to fix the issues, thus we don't take this into account for the time being.

No support an array of textures

This post explain the problems encountered when using an array of textures in msl.

Finally that issues was fixed by upgrading my phone to iOS12.0.1. For macOS, the version should at least macOS 10.13. Due to its restrict on equipments, We temporary no support an array of textures in msl.

Can not generate metal shader.

It is strange that, the same GLSL shader can not be converted to metal shader sometimes. The usage of glsl-optimizer codes is here.

I think it is because some parameters are not initialized, so it works sometimes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.