features: add geometry shader feature

This disallows geom shader creation if we don't have the feature

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Dave Airlie 6 years ago
parent e8eeea7690
commit ea7f3c14cd
  1. 8
      src/vrend_renderer.c

@ -97,6 +97,7 @@ enum features_id
feat_debug_cb, feat_debug_cb,
feat_draw_instance, feat_draw_instance,
feat_dual_src_blend, feat_dual_src_blend,
feat_geometry_shader,
feat_gl_conditional_render, feat_gl_conditional_render,
feat_gl_prim_restart, feat_gl_prim_restart,
feat_gles_khr_robustness, feat_gles_khr_robustness,
@ -140,6 +141,7 @@ static const struct {
[feat_debug_cb] = { UNAVAIL, UNAVAIL, {} }, /* special case */ [feat_debug_cb] = { UNAVAIL, UNAVAIL, {} }, /* special case */
[feat_draw_instance] = { 31, 30, { "GL_ARB_draw_instanced" } }, [feat_draw_instance] = { 31, 30, { "GL_ARB_draw_instanced" } },
[feat_dual_src_blend] = { 33, UNAVAIL, { "GL_ARB_blend_func_extended" } }, [feat_dual_src_blend] = { 33, UNAVAIL, { "GL_ARB_blend_func_extended" } },
[feat_geometry_shader] = { 32, UNAVAIL, {} },
[feat_gl_conditional_render] = { 30, UNAVAIL, {} }, [feat_gl_conditional_render] = { 30, UNAVAIL, {} },
[feat_gl_prim_restart] = { 31, UNAVAIL, {} }, [feat_gl_prim_restart] = { 31, UNAVAIL, {} },
[feat_gles_khr_robustness] = { UNAVAIL, UNAVAIL, { "GL_KHR_robustness" } }, [feat_gles_khr_robustness] = { UNAVAIL, UNAVAIL, { "GL_KHR_robustness" } },
@ -2651,6 +2653,10 @@ int vrend_create_shader(struct vrend_context *ctx,
if (type > PIPE_SHADER_TESS_EVAL) if (type > PIPE_SHADER_TESS_EVAL)
return EINVAL; return EINVAL;
if (!has_feature(feat_geometry_shader) &&
type == PIPE_SHADER_GEOMETRY)
return EINVAL;
if (!has_feature(feat_tessellation) && if (!has_feature(feat_tessellation) &&
(type == PIPE_SHADER_TESS_CTRL || (type == PIPE_SHADER_TESS_CTRL ||
type == PIPE_SHADER_TESS_EVAL)) type == PIPE_SHADER_TESS_EVAL))
@ -7765,7 +7771,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &max); glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &max);
caps->v2.max_vertex_outputs = max / 4; caps->v2.max_vertex_outputs = max / 4;
if (gl_ver >= 32) { if (has_feature(feat_geometry_shader)) {
glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, (GLint*)&caps->v2.max_geom_output_vertices); glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, (GLint*)&caps->v2.max_geom_output_vertices);
glGetIntegerv(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, (GLint*)&caps->v2.max_geom_total_output_components); glGetIntegerv(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, (GLint*)&caps->v2.max_geom_total_output_components);
} }

Loading…
Cancel
Save