Browse Source

WebGPURenderer: Update to latest WebGPU API (#24233)

* Update to latest WebGPU API

* Update to latest WebGPU API (2)
sunag 3 years ago
parent
commit
473f8cdd0e

+ 2 - 2
examples/jsm/renderers/webgpu/WebGPUTextureUtils.js

@@ -34,7 +34,7 @@ struct VarysStruct {
 	@location( 0 ) vTex : vec2<f32>
 };
 
-@stage( vertex )
+@vertex
 fn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {
 
 	var Varys : VarysStruct;
@@ -68,7 +68,7 @@ var imgSampler : sampler;
 @group( 0 ) @binding( 1 )
 var img : texture_2d<f32>;
 
-@stage( fragment )
+@fragment
 fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
 
 	return textureSample( img, imgSampler, vTex );

+ 3 - 3
examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js

@@ -707,7 +707,7 @@ ${shaderData.varys}
 // codes
 ${shaderData.codes}
 
-@stage( vertex )
+@vertex
 fn main( ${shaderData.attributes} ) -> NodeVarysStruct {
 
 	// system
@@ -736,7 +736,7 @@ ${shaderData.uniforms}
 // codes
 ${shaderData.codes}
 
-@stage( fragment )
+@fragment
 fn main( ${shaderData.varys} ) -> @location( 0 ) vec4<f32> {
 
 	// vars
@@ -762,7 +762,7 @@ ${shaderData.uniforms}
 // codes
 ${shaderData.codes}
 
-@stage( compute ) @workgroup_size( ${workgroupSize} )
+@compute @workgroup_size( ${workgroupSize} )
 fn main( ${shaderData.attributes} ) {
 
 	// system