This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,7 @@
import type { TextureSource } from '../../../shared/texture/sources/TextureSource';
import type { GlRenderingContext } from '../../context/GlRenderingContext';
import type { GlTexture } from '../GlTexture';
export interface GLTextureUploader {
id: string;
upload(source: TextureSource, glTexture: GlTexture, gl: GlRenderingContext, webGLVersion: number): void;
}

View File

@@ -0,0 +1,4 @@
'use strict';
"use strict";
//# sourceMappingURL=GLTextureUploader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"GLTextureUploader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=GLTextureUploader.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"GLTextureUploader.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
import type { GLTextureUploader } from './GLTextureUploader';
export declare const glUploadBufferImageResource: GLTextureUploader;

View File

@@ -0,0 +1,38 @@
'use strict';
"use strict";
const glUploadBufferImageResource = {
id: "buffer",
upload(source, glTexture, gl) {
if (glTexture.width === source.width || glTexture.height === source.height) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
source.width,
source.height,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
source.width,
source.height,
0,
glTexture.format,
glTexture.type,
source.resource
);
}
glTexture.width = source.width;
glTexture.height = source.height;
}
};
exports.glUploadBufferImageResource = glUploadBufferImageResource;
//# sourceMappingURL=glUploadBufferImageResource.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"glUploadBufferImageResource.js","sources":["../../../../../../src/rendering/renderers/gl/texture/uploaders/glUploadBufferImageResource.ts"],"sourcesContent":["import type { TextureSource } from '../../../shared/texture/sources/TextureSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nexport const glUploadBufferImageResource = {\n\n id: 'buffer',\n\n upload(source: TextureSource, glTexture: GlTexture, gl: GlRenderingContext)\n {\n if (glTexture.width === source.width || glTexture.height === source.height)\n {\n gl.texSubImage2D(\n gl.TEXTURE_2D,\n 0,\n 0,\n 0,\n source.width,\n source.height,\n glTexture.format,\n glTexture.type,\n source.resource\n );\n }\n else\n {\n gl.texImage2D(\n glTexture.target,\n 0,\n glTexture.internalFormat,\n source.width,\n source.height,\n 0,\n glTexture.format,\n glTexture.type,\n source.resource\n );\n }\n\n glTexture.width = source.width;\n glTexture.height = source.height;\n }\n} as GLTextureUploader;\n\n"],"names":[],"mappings":";;;AAKO,MAAM,2BAA8B,GAAA;AAAA,EAEvC,EAAI,EAAA,QAAA;AAAA,EAEJ,MAAA,CAAO,MAAuB,EAAA,SAAA,EAAsB,EACpD,EAAA;AACI,IAAA,IAAI,UAAU,KAAU,KAAA,MAAA,CAAO,SAAS,SAAU,CAAA,MAAA,KAAW,OAAO,MACpE,EAAA;AACI,MAAG,EAAA,CAAA,aAAA;AAAA,QACC,EAAG,CAAA,UAAA;AAAA,QACH,CAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QACA,MAAO,CAAA,KAAA;AAAA,QACP,MAAO,CAAA,MAAA;AAAA,QACP,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,MAAO,CAAA,QAAA;AAAA,OACX,CAAA;AAAA,KAGJ,MAAA;AACI,MAAG,EAAA,CAAA,UAAA;AAAA,QACC,SAAU,CAAA,MAAA;AAAA,QACV,CAAA;AAAA,QACA,SAAU,CAAA,cAAA;AAAA,QACV,MAAO,CAAA,KAAA;AAAA,QACP,MAAO,CAAA,MAAA;AAAA,QACP,CAAA;AAAA,QACA,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,MAAO,CAAA,QAAA;AAAA,OACX,CAAA;AAAA,KACJ;AAEA,IAAA,SAAA,CAAU,QAAQ,MAAO,CAAA,KAAA,CAAA;AACzB,IAAA,SAAA,CAAU,SAAS,MAAO,CAAA,MAAA,CAAA;AAAA,GAC9B;AACJ;;;;"}

View File

