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 **************************************************************************/
31 * Screen, Adapter or GPU
33 * These are driver functions/facilities that are context independent.
41 #include "pipe/p_compiler.h"
42 #include "pipe/p_state.h"
53 * Gallium screen/adapter context. Basically everything
54 * hardware-specific that doesn't actually require a rendering
58 struct pipe_winsys
*winsys
;
60 void (*destroy
)( struct pipe_screen
* );
63 const char *(*get_name
)( struct pipe_screen
* );
65 const char *(*get_vendor
)( struct pipe_screen
* );
68 * Query an integer-valued capability/parameter/limit
69 * \param param one of PIPE_CAP_x
71 int (*get_param
)( struct pipe_screen
*, int param
);
74 * Query a float-valued capability/parameter/limit
75 * \param param one of PIPE_CAP_x
77 float (*get_paramf
)( struct pipe_screen
*, int param
);
80 * Check if the given pipe_format is supported as a texture or
82 * \param tex_usage bitmask of PIPE_TEXTURE_USAGE_*
83 * \param flags bitmask of PIPE_TEXTURE_GEOM_*
85 boolean (*is_format_supported
)( struct pipe_screen
*,
86 enum pipe_format format
,
87 enum pipe_texture_target target
,
89 unsigned geom_flags
);
92 * Create a new texture object, using the given template info.
94 struct pipe_texture
* (*texture_create
)(struct pipe_screen
*,
95 const struct pipe_texture
*templat
);
98 * Create a new texture object, using the given template info, but on top of
101 * It is assumed that the buffer data is layed out according to the expected
102 * by the hardware. NULL will be returned if any inconsistency is found.
104 struct pipe_texture
* (*texture_blanket
)(struct pipe_screen
*,
105 const struct pipe_texture
*templat
,
106 const unsigned *pitch
,
107 struct pipe_buffer
*buffer
);
109 void (*texture_release
)(struct pipe_screen
*,
110 struct pipe_texture
**pt
);
112 /** Get a surface which is a "view" into a texture */
113 struct pipe_surface
*(*get_tex_surface
)(struct pipe_screen
*,
114 struct pipe_texture
*texture
,
115 unsigned face
, unsigned level
,
119 /* Surfaces allocated by the above must be released here:
121 void (*tex_surface_release
)( struct pipe_screen
*,
122 struct pipe_surface
** );
125 void *(*surface_map
)( struct pipe_screen
*,
126 struct pipe_surface
*surface
,
129 void (*surface_unmap
)( struct pipe_screen
*,
130 struct pipe_surface
*surface
);
139 #endif /* P_SCREEN_H */