summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/nir')
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp3
-rw-r--r--src/glsl/nir/nir.c3
-rw-r--r--src/glsl/nir/nir.h8
3 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 944f7462911..c13f953d914 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -140,6 +140,9 @@ glsl_to_nir(struct gl_shader *sh, const nir_shader_compiler_options *options)
nir_lower_outputs_to_temporaries(shader);
+ shader->gs.vertices_out = sh->Geom.VerticesOut;
+ shader->gs.invocations = sh->Geom.Invocations;
+
return shader;
}
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index ab06ea2bc19..1dc7e12445f 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -54,6 +54,9 @@ nir_shader_create(void *mem_ctx,
shader->stage = stage;
+ shader->gs.vertices_out = 0;
+ shader->gs.invocations = 0;
+
return shader;
}
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index a93ff11f01b..f9c829570c5 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1479,6 +1479,14 @@ typedef struct nir_shader {
/** The shader stage, such as MESA_SHADER_VERTEX. */
gl_shader_stage stage;
+
+ struct {
+ /** The maximum number of vertices the geometry shader might write. */
+ unsigned vertices_out;
+
+ /** 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS */
+ unsigned invocations;
+ } gs;
} nir_shader;
#define nir_foreach_overload(shader, overload) \