mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render/gles2: simplify alpha depth check
GL_ALPHA_BITS is the number of bits of the alpha channel of the
currently bound frame buffer's color buffer -- which is precisely
renderer->current_buffer->rbo . Thus, instead of binding the color
buffer and checking its properties, we can query the already bound
frame buffer.
Note that GL_IMPLEMENTATION_COLOR_READ_{FORMAT,TYPE} are also
properties of frame buffer's color buffer.
			
			
This commit is contained in:
		
							parent
							
								
									add44b3e2e
								
							
						
					
					
						commit
						972a5cdf7a
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
					@ -395,15 +395,10 @@ static uint32_t gles2_preferred_read_format(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	push_gles2_debug(renderer);
 | 
						push_gles2_debug(renderer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GLint gl_format = -1, gl_type = -1;
 | 
						GLint gl_format = -1, gl_type = -1, alpha_size = -1;
 | 
				
			||||||
	glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &gl_format);
 | 
						glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &gl_format);
 | 
				
			||||||
	glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &gl_type);
 | 
						glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &gl_type);
 | 
				
			||||||
 | 
						glGetIntegerv(GL_ALPHA_BITS, &alpha_size);
 | 
				
			||||||
	EGLint alpha_size = -1;
 | 
					 | 
				
			||||||
	glBindRenderbuffer(GL_RENDERBUFFER, renderer->current_buffer->rbo);
 | 
					 | 
				
			||||||
	glGetRenderbufferParameteriv(GL_RENDERBUFFER,
 | 
					 | 
				
			||||||
		GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
 | 
					 | 
				
			||||||
	glBindRenderbuffer(GL_RENDERBUFFER, 0);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pop_gles2_debug(renderer);
 | 
						pop_gles2_debug(renderer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue