sp_screen.c File Reference

Include dependency graph for sp_screen.c:

Go to the source code of this file.

Functions

static const char * softpipe_get_vendor (struct pipe_screen *screen)
static const char * softpipe_get_name (struct pipe_screen *screen)
static int softpipe_get_param (struct pipe_screen *screen, int param)
static float softpipe_get_paramf (struct pipe_screen *screen, int param)
static boolean softpipe_is_format_supported (struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, unsigned tex_usage, unsigned geom_flags)
 Query format support for creating a texture, drawing surface, etc.
static void softpipe_destroy_screen (struct pipe_screen *screen)
struct pipe_screensoftpipe_create_screen (struct pipe_winsys *winsys)
 Create a new pipe_screen object Note: we're not presently subclassing pipe_screen (no softpipe_screen).


Function Documentation

struct pipe_screen* softpipe_create_screen ( struct pipe_winsys winsys  )  [read]

Create a new pipe_screen object Note: we're not presently subclassing pipe_screen (no softpipe_screen).

Definition at line 158 of file sp_screen.c.

References softpipe_screen::base, CALLOC_STRUCT, pipe_screen::destroy, pipe_screen::get_name, pipe_screen::get_param, pipe_screen::get_paramf, pipe_screen::get_vendor, pipe_screen::is_format_supported, softpipe_destroy_screen(), softpipe_get_name(), softpipe_get_param(), softpipe_get_paramf(), softpipe_get_vendor(), softpipe_init_screen_texture_funcs(), softpipe_is_format_supported(), and pipe_screen::winsys.

00159 {
00160    struct softpipe_screen *screen = CALLOC_STRUCT(softpipe_screen);
00161 
00162    if (!screen)
00163       return NULL;
00164 
00165    screen->base.winsys = winsys;
00166 
00167    screen->base.destroy = softpipe_destroy_screen;
00168 
00169    screen->base.get_name = softpipe_get_name;
00170    screen->base.get_vendor = softpipe_get_vendor;
00171    screen->base.get_param = softpipe_get_param;
00172    screen->base.get_paramf = softpipe_get_paramf;
00173    screen->base.is_format_supported = softpipe_is_format_supported;
00174 
00175    softpipe_init_screen_texture_funcs(&screen->base);
00176 
00177    return &screen->base;
00178 }

static void softpipe_destroy_screen ( struct pipe_screen screen  )  [static]

Definition at line 141 of file sp_screen.c.

References pipe_winsys::destroy, FREE, and pipe_screen::winsys.

00142 {
00143    struct pipe_winsys *winsys = screen->winsys;
00144 
00145    if(winsys->destroy)
00146       winsys->destroy(winsys);
00147 
00148    FREE(screen);
00149 }

static const char* softpipe_get_name ( struct pipe_screen screen  )  [static]

Definition at line 47 of file sp_screen.c.

00048 {
00049    return "softpipe";
00050 }

static int softpipe_get_param ( struct pipe_screen screen,
int  param 
) [static]

Definition at line 54 of file sp_screen.c.

References PIPE_CAP_ANISOTROPIC_FILTER, PIPE_CAP_GLSL, PIPE_CAP_MAX_RENDER_TARGETS, PIPE_CAP_MAX_TEXTURE_2D_LEVELS, PIPE_CAP_MAX_TEXTURE_3D_LEVELS, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS, PIPE_CAP_NPOT_TEXTURES, PIPE_CAP_OCCLUSION_QUERY, PIPE_CAP_POINT_SPRITE, PIPE_CAP_S3TC, PIPE_CAP_TEXTURE_MIRROR_CLAMP, PIPE_CAP_TEXTURE_MIRROR_REPEAT, PIPE_CAP_TEXTURE_SHADOW_MAP, PIPE_CAP_TWO_SIDED_STENCIL, and PIPE_MAX_COLOR_BUFS.

00055 {
00056    switch (param) {
00057    case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
00058       return 8;
00059    case PIPE_CAP_NPOT_TEXTURES:
00060       return 1;
00061    case PIPE_CAP_TWO_SIDED_STENCIL:
00062       return 1;
00063    case PIPE_CAP_GLSL:
00064       return 1;
00065    case PIPE_CAP_S3TC:
00066       return 0;
00067    case PIPE_CAP_ANISOTROPIC_FILTER:
00068       return 0;
00069    case PIPE_CAP_POINT_SPRITE:
00070       return 1;
00071    case PIPE_CAP_MAX_RENDER_TARGETS:
00072       return PIPE_MAX_COLOR_BUFS;
00073    case PIPE_CAP_OCCLUSION_QUERY:
00074       return 1;
00075    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
00076       return 1;
00077    case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
00078       return 1;
00079    case PIPE_CAP_TEXTURE_SHADOW_MAP:
00080       return 1;
00081    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
00082       return 12; /* max 2Kx2K */
00083    case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
00084       return 8;  /* max 128x128x128 */
00085    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
00086       return 12; /* max 2Kx2K */
00087    default:
00088       return 0;
00089    }
00090 }

static float softpipe_get_paramf ( struct pipe_screen screen,
int  param 
) [static]

Definition at line 94 of file sp_screen.c.

References PIPE_CAP_MAX_LINE_WIDTH, PIPE_CAP_MAX_LINE_WIDTH_AA, PIPE_CAP_MAX_POINT_WIDTH, PIPE_CAP_MAX_POINT_WIDTH_AA, PIPE_CAP_MAX_TEXTURE_ANISOTROPY, and PIPE_CAP_MAX_TEXTURE_LOD_BIAS.

00095 {
00096    switch (param) {
00097    case PIPE_CAP_MAX_LINE_WIDTH:
00098       /* fall-through */
00099    case PIPE_CAP_MAX_LINE_WIDTH_AA:
00100       return 255.0; /* arbitrary */
00101    case PIPE_CAP_MAX_POINT_WIDTH:
00102       /* fall-through */
00103    case PIPE_CAP_MAX_POINT_WIDTH_AA:
00104       return 255.0; /* arbitrary */
00105    case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
00106       return 0.0;
00107    case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
00108       return 16.0; /* arbitrary */
00109    default:
00110       return 0;
00111    }
00112 }

static const char* softpipe_get_vendor ( struct pipe_screen screen  )  [static]

Definition at line 40 of file sp_screen.c.

00041 {
00042    return "Tungsten Graphics, Inc.";
00043 }

static boolean softpipe_is_format_supported ( struct pipe_screen screen,
enum pipe_format  format,
enum pipe_texture_target  target,
unsigned  tex_usage,
unsigned  geom_flags 
) [static]

Query format support for creating a texture, drawing surface, etc.

Parameters:
format the format to test
type one of PIPE_TEXTURE, PIPE_SURFACE

Definition at line 121 of file sp_screen.c.

References FALSE, PIPE_FORMAT_DXT1_RGB, PIPE_FORMAT_DXT1_RGBA, PIPE_FORMAT_DXT3_RGBA, PIPE_FORMAT_DXT5_RGBA, PIPE_FORMAT_Z32_FLOAT, and TRUE.

00126 {
00127    switch(format) {
00128    case PIPE_FORMAT_DXT1_RGB:
00129    case PIPE_FORMAT_DXT1_RGBA:
00130    case PIPE_FORMAT_DXT3_RGBA:
00131    case PIPE_FORMAT_DXT5_RGBA:
00132    case PIPE_FORMAT_Z32_FLOAT:
00133       return FALSE;
00134    default:
00135       return TRUE;
00136    }
00137 }


Generated on Tue Sep 29 06:25:41 2009 for Gallium3D by  doxygen 1.5.4