gallium: start removing pipe_context->get_name/vendor/param/paramf
authorBrian <brian@i915.localnet.net>
Wed, 27 Feb 2008 18:24:35 +0000 (11:24 -0700)
committerBrian <brian@i915.localnet.net>
Wed, 27 Feb 2008 18:24:35 +0000 (11:24 -0700)
These are now per-screen functions, not per-context.
State tracker updated, code in drivers and p_context.h disabled.

13 files changed:
src/gallium/drivers/cell/ppu/cell_context.c
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/i915simple/Makefile
src/gallium/drivers/i915simple/SConscript
src/gallium/drivers/i915simple/i915_context.c
src/gallium/drivers/i965simple/Makefile
src/gallium/drivers/i965simple/SConscript
src/gallium/drivers/i965simple/brw_context.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/include/pipe/p_context.h
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_strings.c
src/mesa/state_tracker/st_extensions.c

index bb1838409fcccb188ffcd3f1bb86944930429050..351601473d2c1bea4c9b291a6d821c0bd41b2876 100644 (file)
@@ -77,30 +77,6 @@ cell_is_format_supported( struct pipe_context *pipe,
 }
 
 
-static int cell_get_param(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_param(pipe->screen, param);
-}
-
-static float cell_get_paramf(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_paramf(pipe->screen, param);
-}
-
-static const char *
-cell_get_name( struct pipe_context *pipe )
-{
-   return pipe->screen->get_name(pipe->screen);
-}
-
-static const char *
-cell_get_vendor( struct pipe_context *pipe )
-{
-   return pipe->screen->get_vendor(pipe->screen);
-}
-
-
-
 static void
 cell_destroy_context( struct pipe_context *pipe )
 {
@@ -148,11 +124,6 @@ cell_create_context(struct pipe_screen *screen,
 
    /* queries */
    cell->pipe.is_format_supported = cell_is_format_supported;
-   cell->pipe.get_name = cell_get_name;
-   cell->pipe.get_vendor = cell_get_vendor;
-   cell->pipe.get_param = cell_get_param;
-   cell->pipe.get_paramf = cell_get_paramf;
-
 
    /* state setters */
    cell->pipe.set_vertex_buffer = cell_set_vertex_buffer;
index 156f7399b031495c24e27702f0bbada438a909fc..d5e54f5d61a36ca91329af7149e82426d63f8d6e 100644 (file)
@@ -117,12 +117,15 @@ struct pipe_context *failover_create( struct pipe_context *hw,
    failover->hw = hw;
    failover->sw = sw;
    failover->pipe.winsys = hw->winsys;
+   failover->pipe.screen = hw->screen;
    failover->pipe.destroy = failover_destroy;
    failover->pipe.is_format_supported = hw->is_format_supported;
+#if 0
    failover->pipe.get_name = hw->get_name;
    failover->pipe.get_vendor = hw->get_vendor;
    failover->pipe.get_param = hw->get_param;
    failover->pipe.get_paramf = hw->get_paramf;
+#endif
 
    failover->pipe.draw_arrays = failover_draw_arrays;
    failover->pipe.draw_elements = failover_draw_elements;
index 3400747a73021338bf5550307cc2a04dfa77ff8c..41a61a0020b513a0f5cc365c41f5533050cb2279 100644 (file)
@@ -18,7 +18,6 @@ C_SOURCES = \
        i915_state_emit.c \
        i915_state_sampler.c \
        i915_screen.c \
-       i915_strings.c \
        i915_prim_emit.c \
        i915_prim_vbuf.c \
        i915_texture.c \
index 3e1beaea6d879938c9f094ccc4ecf47d8fbd0b13..2366e1247f2306a82d6d3292ee9fb2ffd554df7f 100644 (file)
@@ -22,7 +22,6 @@ i915simple = env.ConvenienceLibrary(
                'i915_state_emit.c',
                'i915_state_immediate.c',
                'i915_state_sampler.c',
-               'i915_strings.c',
                'i915_surface.c',
                'i915_texture.c',
        ])
index e89db8a13033e34521bf8ac09931f98a18dc85fb..42355552de13212c9ba0ee28acaf3239764b4a16 100644 (file)
@@ -91,22 +91,6 @@ i915_is_format_supported( struct pipe_context *pipe,
 }
 
 
-/* XXX temporary */
-static int
-i915_get_param(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_param(pipe->screen, param);
-}
-
-
-/* XXX temporary */
-static float
-i915_get_paramf(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_paramf(pipe->screen, param);
-}
-
-
 static void i915_destroy( struct pipe_context *pipe )
 {
    struct i915_context *i915 = i915_context( pipe );
@@ -205,8 +189,6 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
 
    i915->pipe.destroy = i915_destroy;
    i915->pipe.is_format_supported = i915_is_format_supported;
-   i915->pipe.get_param = i915_get_param;
-   i915->pipe.get_paramf = i915_get_paramf;
 
    i915->pipe.clear = i915_clear;
 
@@ -229,7 +211,6 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
    i915_init_surface_functions(i915);
    i915_init_state_functions(i915);
    i915_init_flush_functions(i915);
-   i915_init_string_functions(i915);
    i915_init_texture_functions(i915);
 
    draw_install_aaline_stage(i915->draw, &i915->pipe);
@@ -242,11 +223,6 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
     */
    i915->batch_start = NULL;
 
-   /*
-    * XXX we could plug GL selection/feedback into the drawing pipeline
-    * by specifying a different setup/render stage.
-    */
-
    return &i915->pipe;
 }
 
index 7b0df0f8508150f4db67d3f3574e0ff47567dd75..8589ebdf96436bdbe4c8e3db9c6ca83e04b0ec1e 100644 (file)
@@ -7,7 +7,6 @@ C_SOURCES = \
        brw_blit.c \
        brw_flush.c \
        brw_screen.c \
-       brw_strings.c \
        brw_surface.c \
        brw_cc.c \
        brw_clip.c \
index 74621de84c94cfe5aaf3f89cacbc4468fe477984..e0cc78826ec8134af6d843de4461a4076a63ff00 100644 (file)
@@ -35,7 +35,6 @@ i965simple = env.ConvenienceLibrary(
                'brw_state_cache.c',
                'brw_state_pool.c',
                'brw_state_upload.c',
-               'brw_strings.c',
                'brw_surface.c',
                'brw_tex_layout.c',
                'brw_urb.c',
index d90b32d4b400be1c50b30cf12cc667e6856196ba..e0a40372867a46933b97c5d65ab883476b755810 100644 (file)
@@ -71,20 +71,6 @@ static void brw_clear(struct pipe_context *pipe, struct pipe_surface *ps,
 }
 
 
-static int
-brw_get_param(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_param(pipe->screen, param);
-}
-
-
-static float
-brw_get_paramf(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_paramf(pipe->screen, param);
-}
-
-
 static boolean
 brw_is_format_supported( struct pipe_context *pipe,
                           enum pipe_format format, uint type )
@@ -173,15 +159,12 @@ struct pipe_context *brw_create(struct pipe_screen *screen,
 
    brw->pipe.destroy = brw_destroy;
    brw->pipe.is_format_supported = brw_is_format_supported;
-   brw->pipe.get_param = brw_get_param;
-   brw->pipe.get_paramf = brw_get_paramf;
    brw->pipe.clear = brw_clear;
 
    brw_init_surface_functions(brw);
    brw_init_texture_functions(brw);
    brw_init_state_functions(brw);
    brw_init_flush_functions(brw);
-   brw_init_string_functions(brw);
    brw_init_draw_functions( brw );
 
 
index 4ac1719cbbe48d2ee5663e7bad8aab47e2f38272..6a88c277aa63b460450c6c3c7e9917a1673ee42e 100644 (file)
@@ -143,27 +143,6 @@ static void softpipe_destroy( struct pipe_context *pipe )
 }
 
 
-/* XXX these will go away shortly */
-static const char *softpipe_get_name( struct pipe_context *pipe )
-{
-   return pipe->screen->get_name(pipe->screen);
-}
-
-static const char *softpipe_get_vendor( struct pipe_context *pipe )
-{
-   return pipe->screen->get_vendor(pipe->screen);
-}
-
-static int softpipe_get_param(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_param(pipe->screen, param);
-}
-
-static float softpipe_get_paramf(struct pipe_context *pipe, int param)
-{
-   return pipe->screen->get_paramf(pipe->screen, param);
-}
-
 struct pipe_context *
 softpipe_create( struct pipe_screen *screen,
                  struct pipe_winsys *pipe_winsys,
@@ -186,10 +165,6 @@ softpipe_create( struct pipe_screen *screen,
 
    /* queries */
    softpipe->pipe.is_format_supported = softpipe_is_format_supported;
-   softpipe->pipe.get_name = softpipe_get_name;
-   softpipe->pipe.get_vendor = softpipe_get_vendor;
-   softpipe->pipe.get_param = softpipe_get_param;
-   softpipe->pipe.get_paramf = softpipe_get_paramf;
 
    /* state setters */
    softpipe->pipe.create_blend_state = softpipe_create_blend_state;
index 93fcb1c3e962e5df537d3c54e7b15e6ef03f21ea..38ee95bdaddba6d5df1f1ea2231ab6fc56270fc6 100644 (file)
@@ -66,12 +66,15 @@ struct pipe_context {
    boolean (*is_format_supported)( struct pipe_context *pipe,
                                    enum pipe_format format, uint type );
 
+#if 0
+   /* XXX obsolete, moved into pipe_screen */
    const char *(*get_name)( struct pipe_context *pipe );
 
    const char *(*get_vendor)( struct pipe_context *pipe );
 
    int (*get_param)( struct pipe_context *pipe, int param );
    float (*get_paramf)( struct pipe_context *pipe, int param );
+#endif
 
 
    /*
index c83769898047faadafffae6ff00d7cb1fdf22c65..6245ce057f9d95c2c0132c0687e5bd03e7526b68 100644 (file)
@@ -649,7 +649,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
    /* XXX if DrawPixels image is larger than max texture size, break
     * it up into chunks.
     */
-   maxSize = 1 << (pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
+   maxSize = 1 << (pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
    assert(width <= maxSize);
    assert(height <= maxSize);
 
index c344df0ff1e21384282f78e5ba8381dc4f389242..247519ab3de7adc27d3844de61399cc0fd5aebce 100644 (file)
@@ -35,6 +35,7 @@
 #include "main/macros.h"
 #include "main/version.h"
 #include "pipe/p_context.h"
+#include "pipe/p_screen.h"
 #include "pipe/p_winsys.h"
 #include "st_context.h"
 #include "st_cb_strings.h"
@@ -45,11 +46,11 @@ static const GLubyte *
 st_get_string(GLcontext * ctx, GLenum name)
 {
    struct st_context *st = st_context(ctx);
-   struct pipe_context *pipe = st->pipe;
+   struct pipe_screen *screen = st->pipe->screen;
 
    switch (name) {
    case GL_VENDOR: {
-      const char *vendor = pipe->get_vendor( pipe );
+      const char *vendor = screen->get_vendor( screen );
       const char *tungsten = "Tungsten Graphics, Inc.";
 
       /* Tungsten developed the state_tracker module (and much of
@@ -68,8 +69,8 @@ st_get_string(GLcontext * ctx, GLenum name)
    case GL_RENDERER:
       snprintf(st->renderer, sizeof(st->renderer), "Gallium %s, %s on %s", 
                ST_VERSION_STRING,
-              pipe->get_name( pipe ),
-              pipe->winsys->get_name( pipe->winsys ));
+              screen->get_name( screen ),
+              screen->winsys->get_name( screen->winsys ));
 
       return (GLubyte *) st->renderer;
 
index 97d28d77c4b0407588910f62ac5a76529de61748..99d2a5fb9e92aa73896fafbef7da0d1101e0f6db 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
+#include "pipe/p_screen.h"
 
 #include "st_context.h"
 #include "st_extensions.h"
@@ -64,19 +65,19 @@ static int clamp(int a, int min, int max)
  */
 void st_init_limits(struct st_context *st)
 {
-   struct pipe_context *pipe = st->pipe;
+   struct pipe_screen *screen = st->pipe->screen;
    struct gl_constants *c = &st->ctx->Const;
 
    c->MaxTextureLevels
-      = min(pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
+      = min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
             MAX_TEXTURE_LEVELS);
 
    c->Max3DTextureLevels
-      = min(pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_3D_LEVELS),
+      = min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS),
             MAX_3D_TEXTURE_LEVELS);
 
    c->MaxCubeTextureLevels
-      = min(pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS),
+      = min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS),
             MAX_CUBE_TEXTURE_LEVELS);
 
    c->MaxTextureRectSize
@@ -84,31 +85,31 @@ void st_init_limits(struct st_context *st)
 
    c->MaxTextureImageUnits
       = c->MaxTextureCoordUnits
-      = min(pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
+      = min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
             MAX_TEXTURE_IMAGE_UNITS);
 
    c->MaxDrawBuffers
-      = clamp(pipe->get_param(pipe, PIPE_CAP_MAX_RENDER_TARGETS),
+      = clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
               1, MAX_DRAW_BUFFERS);
 
    c->MaxLineWidth
-      = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_LINE_WIDTH));
+      = max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
    c->MaxLineWidthAA
-      = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_LINE_WIDTH_AA));
+      = max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
 
    c->MaxPointSize
-      = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_POINT_WIDTH));
+      = max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
    c->MaxPointSizeAA
-      = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_POINT_WIDTH_AA));
+      = max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
 
    c->MaxTextureMaxAnisotropy
