mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render/vulkan: introduce wlr_vk_frag_texture_pcr_data
Contains UBOs for texture.frag.
This commit is contained in:
		
							parent
							
								
									ec422ac389
								
							
						
					
					
						commit
						56d95c2ecb
					
				
					 3 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -339,6 +339,10 @@ struct wlr_vk_vert_pcr_data {
 | 
				
			||||||
	float uv_size[2];
 | 
						float uv_size[2];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct wlr_vk_frag_texture_pcr_data {
 | 
				
			||||||
 | 
						float alpha;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct wlr_vk_frag_output_pcr_data {
 | 
					struct wlr_vk_frag_output_pcr_data {
 | 
				
			||||||
	float matrix[4][4]; // only a 3x3 subset is used
 | 
						float matrix[4][4]; // only a 3x3 subset is used
 | 
				
			||||||
	float luminance_multiplier;
 | 
						float luminance_multiplier;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -816,6 +816,10 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct wlr_vk_frag_texture_pcr_data frag_pcr_data = {
 | 
				
			||||||
 | 
							.alpha = alpha,
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bind_pipeline(pass, pipe->vk);
 | 
						bind_pipeline(pass, pipe->vk);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	vkCmdBindDescriptorSets(cb, VK_PIPELINE_BIND_POINT_GRAPHICS,
 | 
						vkCmdBindDescriptorSets(cb, VK_PIPELINE_BIND_POINT_GRAPHICS,
 | 
				
			||||||
| 
						 | 
					@ -824,8 +828,8 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
 | 
				
			||||||
	vkCmdPushConstants(cb, pipe->layout->vk,
 | 
						vkCmdPushConstants(cb, pipe->layout->vk,
 | 
				
			||||||
		VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vert_pcr_data), &vert_pcr_data);
 | 
							VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vert_pcr_data), &vert_pcr_data);
 | 
				
			||||||
	vkCmdPushConstants(cb, pipe->layout->vk,
 | 
						vkCmdPushConstants(cb, pipe->layout->vk,
 | 
				
			||||||
		VK_SHADER_STAGE_FRAGMENT_BIT, sizeof(vert_pcr_data), sizeof(float),
 | 
							VK_SHADER_STAGE_FRAGMENT_BIT, sizeof(vert_pcr_data),
 | 
				
			||||||
		&alpha);
 | 
							sizeof(frag_pcr_data), &frag_pcr_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pixman_region32_t clip;
 | 
						pixman_region32_t clip;
 | 
				
			||||||
	get_clip_region(pass, options->clip, &clip);
 | 
						get_clip_region(pass, options->clip, &clip);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,6 +5,7 @@ layout(set = 0, binding = 0) uniform sampler2D tex;
 | 
				
			||||||
layout(location = 0) in vec2 uv;
 | 
					layout(location = 0) in vec2 uv;
 | 
				
			||||||
layout(location = 0) out vec4 out_color;
 | 
					layout(location = 0) out vec4 out_color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// struct wlr_vk_frag_texture_pcr_data
 | 
				
			||||||
layout(push_constant) uniform UBO {
 | 
					layout(push_constant) uniform UBO {
 | 
				
			||||||
	layout(offset = 80) float alpha;
 | 
						layout(offset = 80) float alpha;
 | 
				
			||||||
} data;
 | 
					} data;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue