Mesa (arb_geometry_shader4): gs: abstract these two, they' ll need to be doing more soon

Zack Rusin zack at kemper.freedesktop.org
Tue Jul 28 04:32:09 UTC 2009


Module: Mesa
Branch: arb_geometry_shader4
Commit: 59fdecef645c32ccd7dc134d587fbedbbb6b2a7f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=59fdecef645c32ccd7dc134d587fbedbbb6b2a7f

Author: Zack Rusin <zackr at vmware.com>
Date:   Tue Jul 28 00:37:06 2009 -0400

gs: abstract these two, they'll need to be doing more soon

---

 src/gallium/auxiliary/tgsi/tgsi_exec.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 406d543..ed95bba 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1742,6 +1742,19 @@ exec_kilp(struct tgsi_exec_machine *mach,
    mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= kilmask;
 }
 
+static void
+emit_vertex(struct tgsi_exec_machine *mach)
+{
+   mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] += 16;
+   mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]]++;
+}
+
+static void
+emit_primitive(struct tgsi_exec_machine *mach)
+{
+   mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]++;
+   mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]] = 0;
+}
 
 /*
  * Fetch a four texture samples using STR texture coordinates.
@@ -3089,13 +3102,11 @@ exec_instruction(
       break;
 
    case TGSI_OPCODE_EMIT:
-      mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] += 16;
-      mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]]++;
+      emit_vertex(mach);
       break;
 
    case TGSI_OPCODE_ENDPRIM:
-      mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]++;
-      mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]] = 0;
+      emit_primitive(mach);
       break;
 
    case TGSI_OPCODE_LOOP:




More information about the mesa-commit mailing list