1 /**************************************************************************
3 * Copyright 2008 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 #include "pipe/p_util.h"
30 #include "pipe/p_winsys.h"
31 #include "pipe/p_defines.h"
32 #include "pipe/p_screen.h"
34 #include "cell_screen.h"
35 #include "cell_texture.h"
36 #include "cell_winsys.h"
40 cell_get_vendor(struct pipe_screen
*screen
)
42 return "Tungsten Graphics, Inc.";
47 cell_get_name(struct pipe_screen
*screen
)
54 cell_get_param(struct pipe_screen
*screen
, int param
)
57 case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS
:
58 return PIPE_MAX_SAMPLERS
;
59 case PIPE_CAP_NPOT_TEXTURES
:
61 case PIPE_CAP_TWO_SIDED_STENCIL
:
67 case PIPE_CAP_ANISOTROPIC_FILTER
:
69 case PIPE_CAP_POINT_SPRITE
:
71 case PIPE_CAP_MAX_RENDER_TARGETS
:
73 case PIPE_CAP_OCCLUSION_QUERY
:
75 case PIPE_CAP_TEXTURE_SHADOW_MAP
:
77 case PIPE_CAP_MAX_TEXTURE_2D_LEVELS
:
78 return 12; /* max 2Kx2K */
79 case PIPE_CAP_MAX_TEXTURE_3D_LEVELS
:
80 return 8; /* max 128x128x128 */
81 case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS
:
82 return 12; /* max 2Kx2K */
90 cell_get_paramf(struct pipe_screen
*screen
, int param
)
93 case PIPE_CAP_MAX_LINE_WIDTH
:
95 case PIPE_CAP_MAX_LINE_WIDTH_AA
:
96 return 255.0; /* arbitrary */
98 case PIPE_CAP_MAX_POINT_WIDTH
:
100 case PIPE_CAP_MAX_POINT_WIDTH_AA
:
101 return 255.0; /* arbitrary */
103 case PIPE_CAP_MAX_TEXTURE_ANISOTROPY
:
106 case PIPE_CAP_MAX_TEXTURE_LOD_BIAS
:
107 return 16.0; /* arbitrary */
116 cell_is_format_supported( struct pipe_screen
*screen
,
117 enum pipe_format format
, uint type
)
121 /* cell supports most texture formats, XXX for now anyway */
122 if (format
== PIPE_FORMAT_DXT5_RGBA
||
123 format
== PIPE_FORMAT_R8G8B8A8_SRGB
)
128 /* cell supports all (off-screen) surface formats, XXX for now */
138 cell_destroy_screen( struct pipe_screen
*screen
)
145 * Create a new pipe_screen object
146 * Note: we're not presently subclassing pipe_screen (no cell_screen) but
147 * that would be the place to put SPU thread/context info...
150 cell_create_screen(struct pipe_winsys
*winsys
)
152 struct pipe_screen
*screen
= CALLOC_STRUCT(pipe_screen
);
157 screen
->winsys
= winsys
;
159 screen
->destroy
= cell_destroy_screen
;
161 screen
->get_name
= cell_get_name
;
162 screen
->get_vendor
= cell_get_vendor
;
163 screen
->get_param
= cell_get_param
;
164 screen
->get_paramf
= cell_get_paramf
;
165 screen
->is_format_supported
= cell_is_format_supported
;
167 cell_init_screen_texture_funcs(screen
);