aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/pass.c
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-19 12:05:11 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-06-19 12:25:38 -0400
commit6bd44c4fcd45aa64a757f8797db78252d2fee3b4 (patch)
tree2b7f4c3e51f00e3234e73435b02ba51b24be884d /render/gles2/pass.c
parent64c0272f818523537fe8e133d97539e50fdfec64 (diff)
renderer: Introduce wlr_scale_filter_mode
Diffstat (limited to 'render/gles2/pass.c')
-rw-r--r--render/gles2/pass.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/render/gles2/pass.c b/render/gles2/pass.c
index 89ca873e..b1d21616 100644
--- a/render/gles2/pass.c
+++ b/render/gles2/pass.c
@@ -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);