[virglrenderer-devel] [PATCH 19/21] features: add transform_feedback feature

Dave Airlie airlied at gmail.com
Tue Jul 24 03:39:11 UTC 2018


From: Dave Airlie <airlied at redhat.com>

This just stops us binding any transform feedback if we don't support it
---
 src/vrend_renderer.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 16e66ed..8b924a4 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -123,6 +123,7 @@ enum features_id
    feat_texture_multisample,
    feat_texture_storage,
    feat_texture_view,
+   feat_transform_feedback,
    feat_transform_feedback2,
    feat_transform_feedback3,
    feat_transform_feedback_overflow_query,
@@ -172,6 +173,7 @@ static const  struct {
    [feat_texture_multisample] = { 32, 30, { "GL_ARB_texture_multisample" } },
    [feat_texture_storage] = { 42, UNAVAIL, { "GL_ARB_texture_storage" } },
    [feat_texture_view] = { 43, UNAVAIL, { "GL_ARB_texture_view" } },
+   [feat_transform_feedback] = { 30, UNAVAIL, { "GL_EXT_transform_feedback" } },
    [feat_transform_feedback2] = { 40, UNAVAIL, { "GL_ARB_transform_feedback2" } },
    [feat_transform_feedback3] = { 40, UNAVAIL, { "GL_ARB_transform_feedback3" } },
    [feat_transform_feedback_overflow_query] = { 46, UNAVAIL, { "GL_ARB_transform_feedback_overflow_query" } },
@@ -6318,6 +6320,9 @@ void vrend_set_streamout_targets(struct vrend_context *ctx,
    struct vrend_so_target *target;
    uint i;
 
+   if (!has_feature(feat_transform_feedback))
+      return;
+
    if (num_targets) {
       bool found = false;
       struct vrend_streamout_object *obj;
@@ -7732,15 +7737,15 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
    }
 
    /* we need tf3 so we can do gallium skip buffers */
-   if (has_feature(feat_transform_feedback2)) {
-      caps->v1.bset.streamout_pause_resume = 1;
-   }
+   if (has_feature(feat_transform_feedback)) {
+      if (has_feature(feat_transform_feedback2))
+         caps->v1.bset.streamout_pause_resume = 1;
 
-   if (has_feature(feat_transform_feedback3)) {
-      glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &max);
-      caps->v1.max_streamout_buffers = max;
-   } else if (epoxy_has_gl_extension("GL_EXT_transform_feedback")) {
-      caps->v1.max_streamout_buffers = 4;
+      if (has_feature(feat_transform_feedback3)) {
+         glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &max);
+         caps->v1.max_streamout_buffers = max;
+      } else
+         caps->v1.max_streamout_buffers = 4;
    }
 
    if (has_feature(feat_dual_src_blend)) {
-- 
2.17.1



More information about the virglrenderer-devel mailing list