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().
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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 */
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user