mirror of
				https://github.com/encounter/dawn-cmake.git
				synced 2025-10-26 03:30:30 +00:00 
			
		
		
		
	Implemented in both the reader and writer with E2E tests. Other backends detect compound assignment and ICE for now. Bug: tint:1325 Change-Id: Ie3f51e03627a38b12bd1513c4bcf1bebb3282863 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/74363 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
		
			
				
	
	
		
			31 lines
		
	
	
		
			382 B
		
	
	
	
		
			WebGPU Shading Language
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			382 B
		
	
	
	
		
			WebGPU Shading Language
		
	
	
	
	
	
| struct S {
 | |
|   a : i32,
 | |
|   b : vec4<f32>,
 | |
|   c : mat2x2<f32>,
 | |
| }
 | |
| 
 | |
| @group(0) @binding(0) var<storage, read_write> v : S;
 | |
| 
 | |
| var<private> i : u32;
 | |
| 
 | |
| fn idx1() -> i32 {
 | |
|   i += 1u;
 | |
|   return 1;
 | |
| }
 | |
| 
 | |
| fn idx2() -> i32 {
 | |
|   i += 2u;
 | |
|   return 1;
 | |
| }
 | |
| 
 | |
| fn idx3() -> i32 {
 | |
|   i += 3u;
 | |
|   return 1;
 | |
| }
 | |
| 
 | |
| fn foo() {
 | |
|   var a = array<f32, 4>();
 | |
|   for(a[idx1()] *= 2.0; (a[idx2()] < 10.0); a[idx3()] += 1.0) {
 | |
|   }
 | |
| }
 |