freedreno: remove tex_resource
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 3 Apr 2015 02:26:03 +0000 (22:26 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 5 Apr 2015 20:36:34 +0000 (16:36 -0400)
pipe_sampler_view already contains a texture, remove the redundant
tex_resource member which pointed at the same thing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a2xx/fd2_emit.c
src/gallium/drivers/freedreno/a2xx/fd2_texture.c
src/gallium/drivers/freedreno/a2xx/fd2_texture.h
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a3xx/fd3_texture.c
src/gallium/drivers/freedreno/a3xx/fd3_texture.h
src/gallium/drivers/freedreno/a4xx/fd4_emit.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.h

index a533c2981151197ffee1aea8383b890aa09ee6a8..cc0ed59f3008f1e8ffea6786ceddc4dbf34e9968 100644 (file)
@@ -140,7 +140,7 @@ emit_texture(struct fd_ringbuffer *ring, struct fd_context *ctx,
        OUT_RING(ring, 0x00010000 + (0x6 * const_idx));
 
        OUT_RING(ring, sampler->tex0 | view->tex0);
-       OUT_RELOC(ring, view->tex_resource->bo, 0, view->fmt, 0);
+       OUT_RELOC(ring, fd_resource(view->base.texture)->bo, 0, view->fmt, 0);
        OUT_RING(ring, view->tex2);
        OUT_RING(ring, sampler->tex3 | view->tex3);
        OUT_RING(ring, sampler->tex4);
index b70eaa69898976fd154068ac20392a83dd354450..90013e260ce1131fc2ba983109fc405037747e39 100644 (file)
@@ -136,7 +136,6 @@ fd2_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        so->base.reference.count = 1;
        so->base.context = pctx;
 
-       so->tex_resource =  rsc;
        so->fmt = fd2_pipe2surface(cso->format);
 
        so->tex0 = A2XX_SQ_TEX_0_PITCH(rsc->slices[0].pitch);
index b337acd40aec5b9c38541016ec8cc59efde77d3a..4fffa08b3c31a88aebd7eb38f7b2fa91d441bd63 100644 (file)
@@ -50,7 +50,6 @@ fd2_sampler_stateobj(struct pipe_sampler_state *samp)
 
 struct fd2_pipe_sampler_view {
        struct pipe_sampler_view base;
-       struct fd_resource *tex_resource;
        enum a2xx_sq_surfaceformat fmt;
        uint32_t tex0, tex2, tex3;
 };
index 1b656b77464e4b8f7549ec1d5ddb0350f0a03917..5fd31f50daf4e0d8854f478c2b50de14462a2ee8 100644 (file)
@@ -262,7 +262,7 @@ emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring,
                        const struct fd3_pipe_sampler_view *view = tex->textures[i] ?
                                        fd3_pipe_sampler_view(tex->textures[i]) :
                                        &dummy_view;
-                       struct fd_resource *rsc = view->tex_resource;
+                       struct fd_resource *rsc = fd_resource(view->base.texture);
                        unsigned start = view->base.u.tex.first_level;
                        unsigned end   = view->base.u.tex.last_level;
 
index 69e2d587c93a1750a15f146beee7649e7d90904c..6f44ee3c08e8f89383fb05440ff13f57de80ab90 100644 (file)
@@ -223,8 +223,6 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        so->base.reference.count = 1;
        so->base.context = pctx;
 
-       so->tex_resource =  rsc;
-
        so->texconst0 =
                        A3XX_TEX_CONST_0_TYPE(tex_type(prsc->target)) |
                        A3XX_TEX_CONST_0_FMT(fd3_pipe2tex(cso->format)) |
index f3cb12022f0b3f54de1389b9aa5fd0a564b45840..c38fd847f271952e4d6299980af580ec2b4f8c63 100644 (file)
@@ -51,7 +51,6 @@ fd3_sampler_stateobj(struct pipe_sampler_state *samp)
 
 struct fd3_pipe_sampler_view {
        struct pipe_sampler_view base;
-       struct fd_resource *tex_resource;
        uint32_t texconst0, texconst1, texconst2, texconst3;
 };
 
index 37552cf3c0627681000ca02b39fcc2852318c4dd..bf51847706e82f8f05cf4c9f1cf0e7d5b44366a8 100644 (file)
@@ -207,7 +207,7 @@ emit_textures(struct fd_context *ctx, struct fd_ringbuffer *ring,
                        const struct fd4_pipe_sampler_view *view = tex->textures[i] ?
                                        fd4_pipe_sampler_view(tex->textures[i]) :
                                        &dummy_view;
-                       struct fd_resource *rsc = view->tex_resource;
+                       struct fd_resource *rsc = fd_resource(view->base.texture);
                        unsigned start = view->base.u.tex.first_level;
                        uint32_t offset = fd_resource_offset(rsc, start, 0);
 
index 40aca0e4d05a768578f8b8d247a3b668d058ba1e..f2cc33b1a635f36b66ab09a5b92ffd37f417f6f9 100644 (file)
@@ -162,8 +162,6 @@ fd4_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        so->base.reference.count = 1;
        so->base.context = pctx;
 
-       so->tex_resource =  rsc;
-
        so->texconst0 =
                A4XX_TEX_CONST_0_TYPE(tex_type(prsc->target)) |
                A4XX_TEX_CONST_0_FMT(fd4_pipe2tex(cso->format)) |
index 975dfe5157d473cdbd716c4af566679ddaa01c2c..579ed87f14ba5885f9ee4d145860a3007f7393fb 100644 (file)
@@ -50,7 +50,6 @@ fd4_sampler_stateobj(struct pipe_sampler_state *samp)
 
 struct fd4_pipe_sampler_view {
        struct pipe_sampler_view base;
-       struct fd_resource *tex_resource;
        uint32_t texconst0, texconst1, texconst2, texconst3, textconst4;
 };