summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_fs.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index c88e213751..2b089c2831 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -28,6 +28,7 @@
#include "sp_context.h"
#include "sp_state.h"
#include "sp_fs.h"
+#include "sp_buffer.h"
#include "pipe/p_defines.h"
#include "util/u_memory.h"
@@ -163,26 +164,33 @@ softpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
FREE( state );
}
-
-
void
softpipe_set_constant_buffer(struct pipe_context *pipe,
uint shader, uint index,
- struct pipe_buffer *buf)
+ struct pipe_buffer *constants)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
+ unsigned size = constants ? constants->size : 0;
+ const void *data = constants ? softpipe_buffer(constants)->data : NULL;
assert(shader < PIPE_SHADER_TYPES);
- assert(index < PIPE_MAX_CONSTANT_BUFFERS);
+ assert(index == 0);
draw_flush(softpipe->draw);
/* note: reference counting */
- pipe_buffer_reference(&softpipe->constants[shader][index], buf);
+ pipe_buffer_reference(&softpipe->constants[shader][index], constants);
+ if(shader == PIPE_SHADER_VERTEX) {
+ draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, index,
+ data, size);
+ }
+
+ softpipe->mapped_constants[shader][index] = data;
softpipe->dirty |= SP_NEW_CONSTANTS;
}
+
void *
softpipe_create_gs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)