diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_extensions.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_extensions.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 9829eb596..18ddd4e47 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -39,6 +39,12 @@ #include "st_extensions.h" #include "st_format.h" + +/* + * Note: we use these function rather than the MIN2, MAX2, CLAMP macros to + * avoid evaluating arguments (which are often function calls) more than once. + */ + static unsigned _min(unsigned a, unsigned b) { return (a < b) ? a : b; @@ -262,10 +268,13 @@ void st_init_limits(struct st_context *st) c->Program[MESA_SHADER_VERTEX].MaxOutputComponents = c->MaxVarying * 4; c->Program[MESA_SHADER_GEOMETRY].MaxInputComponents = c->MaxVarying * 4; c->Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = c->MaxVarying * 4; + c->MaxGeometryOutputVertices = screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES); + c->MaxGeometryTotalOutputComponents = screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS); c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET); c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET); + c->MaxProgramTextureGatherComponents = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS); c->UniformBooleanTrue = ~0; c->MaxTransformFeedbackBuffers = @@ -373,6 +382,7 @@ void st_init_extensions(struct st_context *st) static const struct st_extension_cap_mapping cap_mapping[] = { { o(ARB_base_instance), PIPE_CAP_START_INSTANCE }, + { o(ARB_buffer_storage), PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT }, { o(ARB_depth_clamp), PIPE_CAP_DEPTH_CLIP_DISABLE }, { o(ARB_depth_texture), PIPE_CAP_TEXTURE_SHADOW_MAP }, { o(ARB_draw_buffers_blend), PIPE_CAP_INDEP_BLEND_FUNC }, @@ -526,7 +536,6 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_shader = GL_TRUE; - ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_internalformat_query = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; @@ -777,4 +786,15 @@ void st_init_extensions(struct st_context *st) if (!ctx->Extensions.EXT_transform_feedback) ctx->Const.DisableVaryingPacking = GL_TRUE; } + + if (ctx->API == API_OPENGL_CORE) { + ctx->Const.MaxViewports = screen->get_param(screen, PIPE_CAP_MAX_VIEWPORTS); + if (ctx->Const.MaxViewports >= 16) { + ctx->Const.ViewportBounds.Min = -16384.0; + ctx->Const.ViewportBounds.Max = 16384.0; + ctx->Extensions.ARB_viewport_array = GL_TRUE; + } + } + if (ctx->Const.MaxProgramTextureGatherComponents > 0) + ctx->Extensions.ARB_texture_gather = GL_TRUE; } |