brw_screen.c File Reference

Include dependency graph for brw_screen.c:

Go to the source code of this file.

Functions

static const char * brw_get_vendor (struct pipe_screen *screen)
static const char * brw_get_name (struct pipe_screen *screen)
static int brw_get_param (struct pipe_screen *screen, int param)
static float brw_get_paramf (struct pipe_screen *screen, int param)
static boolean brw_is_format_supported (struct pipe_screen *screen, enum pipe_format format, enum pipe_texture_target target, unsigned tex_usage, unsigned geom_flags)
static void brw_destroy_screen (struct pipe_screen *screen)
struct pipe_screenbrw_create_screen (struct pipe_winsys *winsys, uint pci_id)
 Create a new brw_screen object.


Function Documentation

struct pipe_screen* brw_create_screen ( struct pipe_winsys winsys,
uint  pci_id 
) [read]

Create a new brw_screen object.

Definition at line 222 of file brw_screen.c.

References brw_destroy_screen(), brw_get_name(), brw_get_param(), brw_get_paramf(), brw_get_vendor(), brw_init_screen_texture_funcs(), brw_is_format_supported(), 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, brw_screen::pci_id, brw_screen::screen, and pipe_screen::winsys.

00223 {
00224    struct brw_screen *brwscreen = CALLOC_STRUCT(brw_screen);
00225 
00226    if (!brwscreen)
00227       return NULL;
00228 
00229    brwscreen->pci_id = pci_id;
00230 
00231    brwscreen->screen.winsys = winsys;
00232 
00233    brwscreen->screen.destroy = brw_destroy_screen;
00234 
00235    brwscreen->screen.get_name = brw_get_name;
00236    brwscreen->screen.get_vendor = brw_get_vendor;
00237    brwscreen->screen.get_param = brw_get_param;
00238    brwscreen->screen.get_paramf = brw_get_paramf;
00239    brwscreen->screen.is_format_supported = brw_is_format_supported;
00240 
00241    brw_init_screen_texture_funcs(&brwscreen->screen);
00242 
00243    return &brwscreen->screen;
00244 }

static void brw_destroy_screen ( struct pipe_screen screen  )  [static]

Definition at line 207 of file brw_screen.c.

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

00208 {
00209    struct pipe_winsys *winsys = screen->winsys;
00210 
00211    if(winsys->destroy)
00212       winsys->destroy(winsys);
00213 
00214    FREE(screen);
00215 }

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

Definition at line 46 of file brw_screen.c.

References brw_screen(), PCI_CHIP_I965_G, PCI_CHIP_I965_G_1, PCI_CHIP_I965_GM, PCI_CHIP_I965_GME, PCI_CHIP_I965_Q, and util_snprintf.

00047 {
00048    static char buffer[128];
00049    const char *chipset;
00050 
00051    switch (brw_screen(screen)->pci_id) {
00052    case PCI_CHIP_I965_Q:
00053       chipset = "Intel(R) 965Q";
00054       break;
00055    case PCI_CHIP_I965_G:
00056    case PCI_CHIP_I965_G_1:
00057       chipset = "Intel(R) 965G";
00058       break;
00059    case PCI_CHIP_I965_GM:
00060       chipset = "Intel(R) 965GM";
00061       break;
00062    case PCI_CHIP_I965_GME:
00063       chipset = "Intel(R) 965GME/GLE";
00064       break;
00065    default:
00066       chipset = "unknown";
00067       break;
00068    }
00069 
00070    util_snprintf(buffer, sizeof(buffer), "i965 (chipset: %s)", chipset);
00071    return buffer;
00072 }

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

Definition at line 76 of file brw_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_SHADOW_MAP, and PIPE_CAP_TWO_SIDED_STENCIL.

