#define VIRGL_CAP_TRANSFER (1 << 17)
#define VIRGL_CAP_FBO_MIXED_COLOR_FORMATS (1 << 18)
#define VIRGL_CAP_FAKE_FP64 (1 << 19)
+#define VIRGL_CAP_BIND_COMMAND_ARGS (1 << 20)
#define VIRGL_CAP_TRANSFORM_FEEDBACK3 (1 << 23)
/* virgl bind flags - these are compatible with mesa 10.5 gallium.
#define VIRGL_BIND_INDEX_BUFFER (1 << 5)
#define VIRGL_BIND_CONSTANT_BUFFER (1 << 6)
#define VIRGL_BIND_DISPLAY_TARGET (1 << 7)
+#define VIRGL_BIND_COMMAND_ARGS (1 << 8)
#define VIRGL_BIND_STREAM_OUTPUT (1 << 11)
#define VIRGL_BIND_SHADER_BUFFER (1 << 14)
#define VIRGL_BIND_QUERY_BUFFER (1 << 15)
res->u.b = *templ;
res->u.b.screen = &vs->base;
pipe_reference_init(&res->u.b.reference, 1);
- vbind = pipe_to_virgl_bind(templ->bind);
+ vbind = pipe_to_virgl_bind(vs, templ->bind);
virgl_resource_layout(&res->u.b, &res->metadata);
res->hw_res = vs->vws->resource_create(vs->vws, templ->target,
templ->format, vbind,
#include "util/u_transfer.h"
#include "virgl_hw.h"
+#include "virgl_screen.h"
#define VR_MAX_TEXTURE_2D_LEVELS 15
struct winsys_handle;
void virgl_buffer_init(struct virgl_resource *res);
-static inline unsigned pipe_to_virgl_bind(unsigned pbind)
+static inline unsigned pipe_to_virgl_bind(const struct virgl_screen *vs, unsigned pbind)
{
unsigned outbind = 0;
if (pbind & PIPE_BIND_DEPTH_STENCIL)
if (pbind & PIPE_BIND_SHADER_BUFFER)
outbind |= VIRGL_BIND_SHADER_BUFFER;
if (pbind & PIPE_BIND_QUERY_BUFFER)
- outbind |= VIRGL_BIND_QUERY_BUFFER;
+ outbind |= VIRGL_BIND_QUERY_BUFFER;
+ if (pbind & PIPE_BIND_COMMAND_ARGS_BUFFER)
+ if (vs->caps.caps.v2.capability_bits & VIRGL_CAP_BIND_COMMAND_ARGS)
+ outbind |= VIRGL_BIND_COMMAND_ARGS;
return outbind;
}