summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/include/state_tracker/st_api.h5
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c4
-rw-r--r--src/gallium/state_trackers/wgl/stw_st.c4
3 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index d641092aa23..3fd5f011f7d 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -311,6 +311,11 @@ struct st_framebuffer_iface
int32_t stamp;
/**
+ * Identifier that uniquely identifies the framebuffer interface object.
+ */
+ uint32_t ID;
+
+ /**
* Available for the state tracker manager to use.
*/
void *st_manager_private;
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 3c2e3075249..0cfdc305583 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -38,6 +38,8 @@
#include "util/u_memory.h"
#include "util/u_inlines.h"
+static uint32_t drifb_ID = 0;
+
static void
swap_fences_unref(struct dri_drawable *draw);
@@ -155,6 +157,7 @@ dri_create_buffer(__DRIscreen * sPriv,
dPriv->driverPrivate = (void *)drawable;
p_atomic_set(&drawable->base.stamp, 1);
+ drawable->base.ID = p_atomic_inc_return(&drifb_ID);
return GL_TRUE;
fail:
@@ -177,6 +180,7 @@ dri_destroy_buffer(__DRIdrawable * dPriv)
swap_fences_unref(drawable);
+ drawable->base.ID = 0;
FREE(drawable);
}
diff --git a/src/gallium/state_trackers/wgl/stw_st.c b/src/gallium/state_trackers/wgl/stw_st.c
index 7806a2a10e3..c2844b04c4e 100644
--- a/src/gallium/state_trackers/wgl/stw_st.c
+++ b/src/gallium/state_trackers/wgl/stw_st.c
@@ -46,7 +46,7 @@ struct stw_st_framebuffer {
unsigned texture_mask;
};
-
+static uint32_t stwfb_ID = 0;
/**
* Is the given mutex held by the calling thread?
@@ -234,6 +234,7 @@ stw_st_create_framebuffer(struct stw_framebuffer *fb)
stwfb->fb = fb;
stwfb->stvis = fb->pfi->stvis;
+ stwfb->base.ID = p_atomic_inc_return(&stwfb_ID);
stwfb->base.visual = &stwfb->stvis;
p_atomic_set(&stwfb->base.stamp, 1);
@@ -255,6 +256,7 @@ stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb)
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_resource_reference(&stwfb->textures[i], NULL);
+ stwfb->base.ID = 0;
FREE(stwfb);
}