sdfsdfs
This commit is contained in:
21
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.d.ts
generated
vendored
Normal file
21
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions';
|
||||
import type { Geometry } from '../../renderers/shared/geometry/Geometry';
|
||||
import type { Shader } from '../../renderers/shared/shader/Shader';
|
||||
import type { Batch } from '../shared/Batcher';
|
||||
import type { BatcherAdaptor, BatcherPipe } from '../shared/BatcherPipe';
|
||||
/**
|
||||
* A BatcherAdaptor that uses the GPU to render batches.
|
||||
* @memberof rendering
|
||||
* @ignore
|
||||
*/
|
||||
export declare class GpuBatchAdaptor implements BatcherAdaptor {
|
||||
/** @ignore */
|
||||
static extension: {
|
||||
readonly type: readonly [ExtensionType.WebGPUPipesAdaptor];
|
||||
readonly name: "batch";
|
||||
};
|
||||
private _shader;
|
||||
private _geometry;
|
||||
start(batchPipe: BatcherPipe, geometry: Geometry, shader: Shader): void;
|
||||
execute(batchPipe: BatcherPipe, batch: Batch): void;
|
||||
}
|
61
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.js
generated
vendored
Normal file
61
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
var Extensions = require('../../../extensions/Extensions.js');
|
||||
var State = require('../../renderers/shared/state/State.js');
|
||||
var getTextureBatchBindGroup = require('./getTextureBatchBindGroup.js');
|
||||
|
||||
"use strict";
|
||||
const tempState = State.State.for2d();
|
||||
class GpuBatchAdaptor {
|
||||
start(batchPipe, geometry, shader) {
|
||||
const renderer = batchPipe.renderer;
|
||||
const encoder = renderer.encoder;
|
||||
const program = shader.gpuProgram;
|
||||
this._shader = shader;
|
||||
this._geometry = geometry;
|
||||
encoder.setGeometry(geometry, program);
|
||||
tempState.blendMode = "normal";
|
||||
renderer.pipeline.getPipeline(
|
||||
geometry,
|
||||
program,
|
||||
tempState
|
||||
);
|
||||
const globalUniformsBindGroup = renderer.globalUniforms.bindGroup;
|
||||
encoder.resetBindGroup(1);
|
||||
encoder.setBindGroup(0, globalUniformsBindGroup, program);
|
||||
}
|
||||
execute(batchPipe, batch) {
|
||||
const program = this._shader.gpuProgram;
|
||||
const renderer = batchPipe.renderer;
|
||||
const encoder = renderer.encoder;
|
||||
if (!batch.bindGroup) {
|
||||
const textureBatch = batch.textures;
|
||||
batch.bindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup(textureBatch.textures, textureBatch.count);
|
||||
}
|
||||
tempState.blendMode = batch.blendMode;
|
||||
const gpuBindGroup = renderer.bindGroup.getBindGroup(
|
||||
batch.bindGroup,
|
||||
program,
|
||||
1
|
||||
);
|
||||
const pipeline = renderer.pipeline.getPipeline(
|
||||
this._geometry,
|
||||
program,
|
||||
tempState
|
||||
);
|
||||
batch.bindGroup._touch(renderer.textureGC.count);
|
||||
encoder.setPipeline(pipeline);
|
||||
encoder.renderPassEncoder.setBindGroup(1, gpuBindGroup);
|
||||
encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start);
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
GpuBatchAdaptor.extension = {
|
||||
type: [
|
||||
Extensions.ExtensionType.WebGPUPipesAdaptor
|
||||
],
|
||||
name: "batch"
|
||||
};
|
||||
|
||||
exports.GpuBatchAdaptor = GpuBatchAdaptor;
|
||||
//# sourceMappingURL=GpuBatchAdaptor.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.mjs
generated
vendored
Normal file
59
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.mjs
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { ExtensionType } from '../../../extensions/Extensions.mjs';
|
||||
import { State } from '../../renderers/shared/state/State.mjs';
|
||||
import { getTextureBatchBindGroup } from './getTextureBatchBindGroup.mjs';
|
||||
|
||||
"use strict";
|
||||
const tempState = State.for2d();
|
||||
class GpuBatchAdaptor {
|
||||
start(batchPipe, geometry, shader) {
|
||||
const renderer = batchPipe.renderer;
|
||||
const encoder = renderer.encoder;
|
||||
const program = shader.gpuProgram;
|
||||
this._shader = shader;
|
||||
this._geometry = geometry;
|
||||
encoder.setGeometry(geometry, program);
|
||||
tempState.blendMode = "normal";
|
||||
renderer.pipeline.getPipeline(
|
||||
geometry,
|
||||
program,
|
||||
tempState
|
||||
);
|
||||
const globalUniformsBindGroup = renderer.globalUniforms.bindGroup;
|
||||
encoder.resetBindGroup(1);
|
||||
encoder.setBindGroup(0, globalUniformsBindGroup, program);
|
||||
}
|
||||
execute(batchPipe, batch) {
|
||||
const program = this._shader.gpuProgram;
|
||||
const renderer = batchPipe.renderer;
|
||||
const encoder = renderer.encoder;
|
||||
if (!batch.bindGroup) {
|
||||
const textureBatch = batch.textures;
|
||||
batch.bindGroup = getTextureBatchBindGroup(textureBatch.textures, textureBatch.count);
|
||||
}
|
||||
tempState.blendMode = batch.blendMode;
|
||||
const gpuBindGroup = renderer.bindGroup.getBindGroup(
|
||||
batch.bindGroup,
|
||||
program,
|
||||
1
|
||||
);
|
||||
const pipeline = renderer.pipeline.getPipeline(
|
||||
this._geometry,
|
||||
program,
|
||||
tempState
|
||||
);
|
||||
batch.bindGroup._touch(renderer.textureGC.count);
|
||||
encoder.setPipeline(pipeline);
|
||||
encoder.renderPassEncoder.setBindGroup(1, gpuBindGroup);
|
||||
encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start);
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
GpuBatchAdaptor.extension = {
|
||||
type: [
|
||||
ExtensionType.WebGPUPipesAdaptor
|
||||
],
|
||||
name: "batch"
|
||||
};
|
||||
|
||||
export { GpuBatchAdaptor };
|
||||
//# sourceMappingURL=GpuBatchAdaptor.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/GpuBatchAdaptor.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.d.ts
generated
vendored
Normal file
2
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="@webgpu/types" />
|
||||
export declare function generateGPULayout(maxTextures: number): GPUBindGroupLayoutEntry[];
|
31
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.js
generated
vendored
Normal file
31
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
function generateGPULayout(maxTextures) {
|
||||
const gpuLayout = [];
|
||||
let bindIndex = 0;
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
gpuLayout[bindIndex] = {
|
||||
texture: {
|
||||
sampleType: "float",
|
||||
viewDimension: "2d",
|
||||
multisampled: false
|
||||
},
|
||||
binding: bindIndex,
|
||||
visibility: GPUShaderStage.FRAGMENT
|
||||
};
|
||||
bindIndex++;
|
||||
gpuLayout[bindIndex] = {
|
||||
sampler: {
|
||||
type: "filtering"
|
||||
},
|
||||
binding: bindIndex,
|
||||
visibility: GPUShaderStage.FRAGMENT
|
||||
};
|
||||
bindIndex++;
|
||||
}
|
||||
return gpuLayout;
|
||||
}
|
||||
|
||||
exports.generateGPULayout = generateGPULayout;
|
||||
//# sourceMappingURL=generateGPULayout.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateGPULayout.js","sources":["../../../../src/rendering/batcher/gpu/generateGPULayout.ts"],"sourcesContent":["export function generateGPULayout(maxTextures: number): GPUBindGroupLayoutEntry[]\n{\n const gpuLayout: GPUBindGroupLayoutEntry[] = [];\n\n let bindIndex = 0;\n\n for (let i = 0; i < maxTextures; i++)\n {\n gpuLayout[bindIndex] = {\n texture: {\n sampleType: 'float',\n viewDimension: '2d',\n multisampled: false,\n },\n binding: bindIndex,\n visibility: GPUShaderStage.FRAGMENT,\n };\n bindIndex++;\n\n gpuLayout[bindIndex] = {\n sampler: {\n type: 'filtering',\n },\n binding: bindIndex,\n visibility: GPUShaderStage.FRAGMENT,\n };\n\n bindIndex++;\n }\n\n return gpuLayout;\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,kBAAkB,WAClC,EAAA;AACI,EAAA,MAAM,YAAuC,EAAC,CAAA;AAE9C,EAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEhB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,EAAa,CACjC,EAAA,EAAA;AACI,IAAA,SAAA,CAAU,SAAS,CAAI,GAAA;AAAA,MACnB,OAAS,EAAA;AAAA,QACL,UAAY,EAAA,OAAA;AAAA,QACZ,aAAe,EAAA,IAAA;AAAA,QACf,YAAc,EAAA,KAAA;AAAA,OAClB;AAAA,MACA,OAAS,EAAA,SAAA;AAAA,MACT,YAAY,cAAe,CAAA,QAAA;AAAA,KAC/B,CAAA;AACA,IAAA,SAAA,EAAA,CAAA;AAEA,IAAA,SAAA,CAAU,SAAS,CAAI,GAAA;AAAA,MACnB,OAAS,EAAA;AAAA,QACL,IAAM,EAAA,WAAA;AAAA,OACV;AAAA,MACA,OAAS,EAAA,SAAA;AAAA,MACT,YAAY,cAAe,CAAA,QAAA;AAAA,KAC/B,CAAA;AAEA,IAAA,SAAA,EAAA,CAAA;AAAA,GACJ;AAEA,EAAO,OAAA,SAAA,CAAA;AACX;;;;"}
|
29
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.mjs
generated
vendored
Normal file
29
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
function generateGPULayout(maxTextures) {
|
||||
const gpuLayout = [];
|
||||
let bindIndex = 0;
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
gpuLayout[bindIndex] = {
|
||||
texture: {
|
||||
sampleType: "float",
|
||||
viewDimension: "2d",
|
||||
multisampled: false
|
||||
},
|
||||
binding: bindIndex,
|
||||
visibility: GPUShaderStage.FRAGMENT
|
||||
};
|
||||
bindIndex++;
|
||||
gpuLayout[bindIndex] = {
|
||||
sampler: {
|
||||
type: "filtering"
|
||||
},
|
||||
binding: bindIndex,
|
||||
visibility: GPUShaderStage.FRAGMENT
|
||||
};
|
||||
bindIndex++;
|
||||
}
|
||||
return gpuLayout;
|
||||
}
|
||||
|
||||
export { generateGPULayout };
|
||||
//# sourceMappingURL=generateGPULayout.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateGPULayout.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateGPULayout.mjs","sources":["../../../../src/rendering/batcher/gpu/generateGPULayout.ts"],"sourcesContent":["export function generateGPULayout(maxTextures: number): GPUBindGroupLayoutEntry[]\n{\n const gpuLayout: GPUBindGroupLayoutEntry[] = [];\n\n let bindIndex = 0;\n\n for (let i = 0; i < maxTextures; i++)\n {\n gpuLayout[bindIndex] = {\n texture: {\n sampleType: 'float',\n viewDimension: '2d',\n multisampled: false,\n },\n binding: bindIndex,\n visibility: GPUShaderStage.FRAGMENT,\n };\n bindIndex++;\n\n gpuLayout[bindIndex] = {\n sampler: {\n type: 'filtering',\n },\n binding: bindIndex,\n visibility: GPUShaderStage.FRAGMENT,\n };\n\n bindIndex++;\n }\n\n return gpuLayout;\n}\n"],"names":[],"mappings":";AAAO,SAAS,kBAAkB,WAClC,EAAA;AACI,EAAA,MAAM,YAAuC,EAAC,CAAA;AAE9C,EAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEhB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,EAAa,CACjC,EAAA,EAAA;AACI,IAAA,SAAA,CAAU,SAAS,CAAI,GAAA;AAAA,MACnB,OAAS,EAAA;AAAA,QACL,UAAY,EAAA,OAAA;AAAA,QACZ,aAAe,EAAA,IAAA;AAAA,QACf,YAAc,EAAA,KAAA;AAAA,OAClB;AAAA,MACA,OAAS,EAAA,SAAA;AAAA,MACT,YAAY,cAAe,CAAA,QAAA;AAAA,KAC/B,CAAA;AACA,IAAA,SAAA,EAAA,CAAA;AAEA,IAAA,SAAA,CAAU,SAAS,CAAI,GAAA;AAAA,MACnB,OAAS,EAAA;AAAA,QACL,IAAM,EAAA,WAAA;AAAA,OACV;AAAA,MACA,OAAS,EAAA,SAAA;AAAA,MACT,YAAY,cAAe,CAAA,QAAA;AAAA,KAC/B,CAAA;AAEA,IAAA,SAAA,EAAA,CAAA;AAAA,GACJ;AAEA,EAAO,OAAA,SAAA,CAAA;AACX;;;;"}
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.d.ts
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function generateLayout(maxTextures: number): Record<string, number>;
|
15
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.js
generated
vendored
Normal file
15
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
"use strict";
|
||||
function generateLayout(maxTextures) {
|
||||
const layout = {};
|
||||
let bindIndex = 0;
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
layout[`textureSource${i + 1}`] = bindIndex++;
|
||||
layout[`textureSampler${i + 1}`] = bindIndex++;
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
|
||||
exports.generateLayout = generateLayout;
|
||||
//# sourceMappingURL=generateLayout.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateLayout.js","sources":["../../../../src/rendering/batcher/gpu/generateLayout.ts"],"sourcesContent":["export function generateLayout(maxTextures: number): Record<string, number>\n{\n const layout: Record<string, number> = {};\n\n let bindIndex = 0;\n\n for (let i = 0; i < maxTextures; i++)\n {\n layout[`textureSource${i + 1}`] = bindIndex++;\n layout[`textureSampler${i + 1}`] = bindIndex++;\n }\n\n return layout;\n}\n"],"names":[],"mappings":";;;AAAO,SAAS,eAAe,WAC/B,EAAA;AACI,EAAA,MAAM,SAAiC,EAAC,CAAA;AAExC,EAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEhB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,EAAa,CACjC,EAAA,EAAA;AACI,IAAA,MAAA,CAAO,CAAgB,aAAA,EAAA,CAAA,GAAI,CAAC,CAAA,CAAE,CAAI,GAAA,SAAA,EAAA,CAAA;AAClC,IAAA,MAAA,CAAO,CAAiB,cAAA,EAAA,CAAA,GAAI,CAAC,CAAA,CAAE,CAAI,GAAA,SAAA,EAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}
|
13
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.mjs
generated
vendored
Normal file
13
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
function generateLayout(maxTextures) {
|
||||
const layout = {};
|
||||
let bindIndex = 0;
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
layout[`textureSource${i + 1}`] = bindIndex++;
|
||||
layout[`textureSampler${i + 1}`] = bindIndex++;
|
||||
}
|
||||
return layout;
|
||||
}
|
||||
|
||||
export { generateLayout };
|
||||
//# sourceMappingURL=generateLayout.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/generateLayout.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateLayout.mjs","sources":["../../../../src/rendering/batcher/gpu/generateLayout.ts"],"sourcesContent":["export function generateLayout(maxTextures: number): Record<string, number>\n{\n const layout: Record<string, number> = {};\n\n let bindIndex = 0;\n\n for (let i = 0; i < maxTextures; i++)\n {\n layout[`textureSource${i + 1}`] = bindIndex++;\n layout[`textureSampler${i + 1}`] = bindIndex++;\n }\n\n return layout;\n}\n"],"names":[],"mappings":";AAAO,SAAS,eAAe,WAC/B,EAAA;AACI,EAAA,MAAM,SAAiC,EAAC,CAAA;AAExC,EAAA,IAAI,SAAY,GAAA,CAAA,CAAA;AAEhB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,EAAa,CACjC,EAAA,EAAA;AACI,IAAA,MAAA,CAAO,CAAgB,aAAA,EAAA,CAAA,GAAI,CAAC,CAAA,CAAE,CAAI,GAAA,SAAA,EAAA,CAAA;AAClC,IAAA,MAAA,CAAO,CAAiB,cAAA,EAAA,CAAA,GAAI,CAAC,CAAA,CAAE,CAAI,GAAA,SAAA,EAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}
|
3
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.d.ts
generated
vendored
Normal file
3
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { BindGroup } from '../../renderers/gpu/shader/BindGroup';
|
||||
import type { TextureSource } from '../../renderers/shared/texture/sources/TextureSource';
|
||||
export declare function getTextureBatchBindGroup(textures: TextureSource[], size: number): BindGroup;
|
35
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.js
generated
vendored
Normal file
35
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
var BindGroup = require('../../renderers/gpu/shader/BindGroup.js');
|
||||
var Texture = require('../../renderers/shared/texture/Texture.js');
|
||||
var maxRecommendedTextures = require('../gl/utils/maxRecommendedTextures.js');
|
||||
|
||||
"use strict";
|
||||
const cachedGroups = {};
|
||||
function getTextureBatchBindGroup(textures, size) {
|
||||
let uid = 2166136261;
|
||||
for (let i = 0; i < size; i++) {
|
||||
uid ^= textures[i].uid;
|
||||
uid = Math.imul(uid, 16777619);
|
||||
uid >>>= 0;
|
||||
}
|
||||
return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid);
|
||||
}
|
||||
let maxTextures = 0;
|
||||
function generateTextureBatchBindGroup(textures, size, key) {
|
||||
const bindGroupResources = {};
|
||||
let bindIndex = 0;
|
||||
if (!maxTextures)
|
||||
maxTextures = maxRecommendedTextures.getMaxTexturesPerBatch();
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
const texture = i < size ? textures[i] : Texture.Texture.EMPTY.source;
|
||||
bindGroupResources[bindIndex++] = texture.source;
|
||||
bindGroupResources[bindIndex++] = texture.style;
|
||||
}
|
||||
const bindGroup = new BindGroup.BindGroup(bindGroupResources);
|
||||
cachedGroups[key] = bindGroup;
|
||||
return bindGroup;
|
||||
}
|
||||
|
||||
exports.getTextureBatchBindGroup = getTextureBatchBindGroup;
|
||||
//# sourceMappingURL=getTextureBatchBindGroup.js.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getTextureBatchBindGroup.js","sources":["../../../../src/rendering/batcher/gpu/getTextureBatchBindGroup.ts"],"sourcesContent":["import { BindGroup } from '../../renderers/gpu/shader/BindGroup';\nimport { Texture } from '../../renderers/shared/texture/Texture';\nimport { getMaxTexturesPerBatch } from '../gl/utils/maxRecommendedTextures';\n\nimport type { TextureSource } from '../../renderers/shared/texture/sources/TextureSource';\n\nconst cachedGroups: Record<number, BindGroup> = {};\n\nexport function getTextureBatchBindGroup(textures: TextureSource[], size: number)\n{\n let uid = 2166136261; // FNV-1a 32-bit offset basis\n\n for (let i = 0; i < size; i++)\n {\n uid ^= textures[i].uid;\n uid = Math.imul(uid, 16777619);\n uid >>>= 0;\n }\n\n return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid);\n}\n\nlet maxTextures = 0;\n\nfunction generateTextureBatchBindGroup(textures: TextureSource[], size: number, key: number): BindGroup\n{\n const bindGroupResources: Record<string, any> = {};\n\n let bindIndex = 0;\n\n if (!maxTextures)maxTextures = getMaxTexturesPerBatch();\n\n for (let i = 0; i < maxTextures; i++)\n {\n const texture = i < size ? textures[i] : Texture.EMPTY.source;\n\n bindGroupResources[bindIndex++] = texture.source;\n bindGroupResources[bindIndex++] = texture.style;\n }\n\n // pad out with empty textures\n const bindGroup = new BindGroup(bindGroupResources);\n\n cachedGroups[key] = bindGroup;\n\n return bindGroup;\n}\n\n"],"names":["getMaxTexturesPerBatch","Texture","BindGroup"],"mappings":";;;;;;;AAMA,MAAM,eAA0C,EAAC,CAAA;AAEjC,SAAA,wBAAA,CAAyB,UAA2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pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs
generated
vendored
Normal file
33
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { BindGroup } from '../../renderers/gpu/shader/BindGroup.mjs';
|
||||
import { Texture } from '../../renderers/shared/texture/Texture.mjs';
|
||||
import { getMaxTexturesPerBatch } from '../gl/utils/maxRecommendedTextures.mjs';
|
||||
|
||||
"use strict";
|
||||
const cachedGroups = {};
|
||||
function getTextureBatchBindGroup(textures, size) {
|
||||
let uid = 2166136261;
|
||||
for (let i = 0; i < size; i++) {
|
||||
uid ^= textures[i].uid;
|
||||
uid = Math.imul(uid, 16777619);
|
||||
uid >>>= 0;
|
||||
}
|
||||
return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid);
|
||||
}
|
||||
let maxTextures = 0;
|
||||
function generateTextureBatchBindGroup(textures, size, key) {
|
||||
const bindGroupResources = {};
|
||||
let bindIndex = 0;
|
||||
if (!maxTextures)
|
||||
maxTextures = getMaxTexturesPerBatch();
|
||||
for (let i = 0; i < maxTextures; i++) {
|
||||
const texture = i < size ? textures[i] : Texture.EMPTY.source;
|
||||
bindGroupResources[bindIndex++] = texture.source;
|
||||
bindGroupResources[bindIndex++] = texture.style;
|
||||
}
|
||||
const bindGroup = new BindGroup(bindGroupResources);
|
||||
cachedGroups[key] = bindGroup;
|
||||
return bindGroup;
|
||||
}
|
||||
|
||||
export { getTextureBatchBindGroup };
|
||||
//# sourceMappingURL=getTextureBatchBindGroup.mjs.map
|
1
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/rendering/batcher/gpu/getTextureBatchBindGroup.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getTextureBatchBindGroup.mjs","sources":["../../../../src/rendering/batcher/gpu/getTextureBatchBindGroup.ts"],"sourcesContent":["import { BindGroup } from '../../renderers/gpu/shader/BindGroup';\nimport { Texture } from '../../renderers/shared/texture/Texture';\nimport { getMaxTexturesPerBatch } from '../gl/utils/maxRecommendedTextures';\n\nimport type { TextureSource } from '../../renderers/shared/texture/sources/TextureSource';\n\nconst cachedGroups: Record<number, BindGroup> = {};\n\nexport function getTextureBatchBindGroup(textures: TextureSource[], size: number)\n{\n let uid = 2166136261; // FNV-1a 32-bit offset basis\n\n for (let i = 0; i < size; i++)\n {\n uid ^= textures[i].uid;\n uid = Math.imul(uid, 16777619);\n uid >>>= 0;\n }\n\n return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid);\n}\n\nlet maxTextures = 0;\n\nfunction generateTextureBatchBindGroup(textures: TextureSource[], size: number, key: number): BindGroup\n{\n const bindGroupResources: Record<string, any> = {};\n\n let bindIndex = 0;\n\n if (!maxTextures)maxTextures = getMaxTexturesPerBatch();\n\n for (let i = 0; i < maxTextures; i++)\n {\n const texture = i < size ? textures[i] : Texture.EMPTY.source;\n\n bindGroupResources[bindIndex++] = texture.source;\n bindGroupResources[bindIndex++] = texture.style;\n }\n\n // pad out with empty textures\n const bindGroup = new BindGroup(bindGroupResources);\n\n cachedGroups[key] = bindGroup;\n\n return bindGroup;\n}\n\n"],"names":[],"mappings":";;;;;AAMA,MAAM,eAA0C,EAAC,CAAA;AAEjC,SAAA,wBAAA,CAAyB,UAA2B,IACpE,EAAA;AACI,EAAA,IAAI,GAAM,GAAA,UAAA,CAAA;AAEV,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,IAAA,EAAM,CAC1B,EAAA,EAAA;AACI,IAAO,GAAA,IAAA,QAAA,CAAS,CAAC,CAAE,CAAA,GAAA,CAAA;AACnB,IAAM,GAAA,GAAA,IAAA,CAAK,IAAK,CAAA,GAAA,EAAK,QAAQ,CAAA,CAAA;AAC7B,IAAS,GAAA,MAAA,CAAA,CAAA;AAAA,GACb;AAEA,EAAA,OAAO,aA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