diff options
author | Brian Paul <[email protected]> | 2010-04-18 17:55:23 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-04-18 18:02:42 -0600 |
commit | 5d3d63d45a037fdf603ddcff88da635c3ce8075e (patch) | |
tree | ba14ab292129e2680cffcb7ec2c6ce911998deb7 /src/mesa/state_tracker | |
parent | 073048c872ea5893ad0c39b32ca171893c17148b (diff) |
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().
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_blit.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_eglimage.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 5 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 5 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_gen_mipmap.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_texture.h | 10 |
8 files changed, 15 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index e056487f1a6..f4294ac1e6f 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 5456fb87b05..d6fdfaccd63 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 3c4fe32090b..a924f872232 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 67b9322d4a2..e13bc1921a0 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 245489ca4c4..89f10284ce6 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 177a7982b35..f25b5bf028d 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 26f9554c9ec..5cf17fe530a 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 9fcf86844da..d1a430bc975 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; |