summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-20 11:20:25 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-20 11:20:25 -0700
commit58edb0683db45c449b219988a8715cf8fd69e42d (patch)
tree1797c58be2dfa6768673e8542a754797d37065e4 /src/mesa/state_tracker/st_cb_texture.c
parent22a0b85eaebf767f5b03bf899596e09f5cc03876 (diff)
gallium: state tracker didn't always notify drivers of texobj data changes
Calling glTexSubImage() or glTexImage() to replace texture data didn't reliably cause pipe->set_sampler_texture() to get called so drivers didn't always get notified of new texture data. The st_texture_object->pt pointer doesn't always indicate changed data so added a dirtyData field.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 03dbb30b0f..7226b0dd98 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -53,33 +53,6 @@
#define DBG if (0) printf
-struct st_texture_object
-{
- struct gl_texture_object base; /* The "parent" object */
-
- /* The texture must include at levels [0..lastLevel] once validated:
- */
- GLuint lastLevel;
-
- /* On validation any active images held in main memory or in other
- * textures will be copied to this texture and the old storage freed.
- */
- struct pipe_texture *pt;
-
- GLboolean imageOverride;
- GLint depthOverride;
- GLuint pitchOverride;
-};
-
-
-
-static INLINE struct st_texture_object *
-st_texture_object(struct gl_texture_object *obj)
-{
- return (struct st_texture_object *) obj;
-}
-
-
static INLINE struct st_texture_image *
st_texture_image(struct gl_texture_image *img)
{
@@ -87,14 +60,6 @@ st_texture_image(struct gl_texture_image *img)
}
-struct pipe_texture *
-st_get_texobj_texture(struct gl_texture_object *texObj)
-{
- struct st_texture_object *stObj = st_texture_object(texObj);
- return stObj->pt;
-}
-
-
static enum pipe_texture_target
gl_target_to_pipe(GLenum target)
{
@@ -725,6 +690,9 @@ st_TexImage(GLcontext * ctx,
texImage->Data = NULL;
}
+ /* flag data as dirty */
+ stObj->dirtyData = GL_TRUE;
+
#if 01
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
ctx->Driver.GenerateMipmap(ctx, target, texObj);
@@ -900,6 +868,7 @@ st_TexSubimage(GLcontext * ctx,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
+ struct st_texture_object *stObj = st_texture_object(texObj);
struct st_texture_image *stImage = st_texture_image(texImage);
GLuint dstRowStride;
GLuint srcImageStride = _mesa_image_image_stride(packing, width, height,
@@ -961,6 +930,9 @@ st_TexSubimage(GLcontext * ctx,
st_texture_image_unmap(stImage);
texImage->Data = NULL;
}
+
+ /* flag data as dirty */
+ stObj->dirtyData = GL_TRUE;
}