renderer: test legal flags for resource creation

macos/master
Dave Airlie 10 years ago
parent fdc64af424
commit cbbf679c2f
  1. 7
      src/vrend_renderer.c

@ -3327,6 +3327,13 @@ static int check_resource_valid(struct vrend_renderer_resource_create_args *args
if (args->target != PIPE_TEXTURE_2D && args->target != PIPE_TEXTURE_2D_ARRAY) if (args->target != PIPE_TEXTURE_2D && args->target != PIPE_TEXTURE_2D_ARRAY)
return -1; return -1;
if (args->flags != 0 && args->flags != VIRGL_RESOURCE_Y_0_TOP)
return -1;
if (args->flags & VIRGL_RESOURCE_Y_0_TOP)
if (args->target != PIPE_TEXTURE_2D && args->target != PIPE_TEXTURE_RECT)
return -1;
/* array size for array textures only */ /* array size for array textures only */
if (args->target == PIPE_TEXTURE_CUBE) { if (args->target == PIPE_TEXTURE_CUBE) {
if (args->array_size != 6) if (args->array_size != 6)

Loading…
Cancel
Save