summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-08-07 15:12:22 -0600
committerBrian <brian@i915.localnet.net>2007-08-07 15:12:22 -0600
commitd78dab126724e6e9d475289a086fb6f85adc3985 (patch)
tree9524da035fa30e415e28bae08d8fade891b0ab92
parent28d64d398bb3e04d20a9c03c9a0b92c0a7b9d6d4 (diff)
plug in texture/sampler state update
-rw-r--r--src/mesa/state_tracker/st_atom.c2
-rw-r--r--src/mesa/state_tracker/st_atom.h2
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c14
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c5
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
-rw-r--r--src/mesa/state_tracker/st_cb_texture.h4
6 files changed, 28 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index 85c99bc1822..32b8b8f277b 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -54,6 +54,8 @@ static const struct st_tracked_state *atoms[] =
&st_update_scissor,
&st_update_blend,
&st_update_stencil,
+ &st_update_sampler,
+ &st_update_texture,
/* will be patched out at runtime */
/* &st_update_constants */
};
diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h
index 1b70e279339..2f628206cae 100644
--- a/src/mesa/state_tracker/st_atom.h
+++ b/src/mesa/state_tracker/st_atom.h
@@ -57,6 +57,8 @@ const struct st_tracked_state st_update_constants;
const struct st_tracked_state st_update_scissor;
const struct st_tracked_state st_update_blend;
const struct st_tracked_state st_update_stencil;
+const struct st_tracked_state st_update_sampler;
+const struct st_tracked_state st_update_texture;
#endif
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index 1aa9da84847..a49698cda46 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -103,14 +103,16 @@ update_samplers(struct st_context *st)
memset(&sampler, 0, sizeof(sampler));
- sampler.wrap_s = gl_wrap_to_sp(texobj->WrapS);
- sampler.wrap_t = gl_wrap_to_sp(texobj->WrapT);
- sampler.wrap_r = gl_wrap_to_sp(texobj->WrapR);
+ if (texobj) {
+ sampler.wrap_s = gl_wrap_to_sp(texobj->WrapS);
+ sampler.wrap_t = gl_wrap_to_sp(texobj->WrapT);
+ sampler.wrap_r = gl_wrap_to_sp(texobj->WrapR);
- sampler.min_filter = gl_filter_to_sp(texobj->MinFilter);
- sampler.mag_filter = gl_filter_to_sp(texobj->MagFilter);
+ sampler.min_filter = gl_filter_to_sp(texobj->MinFilter);
+ sampler.mag_filter = gl_filter_to_sp(texobj->MagFilter);
- /* XXX more sampler state here */
+ /* XXX more sampler state here */
+ }
if (memcmp(&sampler, &st->state.sampler[u], sizeof(sampler)) != 0) {
/* state has changed */
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index bb83f7d1216..f82c33e572f 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -39,7 +39,10 @@
#include "pipe/p_defines.h"
-
+/**
+ * XXX This needs some work yet....
+ * Need to "upload" texture images at appropriate times.
+ */
static void
update_textures(struct st_context *st)
{
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 5872ae3e743..42d6b75cb3e 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -104,6 +104,14 @@ st_texture_image(struct gl_texture_image *img)
}
+struct pipe_mipmap_tree *
+st_get_texobj_mipmap_tree(struct gl_texture_object *texObj)
+{
+ struct st_texture_object *stObj = st_texture_object(texObj);
+ return stObj->mt;
+}
+
+
static int
intel_compressed_num_bytes(GLuint mesaFormat)
{
diff --git a/src/mesa/state_tracker/st_cb_texture.h b/src/mesa/state_tracker/st_cb_texture.h
index c732881c39d..dc68aa3d973 100644
--- a/src/mesa/state_tracker/st_cb_texture.h
+++ b/src/mesa/state_tracker/st_cb_texture.h
@@ -2,6 +2,10 @@
#define ST_CB_TEXTURE_H
+extern struct pipe_mipmap_tree *
+st_get_texobj_mipmap_tree(struct gl_texture_object *texObj);
+
+
extern GLuint
st_finalize_mipmap_tree(GLcontext *ctx,
struct pipe_context *pipe, GLuint unit,