On 16/05/2016 20:26, Emil Velikov wrote:
On 15 May 2016 at 11:45, Axel Davy <axel.d...@ens.fr> wrote:
Version 0.1 allows to assume that the second
element of the IDirect3D* structures will
be a pointer to the internal nine vtable.
This is useful if the gallium nine user wants
to wrap some interfaces.
Signed-off-by: Axel Davy <axel.d...@ens.fr>
---
include/d3dadapter/drm.h | 6 +++++-
src/gallium/state_trackers/nine/iunknown.c | 1 +
src/gallium/state_trackers/nine/iunknown.h | 4 +++-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/d3dadapter/drm.h b/include/d3dadapter/drm.h
index 9ec3e60..647f017 100644
--- a/include/d3dadapter/drm.h
+++ b/include/d3dadapter/drm.h
@@ -29,7 +29,11 @@
#define D3DADAPTER9DRM_NAME "drm"
/* current version */
#define D3DADAPTER9DRM_MAJOR 0
-#define D3DADAPTER9DRM_MINOR 0
+#define D3DADAPTER9DRM_MINOR 1
+
+/* version 0.0: Initial release
+ * 0.1: All IDirect3D objects can be assumed to have a pointer to the
+ * internal vtable in second position of the structure */
struct D3DAdapter9DRM
{
diff --git a/src/gallium/state_trackers/nine/iunknown.c
b/src/gallium/state_trackers/nine/iunknown.c
index 515ceaa..58ed9dc 100644
--- a/src/gallium/state_trackers/nine/iunknown.c
+++ b/src/gallium/state_trackers/nine/iunknown.c
@@ -39,6 +39,7 @@ NineUnknown_ctor( struct NineUnknown *This,
NineUnknown_AddRef(NineUnknown(This->device));
This->vtable = pParams->vtable;
+ This->vtable_internal = pParams->vtable;
This->guids = pParams->guids;
This->dtor = pParams->dtor;
diff --git a/src/gallium/state_trackers/nine/iunknown.h
b/src/gallium/state_trackers/nine/iunknown.h
index b8de6be..bcd0b8b 100644
--- a/src/gallium/state_trackers/nine/iunknown.h
+++ b/src/gallium/state_trackers/nine/iunknown.h
@@ -39,8 +39,10 @@ struct NineDevice9;
struct NineUnknown
{
- /* pointer to vtable */
+ /* pointer to vtable (can be overriden outside gallium nine) */
void *vtable;
The header is not exported for public consumption thus this pointer
is/should be internal, correct ?
So how one can the overwrite it (I assume that's what you meant with overriden)?
There is a general rule that implies "bumping API/ABI in a backwards
incompaible way - bump the major version". All that applies on how
rigorous the check (on the other side) is, of course.
-Emil
All d3d apps assume the vtable is in first position, but cannot assume
anything else (at least I've not noticed any other assumption, and any
such assumption would be forbidden).
Typically wrappers (that add hud or similar) do replace the vtable (and
punkbusters check the vtable is correct).
The Steam overlay does differently, and to fix the Steam overlay, it
helped to enable the wine gallium nine side to assume the second
position would be filled by a copy of the original gallium nine vtable.
Thus the change is backward compatible, which justifies a minor version
bump.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev