32
32
#include "pipe/p_compiler.h"
33
33
#include "pipe/p_state.h"
34
#include "pipe/p_video_state.h"
36
35
#include "id_screen.h"
39
struct identity_buffer
37
struct identity_context;
40
struct identity_resource
41
struct pipe_buffer base;
42
struct pipe_resource base;
43
struct pipe_buffer *buffer;
44
struct pipe_resource *resource;
47
struct identity_texture
48
struct identity_sampler_view
49
struct pipe_texture base;
50
struct pipe_sampler_view base;
51
struct pipe_texture *texture;
52
struct pipe_sampler_view *sampler_view;
71
struct identity_video_surface
73
struct pipe_video_surface base;
75
struct pipe_video_surface *video_surface;
79
static INLINE struct identity_buffer *
80
identity_buffer(struct pipe_buffer *_buffer)
72
static INLINE struct identity_resource *
73
identity_resource(struct pipe_resource *_resource)
84
(void)identity_screen(_buffer->screen);
85
return (struct identity_buffer *)_buffer;
77
(void)identity_screen(_resource->screen);
78
return (struct identity_resource *)_resource;
88
static INLINE struct identity_texture *
89
identity_texture(struct pipe_texture *_texture)
81
static INLINE struct identity_sampler_view *
82
identity_sampler_view(struct pipe_sampler_view *_sampler_view)
93
(void)identity_screen(_texture->screen);
94
return (struct identity_texture *)_texture;
87
return (struct identity_sampler_view *)_sampler_view;
97
90
static INLINE struct identity_surface *
111
(void)identity_texture(_transfer->texture);
104
(void)identity_resource(_transfer->resource);
112
105
return (struct identity_transfer *)_transfer;
115
static INLINE struct identity_video_surface *
116
identity_video_surface(struct pipe_video_surface *_video_surface)
118
if (!_video_surface) {
108
static INLINE struct pipe_resource *
109
identity_resource_unwrap(struct pipe_resource *_resource)
113
return identity_resource(_resource)->resource;
116
static INLINE struct pipe_sampler_view *
117
identity_sampler_view_unwrap(struct pipe_sampler_view *_sampler_view)
119
if (!_sampler_view) {
121
(void)identity_screen(_video_surface->screen);
122
return (struct identity_video_surface *)_video_surface;
125
static INLINE struct pipe_buffer *
126
identity_buffer_unwrap(struct pipe_buffer *_buffer)
130
return identity_buffer(_buffer)->buffer;
133
static INLINE struct pipe_texture *
134
identity_texture_unwrap(struct pipe_texture *_texture)
138
return identity_texture(_texture)->texture;
122
return identity_sampler_view(_sampler_view)->sampler_view;
141
125
static INLINE struct pipe_surface *
159
identity_buffer_create(struct identity_screen *id_screen,
160
struct pipe_buffer *buffer);
163
identity_buffer_destroy(struct identity_buffer *id_buffer);
165
struct pipe_texture *
166
identity_texture_create(struct identity_screen *id_screen,
167
struct pipe_texture *texture);
170
identity_texture_destroy(struct identity_texture *id_texture);
142
struct pipe_resource *
143
identity_resource_create(struct identity_screen *id_screen,
144
struct pipe_resource *resource);
147
identity_resource_destroy(struct identity_resource *id_resource);
172
149
struct pipe_surface *
173
identity_surface_create(struct identity_texture *id_texture,
150
identity_surface_create(struct identity_resource *id_resource,
174
151
struct pipe_surface *surface);
177
154
identity_surface_destroy(struct identity_surface *id_surface);
156
struct pipe_sampler_view *
157
identity_sampler_view_create(struct identity_context *id_context,
158
struct identity_resource *id_resource,
159
struct pipe_sampler_view *view);
162
identity_sampler_view_destroy(struct identity_context *id_context,
163
struct identity_sampler_view *id_sampler_view);
179
165
struct pipe_transfer *
180
identity_transfer_create(struct identity_texture *id_texture,
166
identity_transfer_create(struct identity_context *id_context,
167
struct identity_resource *id_resource,
181
168
struct pipe_transfer *transfer);
184
identity_transfer_destroy(struct identity_transfer *id_transfer);
186
struct pipe_video_surface *
187
identity_video_surface_create(struct identity_screen *id_screen,
188
struct pipe_video_surface *video_surface);
191
identity_video_surface_destroy(struct identity_video_surface *id_video_surface);
171
identity_transfer_destroy(struct identity_context *id_context,
172
struct identity_transfer *id_transfer);
194
175
#endif /* ID_OBJECTS_H */