From 44254b92480115e5c8a2d5cf78f99195c03701eb Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 8 Nov 2007 08:22:42 -0700 Subject: Added pipe->get_paramf() to query float limits. So far max point size, line width, texture anistopy and lod bias. --- src/mesa/state_tracker/st_extensions.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index fc003d4776..97578e5002 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); } -- cgit v1.2.3