gallium: separate out floating-point CAPs into its own enum
authorMarek Olšák <maraeo@gmail.com>
Sat, 19 Nov 2011 21:38:22 +0000 (22:38 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 22 Nov 2011 19:56:50 +0000 (20:56 +0100)
The motivation behind this is to add some self-documentation in the code
about how each CAP can be used.

The idea is:
- enum pipe_cap is only valid in get_param
- enum pipe_capf is only valid in get_paramf

Which CAPs are floating-point have been determined based on how everybody
except svga implemented the functions. svga have been modified to match all
the other drivers.

Besides that, the floating-point CAPs are now prefixed with PIPE_CAPF_.

22 files changed:
src/gallium/auxiliary/util/u_caps.h
src/gallium/docs/source/screen.rst
src/gallium/drivers/cell/ppu/cell_screen.c
src/gallium/drivers/galahad/glhd_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i965/brw_screen.c
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/noop/noop_pipe.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nvc0/nvc0_screen.c
src/gallium/drivers/nvfx/nvfx_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/rbug/rbug_screen.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_screen.h
src/mesa/state_tracker/st_extensions.c

index 7bd2380041426f3c35372b289a3c3710d14fe920..038efc9f13e55c8b3ef32db4b656b7e289a1cc80 100644 (file)
@@ -50,7 +50,7 @@ enum u_caps_check_enum {
 
 /* Floats currently lose precision */
 #define UTIL_CHECK_FLOAT(cap, higher) \
-   UTIL_CAPS_CHECK_FLOAT, PIPE_CAP_##cap, (unsigned)(int)(higher)
+   UTIL_CAPS_CHECK_FLOAT, PIPE_CAPF_##cap, (unsigned)(int)(higher)
 
 #define UTIL_CHECK_FORMAT(format) \
    UTIL_CAPS_CHECK_FORMAT, PIPE_FORMAT_##format
index 017c28d1104d47756c397cf6e2b327c0edf54c72..8b504201b3eb85a94f6dbb78b32ea2d2d6db7ae7 100644 (file)
@@ -73,20 +73,26 @@ The integer capabilities:
 * ``PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER``: Whether the TGSI
   property FS_COORD_PIXEL_CENTER with value INTEGER is supported.
 
-The floating-point capabilities:
 
-* ``PIPE_CAP_MAX_LINE_WIDTH``: The maximum width of a regular line.
-* ``PIPE_CAP_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
-* ``PIPE_CAP_MAX_POINT_WIDTH``: The maximum width and height of a point.
-* ``PIPE_CAP_MAX_POINT_WIDTH_AA``: The maximum width and height of a smoothed point.
-* ``PIPE_CAP_MAX_TEXTURE_ANISOTROPY``: The maximum level of anisotropy that can be
+.. _pipe_capf:
+
+PIPE_CAPF_*
+^^^^^^^^^^^^^^^^
+
+The floating-point capabilities are:
+
+* ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
+* ``PIPE_CAPF_MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line.
+* ``PIPE_CAPF_MAX_POINT_WIDTH``: The maximum width and height of a point.
+* ``PIPE_CAPF_MAX_POINT_WIDTH_AA``: The maximum width and height of a smoothed point.
+* ``PIPE_CAPF_MAX_TEXTURE_ANISOTROPY``: The maximum level of anisotropy that can be
   applied to anisotropically filtered textures.
-* ``PIPE_CAP_MAX_TEXTURE_LOD_BIAS``: The maximum :term:`LOD` bias that may be applied
+* ``PIPE_CAPF_MAX_TEXTURE_LOD_BIAS``: The maximum :term:`LOD` bias that may be applied
   to filtered textures.
-* ``PIPE_CAP_GUARD_BAND_LEFT``,
-  ``PIPE_CAP_GUARD_BAND_TOP``,
-  ``PIPE_CAP_GUARD_BAND_RIGHT``,
-  ``PIPE_CAP_GUARD_BAND_BOTTOM``: TODO
+* ``PIPE_CAPF_GUARD_BAND_LEFT``,
+  ``PIPE_CAPF_GUARD_BAND_TOP``,
+  ``PIPE_CAPF_GUARD_BAND_RIGHT``,
+  ``PIPE_CAPF_GUARD_BAND_BOTTOM``: TODO
 
 
 .. _pipe_shader_cap:
index a4677fd9bc7949076a1da743b0cc9bc952c1a45a..7ffdcc51bbd4b2e5250fa23d043ccf009c49758c 100644 (file)
@@ -118,23 +118,23 @@ cell_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha
 }
 
 static float
-cell_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+cell_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 255.0; /* arbitrary */
 
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 255.0; /* arbitrary */
 
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 0.0;
 
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0; /* arbitrary */
 
    default:
index b4edebe49207b67f987c1a57dd6c96126b4b3680..2fe82fe695bea9e61d8d05b9d8022cf3ddfb6898 100644 (file)
@@ -92,7 +92,7 @@ galahad_screen_get_shader_param(struct pipe_screen *_screen,
 
 static float
 galahad_screen_get_paramf(struct pipe_screen *_screen,
-                           enum pipe_cap param)
+                           enum pipe_capf param)
 {
    struct galahad_screen *glhd_screen = galahad_screen(_screen);
    struct pipe_screen *screen = glhd_screen->screen;
index f0128a3fe3ae7863e19f07633b8a7298b64b1f7c..9341fa92457b7ed5086840bef5ae261cea2b7de3 100644 (file)
@@ -240,23 +240,23 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
 }
 
 static float
-i915_get_paramf(struct pipe_screen *screen, enum pipe_cap cap)
+i915_get_paramf(struct pipe_screen *screen, enum pipe_capf cap)
 {
    switch(cap) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 7.5;
 
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 255.0;
 
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 4.0;
 
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0;
 
    default:
index f4abd0fc4ec13c44191f864db5c286fda14bd297..b382e703a0c182d2d7fbcc3befef00547cbaa9d6 100644 (file)
@@ -248,23 +248,23 @@ brw_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shad
 }
 
 static float
-brw_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+brw_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 7.5;
 
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 255.0;
 
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 4.0;
 
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0;
 
    default:
index 9bf7fd4c0eebef38bebd17105cda3631d39a1d6e..5675c27c63b6c10ca75a35ebfec542c1888040b4 100644 (file)
@@ -89,7 +89,7 @@ identity_screen_get_shader_param(struct pipe_screen *_screen,
 
 static float
 identity_screen_get_paramf(struct pipe_screen *_screen,
-                           enum pipe_cap param)
+                           enum pipe_capf param)
 {
    struct identity_screen *id_screen = identity_screen(_screen);
    struct pipe_screen *screen = id_screen->screen;
index 9d77cf8128e3114f0dbc0b71fac4b351c68fb533..98b838be4dbd92b31ce414b9c32accd1e0acb8ba 100644 (file)
@@ -190,25 +190,25 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
 }
 
 static float
-llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 255.0; /* arbitrary */
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 255.0; /* arbitrary */
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 16.0; /* not actually signficant at this time */
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0; /* arbitrary */
-   case PIPE_CAP_GUARD_BAND_LEFT:
-   case PIPE_CAP_GUARD_BAND_TOP:
-   case PIPE_CAP_GUARD_BAND_RIGHT:
-   case PIPE_CAP_GUARD_BAND_BOTTOM:
+   case PIPE_CAPF_GUARD_BAND_LEFT:
+   case PIPE_CAPF_GUARD_BAND_TOP:
+   case PIPE_CAPF_GUARD_BAND_RIGHT:
+   case PIPE_CAPF_GUARD_BAND_BOTTOM:
       return 0.0;
    default:
       assert(0);
index baa42552c9d169be0455c7b50206b5c90d5f9786..ec20e0d25a906a16f3c15618889aed7c56be8f3a 100644 (file)
@@ -329,7 +329,8 @@ static int noop_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        return screen->get_param(screen, param);
 }
 
-static float noop_get_paramf(struct pipe_screen* pscreen, enum pipe_cap param)
+static float noop_get_paramf(struct pipe_screen* pscreen,
+                            enum pipe_capf param)
 {
        struct pipe_screen *screen = ((struct noop_pipe_screen*)pscreen)->oscreen;
 
index 278b3ee20efbcd7712599b0d4207676eda4f7bc5..47eba85ba84e35b3988193b226f12ffbb9e8064c 100644 (file)
@@ -200,18 +200,18 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
 }
 
 static float
-nv50_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_cap param)
+nv50_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 10.0f;
-   case PIPE_CAP_MAX_POINT_WIDTH:
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 64.0f;
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 16.0f;
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 4.0f;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index 8b109a93a586f2d5ef2b90a541c5170c0a083c43..38f918ac83f127ef70c40b8eab3c181bf1826718 100644 (file)
@@ -192,18 +192,18 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
 }
 
 static float
-nvc0_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_cap param)
+nvc0_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 10.0f;
-   case PIPE_CAP_MAX_POINT_WIDTH:
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 64.0f;
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 16.0f;
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 4.0f;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index ce23144f2c2ee19c241f76b4602bf8929339b5a3..f56c6975a0bfc0aa0ec9859b73ab10c6f1219586 100644 (file)
@@ -188,20 +188,20 @@ nvfx_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, enum
 }
 
 static float
