gallium: add face, dirtyLevels params to pipe->texture_update()
This provides better information about which images in texture object have changed. Also, call texture_update() from more places previously missed.
This commit is contained in:
parent
11c34dc644
commit
4984487bc3
|
@ -410,6 +410,7 @@ aaline_create_texture(struct aaline_stage *aaline)
|
|||
/* unmap */
|
||||
pipe_surface_unmap(surface);
|
||||
pipe_surface_reference(&surface, NULL);
|
||||
pipe->texture_update(pipe, aaline->texture, 0, (1 << level));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ pstip_update_texture(struct pstip_stage *pstip)
|
|||
/* unmap */
|
||||
pipe_surface_unmap(surface);
|
||||
pipe_surface_reference(&surface, NULL);
|
||||
pipe->texture_update(pipe, pstip->texture);
|
||||
pipe->texture_update(pipe, pstip->texture, 0, 0x1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -872,7 +872,8 @@ util_gen_mipmap(struct gen_mipmap_state *ctx,
|
|||
|
||||
pipe->flush(pipe, PIPE_FLUSH_WAIT);
|
||||
|
||||
/*pipe->texture_update(pipe, pt); not really needed */
|
||||
/* need to signal that the texture has changed _after_ rendering to it */
|
||||
pipe->texture_update(pipe, pt, face, (1 << dstLevel));
|
||||
}
|
||||
|
||||
/* restore state we changed */
|
||||
|
|
|
@ -134,7 +134,8 @@ cell_texture_release_screen(struct pipe_screen *screen,
|
|||
|
||||
|
||||
static void
|
||||
cell_texture_update(struct pipe_context *pipe, struct pipe_texture *texture)
|
||||
cell_texture_update(struct pipe_context *pipe, struct pipe_texture *texture,
|
||||
uint face, uint levelsMask)
|
||||
{
|
||||
/* XXX TO DO: re-tile the texture data ... */
|
||||
|
||||
|
|
|
@ -542,7 +542,8 @@ i915_texture_release_screen(struct pipe_screen *screen,
|
|||
|
||||
|
||||
static void
|
||||
i915_texture_update(struct pipe_context *pipe, struct pipe_texture *texture)
|
||||
i915_texture_update(struct pipe_context *pipe, struct pipe_texture *texture,
|
||||
uint face, uint levelsMask)
|
||||
{
|
||||
/* no-op? */
|
||||
}
|
||||
|
|
|
@ -358,7 +358,8 @@ brw_texture_release_screen(struct pipe_screen *screen,
|
|||
|
||||
|
||||
static void
|
||||
brw_texture_update(struct pipe_context *pipe, struct pipe_texture *texture)
|
||||
brw_texture_update(struct pipe_context *pipe, struct pipe_texture *texture,
|
||||
uint face, uint levelsMask)
|
||||
{
|
||||
/* no-op? */
|
||||
}
|
||||
|
|
|
@ -174,7 +174,8 @@ softpipe_get_tex_surface_screen(struct pipe_screen *screen,
|
|||
|
||||
static void
|
||||
softpipe_texture_update(struct pipe_context *pipe,
|
||||
struct pipe_texture *texture)
|
||||
struct pipe_texture *texture,
|
||||
uint face, uint levelsMask)
|
||||
{
|
||||
struct softpipe_context *softpipe = softpipe_context(pipe);
|
||||
uint unit;
|
||||
|
|
|
@ -192,12 +192,10 @@ struct pipe_context {
|
|||
|
||||
/**
|
||||
* Called when texture data is changed.
|
||||
* Note: we could pass some hints about which mip levels or cube faces
|
||||
* have changed...
|
||||
* XXX this may go away - could pass a 'write' flag to get_tex_surface()
|
||||
*/
|
||||
void (*texture_update)(struct pipe_context *pipe,
|
||||
struct pipe_texture *texture);
|
||||
struct pipe_texture *texture,
|
||||
uint face, uint dirtyLevelsMask);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -76,11 +76,6 @@ update_textures(struct st_context *st)
|
|||
|
||||
pt = st_get_stobj_texture(stObj);
|
||||
pipe_texture_reference(&st->state.sampler_texture[unit], pt);
|
||||
|
||||
if (stObj && stObj->dirtyData) {
|
||||
st->pipe->texture_update(st->pipe, pt);
|
||||
stObj->dirtyData = GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
st->pipe->set_sampler_textures(st->pipe, st->state.num_textures,
|
||||
|
|
|
@ -513,6 +513,8 @@ make_texture(struct st_context *st,
|
|||
/* unmap */
|
||||
pipe_surface_unmap(surface);
|
||||
pipe_surface_reference(&surface, NULL);
|
||||
pipe->texture_update(pipe, pt, 0, 0x1);
|
||||
|
||||
assert(success);
|
||||
|
||||
/* restore */
|
||||
|
@ -1100,6 +1102,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
|
|||
/* Release surface */
|
||||
pipe_surface_unmap(surface);
|
||||
pipe_surface_reference(&surface, NULL);
|
||||
pipe->texture_update(pipe, pt, 0, 0x1);
|
||||
|
||||
pt->format = format;
|
||||
|
||||
|
|
|
@ -476,6 +476,7 @@ st_TexImage(GLcontext * ctx,
|
|||
struct gl_texture_image *texImage,
|
||||
GLsizei imageSize, int compressed)
|
||||
{
|
||||
struct pipe_context *pipe = ctx->st->pipe;
|
||||
struct st_texture_object *stObj = st_texture_object(texObj);
|
||||
struct st_texture_image *stImage = st_texture_image(texImage);
|
||||
GLint postConvWidth, postConvHeight;
|
||||
|
@ -690,8 +691,8 @@ st_TexImage(GLcontext * ctx,
|
|||
texImage->Data = NULL;
|
||||
}
|
||||
|
||||
/* flag data as dirty */
|
||||
stObj->dirtyData = GL_TRUE;
|
||||
if (stObj->pt)
|
||||
pipe->texture_update(pipe, stObj->pt, stImage->face, (1 << level));
|
||||
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
ctx->Driver.GenerateMipmap(ctx, target, texObj);
|
||||
|
@ -866,6 +867,7 @@ st_TexSubimage(GLcontext * ctx,
|
|||
struct gl_texture_object *texObj,
|
||||
struct gl_texture_image *texImage)
|
||||
{
|
||||
struct pipe_context *pipe = ctx->st->pipe;
|
||||
struct st_texture_object *stObj = st_texture_object(texObj);
|
||||
struct st_texture_image *stImage = st_texture_image(texImage);
|
||||
GLuint dstRowStride;
|
||||
|
@ -924,8 +926,7 @@ st_TexSubimage(GLcontext * ctx,
|
|||
texImage->Data = NULL;
|
||||
}
|
||||
|
||||
/* flag data as dirty */
|
||||
stObj->dirtyData = GL_TRUE;
|
||||
pipe->texture_update(pipe, stObj->pt, stImage->face, (1 << level));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1179,8 +1180,7 @@ do_copy_texsubimage(GLcontext *ctx,
|
|||
|
||||
pipe_surface_reference(&dest_surface, NULL);
|
||||
|
||||
/* flag data as dirty */
|
||||
stObj->dirtyData = GL_TRUE;
|
||||
pipe->texture_update(pipe, stObj->pt, stImage->face, (1 << level));
|
||||
|
||||
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
|
||||
ctx->Driver.GenerateMipmap(ctx, target, texObj);
|
||||
|
@ -1481,6 +1481,7 @@ st_finalize_texture(GLcontext *ctx,
|
|||
if (stImage && stObj->pt != stImage->pt) {
|
||||
copy_image_data_to_texture(ctx->st, stObj, level, stImage);
|
||||
*needFlush = GL_TRUE;
|
||||
pipe->texture_update(pipe, stObj->pt, face, (1 << level));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,8 +71,6 @@ struct st_texture_object
|
|||
GLboolean imageOverride;
|
||||
GLint depthOverride;
|
||||
GLuint pitchOverride;
|
||||
|
||||
GLboolean dirtyData;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue