gallium: add GS_INVOCATIONS property
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Apr 2014 03:14:55 +0000 (23:14 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 26 Apr 2014 15:57:09 +0000 (11:57 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/docs/source/tgsi.rst
src/gallium/include/pipe/p_shader_tokens.h

index 38cce58490001f6ef4ab815404f811439e1bf2b1..2bf93ee6adb98172be8410a165f5b526ae916548 100644 (file)
@@ -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)
index 170f83e20acdead8e0b835f4808fba595aa91eb9..0ea0759aa1ce837a0bcf1a91da74f9757da2212a 100644 (file)
@@ -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
 ------------------------------------
index 1903d5318a1948175cdb998d507d88a2ebe6adee..b537166e93ca71cb6e7ddd1f228b8deb6e3ae7e6 100644 (file)
@@ -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 */