* Brian Paul
*/
-#include "imports.h"
-
+#include "pipe/p_util.h"
#include "sp_context.h"
#include "sp_state.h"
+#include "sp_tile_cache.h"
+void *
+softpipe_create_sampler_state(struct pipe_context *pipe,
+ const struct pipe_sampler_state *sampler)
+{
+ struct pipe_sampler_state *state = MALLOC( sizeof(struct pipe_sampler_state) );
+ memcpy(state, sampler, sizeof(struct pipe_sampler_state));
+ return state;
+}
void
-softpipe_set_sampler_state(struct pipe_context *pipe,
- GLuint unit,
- const struct pipe_sampler_state *sampler)
+softpipe_bind_sampler_state(struct pipe_context *pipe,
+ unsigned unit, void *sampler)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
assert(unit < PIPE_MAX_SAMPLERS);
- softpipe->sampler[unit] = *sampler;
+ softpipe->sampler[unit] = (struct pipe_sampler_state *)sampler;
softpipe->dirty |= SP_NEW_SAMPLER;
}
+void
+softpipe_delete_sampler_state(struct pipe_context *pipe,
+ void *sampler)
+{
+ FREE( sampler );
+}
+
+
void
softpipe_set_texture_state(struct pipe_context *pipe,
- GLuint unit,
- struct pipe_texture_object *texture)
+ unsigned unit,
+ struct pipe_texture *texture)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
assert(unit < PIPE_MAX_SAMPLERS);
- softpipe->texture[unit] = texture; /* ptr, not struct */
+ softpipe->texture[unit] = (struct softpipe_texture *)texture; /* ptr, not struct */
+
+ sp_tile_cache_set_texture(softpipe->tex_cache[unit], texture);
softpipe->dirty |= SP_NEW_TEXTURE;
}
+
+
+void
+softpipe_set_sampler_units(struct pipe_context *pipe,
+ uint num_samplers, const uint *units )
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+ uint i;
+ for (i = 0; i < num_samplers; i++)
+ softpipe->sampler_units[i] = units[i];
+ softpipe->dirty |= SP_NEW_SAMPLER;
+}
+
+