1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
32 #include "pipe/p_compiler.h"
33 #include "pipe/p_state.h"
35 #include "tr_screen.h"
49 struct pipe_resource base
;
51 struct pipe_resource
*resource
;
59 struct pipe_surface base
;
61 struct pipe_surface
*surface
;
67 struct trace_sampler_view
69 struct pipe_sampler_view base
;
71 struct pipe_sampler_view
*sampler_view
;
77 struct pipe_transfer base
;
79 struct pipe_transfer
*transfer
;
80 struct pipe_context
*pipe
;
88 static INLINE
struct trace_resource
*
89 trace_resource(struct pipe_resource
*texture
)
93 (void)trace_screen(texture
->screen
);
94 return (struct trace_resource
*)texture
;
98 static INLINE
struct trace_surface
*
99 trace_surface(struct pipe_surface
*surface
)
103 (void)trace_resource(surface
->texture
);
104 return (struct trace_surface
*)surface
;
108 static INLINE
struct trace_sampler_view
*
109 trace_sampler_view(struct pipe_sampler_view
*sampler_view
)
113 return (struct trace_sampler_view
*)sampler_view
;
117 static INLINE
struct trace_transfer
*
118 trace_transfer(struct pipe_transfer
*transfer
)
122 (void)trace_resource(transfer
->resource
);
123 return (struct trace_transfer
*)transfer
;
127 struct pipe_resource
*
128 trace_resource_create(struct trace_screen
*tr_scr
,
129 struct pipe_resource
*texture
);
132 trace_resource_destroy(struct trace_screen
*tr_scr
,
133 struct trace_resource
*tr_res
);
135 struct pipe_surface
*
136 trace_surf_create(struct trace_context
*tr_ctx
,
137 struct trace_resource
*tr_res
,
138 struct pipe_surface
*surface
);
141 trace_surf_destroy(struct trace_surface
*tr_surf
);
143 struct pipe_transfer
*
144 trace_transfer_create(struct trace_context
*tr_ctx
,
145 struct trace_resource
*tr_res
,
146 struct pipe_transfer
*transfer
);
149 trace_transfer_destroy(struct trace_context
*tr_ctx
,
150 struct trace_transfer
*tr_trans
);
153 #endif /* TR_TEXTURE_H_ */