@@ -0,0 +1,36 @@
"use strict";
const glUploadBufferImageResource = {
id: "buffer",
upload(source, glTexture, gl) {
if (glTexture.width === source.width || glTexture.height === source.height) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
source.width,
source.height,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
source.width,
source.height,
0,
glTexture.format,
glTexture.type,
source.resource
);
}
glTexture.width = source.width;
glTexture.height = source.height;
}
};
export { glUploadBufferImageResource };
//# sourceMappingURL=glUploadBufferImageResource.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"glUploadBufferImageResource.mjs","sources":["../../../../../../src/rendering/renderers/gl/texture/uploaders/glUploadBufferImageResource.ts"],"sourcesContent":["import type { TextureSource } from '../../../shared/texture/sources/TextureSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nexport const glUploadBufferImageResource = {\n\n id: 'buffer',\n\n upload(source: TextureSource, glTexture: GlTexture, gl: GlRenderingContext)\n {\n if (glTexture.width === source.width || glTexture.height === source.height)\n {\n gl.texSubImage2D(\n gl.TEXTURE_2D,\n 0,\n 0,\n 0,\n source.width,\n source.height,\n glTexture.format,\n glTexture.type,\n source.resource\n );\n }\n else\n {\n gl.texImage2D(\n glTexture.target,\n 0,\n glTexture.internalFormat,\n source.width,\n source.height,\n 0,\n glTexture.format,\n glTexture.type,\n source.resource\n );\n }\n\n glTexture.width = source.width;\n glTexture.height = source.height;\n }\n} as GLTextureUploader;\n\n"],"names":[],"mappings":";AAKO,MAAM,2BAA8B,GAAA;AAAA,EAEvC,EAAI,EAAA,QAAA;AAAA,EAEJ,MAAA,CAAO,MAAuB,EAAA,SAAA,EAAsB,EACpD,EAAA;AACI,IAAA,IAAI,UAAU,KAAU,KAAA,MAAA,CAAO,SAAS,SAAU,CAAA,MAAA,KAAW,OAAO,MACpE,EAAA;AACI,MAAG,EAAA,CAAA,aAAA;AAAA,QACC,EAAG,CAAA,UAAA;AAAA,QACH,CAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QACA,MAAO,CAAA,KAAA;AAAA,QACP,MAAO,CAAA,MAAA;AAAA,QACP,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,MAAO,CAAA,QAAA;AAAA,OACX,CAAA;AAAA,KAGJ,MAAA;AACI,MAAG,EAAA,CAAA,UAAA;AAAA,QACC,SAAU,CAAA,MAAA;AAAA,QACV,CAAA;AAAA,QACA,SAAU,CAAA,cAAA;AAAA,QACV,MAAO,CAAA,KAAA;AAAA,QACP,MAAO,CAAA,MAAA;AAAA,QACP,CAAA;AAAA,QACA,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,MAAO,CAAA,QAAA;AAAA,OACX,CAAA;AAAA,KACJ;AAEA,IAAA,SAAA,CAAU,QAAQ,MAAO,CAAA,KAAA,CAAA;AACzB,IAAA,SAAA,CAAU,SAAS,MAAO,CAAA,MAAA,CAAA;AAAA,GAC9B;AACJ;;;;"}

View File

@@ -0,0 +1,2 @@
import type { GLTextureUploader } from './GLTextureUploader';
export declare const glUploadCompressedTextureResource: GLTextureUploader;

View File

