summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_pipe_sampler.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-10-25 11:36:22 +0000
committerKeith Whitwell <keithw@vmware.com>2009-10-25 11:37:39 +0000
commit590949553f737902008dea020420311e2085aa1a (patch)
tree28a207ded4c1bdb0d4d722f69f86730b501e9ef8 /src/gallium/drivers/i965/brw_pipe_sampler.c
parent562ca4eae257dd3b268e7f13487c8cd91f618eae (diff)
i965g: start hooking up some to the gallium context interfaces
- create/bind/destroy blend and depth state - framebuffer and viewport - etc.
Diffstat (limited to 'src/gallium/drivers/i965/brw_pipe_sampler.c')
-rw-r--r--src/gallium/drivers/i965/brw_pipe_sampler.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c
new file mode 100644
index 0000000000..b3069f08c0
--- /dev/null
+++ b/src/gallium/drivers/i965/brw_pipe_sampler.c
@@ -0,0 +1,52 @@
+
+#include "util/u_memory.h"
+#include "pipe/p_context.h"
+#include "pipe/p_state.h"
+
+#include "brw_context.h"
+#include "brw_defines.h"
+#include "brw_debug.h"
+
+
+
+static void *brw_create_sampler_state( struct pipe_context *pipe,
+ const struct pipe_sampler_state *templ )
+{
+ struct brw_sampler_state *sampler = CALLOC_STRUCT(brw_sampler_state);
+
+
+ return (void *)sampler;
+}
+
+static void brw_bind_sampler_state(struct pipe_context *pipe,
+ void *cso)
+{
+ struct brw_context *brw = brw_context(pipe);
+ brw->curr.sampler = (const struct brw_sampler_state *)cso;
+ brw->state.dirty.mesa |= PIPE_NEW_SAMPLER;
+}
+
+static void brw_delete_sampler_state(struct pipe_context *pipe,
+ void *cso)
+{
+ struct brw_context *brw = brw_context(pipe);
+ FREE(cso);
+}
+
+static void brw_set_sampler_textures(struct pipe_context *pipe,
+ unsigned num_textures,
+ struct pipe_texture **tex)
+{
+ struct brw_context *brw = brw_context(pipe);
+
+ brw->state.dirty.mesa |= PIPE_NEW_BOUND_TEXTURES;
+}
+
+
+void brw_sampler_init( struct brw_context *brw )
+{
+ brw->base.set_sampler_textures = brw_set_sampler_textures;
+ brw->base.create_sampler_state = brw_create_sampler_state;
+ brw->base.bind_sampler_state = brw_bind_sampler_state;
+ brw->base.destroy_sampler_state = brw_destroy_sampler_state;
+}