-      = max(2.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
+      = max(2.0, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
 
    c->MaxTextureLodBias
-      = pipe->get_paramf(pipe, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
+      = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
 
    st->bitmap_texcoord_bias
-      = pipe->get_paramf(pipe, PIPE_CAP_BITMAP_TEXCOORD_BIAS);
+      = screen->get_paramf(screen, PIPE_CAP_BITMAP_TEXCOORD_BIAS);
 }
 
 
@@ -117,7 +118,7 @@ void st_init_limits(struct st_context *st)
  */
 void st_init_extensions(struct st_context *st)
 {
-   struct pipe_context *pipe = st->pipe;
+   struct pipe_screen *screen = st->pipe->screen;
    GLcontext *ctx = st->ctx;
 
    /*
@@ -163,11 +164,11 @@ void st_init_extensions(struct st_context *st)
    /*
     * Extensions that depend on the driver/hardware:
     */
-   if (pipe->get_param(pipe, PIPE_CAP_MAX_RENDER_TARGETS) > 0) {
+   if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) {
       ctx->Extensions.ARB_draw_buffers = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_GLSL)) {
+   if (screen->get_param(screen, PIPE_CAP_GLSL)) {
       ctx->Extensions.ARB_fragment_shader = GL_TRUE;
       ctx->Extensions.ARB_vertex_shader = GL_TRUE;
       ctx->Extensions.ARB_shader_objects = GL_TRUE;
@@ -175,37 +176,37 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.ARB_shading_language_120 = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_NPOT_TEXTURES)) {
+   if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) {
       ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
       ctx->Extensions.NV_texture_rectangle = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) {
+   if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) {
       ctx->Extensions.ARB_multitexture = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_TWO_SIDED_STENCIL)) {
+   if (screen->get_param(screen, PIPE_CAP_TWO_SIDED_STENCIL)) {
       ctx->Extensions.ATI_separate_stencil = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_S3TC)) {
+   if (screen->get_param(screen, PIPE_CAP_S3TC)) {
       ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_ANISOTROPIC_FILTER)) {
+   if (screen->get_param(screen, PIPE_CAP_ANISOTROPIC_FILTER)) {
       ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_POINT_SPRITE)) {
+   if (screen->get_param(screen, PIPE_CAP_POINT_SPRITE)) {
       ctx->Extensions.ARB_point_sprite = GL_TRUE;
       ctx->Extensions.NV_point_sprite = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_OCCLUSION_QUERY)) {
+   if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) {
       ctx->Extensions.ARB_occlusion_query = GL_TRUE;
    }
 
-   if (pipe->get_param(pipe, PIPE_CAP_TEXTURE_SHADOW_MAP)) {
+   if (screen->get_param(screen, PIPE_CAP_TEXTURE_SHADOW_MAP)) {
       ctx->Extensions.ARB_depth_texture = GL_TRUE;
       ctx->Extensions.ARB_shadow = GL_TRUE;
       ctx->Extensions.EXT_shadow_funcs = GL_TRUE;