mirror of
				https://gitlab.winehq.org/wine/vkd3d.git
				synced 2025-09-12 18:50:22 -07:00 
			
		
		
		
	The location of dxcompiler should be set during configuration with 'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with LD_LIBRARY_PATH, WINEPATH or PATH as applicable. A new 'fail(sm<6)' decoration is needed on many shader declarations because dxcompiler succeeds on many shaders which fail with fxc. The opposite case is less common and is flagged with 'fail(sm>=6)'. A few tests cause dxcompiler to crash or hang, so these are avoided using [require], which now skips tests until reset instead of exiting. Also, 'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results.
		
			
				
	
	
		
			193 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			193 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| % Test allowed syntax for the "numthreads" attribute.
 | |
| 
 | |
| [require]
 | |
| shader model >= 5.0
 | |
| 
 | |
| [compute shader]
 | |
| 
 | |
|     [numthreads(1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(1, 1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(0, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(1, 0, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(1, 1, 0)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
|     [numthreads(-1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
|     [numthreads(1, -1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
|     [numthreads(1, 1, -1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
|     [numthreads(1, -1, -1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader todo]
 | |
| 
 | |
|     [numthreads(uint(1), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader todo]
 | |
| 
 | |
|     [numthreads(int(1), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(float(1), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads(uint1(1), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader todo]
 | |
| 
 | |
|     [numthreads(int(1), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader todo]
 | |
| 
 | |
|     [numthreads(1 + 1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
|     [numthreads("1", 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader todo fail(sm>=6)]
 | |
| static int x = 1;
 | |
| 
 | |
|     [numthreads(x, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail(sm<6)]
 | |
| 
 | |
|     [NumThreads(1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader]
 | |
| 
 | |
|     [numthreads(1, 1, 1)]
 | |
| void main();
 | |
| 
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail]
 | |
| 
 | |
| void main() {}
 | |
| 
 | |
|     [numthreads(1, 1, 1)]
 | |
| void main();
 | |
| 
 | |
| [compute shader fail(sm<6)]
 | |
| 
 | |
| void main();
 | |
| 
 | |
|     [numthreads(1, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
| /* Expressions with side effects are forbidden in attributes (but not if the
 | |
|  * attribute is ignored). */
 | |
| 
 | |
| static int x = 1;
 | |
| 
 | |
|     [numthreads(x++, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
| static int x = 1;
 | |
| 
 | |
|     [numthreads(++x, 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail todo]
 | |
| 
 | |
| static int x = 1;
 | |
| 
 | |
|     [numthreads((x = 2), 1, 1)]
 | |
| void main() {}
 | |
| 
 | |
| [compute shader fail(sm>=6)]
 | |
| 
 | |
| static int x = 1;
 | |
| 
 | |
|     [numthreads(++x, 1, 1)]
 | |
| void func() {}
 | |
| 
 | |
|     [bogus(++x)]
 | |
|     [numthreads(1, 1, 1)]
 | |
| void main() { func(); }
 | |
| 
 | |
| [uav 0]
 | |
| format r32 float
 | |
| size (2, 2)
 | |
| 
 | |
| 1.0 1.0
 | |
| 1.0 1.0
 | |
| 
 | |
| [compute shader]
 | |
| /* Attributes are taken from the first function, and dropped from the second. */
 | |
| RWTexture2D<float> u;
 | |
| 
 | |
|     [numthreads(2, 1, 1)]
 | |
| void main(uint2 id);
 | |
| 
 | |
|     [numthreads(1, 2, 1)]
 | |
| void main(uint2 id : sv_dispatchthreadid)
 | |
| {
 | |
|     u[id] = 2.0;
 | |
| }
 | |
| 
 | |
| [test]
 | |
| todo(sm>=6) dispatch 1 1 1
 | |
| probe uav 0 (0, 0) r (2.0)
 | |
| probe uav 0 (0, 1) r (1.0)
 | |
| probe uav 0 (1, 0) r (2.0)
 | |
| probe uav 0 (1, 1) r (1.0)
 |