@ -5039,21 +5039,21 @@ static int check_resource_valid(struct vrend_renderer_resource_create_args *args
}
}
if ( args - > bind = = 0 | |
if ( args - > bind = = 0 | |
args - > bind = = VREND_RES _BIND_CUSTOM | |
args - > bind = = VIRGL _BIND_CUSTOM | |
args - > bind = = VREND_RES _BIND_INDEX_BUFFER | |
args - > bind = = VIRGL _BIND_INDEX_BUFFER | |
args - > bind = = VREND_RES _BIND_STREAM_OUTPUT | |
args - > bind = = VIRGL _BIND_STREAM_OUTPUT | |
args - > bind = = VREND_RES _BIND_VERTEX_BUFFER | |
args - > bind = = VIRGL _BIND_VERTEX_BUFFER | |
args - > bind = = VREND_RES _BIND_CONSTANT_BUFFER | |
args - > bind = = VIRGL _BIND_CONSTANT_BUFFER | |
args - > bind = = VREND_RES _BIND_SHADER_BUFFER ) {
args - > bind = = VIRGL _BIND_SHADER_BUFFER ) {
if ( args - > target ! = PIPE_BUFFER )
if ( args - > target ! = PIPE_BUFFER )
return - 1 ;
return - 1 ;
if ( args - > height ! = 1 | | args - > depth ! = 1 )
if ( args - > height ! = 1 | | args - > depth ! = 1 )
return - 1 ;
return - 1 ;
} else {
} else {
if ( ! ( ( args - > bind & VREND_RES _BIND_SAMPLER_VIEW ) | |
if ( ! ( ( args - > bind & VIRGL _BIND_SAMPLER_VIEW ) | |
( args - > bind & VREND_RES _BIND_DEPTH_STENCIL ) | |
( args - > bind & VIRGL _BIND_DEPTH_STENCIL ) | |
( args - > bind & VREND_RES _BIND_RENDER_TARGET ) | |
( args - > bind & VIRGL _BIND_RENDER_TARGET ) | |
( args - > bind & VREND_RES _BIND_CURSOR ) ) )
( args - > bind & VIRGL _BIND_CURSOR ) ) )
return - 1 ;
return - 1 ;
if ( args - > target = = PIPE_TEXTURE_2D | |
if ( args - > target = = PIPE_TEXTURE_2D | |
@ -5263,29 +5263,29 @@ 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 - > bind = = VREND_RES _BIND_CUSTOM ) {
if ( args - > bind = = VIRGL _BIND_CUSTOM ) {
/* custom should only be for buffers */
/* custom should only be for buffers */
gr - > ptr = malloc ( args - > width ) ;
gr - > ptr = malloc ( args - > width ) ;
if ( ! gr - > ptr ) {
if ( ! gr - > ptr ) {
FREE ( gr ) ;
FREE ( gr ) ;
return ENOMEM ;
return ENOMEM ;
}
}
} else if ( args - > bind = = VREND_RES _BIND_INDEX_BUFFER ) {
} else if ( args - > bind = = VIRGL _BIND_INDEX_BUFFER ) {
gr - > target = GL_ELEMENT_ARRAY_BUFFER_ARB ;
gr - > target = GL_ELEMENT_ARRAY_BUFFER_ARB ;
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else if ( args - > bind = = VREND_RES _BIND_STREAM_OUTPUT ) {
} else if ( args - > bind = = VIRGL _BIND_STREAM_OUTPUT ) {
gr - > target = GL_TRANSFORM_FEEDBACK_BUFFER ;
gr - > target = GL_TRANSFORM_FEEDBACK_BUFFER ;
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else if ( args - > bind = = VREND_RES _BIND_VERTEX_BUFFER ) {
} else if ( args - > bind = = VIRGL _BIND_VERTEX_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 - > bind = = VREND_RES _BIND_CONSTANT_BUFFER ) {
} else if ( args - > bind = = VIRGL _BIND_CONSTANT_BUFFER ) {
gr - > target = GL_UNIFORM_BUFFER ;
gr - > target = GL_UNIFORM_BUFFER ;
vrend_create_buffer ( gr , args - > width ) ;
vrend_create_buffer ( gr , args - > width ) ;
} else if ( args - > target = = PIPE_BUFFER & & ( args - > bind = = 0 | | args - > bind = = VREND_RES _BIND_SHADER_BUFFER ) ) {
} else if ( args - > target = = PIPE_BUFFER & & ( 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 & VREND_RES _BIND_SAMPLER_VIEW ) ) {
} else if ( args - > target = = PIPE_BUFFER & & ( 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 ) .