vrend: Check glTextureView feature before using it

This fixes the regression introduced with commit
45eb512a43e257427617699e3849ca93434c1717c and
62cc6ed6e5.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Akihiko Odaki 3 years ago
parent 7b5dd3eb47
commit 146509e20f
  1. 7
      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;

Loading…
Cancel
Save