diff options
author | Emil Velikov <[email protected]> | 2016-04-21 17:29:16 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-05-24 23:03:00 +0100 |
commit | e384d75b120ce60954c545e8c6edbe98fd01bea7 (patch) | |
tree | 91f111db322fbfcb97ce308e0276558a507268e6 /src/gallium/state_trackers/dri | |
parent | 0e983276b96eee5aa1dd091888bc81e36169a8f1 (diff) |
mesa_glinterop: make GL interop version field bidirectional
This allows clear and easy communication between the two.
Caller: Requesting information (struct vN)
Callee: I know how to deal with older version (vN-1) only. Here is your
data and the version I support.
Caller: Older version ? Sure I'll cap all access to the fields provided
by the older version (vN-1)
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r-- | src/gallium/state_trackers/dri/dri2.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 3a2a3cedc5a..0c84bafe14e 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -1480,12 +1480,15 @@ dri2_interop_query_device_info(__DRIcontext *_ctx, out->vendor_id = screen->get_param(screen, PIPE_CAP_VENDOR_ID); out->device_id = screen->get_param(screen, PIPE_CAP_DEVICE_ID); + /* Instruct the caller that we support up-to version one of the interface */ + out->version = 1; + return MESA_GLINTEROP_SUCCESS; } static int dri2_interop_export_object(__DRIcontext *_ctx, - const mesa_glinterop_export_in *in, + mesa_glinterop_export_in *in, mesa_glinterop_export_out *out) { struct st_context_iface *st = dri_context(_ctx)->st; @@ -1704,6 +1707,10 @@ dri2_interop_export_object(__DRIcontext *_ctx, if (res->target == PIPE_BUFFER) out->buf_offset += whandle.offset; + /* Instruct the caller that we support up-to version one of the interface */ + in->version = 1; + out->version = 1; + return MESA_GLINTEROP_SUCCESS; } |