r600g: tgsi_dst() can't fail.
[mesa.git] / src / gallium / drivers / svga / svga_tgsi_decl_sm30.c
index d1c7336dec497b0861b32cc74fb31d27cfc864fc..73102a72a8379910ac749d301cad4cfc4f4c2780 100644 (file)
@@ -29,7 +29,6 @@
 #include "util/u_memory.h"
 
 #include "svga_tgsi_emit.h"
-#include "svga_context.h"
 
 static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semantic,
                                          unsigned *usage,
@@ -195,8 +194,19 @@ static boolean ps30_output( struct svga_shader_emitter *emit,
 
    switch (semantic.Name) {
    case TGSI_SEMANTIC_COLOR:
-      emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT, 
-                                            semantic.Index );
+      if (emit->unit == PIPE_SHADER_FRAGMENT &&
+          emit->key.fkey.white_fragments) {
+
+         emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
+                                               emit->nr_hw_temp++ );
+         emit->temp_col[idx] = emit->output_map[idx];
+         emit->true_col[idx] = dst_register( SVGA3DREG_COLOROUT, 
+                                              semantic.Index );
+      }
+      else {
+         emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT, 
+                                               semantic.Index );
+      }
       break;
    case TGSI_SEMANTIC_POSITION:
       emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,