nir/info: Add more information about geometry shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 20 Oct 2015 23:35:44 +0000 (16:35 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 21 Oct 2015 21:20:32 +0000 (14:20 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/nir/glsl_to_nir.cpp
src/glsl/nir/nir.h

index c9cdf35d6db287ec2d90715d523b70edab6bb4e3..9b50a93e7f6e4a58e12b40b35c7b0ae820ad334d 100644 (file)
@@ -170,8 +170,12 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
 
    switch (stage) {
    case MESA_SHADER_GEOMETRY:
+      shader->info.gs.vertices_in = shader_prog->Geom.VerticesIn;
+      shader->info.gs.output_primitive = sh->Geom.OutputType;
       shader->info.gs.vertices_out = sh->Geom.VerticesOut;
       shader->info.gs.invocations = sh->Geom.Invocations;
+      shader->info.gs.uses_end_primitive = shader_prog->Geom.UsesEndPrimitive;
+      shader->info.gs.uses_streams = shader_prog->Geom.UsesStreams;
       break;
 
    case MESA_SHADER_FRAGMENT: {
index 2ab48fb9d9cb852692ea627721f8cfa466c8b4e0..f65d44c4bdfb4ee85dc930cb34bcaf853cbf5590 100644 (file)
@@ -1495,11 +1495,23 @@ typedef struct nir_shader_info {
 
    union {
       struct {
+         /** The number of vertices recieves per input primitive */
+         unsigned vertices_in;
+
+         /** The output primitive type (GL enum value) */
+         unsigned output_primitive;
+
          /** The maximum number of vertices the geometry shader might write. */
          unsigned vertices_out;
 
          /** 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS */
          unsigned invocations;
+
+         /** Whether or not this shader uses EndPrimitive */
+         bool uses_end_primitive;
+
+         /** Whether or not this shader uses non-zero streams */
+         bool uses_streams;
       } gs;
 
       struct {