renderer: do not repeat base_level and max_level unpacking

We're going to have to do this anyway, so let's just do it cleanly
right away.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
macos/master
Erik Faye-Lund 6 years ago
parent 14972df3a6
commit 6d37d9f1f5
  1. 9
      src/vrend_renderer.c

@ -2610,13 +2610,14 @@ void vrend_set_single_sampler_view(struct vrend_context *ctx,
} }
} }
if (tex->cur_base != (view->val1 & 0xff)) { GLuint base_level = view->val1 & 0xff;
int base_level = view->val1 & 0xff; GLuint max_level = (view->val1 >> 8) & 0xff;
if (tex->cur_base != base_level) {
glTexParameteri(view->texture->target, GL_TEXTURE_BASE_LEVEL, base_level); glTexParameteri(view->texture->target, GL_TEXTURE_BASE_LEVEL, base_level);
tex->cur_base = base_level; tex->cur_base = base_level;
} }
if (tex->cur_max != ((view->val1 >> 8) & 0xff)) { if (tex->cur_max != max_level) {
int max_level = (view->val1 >> 8) & 0xff;
glTexParameteri(view->texture->target, GL_TEXTURE_MAX_LEVEL, max_level); glTexParameteri(view->texture->target, GL_TEXTURE_MAX_LEVEL, max_level);
tex->cur_max = max_level; tex->cur_max = max_level;
} }

Loading…
Cancel
Save