From e3256ccb045032960f099318938991392b896b44 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 5 Dec 2010 12:09:30 +0100 Subject: init ps->context with util_surfaces_get and do_get Signed-off-by: Xavier Chantry Reviewed-by: Jakob Bornecrantz Signed-off-by: Patrice Mandin --- src/gallium/auxiliary/util/u_surfaces.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/util/u_surfaces.c') diff --git a/src/gallium/auxiliary/util/u_surfaces.c b/src/gallium/auxiliary/util/u_surfaces.c index fd55bd1830c..b0cfec2a826 100644 --- a/src/gallium/auxiliary/util/u_surfaces.c +++ b/src/gallium/auxiliary/util/u_surfaces.c @@ -31,7 +31,7 @@ boolean util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, - struct pipe_screen *pscreen, struct pipe_resource *pt, + struct pipe_context *ctx, struct pipe_resource *pt, unsigned level, unsigned layer, unsigned flags, struct pipe_surface **res) { @@ -51,7 +51,7 @@ util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, ps = us->u.array[level]; } - if(ps) + if(ps && ps->context == ctx) { p_atomic_inc(&ps->reference.count); *res = ps; @@ -65,7 +65,7 @@ util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, return FALSE; } - pipe_surface_init(ps, pt, level, layer, flags); + pipe_surface_init(ctx, ps, pt, level, layer, flags); if(pt->target == PIPE_TEXTURE_3D || pt->target == PIPE_TEXTURE_CUBE) cso_hash_insert(us->u.hash, (layer << 8) | level, ps); -- cgit v1.2.3