mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render/vulkan: check format support before creating YCbCr sampler
We need to check whether the format supports dma_tex_ycbcr_features before creating the YCbCr sampler.
This commit is contained in:
		
							parent
							
								
									c7ae9dfaf8
								
							
						
					
					
						commit
						91d469d8c0
					
				
					 1 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
					@ -2465,12 +2465,10 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) {
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	size_t formats_len;
 | 
					 | 
				
			||||||
	const struct wlr_vk_format *formats = vulkan_get_format_list(&formats_len);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	size_t ycbcr_formats_len = 0;
 | 
						size_t ycbcr_formats_len = 0;
 | 
				
			||||||
	for (size_t i = 0; i < formats_len; i++) {
 | 
						for (size_t i = 0; i < renderer->dev->format_prop_count; i++) {
 | 
				
			||||||
		if (renderer->dev->sampler_ycbcr_conversion && formats[i].is_ycbcr) {
 | 
							struct wlr_vk_format_props *props = &renderer->dev->format_props[i];
 | 
				
			||||||
 | 
							if (renderer->dev->sampler_ycbcr_conversion && props->format.is_ycbcr) {
 | 
				
			||||||
			ycbcr_formats_len++;
 | 
								ycbcr_formats_len++;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -2482,8 +2480,8 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) {
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (size_t i = 0; i < formats_len; i++) {
 | 
							for (size_t i = 0; i < renderer->dev->format_prop_count; i++) {
 | 
				
			||||||
			const struct wlr_vk_format *format = &formats[i];
 | 
								const struct wlr_vk_format *format = &renderer->dev->format_props[i].format;
 | 
				
			||||||
			if (!format->is_ycbcr) {
 | 
								if (!format->is_ycbcr) {
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue