mirror of
				https://github.com/encounter/dawn-cmake.git
				synced 2025-10-24 18:50:29 +00:00 
			
		
		
		
	If a call to atan2 with args of type AFloat and AInt is made, Resolver would correctly select the atan2(AFloat, AFloat) overload, but if the input args were of type (AFloat, AInt), it would attempt to constant evaluate without first converting the AInt arg to AFloat. The same would occur for a binary operation, say AFloat + AInt. Before constant evaluating, the Resolver now converts AInt to AFloat if necessary. Bug: chromium:1350147 Change-Id: I85390c5d7af7e706115278ece34b2b18b8574f9f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98543 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			637 B
		
	
	
	
		
			WebGPU Shading Language
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			637 B
		
	
	
	
		
			WebGPU Shading Language
		
	
	
	
	
	
| fn original_clusterfuzz_code() {
 | |
|     atan2(1,.1);
 | |
| }
 | |
| 
 | |
| fn more_tests_that_would_fail() {
 | |
|     // Builtin calls with mixed abstract args would fail because AInt would not materialize to AFloat.
 | |
|     {
 | |
|         let a = atan2(1, 0.1);
 | |
|         let b = atan2(0.1, 1);
 | |
|     }
 | |
| 
 | |
|     // Same for binary operators
 | |
|     {
 | |
|         let a = 1 + 1.5;
 | |
|         let b = 1.5 + 1;
 | |
|     }
 | |
| 
 | |
|     // Once above was fixed, builtin calls without assignment would also fail in backends because
 | |
|     // abstract constant value is not handled by backends. These should be removed by RemovePhonies
 | |
|     // transform.
 | |
|     {
 | |
|         atan2(1, 0.1);
 | |
|         atan2(0.1, 1);
 | |
|     }
 | |
| }
 |