summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_resource.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-02-11 12:53:38 +1000
committerDave Airlie <[email protected]>2019-04-09 14:15:12 +1000
commit316b785c59446c9206343d5349091d797f677f2b (patch)
treef2bb5fb3e462d100998b0db478ed48a7e095dbbb /src/gallium/drivers/virgl/virgl_resource.h
parent899fd66b446356544afadff27b9365f5f5a26276 (diff)
virgl: add support for missing command buffer binding.
When I added indirect support I forgot this, however to use it now we need to check for a new enough capability on the host side. Reviewed-By: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_resource.h')
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/virgl/virgl_resource.h b/src/gallium/drivers/virgl/virgl_resource.h
index a60987c5b86..f127d45cff1 100644
--- a/src/gallium/drivers/virgl/virgl_resource.h
+++ b/src/gallium/drivers/virgl/virgl_resource.h
@@ -30,6 +30,7 @@
#include "util/u_transfer.h"
#include "virgl_hw.h"
+#include "virgl_screen.h"
#define VR_MAX_TEXTURE_2D_LEVELS 15
struct winsys_handle;
@@ -80,7 +81,7 @@ static inline struct virgl_transfer *virgl_transfer(struct pipe_transfer *trans)
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)
@@ -108,7 +109,10 @@ static inline unsigned pipe_to_virgl_bind(unsigned pbind)
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;
}