Skip to content

Commit 0ada203

Browse files
committed
Updated builds.
1 parent 65104ce commit 0ada203

File tree

7 files changed

+103
-59
lines changed

7 files changed

+103
-59
lines changed

build/three.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

build/three.module.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

build/three.module.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.webgpu.js

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44752,7 +44752,7 @@ class NodeBuilderState {
4475244752

4475344753
if ( shared !== true ) {
4475444754

44755-
const bindingsGroup = new BindGroup( instanceGroup.name, [], instanceGroup.index, instanceGroup );
44755+
const bindingsGroup = new BindGroup( instanceGroup.name, [], instanceGroup.index, instanceGroup.bindingsReference );
4475644756
bindings.push( bindingsGroup );
4475744757

4475844758
for ( const instanceBinding of instanceGroup.bindings ) {
@@ -55401,25 +55401,29 @@ class Renderer {
5540155401
*/
5540255402
dispose() {
5540355403

55404-
this.info.dispose();
55405-
this.backend.dispose();
55404+
if ( this._initialized === true ) {
5540655405

55407-
this._animation.dispose();
55408-
this._objects.dispose();
55409-
this._pipelines.dispose();
55410-
this._nodes.dispose();
55411-
this._bindings.dispose();
55412-
this._renderLists.dispose();
55413-
this._renderContexts.dispose();
55414-
this._textures.dispose();
55406+
this.info.dispose();
55407+
this.backend.dispose();
5541555408

55416-
if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
55409+
this._animation.dispose();
55410+
this._objects.dispose();
55411+
this._pipelines.dispose();
55412+
this._nodes.dispose();
55413+
this._bindings.dispose();
55414+
this._renderLists.dispose();
55415+
this._renderContexts.dispose();
55416+
this._textures.dispose();
5541755417

55418-
Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
55418+
if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
5541955419

55420-
if ( queryPool !== null ) queryPool.dispose();
55420+
Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
5542155421

55422-
} );
55422+
if ( queryPool !== null ) queryPool.dispose();
55423+
55424+
} );
55425+
55426+
}
5542355427

5542455428
this.setRenderTarget( null );
5542555429
this.setAnimationLoop( null );
@@ -65007,28 +65011,46 @@ class WebGLBackend extends Backend {
6500765011

6500865012
for ( const binding of bindGroup.bindings ) {
6500965013

65014+
const map = this.get( binding );
65015+
6501065016
if ( binding.isUniformsGroup || binding.isUniformBuffer ) {
6501165017

6501265018
const data = binding.buffer;
65013-
const bufferGPU = gl.createBuffer();
65019+
let { bufferGPU } = this.get( data );
6501465020

65015-
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65016-
gl.bufferData( gl.UNIFORM_BUFFER, data, gl.DYNAMIC_DRAW );
65021+
if ( bufferGPU === undefined ) {
6501765022

65018-
this.set( binding, {
65019-
index: i ++,
65020-
bufferGPU
65021-
} );
65023+
// create
65024+
65025+
bufferGPU = gl.createBuffer();
65026+
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65027+
gl.bufferData( gl.UNIFORM_BUFFER, data, gl.DYNAMIC_DRAW );
65028+
65029+
this.set( data, { bufferGPU } );
65030+
65031+
} else {
65032+
65033+
// update
65034+
65035+
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65036+
gl.bufferSubData( gl.UNIFORM_BUFFER, 0, data );
65037+
65038+
}
65039+
65040+
map.index = i ++;
65041+
map.bufferGPU = bufferGPU;
65042+
65043+
this.set( binding, map );
6502265044

6502365045
} else if ( binding.isSampledTexture ) {
6502465046

6502565047
const { textureGPU, glTextureType } = this.get( binding.texture );
6502665048

65027-
this.set( binding, {
65028-
index: t ++,
65029-
textureGPU,
65030-
glTextureType
65031-
} );
65049+
map.index = t ++;
65050+
map.textureGPU = textureGPU;
65051+
map.glTextureType = glTextureType;
65052+
65053+
this.set( binding, map );
6503265054

6503365055
}
6503465056

build/three.webgpu.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.webgpu.nodes.js

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44752,7 +44752,7 @@ class NodeBuilderState {
4475244752

4475344753
if ( shared !== true ) {
4475444754

44755-
const bindingsGroup = new BindGroup( instanceGroup.name, [], instanceGroup.index, instanceGroup );
44755+
const bindingsGroup = new BindGroup( instanceGroup.name, [], instanceGroup.index, instanceGroup.bindingsReference );
4475644756
bindings.push( bindingsGroup );
4475744757

4475844758
for ( const instanceBinding of instanceGroup.bindings ) {
@@ -55401,25 +55401,29 @@ class Renderer {
5540155401
*/
5540255402
dispose() {
5540355403

55404-
this.info.dispose();
55405-
this.backend.dispose();
55404+
if ( this._initialized === true ) {
5540655405

55407-
this._animation.dispose();
55408-
this._objects.dispose();
55409-
this._pipelines.dispose();
55410-
this._nodes.dispose();
55411-
this._bindings.dispose();
55412-
this._renderLists.dispose();
55413-
this._renderContexts.dispose();
55414-
this._textures.dispose();
55406+
this.info.dispose();
55407+
this.backend.dispose();
5541555408

55416-
if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
55409+
this._animation.dispose();
55410+
this._objects.dispose();
55411+
this._pipelines.dispose();
55412+
this._nodes.dispose();
55413+
this._bindings.dispose();
55414+
this._renderLists.dispose();
55415+
this._renderContexts.dispose();
55416+
this._textures.dispose();
5541755417

55418-
Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
55418+
if ( this._frameBufferTarget !== null ) this._frameBufferTarget.dispose();
5541955419

55420-
if ( queryPool !== null ) queryPool.dispose();
55420+
Object.values( this.backend.timestampQueryPool ).forEach( queryPool => {
5542155421

55422-
} );
55422+
if ( queryPool !== null ) queryPool.dispose();
55423+
55424+
} );
55425+
55426+
}
5542355427

5542455428
this.setRenderTarget( null );
5542555429
this.setAnimationLoop( null );
@@ -65007,28 +65011,46 @@ class WebGLBackend extends Backend {
6500765011

6500865012
for ( const binding of bindGroup.bindings ) {
6500965013

65014+
const map = this.get( binding );
65015+
6501065016
if ( binding.isUniformsGroup || binding.isUniformBuffer ) {
6501165017

6501265018
const data = binding.buffer;
65013-
const bufferGPU = gl.createBuffer();
65019+
let { bufferGPU } = this.get( data );
6501465020

65015-
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65016-
gl.bufferData( gl.UNIFORM_BUFFER, data, gl.DYNAMIC_DRAW );
65021+
if ( bufferGPU === undefined ) {
6501765022

65018-
this.set( binding, {
65019-
index: i ++,
65020-
bufferGPU
65021-
} );
65023+
// create
65024+
65025+
bufferGPU = gl.createBuffer();
65026+
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65027+
gl.bufferData( gl.UNIFORM_BUFFER, data, gl.DYNAMIC_DRAW );
65028+
65029+
this.set( data, { bufferGPU } );
65030+
65031+
} else {
65032+
65033+
// update
65034+
65035+
gl.bindBuffer( gl.UNIFORM_BUFFER, bufferGPU );
65036+
gl.bufferSubData( gl.UNIFORM_BUFFER, 0, data );
65037+
65038+
}
65039+
65040+
map.index = i ++;
65041+
map.bufferGPU = bufferGPU;
65042+
65043+
this.set( binding, map );
6502265044

6502365045
} else if ( binding.isSampledTexture ) {
6502465046

6502565047
const { textureGPU, glTextureType } = this.get( binding.texture );
6502665048

65027-
this.set( binding, {
65028-
index: t ++,
65029-
textureGPU,
65030-
glTextureType
65031-
} );
65049+
map.index = t ++;
65050+
map.textureGPU = textureGPU;
65051+
map.glTextureType = glTextureType;
65052+
65053+
this.set( binding, map );
6503265054

6503365055
}
6503465056

build/three.webgpu.nodes.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)