@@ -0,0 +1,101 @@
'use strict';
"use strict";
const compressedFormatMap = {
"bc1-rgba-unorm": true,
"bc1-rgba-unorm-srgb": true,
"bc2-rgba-unorm": true,
"bc2-rgba-unorm-srgb": true,
"bc3-rgba-unorm": true,
"bc3-rgba-unorm-srgb": true,
"bc4-r-unorm": true,
"bc4-r-snorm": true,
"bc5-rg-unorm": true,
"bc5-rg-snorm": true,
"bc6h-rgb-ufloat": true,
"bc6h-rgb-float": true,
"bc7-rgba-unorm": true,
"bc7-rgba-unorm-srgb": true,
// ETC2 compressed formats usable if "texture-compression-etc2" is both
// supported by the device/user agent and enabled in requestDevice.
"etc2-rgb8unorm": true,
"etc2-rgb8unorm-srgb": true,
"etc2-rgb8a1unorm": true,
"etc2-rgb8a1unorm-srgb": true,
"etc2-rgba8unorm": true,
"etc2-rgba8unorm-srgb": true,
"eac-r11unorm": true,
"eac-r11snorm": true,
"eac-rg11unorm": true,
"eac-rg11snorm": true,
// ASTC compressed formats usable if "texture-compression-astc" is both
// supported by the device/user agent and enabled in requestDevice.
"astc-4x4-unorm": true,
"astc-4x4-unorm-srgb": true,
"astc-5x4-unorm": true,
"astc-5x4-unorm-srgb": true,
"astc-5x5-unorm": true,
"astc-5x5-unorm-srgb": true,
"astc-6x5-unorm": true,
"astc-6x5-unorm-srgb": true,
"astc-6x6-unorm": true,
"astc-6x6-unorm-srgb": true,
"astc-8x5-unorm": true,
"astc-8x5-unorm-srgb": true,
"astc-8x6-unorm": true,
"astc-8x6-unorm-srgb": true,
"astc-8x8-unorm": true,
"astc-8x8-unorm-srgb": true,
"astc-10x5-unorm": true,
"astc-10x5-unorm-srgb": true,
"astc-10x6-unorm": true,
"astc-10x6-unorm-srgb": true,
"astc-10x8-unorm": true,
"astc-10x8-unorm-srgb": true,
"astc-10x10-unorm": true,
"astc-10x10-unorm-srgb": true,
"astc-12x10-unorm": true,
"astc-12x10-unorm-srgb": true,
"astc-12x12-unorm": true,
"astc-12x12-unorm-srgb": true
};
const glUploadCompressedTextureResource = {
id: "compressed",
upload(source, glTexture, gl) {
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
let mipWidth = source.pixelWidth;
let mipHeight = source.pixelHeight;
const compressed = !!compressedFormatMap[source.format];
for (let i = 0; i < source.resource.length; i++) {
const levelBuffer = source.resource[i];
if (compressed) {
gl.compressedTexImage2D(
gl.TEXTURE_2D,
i,
glTexture.internalFormat,
mipWidth,
mipHeight,
0,
levelBuffer
);
} else {
gl.texImage2D(
gl.TEXTURE_2D,
i,
glTexture.internalFormat,
mipWidth,
mipHeight,
0,
glTexture.format,
glTexture.type,
levelBuffer
);
}
mipWidth = Math.max(mipWidth >> 1, 1);
mipHeight = Math.max(mipHeight >> 1, 1);
}
}
};
exports.glUploadCompressedTextureResource = glUploadCompressedTextureResource;
//# sourceMappingURL=glUploadCompressedTextureResource.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,99 @@
"use strict";
const compressedFormatMap = {
"bc1-rgba-unorm": true,
"bc1-rgba-unorm-srgb": true,
"bc2-rgba-unorm": true,
"bc2-rgba-unorm-srgb": true,
"bc3-rgba-unorm": true,
"bc3-rgba-unorm-srgb": true,
"bc4-r-unorm": true,
"bc4-r-snorm": true,
"bc5-rg-unorm": true,
"bc5-rg-snorm": true,
"bc6h-rgb-ufloat": true,
"bc6h-rgb-float": true,
"bc7-rgba-unorm": true,
"bc7-rgba-unorm-srgb": true,
// ETC2 compressed formats usable if "texture-compression-etc2" is both
// supported by the device/user agent and enabled in requestDevice.
"etc2-rgb8unorm": true,
"etc2-rgb8unorm-srgb": true,
"etc2-rgb8a1unorm": true,
"etc2-rgb8a1unorm-srgb": true,
"etc2-rgba8unorm": true,
"etc2-rgba8unorm-srgb": true,
"eac-r11unorm": true,
"eac-r11snorm": true,
"eac-rg11unorm": true,
"eac-rg11snorm": true,
// ASTC compressed formats usable if "texture-compression-astc" is both
// supported by the device/user agent and enabled in requestDevice.
"astc-4x4-unorm": true,
"astc-4x4-unorm-srgb": true,
"astc-5x4-unorm": true,
"astc-5x4-unorm-srgb": true,
"astc-5x5-unorm": true,
"astc-5x5-unorm-srgb": true,
"astc-6x5-unorm": true,
"astc-6x5-unorm-srgb": true,
"astc-6x6-unorm": true,
"astc-6x6-unorm-srgb": true,
"astc-8x5-unorm": true,
"astc-8x5-unorm-srgb": true,
"astc-8x6-unorm": true,
"astc-8x6-unorm-srgb": true,
"astc-8x8-unorm": true,
"astc-8x8-unorm-srgb": true,
"astc-10x5-unorm": true,
"astc-10x5-unorm-srgb": true,
"astc-10x6-unorm": true,
"astc-10x6-unorm-srgb": true,
"astc-10x8-unorm": true,
"astc-10x8-unorm-srgb": true,
"astc-10x10-unorm": true,
"astc-10x10-unorm-srgb": true,
"astc-12x10-unorm": true,
"astc-12x10-unorm-srgb": true,
"astc-12x12-unorm": true,
"astc-12x12-unorm-srgb": true
};
const glUploadCompressedTextureResource = {
id: "compressed",
upload(source, glTexture, gl) {
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
let mipWidth = source.pixelWidth;
let mipHeight = source.pixelHeight;
const compressed = !!compressedFormatMap[source.format];
for (let i = 0; i < source.resource.length; i++) {
const levelBuffer = source.resource[i];
if (compressed) {
gl.compressedTexImage2D(
gl.TEXTURE_2D,
i,
glTexture.internalFormat,
mipWidth,
mipHeight,
0,
levelBuffer
);
} else {
gl.texImage2D(
gl.TEXTURE_2D,
i,
glTexture.internalFormat,
mipWidth,
mipHeight,
0,
glTexture.format,
glTexture.type,
levelBuffer
);
}
mipWidth = Math.max(mipWidth >> 1, 1);
mipHeight = Math.max(mipHeight >> 1, 1);
}
}
};
export { glUploadCompressedTextureResource };
//# sourceMappingURL=glUploadCompressedTextureResource.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import type { GLTextureUploader } from './GLTextureUploader';
export declare const glUploadImageResource: GLTextureUploader;

