vrend: move texture width check earlier

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 4 years ago
parent 7899e05732
commit 99051a49b6
  1. 7
      src/vrend_renderer.c

@ -6386,8 +6386,8 @@ static int check_resource_valid(const struct vrend_renderer_resource_create_args
}
}
if (format_can_texture_storage && !args->width) {
snprintf(errmsg, 256, "Texture storage texture width must be >0");
if (args->target != PIPE_BUFFER && !args->width) {
snprintf(errmsg, 256, "Texture width must be >0");
return -1;
}
@ -6729,9 +6729,6 @@ static int vrend_renderer_resource_allocate_texture(struct vrend_resource *gr,
struct vrend_texture *gt = (struct vrend_texture *)gr;
struct pipe_resource *pr = &gr->base;
if (pr->width0 == 0)
return EINVAL;
bool format_can_texture_storage = has_feature(feat_texture_storage) &&
(tex_conv_table[format].flags & VIRGL_TEXTURE_CAN_TEXTURE_STORAGE);

Loading…
Cancel
Save