vrend, allocal_texture: Set mip-map levels correctly in the texture's state

OpenGL defaults GL_TEXTURE_MIN_FILTER=GL_NEAREST_MIPMAP_LINEAR and
GL_TEXTURE_MAX_LEVEL=1000, and expects all these mip-map levels to be
defined. With glTexStorage this is set apropriately, but when the mip-map
levels are initialiazed manually, then the GL_TEXTURE_MAX_LEVEL must be set.

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent 753db79f99
commit 6b4d7f5cf8
  1. 5
      src/vrend_renderer.c

@ -4932,6 +4932,11 @@ static int vrend_renderer_resource_allocate_texture(struct vrend_resource *gr,
} }
} }
if (!vrend_state.have_texture_storage) {
glTexParameteri(gr->target, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(gr->target, GL_TEXTURE_MAX_LEVEL, pr->last_level);
}
gt->state.max_lod = -1; gt->state.max_lod = -1;
gt->cur_swizzle_r = gt->cur_swizzle_g = gt->cur_swizzle_b = gt->cur_swizzle_a = -1; gt->cur_swizzle_r = gt->cur_swizzle_g = gt->cur_swizzle_b = gt->cur_swizzle_a = -1;
return 0; return 0;

Loading…
Cancel
Save