Skip to content

Commit

Permalink
Continue 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Nov 25, 2024
1 parent db5df7c commit 201b9df
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 26 deletions.
10 changes: 5 additions & 5 deletions cocos/gfx/webgl/states/webgl-sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export class WebGLSampler extends Sampler {
const glWrapR = WebGLWraps[this._info.addressW];

this._gpuSampler = {
glMinFilter: glMinFilter,
glMagFilter: glMagFilter,
glWrapS: glWrapS,
glWrapT: glWrapT,
glWrapR: glWrapR,
glMinFilter,
glMagFilter,
glWrapS,
glWrapT,
glWrapR,
};
}
}
6 changes: 3 additions & 3 deletions cocos/gfx/webgl/webgl-descriptor-set-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export class WebGLDescriptorSetLayout extends DescriptorSetLayout {

this._gpuDescriptorSetLayout = {
bindings: this._bindings,
dynamicBindings: dynamicBindings,
descriptorIndices: descriptorIndices,
descriptorCount: descriptorCount,
dynamicBindings,
descriptorIndices,
descriptorCount,
};
}

Expand Down
4 changes: 2 additions & 2 deletions cocos/gfx/webgl/webgl-descriptor-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export class WebGLDescriptorSet extends DescriptorSet {

public initialize (info: Readonly<DescriptorSetInfo>): void {
this._layout = info.layout;
const { bindings: bindings, descriptorIndices: descriptorIndices, descriptorCount: descriptorCount } = (info.layout as WebGLDescriptorSetLayout).gpuDescriptorSetLayout;
const { bindings, descriptorIndices, descriptorCount } = (info.layout as WebGLDescriptorSetLayout).gpuDescriptorSetLayout;

this._buffers = Array(descriptorCount).fill(null);
this._textures = Array(descriptorCount).fill(null);
this._samplers = Array(descriptorCount).fill(null);

const gpuDescriptors: IWebGLGPUDescriptor[] = [];
this._gpuDescriptorSet = { gpuDescriptors: gpuDescriptors, descriptorIndices: descriptorIndices };
this._gpuDescriptorSet = { gpuDescriptors, descriptorIndices };

for (let i = 0; i < bindings.length; ++i) {
const binding = bindings[i];
Expand Down
6 changes: 3 additions & 3 deletions cocos/gfx/webgl/webgl-framebuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class WebGLFramebuffer extends Framebuffer {
let height = Number.MAX_SAFE_INTEGER;
this._gpuFramebuffer = {
gpuRenderPass: (info.renderPass as WebGLRenderPass).gpuRenderPass,
gpuColorTextures: gpuColorTextures,
gpuDepthStencilTexture: gpuDepthStencilTexture,
gpuColorTextures,
gpuDepthStencilTexture,
glFramebuffer: null,
isOffscreen: true,
get width (): number {
Expand All @@ -111,7 +111,7 @@ export class WebGLFramebuffer extends Framebuffer {
set height (val) {
height = val;
},
lodLevel: lodLevel,
lodLevel,
};

WebGLCmdFuncCreateFramebuffer(WebGLDeviceManager.instance, this._gpuFramebuffer);
Expand Down
2 changes: 1 addition & 1 deletion cocos/gfx/webgl2/webgl2-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ export function WebGL2CmdFuncCreateShader (device: WebGL2Device, gpuShader: IWeb
gpuShader.glBlocks[b] = {
set: block.set,
binding: block.binding,
idx$: blockIdx,
idx: blockIdx,
name: blockName,
size: blockSize,
glBinding: glBinding,
Expand Down
6 changes: 3 additions & 3 deletions cocos/gfx/webgl2/webgl2-descriptor-set-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export class WebGL2DescriptorSetLayout extends DescriptorSetLayout {

this._gpuDescriptorSetLayout = {
bindings: this._bindings,
dynamicBindings: dynamicBindings,
descriptorIndices: descriptorIndices,
descriptorCount: descriptorCount,
dynamicBindings,
descriptorIndices,
descriptorCount,
};
}

Expand Down
8 changes: 2 additions & 6 deletions cocos/gfx/webgl2/webgl2-descriptor-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,14 @@ export class WebGL2DescriptorSet extends DescriptorSet {

public initialize (info: Readonly<DescriptorSetInfo>): void {
this._layout = info.layout;
const {
bindings: bindings,
descriptorIndices: descriptorIndices,
descriptorCount: descriptorCount,
} = (info.layout as WebGL2DescriptorSetLayout).getGpuDescriptorSetLayout();
const { bindings, descriptorIndices, descriptorCount } = (info.layout as WebGL2DescriptorSetLayout).getGpuDescriptorSetLayout();

this._buffers = Array(descriptorCount).fill(null);
this._textures = Array(descriptorCount).fill(null);
this._samplers = Array(descriptorCount).fill(null);

const gpuDescriptors: IWebGL2GPUDescriptor[] = [];
this._gpuDescriptorSet = { gpuDescriptors: gpuDescriptors, descriptorIndices: descriptorIndices };
this._gpuDescriptorSet = { gpuDescriptors, descriptorIndices };

for (let i = 0; i < bindings.length; ++i) {
const binding = bindings[i];
Expand Down
2 changes: 1 addition & 1 deletion cocos/gfx/webgl2/webgl2-gpu-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export interface IWebGL2GPUUniform {
export interface IWebGL2GPUUniformBlock {
set: number;
binding: number;
idx$: number;
idx: number;
name: string;
size: number;
glBinding: number;
Expand Down
4 changes: 2 additions & 2 deletions cocos/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class Root {
* @zh 当前每秒帧率
*/
public get fps (): number {
return this._fps$;
return this._fps;
}

/**
Expand Down Expand Up @@ -470,7 +470,7 @@ export class Root {
this._cumulativeTime += deltaTime;
this._fpsTime += deltaTime;
if (this._fpsTime > 1.0) {
this._fps$ = this._frameCount;
this._fps = this._frameCount;
this._frameCount = 0;
this._fpsTime = 0.0;
}
Expand Down

0 comments on commit 201b9df

Please sign in to comment.