From 146509e20ffad25f110267f13c83508916337012 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 22 Jun 2021 08:32:17 +0900 Subject: [PATCH] vrend: Check glTextureView feature before using it This fixes the regression introduced with commit 45eb512a43e257427617699e3849ca93434c1717c and 62cc6ed6e50b271365eea533bebc1688630abb4f. Signed-off-by: Akihiko Odaki Reviewed-by: Gert Wollny --- src/vrend_renderer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 50c5682..0106868 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -1875,7 +1875,8 @@ int vrend_create_surface(struct vrend_context *ctx, surf->nr_samples = nr_samples; if (!has_bit(res->storage_bits, VREND_STORAGE_GL_BUFFER) && - has_bit(res->storage_bits, VREND_STORAGE_GL_IMMUTABLE)) { + has_bit(res->storage_bits, VREND_STORAGE_GL_IMMUTABLE) && + has_feature(feat_texture_view)) { /* We don't need texture views for buffer objects. * Otherwise we only need a texture view if the * a) formats differ between the surface and base texture @@ -2250,7 +2251,9 @@ int vrend_create_sampler_view(struct vrend_context *ctx, else if (view->format != view->texture->base.format) needs_view = true; - if (needs_view && has_bit(view->texture->storage_bits, VREND_STORAGE_GL_IMMUTABLE)) { + if (needs_view && + has_bit(view->texture->storage_bits, VREND_STORAGE_GL_IMMUTABLE) && + has_feature(feat_texture_view)) { glGenTextures(1, &view->id); GLenum internalformat = tex_conv_table[format].internalformat; unsigned base_layer = view->val0 & 0xffff;