View File

@@ -0,0 +1,90 @@
'use strict';
"use strict";
const glUploadImageResource = {
id: "image",
upload(source, glTexture, gl, webGLVersion) {
const premultipliedAlpha = source.alphaMode === "premultiply-alpha-on-upload";
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultipliedAlpha);
const glWidth = glTexture.width;
const glHeight = glTexture.height;
const textureWidth = source.pixelWidth;
const textureHeight = source.pixelHeight;
const resourceWidth = source.resourceWidth;
const resourceHeight = source.resourceHeight;
if (resourceWidth < textureWidth || resourceHeight < textureHeight) {
if (glWidth !== textureWidth || glHeight !== textureHeight) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
textureWidth,
textureHeight,
0,
glTexture.format,
glTexture.type,
null
);
}
if (webGLVersion === 2) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
resourceWidth,
resourceHeight,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
glTexture.format,
glTexture.type,
source.resource
);
}
} else if (glWidth === textureWidth || glHeight === textureHeight) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
glTexture.format,
glTexture.type,
source.resource
);
} else if (webGLVersion === 2) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
textureWidth,
textureHeight,
0,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
glTexture.format,
glTexture.type,
source.resource
);
}
glTexture.width = textureWidth;
glTexture.height = textureHeight;
}
};
exports.glUploadImageResource = glUploadImageResource;
//# sourceMappingURL=glUploadImageResource.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,88 @@
"use strict";
const glUploadImageResource = {
id: "image",
upload(source, glTexture, gl, webGLVersion) {
const premultipliedAlpha = source.alphaMode === "premultiply-alpha-on-upload";
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultipliedAlpha);
const glWidth = glTexture.width;
const glHeight = glTexture.height;
const textureWidth = source.pixelWidth;
const textureHeight = source.pixelHeight;
const resourceWidth = source.resourceWidth;
const resourceHeight = source.resourceHeight;
if (resourceWidth < textureWidth || resourceHeight < textureHeight) {
if (glWidth !== textureWidth || glHeight !== textureHeight) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
textureWidth,
textureHeight,
0,
glTexture.format,
glTexture.type,
null
);
}
if (webGLVersion === 2) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
resourceWidth,
resourceHeight,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
glTexture.format,
glTexture.type,
source.resource
);
}
} else if (glWidth === textureWidth || glHeight === textureHeight) {
gl.texSubImage2D(
gl.TEXTURE_2D,
0,
0,
0,
glTexture.format,
glTexture.type,
source.resource
);
} else if (webGLVersion === 2) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
textureWidth,
textureHeight,
0,
glTexture.format,
glTexture.type,
source.resource
);
} else {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
glTexture.format,
glTexture.type,
source.resource
);
}
glTexture.width = textureWidth;
glTexture.height = textureHeight;
}
};
export { glUploadImageResource };
//# sourceMappingURL=glUploadImageResource.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import type { GLTextureUploader } from './GLTextureUploader';
export declare const glUploadVideoResource: GLTextureUploader;

View File

