Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ModelNode from '../accessors/ModelNode.js';
import OperatorNode from '../math/OperatorNode.js';
import PositionNode from '../accessors/PositionNode.js';

class GLPositionNode extends Node {
class ModelViewProjectionMatrixNode extends Node {

constructor( position = new PositionNode() ) {

Expand All @@ -29,4 +29,4 @@ class GLPositionNode extends Node {

}

export default GLPositionNode;
export default ModelViewProjectionMatrixNode;
4 changes: 2 additions & 2 deletions examples/jsm/renderers/webgpu/WebGPUAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class WebGPUAttributes {

// Not using update ranges

this.device.defaultQueue.writeBuffer(
this.device.queue.writeBuffer(
buffer,
0,
array,
Expand All @@ -104,7 +104,7 @@ class WebGPUAttributes {

} else {

this.device.defaultQueue.writeBuffer(
this.device.queue.writeBuffer(
buffer,
0,
array,
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/renderers/webgpu/WebGPUBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class WebGPUBindings {

if ( needsBufferWrite === true ) {

this.device.defaultQueue.writeBuffer(
this.device.queue.writeBuffer(
bufferGPU,
0,
array,
Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/renderers/webgpu/WebGPURenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class WebGPURenderer {
// finish render pass

passEncoder.endPass();
device.defaultQueue.submit( [ cmdEncoder.finish() ] );
device.queue.submit( [ cmdEncoder.finish() ] );

}

Expand Down Expand Up @@ -568,7 +568,7 @@ class WebGPURenderer {
}

passEncoder.endPass();
device.defaultQueue.submit( [ cmdEncoder.finish() ] );
device.queue.submit( [ cmdEncoder.finish() ] );

}

Expand Down Expand Up @@ -856,7 +856,7 @@ class WebGPURenderer {
},
sampleCount: this._parameters.sampleCount,
format: GPUTextureFormat.BRGA8Unorm,
usage: GPUTextureUsage.OUTPUT_ATTACHMENT
usage: GPUTextureUsage.RENDER_ATTACHMENT
} );

}
Expand All @@ -879,7 +879,7 @@ class WebGPURenderer {
},
sampleCount: this._parameters.sampleCount,
format: GPUTextureFormat.Depth24PlusStencil8,
usage: GPUTextureUsage.OUTPUT_ATTACHMENT
usage: GPUTextureUsage.RENDER_ATTACHMENT
} );

}
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/renderers/webgpu/WebGPUTextureUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class WebGPUTextureUtils {

}

this.device.defaultQueue.submit( [ commandEncoder.finish() ] );
this.device.queue.submit( [ commandEncoder.finish() ] );

}

Expand Down
14 changes: 7 additions & 7 deletions examples/jsm/renderers/webgpu/WebGPUTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class WebGPUTextures {
depth: 1
},
format: colorTextureFormat,
usage: GPUTextureUsage.OUTPUT_ATTACHMENT | GPUTextureUsage.SAMPLED
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.SAMPLED
} );

this.info.memory.textures ++;
Expand Down Expand Up @@ -234,7 +234,7 @@ class WebGPUTextures {
depth: 1
},
format: depthTextureFormat,
usage: GPUTextureUsage.OUTPUT_ATTACHMENT
usage: GPUTextureUsage.RENDER_ATTACHMENT
} );

this.info.memory.textures ++;
Expand Down Expand Up @@ -320,9 +320,9 @@ class WebGPUTextures {

if ( needsMipmaps === true ) {

// current mipmap generation requires OUTPUT_ATTACHMENT
// current mipmap generation requires RENDER_ATTACHMENT

usage |= GPUTextureUsage.OUTPUT_ATTACHMENT;
usage |= GPUTextureUsage.RENDER_ATTACHMENT;

}

Expand Down Expand Up @@ -390,7 +390,7 @@ class WebGPUTextures {
const bytesPerTexel = this._getBytesPerTexel( format );
const bytesPerRow = Math.ceil( image.width * bytesPerTexel / 256 ) * 256;

this.device.defaultQueue.writeTexture(
this.device.queue.writeTexture(
{
texture: textureGPU,
mipLevel: 0
Expand Down Expand Up @@ -426,7 +426,7 @@ class WebGPUTextures {

_copyImageBitmapToTexture( image, textureGPU, origin = { x: 0, y: 0, z: 0 } ) {

this.device.defaultQueue.copyImageBitmapToTexture(
this.device.queue.copyImageBitmapToTexture(
{
imageBitmap: image
}, {
Expand Down Expand Up @@ -457,7 +457,7 @@ class WebGPUTextures {

const bytesPerRow = Math.ceil( width / blockData.width ) * blockData.byteLength;

this.device.defaultQueue.writeTexture(
this.device.queue.writeTexture(
{
texture: textureGPU,
mipLevel: i
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/renderers/webgpu/nodes/ShaderLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NODE_HEADER_VARYS

void main(){
NODE_BODY_VARYS
gl_Position = NODE_GL_POSITION;
gl_Position = NODE_MVP;
}`,
fragmentShader: `#version 450

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { WebGPUSampledTexture } from '../WebGPUSampledTexture.js';

import NodeSlot from '../../nodes/core/NodeSlot.js';
import NodeBuilder from '../../nodes/core/NodeBuilder.js';
import GLPositionNode from '../../nodes/accessors/GLPositionNode.js';
import ModelViewProjectionMatrixNode from '../../nodes/accessors/ModelViewProjectionMatrixNode.js';

import ShaderLib from './ShaderLib.js';

Expand Down Expand Up @@ -41,15 +41,15 @@ class WebGPUNodeBuilder extends NodeBuilder {

if ( material.isMeshBasicMaterial || material.isPointsMaterial || material.isLineBasicMaterial ) {

const glPositionNode = new GLPositionNode();
const mvpNode = new ModelViewProjectionMatrixNode();

if ( material.positionNode !== undefined ) {

glPositionNode.position = material.positionNode;
mvpNode.position = material.positionNode;

}

this.addSlot( 'vertex', new NodeSlot( glPositionNode, 'GL_POSITION', 'vec4' ) );
this.addSlot( 'vertex', new NodeSlot( mvpNode, 'MVP', 'vec4' ) );

if ( material.colorNode !== undefined ) {

Expand Down