-nvfx_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_cap param)
+nvfx_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capf param)
 {
        struct nvfx_screen *screen = nvfx_screen(pscreen);
 
        switch (param) {
-       case PIPE_CAP_MAX_LINE_WIDTH:
-       case PIPE_CAP_MAX_LINE_WIDTH_AA:
+       case PIPE_CAPF_MAX_LINE_WIDTH:
+       case PIPE_CAPF_MAX_LINE_WIDTH_AA:
                return 10.0;
-       case PIPE_CAP_MAX_POINT_WIDTH:
-       case PIPE_CAP_MAX_POINT_WIDTH_AA:
+       case PIPE_CAPF_MAX_POINT_WIDTH:
+       case PIPE_CAPF_MAX_POINT_WIDTH_AA:
                return 64.0;
-       case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+       case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
                return screen->use_nv4x ? 16.0 : 8.0;
-       case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+       case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
                return 15.0;
        default:
                NOUVEAU_ERR("Unknown PIPE_CAP %d\n", param);
index aa7005c50edb61a480e353b7f21e2dabb27406bd..24d15c4f1c6e605273d89d9e30a30e41eaf34d0c 100644 (file)
@@ -258,15 +258,16 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
     return 0;
 }
 
-static float r300_get_paramf(struct pipe_screen* pscreen, enum pipe_cap param)
+static float r300_get_paramf(struct pipe_screen* pscreen,
+                             enum pipe_capf param)
 {
     struct r300_screen* r300screen = r300_screen(pscreen);
 
     switch (param) {
-        case PIPE_CAP_MAX_LINE_WIDTH:
-        case PIPE_CAP_MAX_LINE_WIDTH_AA:
-        case PIPE_CAP_MAX_POINT_WIDTH:
-        case PIPE_CAP_MAX_POINT_WIDTH_AA:
+        case PIPE_CAPF_MAX_LINE_WIDTH:
+        case PIPE_CAPF_MAX_LINE_WIDTH_AA:
+        case PIPE_CAPF_MAX_POINT_WIDTH:
+        case PIPE_CAPF_MAX_POINT_WIDTH_AA:
             /* The maximum dimensions of the colorbuffer are our practical
              * rendering limits. 2048 pixels should be enough for anybody. */
             if (r300screen->caps.is_r500) {
@@ -276,14 +277,14 @@ static float r300_get_paramf(struct pipe_screen* pscreen, enum pipe_cap param)
             } else {
                 return 2560.0f;
             }
-        case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+        case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
             return 16.0f;
-        case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+        case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
             return 16.0f;
-        case PIPE_CAP_GUARD_BAND_LEFT:
-        case PIPE_CAP_GUARD_BAND_TOP:
-        case PIPE_CAP_GUARD_BAND_RIGHT:
-        case PIPE_CAP_GUARD_BAND_BOTTOM:
+        case PIPE_CAPF_GUARD_BAND_LEFT:
+        case PIPE_CAPF_GUARD_BAND_TOP:
+        case PIPE_CAPF_GUARD_BAND_RIGHT:
+        case PIPE_CAPF_GUARD_BAND_BOTTOM:
             /* XXX I don't know what these should be but the least we can do is
              * silence the potential error message */
             return 0.0f;
index 10d7ac285d316dcfd69767a73e012e75ff6a7a36..b0aae534a6d17e09072784cdb4426f51a91a9dba 100644 (file)
@@ -1074,7 +1074,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
         /* Per-vertex point size.
          * Clamp to [0, max FB size] */
         psiz = pipe->screen->get_paramf(pipe->screen,
-                                        PIPE_CAP_MAX_POINT_WIDTH);
+                                        PIPE_CAPF_MAX_POINT_WIDTH);
         point_minmax =
             pack_float_16_6x(psiz) << R300_GA_POINT_MINMAX_MAX_SHIFT;
     } else {
index ad5863a0ece9e8bb2d733ad23081d748fa8f3c98..c31ddc254c36c5f7ffa8bf212c4b709fbb5f1f57 100644 (file)
@@ -432,23 +432,24 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        }
 }
 
