summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-20 16:35:44 -0700
committerJason Ekstrand <[email protected]>2015-10-21 14:20:32 -0700
commit4eb84a03becec582a3a26ceee470334f0fba4721 (patch)
treed5c0049b73c3e6998e68f311e5ddb988cdc187eb /src/glsl/nir
parent3c5d24363a4c3e332d9b0820b4682d3a336d00f7 (diff)
nir/info: Add more information about geometry shaders
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp4
-rw-r--r--src/glsl/nir/nir.h12
2 files changed, 16 insertions, 0 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index c9cdf35d6db..9b50a93e7f6 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -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: {
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 2ab48fb9d9c..f65d44c4bdf 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -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 {