summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-08-19 09:40:37 -0700
committerEric Anholt <[email protected]>2014-08-22 10:16:57 -0700
commit3a1efcc7f9f99d42cda191ded1eb78140366c708 (patch)
treefacf7091502e68b2da35810513efbcea765c4916 /src/gallium/drivers/vc4/vc4_program.c
parent1b6dcaf40c639d7933e83fecfdf28dbe84175ac6 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c6
1 files changed, 4 insertions, 2 deletions
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) |