Commit f15c9cb2 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

mip filter

parent 00e6d6ed
......@@ -369,6 +369,12 @@ translate_tex_filter(enum pipe_tex_filter f) {
}
}
static unsigned
translate_mip_filter(enum pipe_tex_mipfilter f)
{
return (f == PIPE_TEX_MIPFILTER_LINEAR) ? 0x18 : 0;
}
static unsigned
trans_translate_compare_func(enum pipe_compare_func in)
{
......@@ -919,6 +925,7 @@ trans_emit_for_draw(struct panfrost_context *ctx)
/* Inject the address in. */
for (int l = 0; l < (tex_rsrc->last_level + 1); ++l) {
printf("Dirty %d\n", l);
ctx->sampler_views[t][i]->hw.swizzled_bitmaps[l] = rsrc->gpu[l];
}
......@@ -1378,6 +1385,7 @@ panfrost_create_sampler_state(
struct mali_sampler_descriptor sampler_descriptor = {
.filter_mode = MALI_GL_TEX_MIN(translate_tex_filter(cso->min_img_filter))
| MALI_GL_TEX_MAG(translate_tex_filter(cso->mag_img_filter))
| translate_mip_filter(cso->min_mip_filter)
| 0x20,
.wrap_s = translate_tex_wrap(cso->wrap_s),
......@@ -1391,10 +1399,12 @@ panfrost_create_sampler_state(
cso->border_color.f[3]
},
.min_lod = FIXED_16(0.0),
.max_lod = FIXED_16(0.25),
.max_lod = FIXED_16(31.0),
.unknown2 = 1,
};
printf("mip %d -> %d\n", cso->min_mip_filter, translate_mip_filter(cso->min_mip_filter));
so->hw = sampler_descriptor;
return so;
......@@ -2011,6 +2021,7 @@ panfrost_tile_texture(struct panfrost_context *ctx, struct panfrost_resource *rs
* we allocated */
trans_texture_swizzle(width, height, bpp, stride, rsrc->cpu[level], swizzled);
printf("Swizzling level %d\n", level);
}
static void
......@@ -2022,7 +2033,7 @@ panfrost_transfer_unmap(struct pipe_context *pctx,
if (transfer->usage & PIPE_TRANSFER_WRITE) {
if (transfer->resource->target == PIPE_TEXTURE_2D) {
/* Gallium thinks writeback happens here; instead, this is our cue to tile */
panfrost_tile_texture(ctx, (struct panfrost_resource *) transfer->resource, 0);
panfrost_tile_texture(ctx, (struct panfrost_resource *) transfer->resource, transfer->level);
}
}
/* XXX */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment