@ -6536,8 +6536,8 @@ int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *a
pipe_reference_init ( & gr - > base . reference , 1 ) ;
pipe_reference_init ( & gr - > base . reference , 1 ) ;
if ( args - > target = = PIPE_BUFFER ) {
if ( args - > bind = = VIRGL_BIND_CUSTOM ) {
if ( args - > bind = = VIRGL_BIND_CUSTOM ) {
assert ( args - > target = = PIPE_BUFFER ) ;
/* use iovec directly when attached */
/* use iovec directly when attached */
gr - > storage = VREND_RESOURCE_STORAGE_GUEST_ELSE_SYSTEM ;
gr - > storage = VREND_RESOURCE_STORAGE_GUEST_ELSE_SYSTEM ;
gr - > ptr = malloc ( args - > width ) ;
gr - > ptr = malloc ( args - > width ) ;
@ -6566,10 +6566,10 @@ int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *a
} else if ( args - > bind = = VIRGL_BIND_COMMAND_ARGS ) {
} else if ( args - > bind = = VIRGL_BIND_COMMAND_ARGS ) {
gr - > target = GL_DRAW_INDIRECT_BUFFER ;
gr - > target = GL_DRAW_INDIRECT_BUFFER ;
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else if ( args - > target = = PIPE_BUFFER & & ( args - > bind = = 0 | | args - > bind = = VIRGL_BIND_SHADER_BUFFER ) ) {
} else if ( args - > bind = = 0 | | args - > bind = = VIRGL_BIND_SHADER_BUFFER ) {
gr - > target = GL_ARRAY_BUFFER_ARB ;
gr - > target = GL_ARRAY_BUFFER_ARB ;
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else if ( args - > target = = PIPE_BUFFER & & ( args - > bind & VIRGL_BIND_SAMPLER_VIEW ) ) {
} else if ( args - > bind & VIRGL_BIND_SAMPLER_VIEW ) {
/*
/*
* On Desktop we use GL_ARB_texture_buffer_object on GLES we use
* On Desktop we use GL_ARB_texture_buffer_object on GLES we use
* GL_EXT_texture_buffer ( it is in the ANDRIOD extension pack ) .
* GL_EXT_texture_buffer ( it is in the ANDRIOD extension pack ) .
@ -6585,6 +6585,11 @@ int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *a
gr - > target = GL_PIXEL_PACK_BUFFER_ARB ;
gr - > target = GL_PIXEL_PACK_BUFFER_ARB ;
}
}
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else {
vrend_printf ( " %s: Illegal buffer binding flags 0x%x \n " , __func__ , args - > bind ) ;
FREE ( gr ) ;
return EINVAL ;
}
} else {
} else {
int r = vrend_renderer_resource_allocate_texture ( gr , image_oes ) ;
int r = vrend_renderer_resource_allocate_texture ( gr , image_oes ) ;
if ( r ) {
if ( r ) {