cocos2d / glsl-optimizer Goto Github PK
View Code? Open in Web Editor NEWThis project forked from aras-p/glsl-optimizer
GLSL optimizer based on Mesa's GLSL compiler. Used in Unity for mobile shader optimization.
License: Other
This project forked from aras-p/glsl-optimizer
GLSL optimizer based on Mesa's GLSL compiler. Used in Unity for mobile shader optimization.
License: Other
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.