diff options
author | Xavier Chantry <[email protected]> | 2010-12-05 12:04:47 +0100 |
---|---|---|
committer | Patrice Mandin <[email protected]> | 2010-12-05 12:08:00 +0100 |
commit | af5345d9371e927019d51ce3ad198958f8cd42a9 (patch) | |
tree | 39bd4692e2df0a1430322c14ad6ea8be2f4b1e36 /src/gallium/auxiliary/util/u_surfaces.h | |
parent | 66d45567b4e2c6f2585789b68667e6c00b7567e1 (diff) |
nvfx: fixes after array textures merge
Signed-off-by: Xavier Chantry <[email protected]>
Signed-off-by: Patrice Mandin <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_surfaces.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_surfaces.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_surfaces.h b/src/gallium/auxiliary/util/u_surfaces.h index 86a1c2f83c9..da4fbbfc254 100644 --- a/src/gallium/auxiliary/util/u_surfaces.h +++ b/src/gallium/auxiliary/util/u_surfaces.h @@ -42,11 +42,19 @@ struct util_surfaces } u; }; -struct pipe_surface *util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, struct pipe_screen *pscreen, struct pipe_resource *pt, unsigned level, unsigned layer, unsigned flags); +/* Return value indicates if the pipe surface result is new */ +boolean +util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size, + struct pipe_screen *pscreen, struct pipe_resource *pt, + unsigned level, unsigned layer, unsigned flags, + struct pipe_surface **res); /* fast inline path for the very common case */ -static INLINE struct pipe_surface * -util_surfaces_get(struct util_surfaces *us, unsigned surface_struct_size, struct pipe_screen *pscreen, struct pipe_resource *pt, unsigned level, unsigned layer, unsigned flags) +static INLINE boolean +util_surfaces_get(struct util_surfaces *us, unsigned surface_struct_size, + struct pipe_screen *pscreen, struct pipe_resource *pt, + unsigned level, unsigned layer, unsigned flags, + struct pipe_surface **res) { if(likely((pt->target == PIPE_TEXTURE_2D || pt->target == PIPE_TEXTURE_RECT) && us->u.array)) { @@ -54,11 +62,12 @@ util_surfaces_get(struct util_surfaces *us, unsigned surface_struct_size, struct if(ps) { p_atomic_inc(&ps->reference.count); - return ps; + *res = ps; + return FALSE; } } - return util_surfaces_do_get(us, surface_struct_size, pscreen, pt, level, layer, flags); + return util_surfaces_do_get(us, surface_struct_size, pscreen, pt, level, layer, flags, res); } static INLINE struct pipe_surface * |