renderer: Introduce wlr_scale_filter_mode

This commit is contained in:
Alexander Orzechowski 2023-06-19 12:05:11 -04:00
parent 64c0272f81
commit 6bd44c4fcd
6 changed files with 50 additions and 3 deletions

View file

@ -170,7 +170,18 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->target, texture->tex);
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
switch (options->filter_mode) {
case WLR_SCALE_FILTER_BILINEAR:
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
break;
case WLR_SCALE_FILTER_NEAREST:
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
break;
}
glUniform1i(shader->tex, 0);
glUniform1f(shader->alpha, alpha);
set_proj_matrix(shader->proj, pass->projection_matrix, &dst_box);