Skip to content

Commit 8e95c28

Browse files
committed
test ci
1 parent 411f98d commit 8e95c28

32 files changed

Lines changed: 161 additions & 687 deletions

File tree

.github/workflows/generate-oh-sdk-cache.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
id: cache-oh-sdk
2323
uses: actions/cache@v4
2424
env:
25-
cache-name: cache-oh-sdk-21
25+
cache-name: cache-oh-sdk-15
2626
with:
2727
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
2828
key: ${{ runner.os }}-build-${{ env.cache-name }}
@@ -33,11 +33,11 @@ jobs:
3333
run: |
3434
if [ ! -d "$HOME/openharmony" ]; then
3535
mkdir -p $HOME/openharmony
36-
echo "Download commandline-tools-linux-x64-6.0.1.246.zip ..."
37-
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.001
38-
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.002
39-
echo "Unzip commandline-tools-linux-x64-6.0.1.246.zip ..."
40-
7z x commandline-tools-linux-x64-6.0.1.246.zip.001 -o$HOME/openharmony > /dev/null
36+
echo "Download commandline-tools-linux-x64-5.0.13.200.zip ..."
37+
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-15/commandline-tools-linux-x64-5.0.13.200.zip.001
38+
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-15/commandline-tools-linux-x64-5.0.13.200.zip.002
39+
echo "Unzip commandline-tools-linux-x64-5.0.13.200.zip ..."
40+
7z x commandline-tools-linux-x64-5.0.13.200.zip.001 -o$HOME/openharmony > /dev/null
4141
cd $HOME/openharmony
4242
ls -l
4343
cd command-line-tools

.github/workflows/native-compile-platforms.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ jobs:
296296
297297
- name: Install libgl1
298298
run: |
299-
sudo apt-get update
300299
sudo apt-get install -y libgl1
301300
302301
- name: Checking libGL.so.1
@@ -329,7 +328,7 @@ jobs:
329328
id: cache-oh-sdk
330329
uses: actions/cache@v4
331330
env:
332-
cache-name: cache-oh-sdk-21
331+
cache-name: cache-oh-sdk-13
333332
with:
334333
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
335334
key: ${{ runner.os }}-build-${{ env.cache-name }}
@@ -348,11 +347,11 @@ jobs:
348347
run: |
349348
if [ ! -d "$HOME/openharmony" ]; then
350349
mkdir -p $HOME/openharmony
351-
echo "Download commandline-tools-linux-x64-6.0.1.246.zip ..."
352-
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.001
353-
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-21/commandline-tools-linux-x64-6.0.1.246.zip.002
354-
echo "Unzip commandline-tools-linux-x64-6.0.1.246.zip ..."
355-
7z x commandline-tools-linux-x64-6.0.1.246.zip.001 -o$HOME/openharmony > /dev/null
350+
echo "Download commandline-tools-linux-x64-5.0.13.200.zip ..."
351+
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-15/commandline-tools-linux-x64-5.0.13.200.zip.001
352+
wget -q https://github.com/cocos/oh-sdk-for-ci/releases/download/api-15/commandline-tools-linux-x64-5.0.13.200.zip.002
353+
echo "Unzip commandline-tools-linux-x64-5.0.13.200.zip ..."
354+
7z x commandline-tools-linux-x64-5.0.13.200.zip.001 -o$HOME/openharmony > /dev/null
356355
cd $HOME/openharmony
357356
ls -l
358357
cd command-line-tools

cocos/2d/components/label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ export class Label extends UIRenderer {
10271027
if (!this.renderData) {
10281028
if (this._assembler && this._assembler.createData) {
10291029
this._renderData = this._assembler.createData(this) as RenderData;
1030-
this.renderData!.material = this.getRenderMaterial(0);
1030+
this.renderData!.material = this.material;
10311031
this._updateColor();
10321032
}
10331033
}

cocos/2d/components/sprite.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
import { ccclass, help, executionOrder, menu, tooltip, displayOrder, type, range, editable, serializable, visible } from 'cc.decorator';
27-
import { BUILD, JSB, EDITOR } from 'internal:constants';
27+
import { BUILD, EDITOR } from 'internal:constants';
2828
import { SpriteAtlas } from '../assets/sprite-atlas';
2929
import { SpriteFrame, SpriteFrameEvent } from '../assets/sprite-frame';
3030
import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr';
@@ -703,7 +703,6 @@ export class Sprite extends UIRenderer {
703703
}
704704
if (textureChanged) {
705705
if (self.renderData) self.renderData.textureDirty = true;
706-
if (JSB) this._colorDirty();
707706
// texture type changed, set this._instanceMaterialType to default value
708707
const oldIsRT = oldFrame ? oldFrame.texture instanceof RenderTexture : false;
709708
const newIsRT = spriteFrame.texture instanceof RenderTexture;

cocos/2d/framework/ui-renderer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ export class UIRenderer extends Renderer {
398398
this.node.off(NodeEventType.ANCHOR_CHANGED, this._nodeStateChange, this);
399399
this.node.off(NodeEventType.SIZE_CHANGED, this._nodeStateChange, this);
400400
this.node.off(NodeEventType.PARENT_CHANGED, this._colorDirty, this);
401-
this.destroyRenderData();
401+
// When disabling, it is necessary to free up idle space to fully utilize chunks
402+
// and avoid breaking batch processing.
403+
this._destroyData();
402404
uiRendererManager.removeRenderer(this);
403405
this._renderFlag = false;
404406
this._renderEntity.enabled = false;
@@ -542,8 +544,10 @@ export class UIRenderer extends Renderer {
542544
}
543545

544546
protected _updateColor (): void {
545-
this._colorDirty();
547+
this.node._uiProps.colorDirty = true;
548+
this.setEntityColorDirty(true);
546549
this.setEntityColor(this._color);
550+
547551
const assembler = this._assembler;
548552
if (assembler) {
549553
if (assembler.updateColor) {

cocos/2d/renderer/mesh-buffer.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
import { JSB } from 'internal:constants';
26-
import { Device, BufferUsageBit, MemoryUsageBit, Attribute, Buffer, BufferInfo, InputAssembler, InputAssemblerInfo, Feature, API } from '../../gfx';
26+
import { Device, BufferUsageBit, MemoryUsageBit, Attribute, Buffer, BufferInfo, InputAssembler, InputAssemblerInfo } from '../../gfx';
2727
import { getAttributeStride } from './vertex-format';
2828
import { sys, getError, warnID, assertIsTrue } from '../../core';
2929
import { NativeUIMeshBuffer } from './native-2d';
@@ -251,12 +251,7 @@ export class MeshBuffer {
251251

252252
this.floatsPerVertex = getAttributeStride(attrs) >> 2;
253253

254-
var vDataCountLimit = 65536; // 2^16 - 1
255-
const glApi = device.gfxAPI;
256-
if (glApi === API.WEBGPU || glApi === API.WEBGL2 || glApi === API.WEBGL && device.hasFeature(Feature.ELEMENT_INDEX_UINT)) {
257-
vDataCountLimit = 4294967295; // 2^32 - 1
258-
}
259-
assertIsTrue(this._initVDataCount / this._floatsPerVertex < vDataCountLimit, getError(9005));
254+
assertIsTrue(this._initVDataCount / this._floatsPerVertex < 65536, getError(9005));
260255

261256
if (!this.vData || !this.iData) {
262257
this.vData = new Float32Array(this._initVDataCount);

cocos/asset/assets/image-asset.jsb.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ imageAssetProto._setRawAsset = function (filename: string, inLibrary = true) {
125125
imageAssetProto.reset = function (data: any) {
126126
this._nativeData = data;
127127

128-
if (data.format !== undefined && !this.isFormatFixed()) {
129-
this.format = (data as any).format;
128+
if (!(data instanceof jsbWindow.HTMLElement)) {
129+
if(data.format !== undefined) {
130+
this.format = (data as any).format;
131+
}
130132
}
131133
this._syncDataToNative();
132134
};
@@ -265,7 +267,8 @@ imageAssetProto._deserialize = function (data: any) {
265267

266268
if (ext) {
267269
this._setRawAsset(ext);
268-
this.setFixedFormat(format);
270+
this.format = format;
271+
// this._format = format;
269272
} else {
270273
warnID(3121);
271274
}

cocos/core/platform/macro.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,25 +1066,17 @@ interface Macro {
10661066
ENABLE_WEBGL_HIGHP_STRUCT_VALUES: boolean;
10671067

10681068
/**
1069-
* @zh Batcher2D 中每个渲染批次的内存增量(KB)
1070-
* 增大此值能使参与渲染合批的 2d 渲染组件数量增加,但是每次增加渲染批次的内存增量也会变大。
1071-
* 这个值决定每个 2D 渲染批次的顶点数量,计算公式为 vCount = Math.floor(macro.BATCHER2D_MEM_INCREMENT * 1024 / 9 * 4);
1072-
* WebGL2 & WebGPU 等渲染后端的最大顶点数量通常是 2^32 - 1,即 4294967295。
1073-
* WebGL1 渲染后端的最大顶点数量通常是 2^16 - 1,即 65535。引擎使用拓展 OES_element_index_uint 突破了这个限制,最大顶点数量也可达到 2^32 - 1。
1074-
* 所以 macro.BATCHER2D_MEM_INCREMENT 的理论最大值为 150994943,但是因为所运行平台的 js 引擎对 Float32Array|Uint16Array 的最大长度有限制,实际最大值往往会小于 2^32 - 1。
1075-
* 建议最大值不超过 1048576 kb (1GB),否则会因为 js 引擎的限制而导致 buffer 创建失败。
1076-
* @en Memory increment (KB) for each rendering batch in Batcher2D
1077-
* Increasing this value can increase the number of 2D rendering components involved in rendering batching, but the memory increment for each additional rendering batch will also become larger.
1078-
* This value determines the number of vertices in each 2D rendering batch, calculated as vCount = Math.floor(macro.BATCHER2D_MEM_INCREMENT * 1024 / 9 * 4);
1079-
* The maximum number of vertices for rendering backends such as WebGL2 & WebGPU is usually 2^32 - 1, which is 4294967295.
1080-
* The maximum number of vertices for the WebGL1 rendering backend is usually 2^16 - 1, which is 65535. The engine uses the extension OES_element_index_uint to break this limit, and the maximum number of vertices can also reach 2^32 - 1.
1081-
* Therefore, the theoretical maximum value of macro.BATCHER2D_MEM_INCREMENT is 150994943. However, due to the limitations of the JS engine on the maximum length of Float32Array|Uint16Array on the running platform, the actual maximum value is often less than 2^32 - 1.
1082-
* It is recommended that the maximum value does not exceed 1048576 kb (1GB); otherwise, buffer creation will fail due to JS engine limitations.
1083-
* @example
1084-
* ```typescript
1085-
* import { macro } from 'cc';
1086-
* macro.BATCHER2D_MEM_INCREMENT = 4096; //4096 KB
1087-
* ```
1069+
* @zh Batcher2D 中内存增量的大小(KB)
1070+
* 这个值决定了当场景中存在的 2d 渲染组件的顶点数量超过当前 batcher2D 中可容纳的顶点数量时,内存扩充的增加量
1071+
* 这个值越大,共用同一个 meshBuffer 的 2d 渲染组件数量会更多,但每次扩充所占用的内存也会更大
1072+
* 默认值在标准格式([[VertexFormat.vfmtPosUvColor]])下可容纳 4096 个顶点(4096*9*4/1024),你可以增加容量来提升每个批次可容纳的元素数量
1073+
* @en The MeshBuffer chunk size in Batcher2D (KB)
1074+
* This value determines the increase in memory expansion,
1075+
* when the number of vertices of 2d rendering components present in the scene exceeds the number of vertices,
1076+
* that can be accommodated in the current batcher2D.
1077+
* The larger this value is, the more 2d rendering components will share the same meshBuffer, but the more memory will be used for each expansion
1078+
* The default size can contain 4096 standard vertex ([[VertexFormat.vfmtPosUvColor]]) in one buffer,
1079+
* you can user larger buffer size to increase the elements count per 2d draw batch.
10881080
* @default 144 KB
10891081
*/
10901082
BATCHER2D_MEM_INCREMENT: number;

cocos/misc/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ export { ModelRenderer } from './model-renderer';
2929
export { Renderer } from './renderer';
3030
export { MissingScript } from './missing-script';
3131
export { PrefabLink } from './prefab-link';
32+
3233
/** deprecated */
3334
export * from './deprecated';

cocos/particle-2d/motion-streak-2d-assembler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ class MotionStreakAssembler implements IAssembler {
155155

156156
renderData.resize(vertexCount, indexCount); // resize
157157

158-
if (JSB && comp.texture) {
158+
if (JSB) {
159159
const indexCount = renderData.indexCount;
160160
this.createQuadIndices(comp, indexCount);
161161
renderData.chunk.setIndexBuffer(QUAD_INDICES!);
162162

163163
// Fill all dataList to vData
164164
this.updateWorldVertexAllData(comp);
165165

166-
renderData.updateRenderData(comp, comp.texture);
166+
renderData.updateRenderData(comp, comp.texture!);
167167
comp._markForUpdateRenderData();
168168
}
169169
}

0 commit comments

Comments
 (0)