summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/iunknown.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2018-09-09 12:36:28 +0200
committerAxel Davy <[email protected]>2018-09-25 22:05:24 +0200
commitfd86ce7c1464c74c167a850e77bc6fb073a143d5 (patch)
tree4d049722651649823e051c3cafaa7b5f148f6158 /src/gallium/state_trackers/nine/iunknown.c
parenta9bf82ecf4c284989c40e4e6c1f6962bc9bd58d2 (diff)
st/nine: Add parameter to start with bind
Add a parameter to start new object with a bind instead of a refcount. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/iunknown.c')
-rw-r--r--src/gallium/state_trackers/nine/iunknown.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/nine/iunknown.c b/src/gallium/state_trackers/nine/iunknown.c
index d76d6447896..3835651f536 100644
--- a/src/gallium/state_trackers/nine/iunknown.c
+++ b/src/gallium/state_trackers/nine/iunknown.c
@@ -34,9 +34,21 @@ HRESULT
NineUnknown_ctor( struct NineUnknown *This,
struct NineUnknownParams *pParams )
{
- This->refs = pParams->container ? 0 : 1;
- This->bind = 0;
- This->forward = !This->refs;
+ if (pParams->container) {
+ This->refs = 0;
+ This->forward = true;
+ This->bind = 0;
+ assert(!pParams->start_with_bind_not_ref);
+ } else if (pParams->start_with_bind_not_ref) {
+ This->refs = 0;
+ This->forward = false;
+ This->bind = 1;
+ } else {
+ This->refs = 1;
+ This->forward = false;
+ This->bind = 0;
+ }
+
This->container = pParams->container;
This->device = pParams->device;
if (This->refs && This->device)