summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-11-01 15:18:41 -0800
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-11-01 15:19:39 -0800
commit3bf12728325ce546a688dbb92379e913fd5e29f9 (patch)
tree55ebd430ed6dbd26186cbbb41cf514482623ee45
parent1f630fa0167ed799556a764178772c096a3ddeba (diff)
gallium: Convert PIPE_CAP to enum.gallium-api-cleanup
-rw-r--r--src/gallium/drivers/cell/ppu/cell_screen.c4
-rw-r--r--src/gallium/drivers/i915/i915_screen.c4
-rw-r--r--src/gallium/drivers/identity/id_screen.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c4
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.c4
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.c4
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.c4
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.c4
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.c4
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c4
-rw-r--r--src/gallium/drivers/r300/r300_screen.c6
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c4
-rw-r--r--src/gallium/drivers/trace/tr_screen.c4
-rw-r--r--src/gallium/include/pipe/p_defines.h84
-rw-r--r--src/gallium/include/pipe/p_screen.h4
15 files changed, 86 insertions, 56 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c
index d185c6b849..a852b2556a 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -53,7 +53,7 @@ cell_get_name(struct pipe_screen *screen)
static int
-cell_get_param(struct pipe_screen *screen, int param)
+cell_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -93,7 +93,7 @@ cell_get_param(struct pipe_screen *screen, int param)
static float
-cell_get_paramf(struct pipe_screen *screen, int param)
+cell_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index c66558c320..56a2720aa4 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -90,7 +90,7 @@ i915_get_name(struct pipe_screen *screen)
}
static int
-i915_get_param(struct pipe_screen *screen, int param)
+i915_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -123,7 +123,7 @@ i915_get_param(struct pipe_screen *screen, int param)
}
static float
-i915_get_paramf(struct pipe_screen *screen, int param)
+i915_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 26439637d0..e8575644c1 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -66,7 +66,7 @@ identity_screen_get_vendor(struct pipe_screen *_screen)
static int
identity_screen_get_param(struct pipe_screen *_screen,
- int param)
+ enum pipe_capability param)
{
struct identity_screen *id_screen = identity_screen(_screen);
struct pipe_screen *screen = id_screen->screen;
@@ -77,7 +77,7 @@ identity_screen_get_param(struct pipe_screen *_screen,
static float
identity_screen_get_paramf(struct pipe_screen *_screen,
- int param)
+ enum pipe_capability param)
{
struct identity_screen *id_screen = identity_screen(_screen);
struct pipe_screen *screen = id_screen->screen;
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 0518927458..680c930654 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -52,7 +52,7 @@ llvmpipe_get_name(struct pipe_screen *screen)
static int
-llvmpipe_get_param(struct pipe_screen *screen, int param)
+llvmpipe_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -96,7 +96,7 @@ llvmpipe_get_param(struct pipe_screen *screen, int param)
static float
-llvmpipe_get_paramf(struct pipe_screen *screen, int param)
+llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c
index 170ce3eb7e..089c7e5bc5 100644
--- a/src/gallium/drivers/nv04/nv04_screen.c
+++ b/src/gallium/drivers/nv04/nv04_screen.c
@@ -5,7 +5,7 @@
#include "nv04_screen.h"
static int
-nv04_screen_get_param(struct pipe_screen *screen, int param)
+nv04_screen_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -52,7 +52,7 @@ nv04_screen_get_param(struct pipe_screen *screen, int param)
}
static float
-nv04_screen_get_paramf(struct pipe_screen *screen, int param)
+nv04_screen_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c
index ee5901e743..9df9778d5e 100644
--- a/src/gallium/drivers/nv10/nv10_screen.c
+++ b/src/gallium/drivers/nv10/nv10_screen.c
@@ -4,7 +4,7 @@
#include "nv10_screen.h"
static int
-nv10_screen_get_param(struct pipe_screen *screen, int param)
+nv10_screen_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -47,7 +47,7 @@ nv10_screen_get_param(struct pipe_screen *screen, int param)
}
static float
-nv10_screen_get_paramf(struct pipe_screen *screen, int param)
+nv10_screen_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv20/nv20_screen.c b/src/gallium/drivers/nv20/nv20_screen.c
index 4eeacd1afd..520bed7302 100644
--- a/src/gallium/drivers/nv20/nv20_screen.c
+++ b/src/gallium/drivers/nv20/nv20_screen.c
@@ -4,7 +4,7 @@
#include "nv20_screen.h"
static int
-nv20_screen_get_param(struct pipe_screen *screen, int param)
+nv20_screen_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -47,7 +47,7 @@ nv20_screen_get_param(struct pipe_screen *screen, int param)
}
static float
-nv20_screen_get_paramf(struct pipe_screen *screen, int param)
+nv20_screen_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c
index 221ae1b5f8..500f9fb709 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -27,7 +27,7 @@ struct nouveau_winsys {
};
static int
-nv30_screen_get_param(struct pipe_screen *pscreen, int param)
+nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -74,7 +74,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, int param)
}
static float
-nv30_screen_get_paramf(struct pipe_screen *pscreen, int param)
+nv30_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c
index bd13dfddd1..3a6a50fbc8 100644
--- a/src/gallium/drivers/nv40/nv40_screen.c
+++ b/src/gallium/drivers/nv40/nv40_screen.c
@@ -8,7 +8,7 @@
#define NV6X_GRCLASS4497_CHIPSETS 0x00000088
static int
-nv40_screen_get_param(struct pipe_screen *pscreen, int param)
+nv40_screen_get_param(struct pipe_screen *pscreen, enum pipe_capability param)
{
struct nv40_screen *screen = nv40_screen(pscreen);
@@ -59,7 +59,7 @@ nv40_screen_get_param(struct pipe_screen *pscreen, int param)
}
static float
-nv40_screen_get_paramf(struct pipe_screen *pscreen, int param)
+nv40_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index c8d0f1e4d8..66ffe9352a 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -92,7 +92,7 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
}
static int
-nv50_screen_get_param(struct pipe_screen *pscreen, int param)
+nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -139,7 +139,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param)
}
static float
-nv50_screen_get_paramf(struct pipe_screen *pscreen, int param)
+nv50_screen_get_paramf(struct pipe_screen *pscreen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 390b63007e..c0981342ad 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -75,7 +75,8 @@ static const char* r300_get_name(struct pipe_screen* pscreen)
return chip_families[r300screen->caps->family];
}
-static int r300_get_param(struct pipe_screen* pscreen, int param)
+static int r300_get_param(struct pipe_screen* pscreen,
+ enum pipe_capability param)
{
struct r300_screen* r300screen = r300_screen(pscreen);
@@ -147,7 +148,8 @@ static int r300_get_param(struct pipe_screen* pscreen, int param)
}
}
-static float r300_get_paramf(struct pipe_screen* pscreen, int param)
+static float r300_get_paramf(struct pipe_screen* pscreen,
+ enum pipe_capability param)
{
struct r300_screen* r300screen = r300_screen(pscreen);
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 81fb7aa20c..6ddbd04362 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -52,7 +52,7 @@ softpipe_get_name(struct pipe_screen *screen)
static int
-softpipe_get_param(struct pipe_screen *screen, int param)
+softpipe_get_param(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
@@ -96,7 +96,7 @@ softpipe_get_param(struct pipe_screen *screen, int param)
static float
-softpipe_get_paramf(struct pipe_screen *screen, int param)
+softpipe_get_paramf(struct pipe_screen *screen, enum pipe_capability param)
{
switch (param) {
case PIPE_CAP_MAX_LINE_WIDTH:
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 7da9bd3866..28bc259dac 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -84,7 +84,7 @@ trace_screen_get_vendor(struct pipe_screen *_screen)
static int
trace_screen_get_param(struct pipe_screen *_screen,
- int param)
+ enum pipe_capability param)
{
struct trace_screen *tr_scr = trace_screen(_screen);
struct pipe_screen *screen = tr_scr->screen;
@@ -107,7 +107,7 @@ trace_screen_get_param(struct pipe_screen *_screen,
static float
trace_screen_get_paramf(struct pipe_screen *_screen,
- int param)
+ enum pipe_capability param)
{
struct trace_screen *tr_scr = trace_screen(_screen);
struct pipe_screen *screen = tr_scr->screen;
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 52887ea0ad..73a8f45710 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -305,34 +305,62 @@ enum pipe_transfer_usage {
* Implementation capabilities/limits which are queried through
* pipe_screen::get_param() and pipe_screen::get_paramf().
*/
-#define PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS 1
-#define PIPE_CAP_NPOT_TEXTURES 2
-#define PIPE_CAP_TWO_SIDED_STENCIL 3
-#define PIPE_CAP_GLSL 4 /* XXX need something better */
-#define PIPE_CAP_S3TC 5 /* XXX: deprecated; cap determined via supported sampler formats */
-#define PIPE_CAP_ANISOTROPIC_FILTER 6
-#define PIPE_CAP_POINT_SPRITE 7
-#define PIPE_CAP_MAX_RENDER_TARGETS 8
-#define PIPE_CAP_OCCLUSION_QUERY 9
-#define PIPE_CAP_TEXTURE_SHADOW_MAP 10
-#define PIPE_CAP_MAX_TEXTURE_2D_LEVELS 11
-#define PIPE_CAP_MAX_TEXTURE_3D_LEVELS 12
-#define PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS 13
-#define PIPE_CAP_MAX_LINE_WIDTH 14
-#define PIPE_CAP_MAX_LINE_WIDTH_AA 15
-#define PIPE_CAP_MAX_POINT_WIDTH 16
-#define PIPE_CAP_MAX_POINT_WIDTH_AA 17
-#define PIPE_CAP_MAX_TEXTURE_ANISOTROPY 18
-#define PIPE_CAP_MAX_TEXTURE_LOD_BIAS 19
-#define PIPE_CAP_GUARD_BAND_LEFT 20 /*< float */
-#define PIPE_CAP_GUARD_BAND_TOP 21 /*< float */
-#define PIPE_CAP_GUARD_BAND_RIGHT 22 /*< float */
-#define PIPE_CAP_GUARD_BAND_BOTTOM 23 /*< float */
-#define PIPE_CAP_TEXTURE_MIRROR_CLAMP 24
-#define PIPE_CAP_TEXTURE_MIRROR_REPEAT 25
-#define PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS 26
-#define PIPE_CAP_TGSI_CONT_SUPPORTED 27
-#define PIPE_CAP_BLEND_EQUATION_SEPARATE 28
+enum pipe_capability {
+ /* Maximum number of textures referenceable in fragment programs */
+ PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS,
+ /* XXX clarify */
+ PIPE_CAP_NPOT_TEXTURES,
+ /* Whether two-sided stencilling works */
+ PIPE_CAP_TWO_SIDED_STENCIL,
+ /* Whether GLSL is supported
+ * XXX need something better */
+ PIPE_CAP_GLSL,
+ /* XXX deprecated; cap determined via supported sampler formats */
+ PIPE_CAP_S3TC,
+ /* Whether anisotropic filtering works */
+ PIPE_CAP_ANISOTROPIC_FILTER,
+ /* Whether point sprites work */
+ PIPE_CAP_POINT_SPRITE,
+ /* Maximum number of multiple render targets */
+ PIPE_CAP_MAX_RENDER_TARGETS,
+ /* Whether occlusion queries work */
+ PIPE_CAP_OCCLUSION_QUERY,
+ /* Whether shadow mapping for textures works */
+ PIPE_CAP_TEXTURE_SHADOW_MAP,
+ /* Maximum number of mipmaps permitted for 2D textures */
+ PIPE_CAP_MAX_TEXTURE_2D_LEVELS,
+ /* Maximum number of mipmaps permitted for 3D textures */
+ PIPE_CAP_MAX_TEXTURE_3D_LEVELS,
+ /* Maximum number of mipmaps permitted for cubemaps */
+ PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS,
+ /* Maximum width of aliased lines */
+ PIPE_CAP_MAX_LINE_WIDTH,
+ /* Maximum width of anti-aliased lines */
+ PIPE_CAP_MAX_LINE_WIDTH_AA,
+ /* Maximum width/height of non-smoothed points */
+ PIPE_CAP_MAX_POINT_WIDTH,
+ /* Maximum width/height of smoothed points */
+ PIPE_CAP_MAX_POINT_WIDTH_AA,
+ /* Maximum effective anisotropy factor */
+ PIPE_CAP_MAX_TEXTURE_ANISOTROPY,
+ /* Maximum effective level-of-detail bias */
+ PIPE_CAP_MAX_TEXTURE_LOD_BIAS,
+ /* XXX is this min, max, current, whether? */
+ PIPE_CAP_GUARD_BAND_LEFT,
+ PIPE_CAP_GUARD_BAND_TOP,
+ PIPE_CAP_GUARD_BAND_RIGHT,
+ PIPE_CAP_GUARD_BAND_BOTTOM,
+ /* Whether mirrored clamping of texture coordinates works */
+ PIPE_CAP_TEXTURE_MIRROR_CLAMP,
+ /* Whether mirrored repeating of texture coordinates works */
+ PIPE_CAP_TEXTURE_MIRROR_REPEAT,
+ /* Maximum number of texture units usable for lookups in vertex programs */
+ PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS,
+ /* Whether TGSI's CONT opcode works */
+ PIPE_CAP_TGSI_CONT_SUPPORTED,
+ /* Whether separate blend equations work */
+ PIPE_CAP_BLEND_EQUATION_SEPARATE,
+};
/**
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index f0a4de5df3..67cf9d5daa 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -78,13 +78,13 @@ struct pipe_screen {
* Query an integer-valued capability/parameter/limit
* \param param one of PIPE_CAP_x
*/
- int (*get_param)( struct pipe_screen *, int param );
+ int (*get_param)( struct pipe_screen *, enum pipe_capability param );
/**
* Query a float-valued capability/parameter/limit
* \param param one of PIPE_CAP_x
*/
- float (*get_paramf)( struct pipe_screen *, int param );
+ float (*get_paramf)( struct pipe_screen *, enum pipe_capability param );
/**
* Check if the given pipe_format is supported as a texture or