MCPcopy Create free account
hub / github.com/microsoft/SandDance / transpileShader

Function transpileShader

docs/app/js/sanddance-app.js:68645–68654  ·  view source on GitHub ↗
(source, targetGLSLVersion, isVertex)

Source from the content-addressed store, hash-verified

68643var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
68644parcelHelpers.defineInteropFlag(exports);
68645function transpileShader(source, targetGLSLVersion, isVertex) {
68646 switch(targetGLSLVersion){
68647 case 300:
68648 return isVertex ? convertVertexShaderTo300(source) : convertFragmentShaderTo300(source);
68649 case 100:
68650 return isVertex ? convertVertexShaderTo100(source) : convertFragmentShaderTo100(source);
68651 default:
68652 throw new Error("unknown GLSL version ".concat(targetGLSLVersion));
68653 }
68654}
68655exports.default = transpileShader;
68656var FS_OUTPUT_REGEX = /^[ \t]*out[ \t]+vec4[ \t]+(\w+)[ \t]*;\s+/m;
68657function convertVertexShaderTo300(source) {

Callers

nothing calls this directly

Calls 4

convertVertexShaderTo300Function · 0.70
convertVertexShaderTo100Function · 0.70

Tested by

no test coverage detected