[Mesa-dev] [PATCH 10/42] compiler: add fields for tes metadata to shader info

Timothy Arceri timothy.arceri at collabora.com
Wed Oct 19 23:09:27 UTC 2016


And copy the values from gl_tess_eval_program struct.
---
 src/compiler/shader_info.c | 11 +++++++++++
 src/compiler/shader_info.h |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/src/compiler/shader_info.c b/src/compiler/shader_info.c
index 2da9757..3ec1e8a 100644
--- a/src/compiler/shader_info.c
+++ b/src/compiler/shader_info.c
@@ -40,6 +40,17 @@ copy_shader_info(const struct gl_shader_program *shader_prog,
    info->uses_texture_gather = sh->Program->UsesGather;
 
    switch (sh->Stage) {
+   case MESA_SHADER_TESS_EVAL: {
+      struct gl_tess_eval_program *tep =
+         (struct gl_tess_eval_program *)sh->Program;
+
+      info->tes.primitive_mode = tep->PrimitiveMode;
+      info->tes.spacing = tep->Spacing;
+      info->tes.vertex_order = tep->VertexOrder;
+      info->tes.point_mode = tep->PointMode;
+      break;
+   }
+
    case MESA_SHADER_GEOMETRY:
       info->gs.vertices_in = shader_prog->Geom.VerticesIn;
       info->gs.output_primitive = sh->info.Geom.OutputType;
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index 7624008..5eae8f1 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -121,6 +121,13 @@ typedef struct shader_info {
          /** The number of vertices in the TCS output patch. */
          unsigned vertices_out;
       } tcs;
+
+      struct {
+         uint32_t primitive_mode; /* GL_TRIANGLES, GL_QUADS or GL_ISOLINES */
+         uint32_t spacing;        /* GL_EQUAL, GL_FRACTIONAL_EVEN, GL_FRACTIONAL_ODD */
+         uint32_t vertex_order;   /* GL_CW or GL_CCW */
+         bool point_mode;
+      } tes;
    };
 } shader_info;
 
-- 
2.7.4



More information about the mesa-dev mailing list