2011/9/7 Roland Scheidegger <[email protected]>: > That said I'm not really sure why pipe_sampler_view and pipe_surface > actually have a context pointer in them, since they are only supposed to > be used with the context in which they were created I think those > shouldn't actually exist - surface_destroy and sampler_view_destroy will > have context as a parameter, and if they aren't shared between contexts > it's pointless to store the context pointer. Might be a relic from when > those structs were created/destroyed using screen functions...
The ctx pointer is there because of pipe_surface_reference and pipe_sampler_view_reference. When the refcount becomes 0, the corresponding pipe...reference function uses the ctx pointer to do ctx->...destroy(ctx, ... So that we can destroy objects just by: pipe_surface_reference(&surface, NULL); This ctx pointer also ensures that the destroy function is called with the right context. Marek _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
