sdfsdfs
This commit is contained in:
2
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.d.ts
generated
vendored
Normal file
2
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { GlRenderingContext } from '../../../renderers/gl/context/GlRenderingContext';
|
||||
export declare function checkMaxIfStatementsInShader(maxIfs: number, gl: GlRenderingContext): number;
|
47
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.js
generated
vendored
Normal file
47
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
const fragTemplate = [
|
||||
"precision mediump float;",
|
||||
"void main(void){",
|
||||
"float test = 0.1;",
|
||||
"%forloop%",
|
||||
"gl_FragColor = vec4(0.0);",
|
||||
"}"
|
||||
].join("\n");
|
||||
function generateIfTestSrc(maxIfs) {
|
||||
let src = "";
|
||||
for (let i = 0; i < maxIfs; ++i) {
|
||||
if (i > 0) {
|
||||
src += "\nelse ";
|
||||
}
|
||||
if (i < maxIfs - 1) {
|
||||
src += `if(test == ${i}.0){}`;
|
||||
}
|
||||
}
|
||||
return src;
|
||||
}
|
||||
function checkMaxIfStatementsInShader(maxIfs, gl) {
|
||||
if (maxIfs === 0) {
|
||||
throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
|
||||
}
|
||||
const shader = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
try {
|
||||
while (true) {
|
||||
const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));
|
||||
gl.shaderSource(shader, fragmentSrc);
|
||||
gl.compileShader(shader);
|
||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||
maxIfs = maxIfs / 2 | 0;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
gl.deleteShader(shader);
|
||||
}
|
||||
return maxIfs;
|
||||
}
|
||||
|
||||
exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader;
|
||||
//# sourceMappingURL=checkMaxIfStatementsInShader.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkMaxIfStatementsInShader.js","sources":["../../../../../src/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.ts"],"sourcesContent":["import type { GlRenderingContext } from '../../../renderers/gl/context/GlRenderingContext';\n\nconst fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}',\n].join('\\n');\n\nfunction generateIfTestSrc(maxIfs: number): string\n{\n let src = '';\n\n for (let i = 0; i < maxIfs; ++i)\n {\n if (i > 0)\n {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1)\n {\n src += `if(test == ${i}.0){}`;\n }\n }\n\n return src;\n}\n\nexport function checkMaxIfStatementsInShader(maxIfs: number, gl: GlRenderingContext): number\n{\n if (maxIfs === 0)\n {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n\n const shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n try\n {\n while (true) // eslint-disable-line no-constant-condition\n {\n const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n maxIfs = (maxIfs / 2) | 0;\n }\n else\n {\n // valid!\n break;\n }\n }\n }\n finally\n {\n gl.deleteShader(shader);\n }\n\n return maxIfs;\n}\n"],"names":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AA;AAAA,OAG5B,MAAA;AAEI,QAAA,MAAA;AAAA,OACJ;AAAA,KACJ;AAAA,GAEJ,SAAA;AAEI,IAAA,EAAA,CAAG,aAAa,MAAM,CAAA,CAAA;AAAA,GAC1B;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}
|
45
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs
generated
vendored
Normal file
45
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
const fragTemplate = [
|
||||
"precision mediump float;",
|
||||
"void main(void){",
|
||||
"float test = 0.1;",
|
||||
"%forloop%",
|
||||
"gl_FragColor = vec4(0.0);",
|
||||
"}"
|
||||
].join("\n");
|
||||
function generateIfTestSrc(maxIfs) {
|
||||
let src = "";
|
||||
for (let i = 0; i < maxIfs; ++i) {
|
||||
if (i > 0) {
|
||||
src += "\nelse ";
|
||||
}
|
||||
if (i < maxIfs - 1) {
|
||||
src += `if(test == ${i}.0){}`;
|
||||
}
|
||||
}
|
||||
return src;
|
||||
}
|
||||
function checkMaxIfStatementsInShader(maxIfs, gl) {
|
||||
if (maxIfs === 0) {
|
||||
throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");
|
||||
}
|
||||
const shader = gl.createShader(gl.FRAGMENT_SHADER);
|
||||
try {
|
||||
while (true) {
|
||||
const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));
|
||||
gl.shaderSource(shader, fragmentSrc);
|
||||
gl.compileShader(shader);
|
||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||
maxIfs = maxIfs / 2 | 0;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
gl.deleteShader(shader);
|
||||
}
|
||||
return maxIfs;
|
||||
}
|
||||
|
||||
export { checkMaxIfStatementsInShader };
|
||||
//# sourceMappingURL=checkMaxIfStatementsInShader.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkMaxIfStatementsInShader.mjs","sources":["../../../../../src/rendering/batcher/gl/utils/checkMaxIfStatementsInShader.ts"],"sourcesContent":["import type { GlRenderingContext } from '../../../renderers/gl/context/GlRenderingContext';\n\nconst fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}',\n].join('\\n');\n\nfunction generateIfTestSrc(maxIfs: number): string\n{\n let src = '';\n\n for (let i = 0; i < maxIfs; ++i)\n {\n if (i > 0)\n {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1)\n {\n src += `if(test == ${i}.0){}`;\n }\n }\n\n return src;\n}\n\nexport function checkMaxIfStatementsInShader(maxIfs: number, gl: GlRenderingContext): number\n{\n if (maxIfs === 0)\n {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n\n const shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n try\n {\n while (true) // eslint-disable-line no-constant-condition\n {\n const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n maxIfs = (maxIfs / 2) | 0;\n }\n else\n {\n // valid!\n break;\n }\n }\n }\n finally\n {\n gl.deleteShader(shader);\n }\n\n return maxIfs;\n}\n"],"names":[],"mappings":";AAEA,MAAM,YAAe,GAAA;AAAA,EACjB,0BAAA;AAAA,EACA,kBAAA;AAAA,EACA,mBAAA;AAAA,EACA,WAAA;AAAA,EACA,2BAAA;AAAA,E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AAA,GAC1B;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}
|
8
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.d.ts
generated
vendored
Normal file
8
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Returns the maximum number of textures that can be batched. This uses WebGL1's `MAX_TEXTURE_IMAGE_UNITS`.
|
||||
* The response for this is that to get this info via WebGPU, we would need to make a context, which
|
||||
* would make this function async, and we want to avoid that.
|
||||
* @private
|
||||
* @returns {number} The maximum number of textures that can be batched
|
||||
*/
|
||||
export declare function getMaxTexturesPerBatch(): number;
|
22
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.js
generated
vendored
Normal file
22
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var getTestContext = require('../../../renderers/gl/shader/program/getTestContext.js');
|
||||
var checkMaxIfStatementsInShader = require('./checkMaxIfStatementsInShader.js');
|
||||
|
||||
"use strict";
|
||||
let maxTexturesPerBatchCache = null;
|
||||
function getMaxTexturesPerBatch() {
|
||||
if (maxTexturesPerBatchCache)
|
||||
return maxTexturesPerBatchCache;
|
||||
const gl = getTestContext.getTestContext();
|
||||
maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
|
||||
maxTexturesPerBatchCache = checkMaxIfStatementsInShader.checkMaxIfStatementsInShader(
|
||||
maxTexturesPerBatchCache,
|
||||
gl
|
||||
);
|
||||
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
||||
return maxTexturesPerBatchCache;
|
||||
}
|
||||
|
||||
exports.getMaxTexturesPerBatch = getMaxTexturesPerBatch;
|
||||
//# sourceMappingURL=maxRecommendedTextures.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"maxRecommendedTextures.js","sources":["../../../../../src/rendering/batcher/gl/utils/maxRecommendedTextures.ts"],"sourcesContent":["import { getTestContext } from '../../../renderers/gl/shader/program/getTestContext';\nimport { checkMaxIfStatementsInShader } from './checkMaxIfStatementsInShader';\n\nlet maxTexturesPerBatchCache: number | null = null;\n\n/**\n * Returns the maximum number of textures that can be batched. This uses WebGL1's `MAX_TEXTURE_IMAGE_UNITS`.\n * The response for this is that to get this info via WebGPU, we would need to make a context, which\n * would make this function async, and we want to avoid that.\n * @private\n * @returns {number} The maximum number of textures that can be batched\n */\nexport function getMaxTexturesPerBatch(): number\n{\n if (maxTexturesPerBatchCache) return maxTexturesPerBatchCache;\n\n const gl = getTestContext();\n\n // step 1: first check max textures the GPU can handle.\n maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n // step 2: check the maximum number of if statements the shader can have too..\n maxTexturesPerBatchCache = checkMaxIfStatementsInShader(\n maxTexturesPerBatchCache, gl);\n\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return maxTexturesPerBatchCache;\n}\n"],"names":["getTestContext","checkMaxIfStatementsInShader"],"mappings":";;;;;;AAGA,IAAI,wBAA0C,GAAA,IAAA,CAAA;AASvC,SAAS,sBAChB,GAAA;AACI,EAAI,IAAA,wBAAA;AAA0B,IAAO,OAAA,wBAAA,CAAA;AAErC,EAAA,MAAM,KAAKA,6BAAe,EAAA,CAAA;AAG1B,EAA2B,wBAAA,GAAA,EAAA,CAAG,YAAa,CAAA,EAAA,CAAG,uBAAuB,CAAA,CAAA;AAGrE,EAA2B,wBAAA,GAAAC,yDAAA;AAAA,IACvB,wBAAA;AAAA,IAA0B,EAAA;AAAA,GAAE,CAAA;AAEhC,EAAG,EAAA,CAAA,YAAA,CAAa,oBAAoB,CAAA,EAAG,WAAY,EAAA,CAAA;AAEnD,EAAO,OAAA,wBAAA,CAAA;AACX;;;;"}
|
20
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs
generated
vendored
Normal file
20
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { getTestContext } from '../../../renderers/gl/shader/program/getTestContext.mjs';
|
||||
import { checkMaxIfStatementsInShader } from './checkMaxIfStatementsInShader.mjs';
|
||||
|
||||
"use strict";
|
||||
let maxTexturesPerBatchCache = null;
|
||||
function getMaxTexturesPerBatch() {
|
||||
if (maxTexturesPerBatchCache)
|
||||
return maxTexturesPerBatchCache;
|
||||
const gl = getTestContext();
|
||||
maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
|
||||
maxTexturesPerBatchCache = checkMaxIfStatementsInShader(
|
||||
maxTexturesPerBatchCache,
|
||||
gl
|
||||
);
|
||||
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
||||
return maxTexturesPerBatchCache;
|
||||
}
|
||||
|
||||
export { getMaxTexturesPerBatch };
|
||||
//# sourceMappingURL=maxRecommendedTextures.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gl/utils/maxRecommendedTextures.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"maxRecommendedTextures.mjs","sources":["../../../../../src/rendering/batcher/gl/utils/maxRecommendedTextures.ts"],"sourcesContent":["import { getTestContext } from '../../../renderers/gl/shader/program/getTestContext';\nimport { checkMaxIfStatementsInShader } from './checkMaxIfStatementsInShader';\n\nlet maxTexturesPerBatchCache: number | null = null;\n\n/**\n * Returns the maximum number of textures that can be batched. This uses WebGL1's `MAX_TEXTURE_IMAGE_UNITS`.\n * The response for this is that to get this info via WebGPU, we would need to make a context, which\n * would make this function async, and we want to avoid that.\n * @private\n * @returns {number} The maximum number of textures that can be batched\n */\nexport function getMaxTexturesPerBatch(): number\n{\n if (maxTexturesPerBatchCache) return maxTexturesPerBatchCache;\n\n const gl = getTestContext();\n\n // step 1: first check max textures the GPU can handle.\n maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n // step 2: check the maximum number of if statements the shader can have too..\n maxTexturesPerBatchCache = checkMaxIfStatementsInShader(\n maxTexturesPerBatchCache, gl);\n\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return maxTexturesPerBatchCache;\n}\n"],"names":[],"mappings":";;;;AAGA,IAAI,wBAA0C,GAAA,IAAA,CAAA;AASvC,SAAS,sBAChB,GAAA;AACI,EAAI,IAAA,wBAAA;AAA0B,IAAO,OAAA,wBAAA,CAAA;AAErC,EAAA,MAAM,KAAK,cAAe,EAAA,CAAA;AAG1B,EAA2B,wBAAA,GAAA,EAAA,CAAG,YAAa,CAAA,EAAA,CAAG,uBAAuB,CAAA,CAAA;AAGrE,EAA2B,wBAAA,GAAA,4BAAA;AAAA,IACvB,wBAAA;AAAA,IAA0B,EAAA;AAAA,GAAE,CAAA;AAEhC,EAAG,EAAA,CAAA,YAAA,CAAa,oBAAoB,CAAA,EAAG,WAAY,EAAA,CAAA;AAEnD,EAAO,OAAA,wBAAA,CAAA;AACX;;;;"}
|
Reference in New Issue
Block a user