-static float r600_get_paramf(struct pipe_screen* pscreen, enum pipe_cap param)
+static float r600_get_paramf(struct pipe_screen* pscreen,
+                            enum pipe_capf param)
 {
        struct r600_screen *rscreen = (struct r600_screen *)pscreen;
        enum radeon_family family = rscreen->family;
 
        switch (param) {
-       case PIPE_CAP_MAX_LINE_WIDTH:
-       case PIPE_CAP_MAX_LINE_WIDTH_AA:
-       case PIPE_CAP_MAX_POINT_WIDTH:
-       case PIPE_CAP_MAX_POINT_WIDTH_AA:
+       case PIPE_CAPF_MAX_LINE_WIDTH:
+       case PIPE_CAPF_MAX_LINE_WIDTH_AA:
+       case PIPE_CAPF_MAX_POINT_WIDTH:
+       case PIPE_CAPF_MAX_POINT_WIDTH_AA:
                if (family >= CHIP_CEDAR)
                        return 16384.0f;
                else
                        return 8192.0f;
-       case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+       case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
                return 16.0f;
-       case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+       case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
                return 16.0f;
        default:
                R600_ERR("r600: unsupported paramf %d\n", param);
index 7c8dfdcc12a145eb075c62784c0275bf68c84911..fe7cdd8125167b464cffa9ef8e9eeb15ddf2ddbb 100644 (file)
@@ -92,7 +92,7 @@ rbug_screen_get_shader_param(struct pipe_screen *_screen,
 
 static float
 rbug_screen_get_paramf(struct pipe_screen *_screen,
-                       enum pipe_cap param)
+                       enum pipe_capf param)
 {
    struct rbug_screen *rb_screen = rbug_screen(_screen);
    struct pipe_screen *screen = rb_screen->screen;
index 4b71a35f1706813179661672406e011b57d5647e..7a09be7cfa0cc8d4bec83cab19541088783b05f3 100644 (file)
@@ -155,20 +155,20 @@ softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
 }
 
 static float
-softpipe_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+softpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 255.0; /* arbitrary */
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       return 255.0; /* arbitrary */
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       return 16.0;
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0; /* arbitrary */
    default:
       return 0;
index b6061abd467b2bb66e05a54f6f0fac79e9fd63d7..e8970effcce38e1606aa0ead05cf71d058199fde 100644 (file)
@@ -94,34 +94,48 @@ svga_get_name( struct pipe_screen *pscreen )
 
 
 static float
-svga_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
+svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 {
    struct svga_screen *svgascreen = svga_screen(screen);
    struct svga_winsys_screen *sws = svgascreen->sws;
    SVGA3dDevCapResult result;
 
    switch (param) {
-   case PIPE_CAP_MAX_LINE_WIDTH:
+   case PIPE_CAPF_MAX_LINE_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_LINE_WIDTH_AA:
+   case PIPE_CAPF_MAX_LINE_WIDTH_AA:
       return 7.0;
 
-   case PIPE_CAP_MAX_POINT_WIDTH:
+   case PIPE_CAPF_MAX_POINT_WIDTH:
       /* fall-through */
-   case PIPE_CAP_MAX_POINT_WIDTH_AA:
+   case PIPE_CAPF_MAX_POINT_WIDTH_AA:
       /* Keep this to a reasonable size to avoid failures in
        * conform/pntaa.c:
        */
       return SVGA_MAX_POINTSIZE;
 
-   case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+   case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
       if(!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY, &result))
          return 4.0;
       return result.u;
 
-   case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+   case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
       return 16.0;
 
+   default:
+      return 0;
+   }
+}
+
+
+static int
+svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
+{
+   struct svga_screen *svgascreen = svga_screen(screen);
+   struct svga_winsys_screen *sws = svgascreen->sws;
+   SVGA3dDevCapResult result;
+
+   switch (param) {
    case PIPE_CAP_MAX_COMBINED_SAMPLERS:
       return 16;
    case PIPE_CAP_NPOT_TEXTURES:
@@ -194,15 +208,6 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
    }
 }
 
-
-/* This is a fairly pointless interface
- */
-static int
-svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
-{
-   return (int) svga_get_paramf( screen, param );
-}
-
 static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param)
 {
    struct svga_screen *svgascreen = svga_screen(screen);
index a7d33661838edc1f1d9129867c82220b02ff7f9a..362b21a810e6fd37d1c9da63b2b5be851986ac34 100644 (file)
@@ -132,7 +132,7 @@ trace_screen_get_shader_param(struct pipe_screen *_screen, unsigned shader,
 
 static float
 trace_screen_get_paramf(struct pipe_screen *_screen,
-                        enum pipe_cap param)
+                        enum pipe_capf param)
 {
    struct trace_screen *tr_scr = trace_screen(_screen);
    struct pipe_screen *screen = tr_scr->screen;
index afbf0af67dc40111aa6c4116a0913047bc77da43..8a077f0e36cd3d4e34b816f7b4abf0e3d853182e 100644 (file)
@@ -419,7 +419,7 @@ enum pipe_transfer_usage {
 
 /**
  * Implementation capabilities/limits which are queried through
- * pipe_screen::get_param() and pipe_screen::get_paramf().
+ * pipe_screen::get_param()
  */
 enum pipe_cap {
    PIPE_CAP_NPOT_TEXTURES = 1,
@@ -435,16 +435,6 @@ enum pipe_cap {
    PIPE_CAP_MAX_TEXTURE_2D_LEVELS = 12,
    PIPE_CAP_MAX_TEXTURE_3D_LEVELS = 13,
    PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS = 14,
-   PIPE_CAP_MAX_LINE_WIDTH = 15,
-   PIPE_CAP_MAX_LINE_WIDTH_AA = 16,
-   PIPE_CAP_MAX_POINT_WIDTH = 17,
-   PIPE_CAP_MAX_POINT_WIDTH_AA = 18,
-   PIPE_CAP_MAX_TEXTURE_ANISOTROPY = 19,
-   PIPE_CAP_MAX_TEXTURE_LOD_BIAS = 20,
-   PIPE_CAP_GUARD_BAND_LEFT = 21,  /*< float */
-   PIPE_CAP_GUARD_BAND_TOP = 22,  /*< float */
-   PIPE_CAP_GUARD_BAND_RIGHT = 23,  /*< float */
-   PIPE_CAP_GUARD_BAND_BOTTOM = 24,  /*< float */
    PIPE_CAP_TEXTURE_MIRROR_CLAMP = 25,
    PIPE_CAP_BLEND_EQUATION_SEPARATE = 28,
    PIPE_CAP_SM3 = 29,  /*< Shader Model, supported */
@@ -478,6 +468,24 @@ enum pipe_cap {
    PIPE_CAP_TEXTURE_BARRIER = 53
 };
 
+/**
+ * Implementation limits which are queried through
+ * pipe_screen::get_paramf()
+ */
+enum pipe_capf
+{
+   PIPE_CAPF_MAX_LINE_WIDTH = 15,
+   PIPE_CAPF_MAX_LINE_WIDTH_AA = 16,
+   PIPE_CAPF_MAX_POINT_WIDTH = 17,
+   PIPE_CAPF_MAX_POINT_WIDTH_AA = 18,
+   PIPE_CAPF_MAX_TEXTURE_ANISOTROPY = 19,
+   PIPE_CAPF_MAX_TEXTURE_LOD_BIAS = 20,
+   PIPE_CAPF_GUARD_BAND_LEFT = 21,  /*< float */
+   PIPE_CAPF_GUARD_BAND_TOP = 22,  /*< float */
+   PIPE_CAPF_GUARD_BAND_RIGHT = 23,  /*< float */
+   PIPE_CAPF_GUARD_BAND_BOTTOM = 24,  /*< float */
+};
+
 /* Shader caps not specific to any single stage */
 enum pipe_shader_cap
 {
index 6821edd4a566d6b1a95f9594976c027210b12186..70d41357898a92e84f9d182c907369737a12ab83 100644 (file)
@@ -85,7 +85,7 @@ struct pipe_screen {
     * Query a float-valued capability/parameter/limit
     * \param param  one of PIPE_CAP_x
     */
-   float (*get_paramf)( struct pipe_screen *, enum pipe_cap param );
+   float (*get_paramf)( struct pipe_screen *, enum pipe_capf param );
 
    /**
     * Query a per-shader-stage integer-valued capability/parameter/limit
index 544f0b6952a60f897908d28a676b1b39ab7fedb4..25a6cdc7572b5833932b40fcd9485ca6aacbdeb7 100644 (file)
@@ -113,14 +113,18 @@ void st_init_limits(struct st_context *st)
               1, MAX_DRAW_BUFFERS);
 
    c->MaxLineWidth
-      = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
+      = _maxf(1.0f, screen->get_paramf(screen,
+                                       PIPE_CAPF_MAX_LINE_WIDTH));
    c->MaxLineWidthAA
-      = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
+      = _maxf(1.0f, screen->get_paramf(screen,
+                                       PIPE_CAPF_MAX_LINE_WIDTH_AA));
 
    c->MaxPointSize
-      = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
+      = _maxf(1.0f, screen->get_paramf(screen,
+                                       PIPE_CAPF_MAX_POINT_WIDTH));
    c->MaxPointSizeAA
-      = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
+      = _maxf(1.0f, screen->get_paramf(screen,
+                                       PIPE_CAPF_MAX_POINT_WIDTH_AA));
    /* called after _mesa_create_context/_mesa_init_point, fix default user
     * settable max point size up
     */
@@ -132,10 +136,11 @@ void st_init_limits(struct st_context *st)
    c->MinPointSizeAA = 0.0f;
 
    c->MaxTextureMaxAnisotropy
-      = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
+      = _maxf(2.0f, screen->get_paramf(screen,
+                                 PIPE_CAPF_MAX_TEXTURE_ANISOTROPY));
 
    c->MaxTextureLodBias
-      = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);
+      = screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS);
 
    c->MaxDrawBuffers
       = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),