temporarily don't emit TGSI immediates, use the constant buffer
authorBrian <brian.paul@tungstengraphics.com>
Thu, 17 Jan 2008 00:21:05 +0000 (17:21 -0700)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Thu, 17 Jan 2008 03:24:22 +0000 (12:24 +0900)
This allows a few more programs to run and not crash.
Need to get constant buffer uploads working...

src/mesa/state_tracker/st_mesa_to_tgsi.c

index 325aa2017347532b784f76fd1dea3be8bfd49c97..936ba9ed85be3725894152628320bc69fe8ec66a 100644 (file)
@@ -41,6 +41,7 @@
 
 #define TGSI_DEBUG 0
 
+#define EMIT_IMMEDIATES 0
 
 /*
  * Map mesa register file to TGSI register file.
@@ -68,12 +69,17 @@ map_register_file(
    case PROGRAM_STATE_VAR:
    case PROGRAM_NAMED_PARAM:
    case PROGRAM_UNIFORM:
-      if (immediateMapping[index] != ~0) 
+      if (immediateMapping[index] != ~0) {
         return TGSI_FILE_IMMEDIATE;
+      }
       else
         return TGSI_FILE_CONSTANT;
    case PROGRAM_CONSTANT:
+#if EMIT_IMMEDIATES
       return TGSI_FILE_IMMEDIATE;
+#else
+      return TGSI_FILE_CONSTANT;
+#endif
    case PROGRAM_INPUT:
       return TGSI_FILE_INPUT;
    case PROGRAM_OUTPUT:
@@ -828,7 +834,7 @@ tgsi_translate_mesa_program(
 
    /* immediates/literals */
    memset(immediates, ~0, sizeof(immediates));
-
+#if EMIT_IMMEDIATES
    for (i = 0; program->Parameters && i < program->Parameters->NumParameters;
         i++) {
       if (program->Parameters->Parameters[i].Type == PROGRAM_CONSTANT) {
@@ -843,6 +849,7 @@ tgsi_translate_mesa_program(
          numImmediates++;
       }
    }
+#endif
 
    /* constant buffer refs */
    {