mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render/vulkan: correct sRBG gamma expansion in shader
(cherry picked from commit 5ae8ce807a)
			
			
This commit is contained in:
		
							parent
							
								
									108be5ef47
								
							
						
					
					
						commit
						e3760fb1b7
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -16,7 +16,9 @@ layout (constant_id = 0) const int TEXTURE_TRANSFORM = 0;
 | 
				
			||||||
#define TEXTURE_TRANSFORM_SRGB 1
 | 
					#define TEXTURE_TRANSFORM_SRGB 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
float srgb_channel_to_linear(float x) {
 | 
					float srgb_channel_to_linear(float x) {
 | 
				
			||||||
	return max(x / 12.92, pow((x + 0.055) / 1.055, 2.4));
 | 
						return mix(x / 12.92,
 | 
				
			||||||
 | 
							pow((x + 0.055) / 1.055, 2.4),
 | 
				
			||||||
 | 
							x > 0.04045);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vec4 srgb_color_to_linear(vec4 color) {
 | 
					vec4 srgb_color_to_linear(vec4 color) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue