From 3a1efcc7f9f99d42cda191ded1eb78140366c708 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Aug 2014 09:40:37 -0700 Subject: vc4: Add support for texture tiling. This still treats everything as RGBA8888 for the most part, same as before. This is a prerequisite for handling other texture formats, since only RGBA8888 has a raster-layout mode. --- src/gallium/drivers/vc4/vc4_program.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/vc4/vc4_program.c') diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index fb1a2fe47bf..eed0ee1543b 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1438,7 +1438,8 @@ write_texture_p0(struct vc4_context *vc4, struct vc4_resource *rsc = vc4_resource(texture->texture); cl_reloc(vc4, &vc4->uniforms, rsc->bo, - rsc->slices[0].offset | texture->u.tex.last_level); + rsc->slices[0].offset | texture->u.tex.last_level | + ((rsc->vc4_format & 7) << 4)); } static void @@ -1447,6 +1448,7 @@ write_texture_p1(struct vc4_context *vc4, uint32_t unit) { struct pipe_sampler_view *texture = texstate->textures[unit]; + struct vc4_resource *rsc = vc4_resource(texture->texture); struct pipe_sampler_state *sampler = texstate->samplers[unit]; static const uint32_t mipfilter_map[] = { [PIPE_TEX_MIPFILTER_NEAREST] = 2, @@ -1459,7 +1461,7 @@ write_texture_p1(struct vc4_context *vc4, }; cl_u32(&vc4->uniforms, - (1 << 31) /* XXX: data type */| + ((rsc->vc4_format >> 4) << 31) | (texture->texture->height0 << 20) | (texture->texture->width0 << 8) | (imgfilter_map[sampler->mag_img_filter] << 7) | -- cgit v1.2.3