Mesa (master): gallium: add GS_INVOCATIONS property

Ilia Mirkin imirkin at kemper.freedesktop.org
Sat Apr 26 16:03:47 UTC 2014


Module: Mesa
Branch: master
Commit: 4be146b1088c33ca377a2cf8a01e73c7f66732f7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4be146b1088c33ca377a2cf8a01e73c7f66732f7

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Wed Apr 23 23:14:55 2014 -0400

gallium: add GS_INVOCATIONS property

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/auxiliary/tgsi/tgsi_ureg.c     |    9 +++++++++
 src/gallium/docs/source/tgsi.rst           |    8 ++++++++
 src/gallium/include/pipe/p_shader_tokens.h |    3 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 38cce58..2bf93ee 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -1468,6 +1468,14 @@ static void emit_decls( struct ureg_program *ureg )
                     ureg->property_gs_max_vertices);
    }
 
+   if (ureg->property_gs_invocations != ~0) {
+      assert(ureg->processor == TGSI_PROCESSOR_GEOMETRY);
+
+      emit_property(ureg,
+                    TGSI_PROPERTY_GS_INVOCATIONS,
+                    ureg->property_gs_invocations);
+   }
+
    if (ureg->property_fs_coord_origin) {
       assert(ureg->processor == TGSI_PROCESSOR_FRAGMENT);
 
@@ -1757,6 +1765,7 @@ struct ureg_program *ureg_create( unsigned processor )
    ureg->property_gs_input_prim = ~0;
    ureg->property_gs_output_prim = ~0;
    ureg->property_gs_max_vertices = ~0;
+   ureg->property_gs_invocations = ~0;
 
    ureg->free_temps = util_bitmask_create();
    if (ureg->free_temps == NULL)
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 170f83e..0ea0759 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -2765,6 +2765,14 @@ distance outputs.
 This is useful for APIs that don't have UCPs and where clip distances written
 by a shader cannot be disabled.
 
+GS_INVOCATIONS
+""""""""""""""
+
+Specifies the number of times a geometry shader should be executed for each
+input primitive. Each invocation will have a different
+TGSI_SEMANTIC_INVOCATIONID system value set. If not specified, assumed to
+be 1.
+
 
 Texture Sampling and Texture Formats
 ------------------------------------
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 1903d53..b537166 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -236,7 +236,8 @@ union tgsi_immediate_data
 #define TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS 5
 #define TGSI_PROPERTY_FS_DEPTH_LAYOUT        6
 #define TGSI_PROPERTY_VS_PROHIBIT_UCPS       7
-#define TGSI_PROPERTY_COUNT                  8
+#define TGSI_PROPERTY_GS_INVOCATIONS         8
+#define TGSI_PROPERTY_COUNT                  9
 
 struct tgsi_property {
    unsigned Type         : 4;  /**< TGSI_TOKEN_TYPE_PROPERTY */




More information about the mesa-commit mailing list