get rid of diplicate definition of VREND_RES_BIND-flags

These are identical to the corresponding VIRGL_BIND-flags,
so let's get rid of this duplicate definition.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 5ff40d52ca
commit dc1bc1ed61
  1. 34
      src/vrend_renderer.c
  2. 13
      src/vrend_renderer.h

@ -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).

@ -145,19 +145,6 @@ int vrend_renderer_context_create(uint32_t handle, uint32_t nlen, const char *na
void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen, const char *name); void vrend_renderer_context_create_internal(uint32_t handle, uint32_t nlen, const char *name);
void vrend_renderer_context_destroy(uint32_t handle); void vrend_renderer_context_destroy(uint32_t handle);
/* virgl bind flags - these are compatible with mesa 10.5 gallium.
but are fixed, no other should be passed to virgl either. */
#define VREND_RES_BIND_DEPTH_STENCIL (1 << 0)
#define VREND_RES_BIND_RENDER_TARGET (1 << 1)
#define VREND_RES_BIND_SAMPLER_VIEW (1 << 3)
#define VREND_RES_BIND_VERTEX_BUFFER (1 << 4)
#define VREND_RES_BIND_INDEX_BUFFER (1 << 5)
#define VREND_RES_BIND_CONSTANT_BUFFER (1 << 6)
#define VREND_RES_BIND_STREAM_OUTPUT (1 << 11)
#define VREND_RES_BIND_SHADER_BUFFER (1 << 14)
#define VREND_RES_BIND_CURSOR (1 << 16)
#define VREND_RES_BIND_CUSTOM (1 << 17)
struct vrend_renderer_resource_create_args { struct vrend_renderer_resource_create_args {
uint32_t handle; uint32_t handle;
enum pipe_texture_target target; enum pipe_texture_target target;

Loading…
Cancel
Save