00077 {
00078    switch (param) {
00079    case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
00080       return 8;
00081    case PIPE_CAP_NPOT_TEXTURES:
00082       return 1;
00083    case PIPE_CAP_TWO_SIDED_STENCIL:
00084       return 1;
00085    case PIPE_CAP_GLSL:
00086       return 0;
00087    case PIPE_CAP_S3TC:
00088       return 0;
00089    case PIPE_CAP_ANISOTROPIC_FILTER:
00090       return 0;
00091    case PIPE_CAP_POINT_SPRITE:
00092       return 0;
00093    case PIPE_CAP_MAX_RENDER_TARGETS:
00094       return 1;
00095    case PIPE_CAP_OCCLUSION_QUERY:
00096       return 0;
00097    case PIPE_CAP_TEXTURE_SHADOW_MAP:
00098       return 1;
00099    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
00100       return 11; /* max 1024x1024 */
00101    case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
00102       return 8;  /* max 128x128x128 */
00103    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
00104       return 11; /* max 1024x1024 */
00105    default:
00106       return 0;
00107    }
00108 }

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

Definition at line 112 of file brw_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.

00113 {
00114    switch (param) {
00115    case PIPE_CAP_MAX_LINE_WIDTH:
00116       /* fall-through */
00117    case PIPE_CAP_MAX_LINE_WIDTH_AA:
00118       return 7.5;
00119 
00120    case PIPE_CAP_MAX_POINT_WIDTH:
00121       /* fall-through */
00122    case PIPE_CAP_MAX_POINT_WIDTH_AA:
00123       return 255.0;
00124 
00125    case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
00126       return 4.0;
00127 
00128    case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
00129       return 16.0;
00130 
00131    default:
00132       return 0;
00133    }
00134 }

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

Definition at line 39 of file brw_screen.c.

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

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

Definition at line 138 of file brw_screen.c.

References Elements, FALSE, PIPE_FORMAT_A8_UNORM, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_I8_UNORM, PIPE_FORMAT_L8_UNORM, PIPE_FORMAT_R5G6B5_UNORM, PIPE_FORMAT_R8G8B8A8_UNORM, PIPE_FORMAT_S8Z24_UNORM, PIPE_FORMAT_YCBCR, PIPE_FORMAT_YCBCR_REV, PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z32_UNORM, and TRUE.

00143 {
00144 #if 0
00145    /* XXX: This is broken -- rewrite if still needed. */
00146    static const unsigned tex_supported[] = {
00147       PIPE_FORMAT_R8G8B8A8_UNORM,
00148       PIPE_FORMAT_A8R8G8B8_UNORM,
00149       PIPE_FORMAT_R5G6B5_UNORM,
00150       PIPE_FORMAT_L8_UNORM,
00151       PIPE_FORMAT_A8_UNORM,
00152       PIPE_FORMAT_I8_UNORM,
00153       PIPE_FORMAT_L8A8_UNORM,
00154       PIPE_FORMAT_YCBCR,
00155       PIPE_FORMAT_YCBCR_REV,
00156       PIPE_FORMAT_S8_Z24,
00157    };
00158 
00159 
00160    /* Actually a lot more than this - add later:
00161     */
00162    static const unsigned render_supported[] = {
00163       PIPE_FORMAT_A8R8G8B8_UNORM,
00164       PIPE_FORMAT_R5G6B5_UNORM,
00165    };
00166 
00167    /*
00168     */
00169    static const unsigned z_stencil_supported[] = {
00170       PIPE_FORMAT_Z16_UNORM,
00171       PIPE_FORMAT_Z32_UNORM,
00172       PIPE_FORMAT_S8Z24_UNORM,
00173    };
00174 
00175    switch (type) {
00176    case PIPE_RENDER_FORMAT:
00177       *numFormats = Elements(render_supported);
00178       return render_supported;
00179 
00180    case PIPE_TEX_FORMAT:
00181       *numFormats = Elements(tex_supported);
00182       return render_supported;
00183 
00184    case PIPE_Z_STENCIL_FORMAT:
00185       *numFormats = Elements(render_supported);
00186       return render_supported;
00187 
00188    default:
00189       *numFormats = 0;
00190       return NULL;
00191    }
00192 #else
00193    switch (format) {
00194    case PIPE_FORMAT_A8R8G8B8_UNORM:
00195    case PIPE_FORMAT_R5G6B5_UNORM:
00196    case PIPE_FORMAT_S8Z24_UNORM:
00197       return TRUE;
00198    default:
00199       return FALSE;
00200    };
00201    return FALSE;
00202 #endif
00203 }


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