draw: Remove dead code.
[mesa.git] / src / gallium / drivers / softpipe / sp_state_fs.c
index b7ed4441b4363ab0c5f665b36f354f5f267dfe8c..c88e213751092320e127ff2c9523ddf8b29d9026 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "pipe/p_defines.h"
 #include "util/u_memory.h"
+#include "util/u_inlines.h"
 #include "draw/draw_context.h"
 #include "draw/draw_vs.h"
 #include "tgsi/tgsi_dump.h"
@@ -44,6 +45,7 @@ softpipe_create_fs_state(struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
    struct sp_fragment_shader *state;
+   unsigned i;
 
    /* debug */
    if (softpipe->dump_fs) 
@@ -60,6 +62,13 @@ softpipe_create_fs_state(struct pipe_context *pipe,
    /* get/save the summary info for this shader */
    tgsi_scan_shader(templ->tokens, &state->info);
 
+   for (i = 0; i < state->info.num_properties; ++i) {
+      if (state->info.properties[i].name == TGSI_PROPERTY_FS_COORD_ORIGIN)
+         state->origin_lower_left = state->info.properties[i].data[0];
+      else if (state->info.properties[i].name == TGSI_PROPERTY_FS_COORD_PIXEL_CENTER)
+        state->pixel_center_integer = state->info.properties[i].data[0];
+   }
+
    return state;
 }
 
@@ -164,12 +173,12 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
    assert(shader < PIPE_SHADER_TYPES);
-   assert(index == 0);
+   assert(index < PIPE_MAX_CONSTANT_BUFFERS);
 
    draw_flush(softpipe->draw);
 
    /* note: reference counting */
-   pipe_buffer_reference(&softpipe->constants[shader], buf);
+   pipe_buffer_reference(&softpipe->constants[shader][index], buf);
 
    softpipe->dirty |= SP_NEW_CONSTANTS;
 }