#include "util/u_upload_mgr.h"
#include "util/u_blitter.h"
#include "tgsi/tgsi_text.h"
+#include "indices/u_primconvert.h"
#include "pipebuffer/pb_buffer.h"
#include "state_tracker/graw.h"
-#include "state_tracker/drm_driver.h"
#include "virgl_encode.h"
-
#include "virgl_context.h"
-
+#include "virgl_protocol.h"
#include "virgl_resource.h"
#include "virgl_screen.h"
-#include "state_tracker/sw_winsys.h"
- struct pipe_screen encscreen;
static uint32_t next_handle;
uint32_t virgl_object_assign_handle(void)
uint32_t handle;
surf = CALLOC_STRUCT(virgl_surface);
- if (surf == NULL)
+ if (!surf)
return NULL;
res->clean = FALSE;
ib.offset = vctx->index_buffer.offset + info.start * ib.index_size;
if (ib.user_buffer) {
- u_upload_data(vctx->uploader, 0, info.count * ib.index_size,
+ u_upload_data(vctx->uploader, 0, info.count * ib.index_size, 256,
ib.user_buffer, &ib.offset, &ib.buffer);
ib.user_buffer = NULL;
}
const struct pipe_sampler_view *state)
{
struct virgl_context *vctx = virgl_context(ctx);
- struct virgl_sampler_view *grview = CALLOC_STRUCT(virgl_sampler_view);
+ struct virgl_sampler_view *grview;
uint32_t handle;
struct virgl_resource *res;
- if (state == NULL)
+ if (!state)
+ return NULL;
+
+ grview = CALLOC_STRUCT(virgl_sampler_view);
+ if (!grview)
return NULL;
res = virgl_resource(texture);
16, UTIL_SLAB_SINGLETHREADED);
vctx->primconvert = util_primconvert_create(&vctx->base, rs->caps.caps.v1.prim_mask);
- vctx->uploader = u_upload_create(&vctx->base, 1024 * 1024, 256,
- PIPE_BIND_INDEX_BUFFER);
+ vctx->uploader = u_upload_create(&vctx->base, 1024 * 1024,
+ PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STREAM);
if (!vctx->uploader)
goto fail;