@@ -0,0 +1,28 @@
'use strict';
var glUploadImageResource = require('./glUploadImageResource.js');
"use strict";
const glUploadVideoResource = {
id: "video",
upload(source, glTexture, gl, webGLVersion) {
if (!source.isValid) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
1,
1,
0,
glTexture.format,
glTexture.type,
null
);
return;
}
glUploadImageResource.glUploadImageResource.upload(source, glTexture, gl, webGLVersion);
}
};
exports.glUploadVideoResource = glUploadVideoResource;
//# sourceMappingURL=glUploadVideoResource.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"glUploadVideoResource.js","sources":["../../../../../../src/rendering/renderers/gl/texture/uploaders/glUploadVideoResource.ts"],"sourcesContent":["import { glUploadImageResource } from './glUploadImageResource';\n\nimport type { VideoSource } from '../../../shared/texture/sources/VideoSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nexport const glUploadVideoResource = {\n\n id: 'video',\n\n upload(source: VideoSource, glTexture: GlTexture, gl: GlRenderingContext, webGLVersion: number)\n {\n if (!source.isValid)\n {\n gl.texImage2D(\n glTexture.target,\n 0,\n glTexture.internalFormat,\n 1,\n 1,\n 0,\n glTexture.format,\n glTexture.type,\n null\n );\n\n return;\n }\n\n glUploadImageResource.upload(source, glTexture, gl, webGLVersion);\n }\n} as GLTextureUploader;\n\n"],"names":["glUploadImageResource"],"mappings":";;;;;AAOO,MAAM,qBAAwB,GAAA;AAAA,EAEjC,EAAI,EAAA,OAAA;AAAA,EAEJ,MAAO,CAAA,MAAA,EAAqB,SAAsB,EAAA,EAAA,EAAwB,YAC1E,EAAA;AACI,IAAI,IAAA,CAAC,OAAO,OACZ,EAAA;AACI,MAAG,EAAA,CAAA,UAAA;AAAA,QACC,SAAU,CAAA,MAAA;AAAA,QACV,CAAA;AAAA,QACA,SAAU,CAAA,cAAA;AAAA,QACV,CAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QACA,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,IAAA;AAAA,OACJ,CAAA;AAEA,MAAA,OAAA;AAAA,KACJ;AAEA,IAAAA,2CAAA,CAAsB,MAAO,CAAA,MAAA,EAAQ,SAAW,EAAA,EAAA,EAAI,YAAY,CAAA,CAAA;AAAA,GACpE;AACJ;;;;"}

View File

@@ -0,0 +1,26 @@
import { glUploadImageResource } from './glUploadImageResource.mjs';
"use strict";
const glUploadVideoResource = {
id: "video",
upload(source, glTexture, gl, webGLVersion) {
if (!source.isValid) {
gl.texImage2D(
glTexture.target,
0,
glTexture.internalFormat,
1,
1,
0,
glTexture.format,
glTexture.type,
null
);
return;
}
glUploadImageResource.upload(source, glTexture, gl, webGLVersion);
}
};
export { glUploadVideoResource };
//# sourceMappingURL=glUploadVideoResource.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"glUploadVideoResource.mjs","sources":["../../../../../../src/rendering/renderers/gl/texture/uploaders/glUploadVideoResource.ts"],"sourcesContent":["import { glUploadImageResource } from './glUploadImageResource';\n\nimport type { VideoSource } from '../../../shared/texture/sources/VideoSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nexport const glUploadVideoResource = {\n\n id: 'video',\n\n upload(source: VideoSource, glTexture: GlTexture, gl: GlRenderingContext, webGLVersion: number)\n {\n if (!source.isValid)\n {\n gl.texImage2D(\n glTexture.target,\n 0,\n glTexture.internalFormat,\n 1,\n 1,\n 0,\n glTexture.format,\n glTexture.type,\n null\n );\n\n return;\n }\n\n glUploadImageResource.upload(source, glTexture, gl, webGLVersion);\n }\n} as GLTextureUploader;\n\n"],"names":[],"mappings":";;;AAOO,MAAM,qBAAwB,GAAA;AAAA,EAEjC,EAAI,EAAA,OAAA;AAAA,EAEJ,MAAO,CAAA,MAAA,EAAqB,SAAsB,EAAA,EAAA,EAAwB,YAC1E,EAAA;AACI,IAAI,IAAA,CAAC,OAAO,OACZ,EAAA;AACI,MAAG,EAAA,CAAA,UAAA;AAAA,QACC,SAAU,CAAA,MAAA;AAAA,QACV,CAAA;AAAA,QACA,SAAU,CAAA,cAAA;AAAA,QACV,CAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QACA,SAAU,CAAA,MAAA;AAAA,QACV,SAAU,CAAA,IAAA;AAAA,QACV,IAAA;AAAA,OACJ,CAAA;AAEA,MAAA,OAAA;AAAA,KACJ;AAEA,IAAA,qBAAA,CAAsB,MAAO,CAAA,MAAA,EAAQ,SAAW,EAAA,EAAA,EAAI,YAAY,CAAA,CAAA;AAAA,GACpE;AACJ;;;;"}