From 5d3d63d45a037fdf603ddcff88da635c3ce8075e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 18 Apr 2010 17:55:23 -0600 Subject: st/mesa: remove st_texture_object::pipe field Just pass the pipe context to st_get_texture_sampler_view() as is done for st_get_renderbuffer_sampler_view(). --- src/mesa/state_tracker/st_atom_texture.c | 3 ++- src/mesa/state_tracker/st_cb_blit.c | 2 +- src/mesa/state_tracker/st_cb_eglimage.c | 1 - src/mesa/state_tracker/st_cb_fbo.c | 5 ++++- src/mesa/state_tracker/st_cb_texture.c | 5 ++--- src/mesa/state_tracker/st_gen_mipmap.c | 2 +- src/mesa/state_tracker/st_manager.c | 1 - src/mesa/state_tracker/st_texture.h | 10 +++++----- 8 files changed, 15 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index e056487f1a..f4294ac1e6 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -46,6 +46,7 @@ static void update_textures(struct st_context *st) { + struct pipe_context *pipe = st->pipe; struct gl_vertex_program *vprog = st->ctx->VertexProgram._Current; struct gl_fragment_program *fprog = st->ctx->FragmentProgram._Current; const GLbitfield samplersUsed = (vprog->Base.SamplersUsed | @@ -84,7 +85,7 @@ update_textures(struct st_context *st) st->state.num_textures = su + 1; - sampler_view = st_get_texture_sampler_view(stObj); + sampler_view = st_get_texture_sampler_view(stObj, pipe); } /* diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 5456fb87b0..d6fdfaccd6 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -133,7 +133,7 @@ st_BlitFramebuffer(GLcontext *ctx, return; util_blit_pixels(st->blit, - srcSurf, st_get_texture_sampler_view(srcObj), + srcSurf, st_get_texture_sampler_view(srcObj, pipe), srcX0, srcY0, srcX1, srcY1, dstSurf, dstX0, dstY0, dstX1, dstY1, 0.0, pFilter); diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index 3c4fe32090..a924f87223 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -126,7 +126,6 @@ st_bind_surface(GLcontext *ctx, GLenum target, texImage->TexFormat = st_pipe_format_to_mesa_format(ps->format); _mesa_set_fetch_functions(texImage, 2); - stObj->pipe = ctx->st->pipe; /* FIXME create a non-default sampler view from the pipe_surface? */ pipe_resource_reference(&stImage->pt, ps->texture); diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 67b9322d4a..e13bc1921a 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -310,6 +310,8 @@ st_render_texture(GLcontext *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att) { + struct st_context *st = ctx->st; + struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = ctx->st->pipe->screen; struct st_renderbuffer *strb; struct gl_renderbuffer *rb; @@ -360,7 +362,8 @@ st_render_texture(GLcontext *ctx, pipe_surface_reference(&strb->surface, NULL); - pipe_sampler_view_reference(&strb->sampler_view, st_get_texture_sampler_view(stObj)); + pipe_sampler_view_reference(&strb->sampler_view, + st_get_texture_sampler_view(stObj, pipe)); assert(strb->rtt_level <= strb->texture->last_level); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 245489ca4c..89f10284ce 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -322,8 +322,6 @@ guess_and_alloc_texture(struct st_context *st, depth, usage); - stObj->pipe = st->pipe; - DBG("%s - success\n", __FUNCTION__); } @@ -838,7 +836,8 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, struct pipe_screen *screen = pipe->screen; struct st_texture_image *stImage = st_texture_image(texImage); struct st_texture_object *stObj = st_texture_object(texObj); - struct pipe_sampler_view *src_view = st_get_texture_sampler_view(stObj); + struct pipe_sampler_view *src_view = + st_get_texture_sampler_view(stObj, pipe); const GLuint width = texImage->Width; const GLuint height = texImage->Height; struct pipe_surface *dst_surface; diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 177a7982b3..f25b5bf028 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -84,7 +84,7 @@ st_render_mipmap(struct st_context *st, { struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; - struct pipe_sampler_view *psv = st_get_texture_sampler_view(stObj); + struct pipe_sampler_view *psv = st_get_texture_sampler_view(stObj, pipe); const uint face = _mesa_tex_target_to_face(target); assert(target != GL_TEXTURE_3D); /* not done yet */ diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 26f9554c9e..5cf17fe530 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -556,7 +556,6 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target _mesa_clear_texture_image(ctx, texImage); } - stObj->pipe = st->pipe; pipe_resource_reference(&stImage->pt, tex); _mesa_dirty_texobj(ctx, texObj, GL_TRUE); diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index 9fcf86844d..d1a430bc97 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -34,7 +34,7 @@ #include "main/mtypes.h" -struct pipe_context; + struct pipe_resource; @@ -76,8 +76,6 @@ struct st_texture_object */ struct pipe_sampler_view *sampler_view; - struct pipe_context *pipe; - GLboolean teximage_realloc; /* True if there is/was a surface bound to this texture object. It helps @@ -130,14 +128,16 @@ st_create_texture_sampler_view(struct pipe_context *pipe, static INLINE struct pipe_sampler_view * -st_get_texture_sampler_view(struct st_texture_object *stObj) +st_get_texture_sampler_view(struct st_texture_object *stObj, + struct pipe_context *pipe) + { if (!stObj || !stObj->pt) { return NULL; } if (!stObj->sampler_view) { - stObj->sampler_view = st_create_texture_sampler_view(stObj->pipe, stObj->pt); + stObj->sampler_view = st_create_texture_sampler_view(pipe, stObj->pt); } return stObj->sampler_view; -- cgit v1.2.3