nv50: fix bogus error message about 3d surfaces
[mesa.git] / src / gallium / drivers / svga / svga_tgsi.c
index 44d0930bc0a1906e49d6c9fc909f3b8737c38846..781fe6334a500dc931ff136f9dc743c447384307 100644 (file)
@@ -31,8 +31,9 @@
 #include "tgsi/tgsi_dump.h"
 #include "tgsi/tgsi_scan.h"
 #include "util/u_memory.h"
+#include "util/u_bitmask.h"
 
-#include "svgadump/st_shader_dump.h"
+#include "svgadump/svga_shader_dump.h"
 
 #include "svga_context.h"
 #include "svga_tgsi.h"
@@ -202,7 +203,7 @@ svga_tgsi_translate( const struct svga_shader *shader,
       emit.imm_start += key.vkey.num_zero_stride_vertex_elements;
    }
 
-   emit.nr_hw_const = (emit.imm_start + emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
+   emit.nr_hw_float_const = (emit.imm_start + emit.info.file_max[TGSI_FILE_IMMEDIATE] + 1);
 
    emit.nr_hw_temp = emit.info.file_max[TGSI_FILE_TEMPORARY] + 1;
    emit.in_main_func = TRUE;
@@ -221,6 +222,21 @@ svga_tgsi_translate( const struct svga_shader *shader,
    result->tokens = (const unsigned *)emit.buf;
    result->nr_tokens = (emit.ptr - emit.buf) / sizeof(unsigned);
    memcpy(&result->key, &key, sizeof key);
+   result->id = UTIL_BITMASK_INVALID_INDEX;
+
+   if (SVGA_DEBUG & DEBUG_TGSI) 
+   {
+      debug_printf( "#####################################\n" );
+      debug_printf( "Shader %u below\n", shader->id );
+      tgsi_dump( shader->tokens, 0 );
+      if (SVGA_DEBUG & DEBUG_TGSI) {
+         debug_printf( "Shader %u compiled below\n", shader->id );
+         svga_shader_dump( result->tokens,
+                           result->nr_tokens ,
+                           FALSE );
+      }
+      debug_printf( "#####################################\n" );
+   }
 
    return result;