diff options
author | Brian <[email protected]> | 2007-11-08 08:22:42 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-11-08 08:48:14 -0700 |
commit | 44254b92480115e5c8a2d5cf78f99195c03701eb (patch) | |
tree | 086564302fdb3ac15ef1bf25c5da44a11fc42e5b /src/mesa/state_tracker | |
parent | 95128c1d4c88238a79ead6e36215a646f83bbdd3 (diff) |
Added pipe->get_paramf() to query float limits.
So far max point size, line width, texture anistopy and lod bias.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index fc003d47764..97578e50027 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -42,6 +42,11 @@ static int min(int a, int b) return (a < b) ? a : b; } +static int max(int a, int b) +{ + return (a > b) ? a : b; +} + static int clamp(int a, int min, int max) { if (a < min) @@ -85,6 +90,22 @@ void st_init_limits(struct st_context *st) c->MaxDrawBuffers = clamp(pipe->get_param(pipe, PIPE_CAP_MAX_RENDER_TARGETS), 1, MAX_DRAW_BUFFERS); + + c->MaxLineWidth + = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_LINE_WIDTH)); + c->MaxLineWidthAA + = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_LINE_WIDTH_AA)); + + c->MaxPointSize + = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_POINT_WIDTH)); + c->MaxPointSizeAA + = max(1.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_POINT_WIDTH_AA)); + + c->MaxTextureMaxAnisotropy + = max(2.0, pipe->get_paramf(pipe, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); + + c->MaxTextureLodBias + = pipe->get_paramf(pipe, PIPE_CAP_MAX_TEXTURE_LOD_BIAS); } |