gallium: separate out floating-point CAPs into its own enum

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_.
This commit is contained in:
Marek Olšák
2011-11-19 22:38:22 +01:00
parent 2a0126932b
commit bb71f9249a
22 changed files with 157 additions and 130 deletions

View 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),