renderer: use is_buffer flag for transfers

Instead of enumerating all the GL buffer types, just use the
is_buffer flag.

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Dave Airlie 6 years ago
parent 5d2dde49d2
commit 70677eedb7
  1. 18
      src/vrend_renderer.c

@ -6196,14 +6196,7 @@ static int vrend_renderer_transfer_write_iov(struct vrend_context *ctx,
vrend_read_from_iovec(iov, num_iovs, info->offset, res->ptr + info->box->x, info->box->width); vrend_read_from_iovec(iov, num_iovs, info->offset, res->ptr + info->box->x, info->box->width);
return 0; return 0;
} }
if (res->target == GL_TRANSFORM_FEEDBACK_BUFFER || if (res->is_buffer) {
res->target == GL_ELEMENT_ARRAY_BUFFER_ARB ||
res->target == GL_ARRAY_BUFFER_ARB ||
res->target == GL_TEXTURE_BUFFER ||
res->target == GL_QUERY_BUFFER ||
res->target == GL_UNIFORM_BUFFER ||
res->target == GL_PIXEL_PACK_BUFFER ||
res->target == GL_PIXEL_UNPACK_BUFFER) {
struct virgl_sub_upload_data d; struct virgl_sub_upload_data d;
d.box = info->box; d.box = info->box;
d.target = res->target; d.target = res->target;
@ -6706,14 +6699,7 @@ static int vrend_renderer_transfer_send_iov(struct vrend_context *ctx,
return 0; return 0;
} }
if (res->target == GL_ELEMENT_ARRAY_BUFFER_ARB || if (res->is_buffer) {
res->target == GL_ARRAY_BUFFER_ARB ||
res->target == GL_TRANSFORM_FEEDBACK_BUFFER ||
res->target == GL_TEXTURE_BUFFER ||
res->target == GL_UNIFORM_BUFFER ||
res->target == GL_QUERY_BUFFER ||
res->target == GL_PIXEL_PACK_BUFFER ||
res->target == GL_PIXEL_UNPACK_BUFFER) {
uint32_t send_size = info->box->width * util_format_get_blocksize(res->base.format); uint32_t send_size = info->box->width * util_format_get_blocksize(res->base.format);
void *data; void *data;

Loading…
Cancel
Save