1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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 TUNGSTEN GRAPHICS 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 **************************************************************************/
29 * Screen, Adapter or GPU
31 * These are driver functions/facilities that are context independent.
39 #include "pipe/p_compiler.h"
40 #include "pipe/p_state.h"
51 * Gallium screen/adapter context. Basically everything
52 * hardware-specific that doesn't actually require a rendering
56 struct pipe_winsys
*winsys
;
58 void (*destroy
)( struct pipe_screen
* );
61 const char *(*get_name
)( struct pipe_screen
* );
63 const char *(*get_vendor
)( struct pipe_screen
* );
66 * Query an integer-valued capability/parameter/limit
67 * \param param one of PIPE_CAP_x
69 int (*get_param
)( struct pipe_screen
*, int param
);
72 * Query a float-valued capability/parameter/limit
73 * \param param one of PIPE_CAP_x
75 float (*get_paramf
)( struct pipe_screen
*, int param
);
78 * Check if the given pipe_format is supported as a texture or
80 * \param tex_usage bitmask of PIPE_TEXTURE_USAGE_*
81 * \param flags bitmask of PIPE_TEXTURE_GEOM_*
83 boolean (*is_format_supported
)( struct pipe_screen
*,
84 enum pipe_format format
,
85 enum pipe_texture_target target
,
87 unsigned geom_flags
);
90 * Create a new texture object, using the given template info.
92 struct pipe_texture
* (*texture_create
)(struct pipe_screen
*,
93 const struct pipe_texture
*templat
);
96 * Create a new texture object, using the given template info, but on top of
99 * It is assumed that the buffer data is layed out according to the expected
100 * by the hardware. NULL will be returned if any inconsistency is found.
102 struct pipe_texture
* (*texture_blanket
)(struct pipe_screen
*,
103 const struct pipe_texture
*templat
,
104 const unsigned *pitch
,
105 struct pipe_buffer
*buffer
);
107 void (*texture_release
)(struct pipe_screen
*,
108 struct pipe_texture
**pt
);
110 /** Get a surface which is a "view" into a texture */
111 struct pipe_surface
*(*get_tex_surface
)(struct pipe_screen
*,
112 struct pipe_texture
*texture
,
113 unsigned face
, unsigned level
,
117 /* Surfaces allocated by the above must be released here:
119 void (*tex_surface_release
)( struct pipe_screen
*,
120 struct pipe_surface
** );
123 void *(*surface_map
)( struct pipe_screen
*,
124 struct pipe_surface
*surface
,
127 void (*surface_unmap
)( struct pipe_screen
*,
128 struct pipe_surface
*surface
);
137 #endif /* P_SCREEN_H */