[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本

This commit is contained in:
SmallMain
2023-10-30 22:32:32 +08:00
parent 2508616ad9
commit 0092eb9f05
787 changed files with 206249 additions and 422 deletions

View File

@@ -244,6 +244,38 @@ export enum GFXFormat {
PVRTC_RGBA4,
PVRTC2_2BPP,
PVRTC2_4BPP,
// ASTC (Adaptive Scalable Texture Compression)
ASTC_RGBA_4x4,
ASTC_RGBA_5x4,
ASTC_RGBA_5x5,
ASTC_RGBA_6x5,
ASTC_RGBA_6x6,
ASTC_RGBA_8x5,
ASTC_RGBA_8x6,
ASTC_RGBA_8x8,
ASTC_RGBA_10x5,
ASTC_RGBA_10x6,
ASTC_RGBA_10x8,
ASTC_RGBA_10x10,
ASTC_RGBA_12x10,
ASTC_RGBA_12x12,
// ASTC (Adaptive Scalable Texture Compression) SRGB
ASTC_SRGBA_4x4,
ASTC_SRGBA_5x4,
ASTC_SRGBA_5x5,
ASTC_SRGBA_6x5,
ASTC_SRGBA_6x6,
ASTC_SRGBA_8x5,
ASTC_SRGBA_8x6,
ASTC_SRGBA_8x8,
ASTC_SRGBA_10x5,
ASTC_SRGBA_10x6,
ASTC_SRGBA_10x8,
ASTC_SRGBA_10x10,
ASTC_SRGBA_12x10,
ASTC_SRGBA_12x12,
}
export enum GFXBufferUsageBit {
@@ -692,6 +724,36 @@ export const GFXFormatInfos: IGFXFormatInfo[] = [
{ name: 'PVRTC_RGBA4', size: 2, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'PVRTC2_2BPP', size: 2, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'PVRTC2_4BPP', size: 2, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_4x4', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_5x4', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_5x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_6x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_6x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_8x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_8x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_8x8', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_10x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_10x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_10x8', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_10x10', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_12x10', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_RGBA_12x12', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_4x4', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_5x4', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_5x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_6x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_6x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_8x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_8x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_8x8', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_10x5', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_10x6', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_10x8', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_10x10', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_12x10', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
{ name: 'ASTC_SRGBA_12x12', size: 1, count: 4, isFloating: false, hasAlpha: true, hasDepth: false, hasStencil: false, isCompressed: true },
];
// tslint:enable: max-line-length
@@ -742,6 +804,49 @@ export function GFXFormatSize (format: GFXFormat, width: number, height: number,
case GFXFormat.PVRTC2_4BPP:
return Math.ceil(Math.max(width, 16) * Math.max(height, 8) / 2) * depth;
case GFXFormat.ASTC_RGBA_4x4:
case GFXFormat.ASTC_SRGBA_4x4:
return Math.ceil(width / 4) * Math.ceil(height / 4) * 16 * depth;
case GFXFormat.ASTC_RGBA_5x4:
case GFXFormat.ASTC_SRGBA_5x4:
return Math.ceil(width / 5) * Math.ceil(height / 4) * 16 * depth;
case GFXFormat.ASTC_RGBA_5x5:
case GFXFormat.ASTC_SRGBA_5x5:
return Math.ceil(width / 5) * Math.ceil(height / 5) * 16 * depth;
case GFXFormat.ASTC_RGBA_6x5:
case GFXFormat.ASTC_SRGBA_6x5:
return Math.ceil(width / 6) * Math.ceil(height / 5) * 16 * depth;
case GFXFormat.ASTC_RGBA_6x6:
case GFXFormat.ASTC_SRGBA_6x6:
return Math.ceil(width / 6) * Math.ceil(height / 6) * 16 * depth;
case GFXFormat.ASTC_RGBA_8x5:
case GFXFormat.ASTC_SRGBA_8x5:
return Math.ceil(width / 8) * Math.ceil(height / 5) * 16 * depth;
case GFXFormat.ASTC_RGBA_8x6:
case GFXFormat.ASTC_SRGBA_8x6:
return Math.ceil(width / 8) * Math.ceil(height / 6) * 16 * depth;
case GFXFormat.ASTC_RGBA_8x8:
case GFXFormat.ASTC_SRGBA_8x8:
return Math.ceil(width / 8) * Math.ceil(height / 8) * 16 * depth;
case GFXFormat.ASTC_RGBA_10x5:
case GFXFormat.ASTC_SRGBA_10x5:
return Math.ceil(width / 10) * Math.ceil(height / 5) * 16 * depth;
case GFXFormat.ASTC_RGBA_10x6:
case GFXFormat.ASTC_SRGBA_10x6:
return Math.ceil(width / 10) * Math.ceil(height / 6) * 16 * depth;
case GFXFormat.ASTC_RGBA_10x8:
case GFXFormat.ASTC_SRGBA_10x8:
return Math.ceil(width / 10) * Math.ceil(height / 8) * 16 * depth;
case GFXFormat.ASTC_RGBA_10x10:
case GFXFormat.ASTC_SRGBA_10x10:
return Math.ceil(width / 10) * Math.ceil(height / 10) * 16 * depth;
case GFXFormat.ASTC_RGBA_12x10:
case GFXFormat.ASTC_SRGBA_12x10:
return Math.ceil(width / 12) * Math.ceil(height / 10) * 16 * depth;
case GFXFormat.ASTC_RGBA_12x12:
case GFXFormat.ASTC_SRGBA_12x12:
return Math.ceil(width / 12) * Math.ceil(height / 12) * 16 * depth;
default: {
return 0;
}

View File

@@ -91,6 +91,38 @@ const enums = {
TEXTURE_FMT_RGB_ETC2: 28,
TEXTURE_FMT_RGBA_ETC2: 29,
// astc format (Adaptive Scalable Texture Compression)
TEXTURE_FMT_RGBA_ASTC_4X4: 30,
TEXTURE_FMT_RGBA_ASTC_5X4: 31,
TEXTURE_FMT_RGBA_ASTC_5X5: 32,
TEXTURE_FMT_RGBA_ASTC_6X5: 33,
TEXTURE_FMT_RGBA_ASTC_6X6: 34,
TEXTURE_FMT_RGBA_ASTC_8X5: 35,
TEXTURE_FMT_RGBA_ASTC_8X6: 36,
TEXTURE_FMT_RGBA_ASTC_8X8: 37,
TEXTURE_FMT_RGBA_ASTC_10X5: 38,
TEXTURE_FMT_RGBA_ASTC_10X6: 39,
TEXTURE_FMT_RGBA_ASTC_10X8: 40,
TEXTURE_FMT_RGBA_ASTC_10X10: 41,
TEXTURE_FMT_RGBA_ASTC_12X10: 42,
TEXTURE_FMT_RGBA_ASTC_12X12: 43,
// astc format (Adaptive Scalable Texture Compression) SRGB
TEXTURE_FMT_SRGBA_ASTC_4X4: 44,
TEXTURE_FMT_SRGBA_ASTC_5X4: 45,
TEXTURE_FMT_SRGBA_ASTC_5X5: 46,
TEXTURE_FMT_SRGBA_ASTC_6X5: 47,
TEXTURE_FMT_SRGBA_ASTC_6X6: 48,
TEXTURE_FMT_SRGBA_ASTC_8X5: 49,
TEXTURE_FMT_SRGBA_ASTC_8X6: 50,
TEXTURE_FMT_SRGBA_ASTC_8X8: 51,
TEXTURE_FMT_SRGBA_ASTC_10X5: 52,
TEXTURE_FMT_SRGBA_ASTC_10X6: 53,
TEXTURE_FMT_SRGBA_ASTC_10X8: 54,
TEXTURE_FMT_SRGBA_ASTC_10X10: 55,
TEXTURE_FMT_SRGBA_ASTC_12X10: 56,
TEXTURE_FMT_SRGBA_ASTC_12X12: 57,
// depth and stencil function
DS_FUNC_NEVER: 512, // gl.NEVER
DS_FUNC_LESS: 513, // gl.LESS
@@ -449,6 +481,38 @@ var GFXFormat;
GFXFormat[GFXFormat["PVRTC_RGBA4"] = 89] = "PVRTC_RGBA4";
GFXFormat[GFXFormat["PVRTC2_2BPP"] = 90] = "PVRTC2_2BPP";
GFXFormat[GFXFormat["PVRTC2_4BPP"] = 91] = "PVRTC2_4BPP";
// ASTC (Adaptive Scalable Texture Compression)
GFXFormat[GFXFormat["ASTC_RGBA_4x4"] = 92] = "ASTC_RGBA_4x4";
GFXFormat[GFXFormat["ASTC_RGBA_5x4"] = 92] = "ASTC_RGBA_5x4";
GFXFormat[GFXFormat["ASTC_RGBA_5x5"] = 92] = "ASTC_RGBA_5x5";
GFXFormat[GFXFormat["ASTC_RGBA_6x5"] = 92] = "ASTC_RGBA_6x5";
GFXFormat[GFXFormat["ASTC_RGBA_6x6"] = 92] = "ASTC_RGBA_6x6";
GFXFormat[GFXFormat["ASTC_RGBA_8x5"] = 92] = "ASTC_RGBA_8x5";
GFXFormat[GFXFormat["ASTC_RGBA_8x6"] = 92] = "ASTC_RGBA_8x6";
GFXFormat[GFXFormat["ASTC_RGBA_8x8"] = 92] = "ASTC_RGBA_8x8";
GFXFormat[GFXFormat["ASTC_RGBA_10x5"] = 92] = "ASTC_RGBA_10x5";
GFXFormat[GFXFormat["ASTC_RGBA_10x6"] = 92] = "ASTC_RGBA_10x6";
GFXFormat[GFXFormat["ASTC_RGBA_10x8"] = 92] = "ASTC_RGBA_10x8";
GFXFormat[GFXFormat["ASTC_RGBA_10x10"] = 92] = "ASTC_RGBA_10x10";
GFXFormat[GFXFormat["ASTC_RGBA_12x10"] = 92] = "ASTC_RGBA_12x10";
GFXFormat[GFXFormat["ASTC_RGBA_12x12"] = 92] = "ASTC_RGBA_12x12";
// ASTC (Adaptive Scalable Texture Compression) SRGB
GFXFormat[GFXFormat["ASTC_SRGBA_4x4"] = 92] = "ASTC_SRGBA_4x4";
GFXFormat[GFXFormat["ASTC_SRGBA_5x4"] = 92] = "ASTC_SRGBA_5x4";
GFXFormat[GFXFormat["ASTC_SRGBA_5x5"] = 92] = "ASTC_SRGBA_5x5";
GFXFormat[GFXFormat["ASTC_SRGBA_6x5"] = 92] = "ASTC_SRGBA_6x5";
GFXFormat[GFXFormat["ASTC_SRGBA_6x6"] = 92] = "ASTC_SRGBA_6x6";
GFXFormat[GFXFormat["ASTC_SRGBA_8x5"] = 92] = "ASTC_SRGBA_8x5";
GFXFormat[GFXFormat["ASTC_SRGBA_8x6"] = 92] = "ASTC_SRGBA_8x6";
GFXFormat[GFXFormat["ASTC_SRGBA_8x8"] = 92] = "ASTC_SRGBA_8x8";
GFXFormat[GFXFormat["ASTC_SRGBA_10x5"] = 92] = "ASTC_SRGBA_10x5";
GFXFormat[GFXFormat["ASTC_SRGBA_10x6"] = 92] = "ASTC_SRGBA_10x6";
GFXFormat[GFXFormat["ASTC_SRGBA_10x8"] = 92] = "ASTC_SRGBA_10x8";
GFXFormat[GFXFormat["ASTC_SRGBA_10x10"] = 92] = "ASTC_SRGBA_10x10";
GFXFormat[GFXFormat["ASTC_SRGBA_12x10"] = 92] = "ASTC_SRGBA_12x10";
GFXFormat[GFXFormat["ASTC_SRGBA_12x12"] = 92] = "ASTC_SRGBA_12x12";
})(GFXFormat || (GFXFormat = {}));
var GFXBufferUsageBit;
(function (GFXBufferUsageBit) {