So far max point size, line width, texture anistopy and lod bias.
failover->pipe.get_name = hw->get_name;
failover->pipe.get_vendor = hw->get_vendor;
failover->pipe.get_param = hw->get_param;
+ failover->pipe.get_paramf = hw->get_paramf;
failover->pipe.draw_arrays = failover_draw_arrays;
failover->pipe.draw_elements = failover_draw_elements;
}
+static float
+i915_get_paramf(struct pipe_context *pipe, int param)
+{
+ switch (param) {
+ case PIPE_CAP_MAX_LINE_WIDTH:
+ /* fall-through */
+ case PIPE_CAP_MAX_LINE_WIDTH_AA:
+ return 7.5;
+
+ case PIPE_CAP_MAX_POINT_WIDTH:
+ /* fall-through */
+ case PIPE_CAP_MAX_POINT_WIDTH_AA:
+ return 255.0;
+
+ case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+ return 0.0;
+
+ case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+ return 16.0;
+
+ default:
+ return 0;
+ }
+}
+
+
static void i915_destroy( struct pipe_context *pipe )
{
struct i915_context *i915 = i915_context( pipe );
i915->pipe.destroy = i915_destroy;
i915->pipe.is_format_supported = i915_is_format_supported;
i915->pipe.get_param = i915_get_param;
+ i915->pipe.get_paramf = i915_get_paramf;
i915->pipe.clear = i915_clear;
const char *(*get_vendor)( struct pipe_context *pipe );
int (*get_param)( struct pipe_context *pipe, int param );
+ float (*get_paramf)( struct pipe_context *pipe, int param );
/*
#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
+
#endif
}
}
+static float softpipe_get_paramf(struct pipe_context *pipe, int param)
+{
+ switch (param) {
+ case PIPE_CAP_MAX_LINE_WIDTH:
+ /* fall-through */
+ case PIPE_CAP_MAX_LINE_WIDTH_AA:
+ return 255.0; /* arbitrary */
+
+ case PIPE_CAP_MAX_POINT_WIDTH:
+ /* fall-through */
+ case PIPE_CAP_MAX_POINT_WIDTH_AA:
+ return 255.0; /* arbitrary */
+
+ case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
+ return 0.0;
+
+ case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
+ return 16.0; /* arbitrary */
+
+ default:
+ return 0;
+ }
+}
+
struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
struct softpipe_winsys *softpipe_winsys )
{
/* queries */
softpipe->pipe.is_format_supported = softpipe_is_format_supported;
- //softpipe->pipe.max_texture_size = softpipe_max_texture_size;
softpipe->pipe.get_param = softpipe_get_param;
+ softpipe->pipe.get_paramf = softpipe_get_paramf;
/* state setters */
softpipe->pipe.create_alpha_test_state = softpipe_create_alpha_test_state;
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)
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);
}