diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:01:20 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:01:20 +0000 |
commit | e2a3acb64af2657b1181806818eacad061103c23 (patch) | |
tree | 7535f61f2c3f8a69404befb400ecca145be4429c /lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c | |
parent | 1e3bb66f697283b6bd192f3a000d99d637624079 (diff) |
Import Mesa 19.0.5
Diffstat (limited to 'lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c')
-rw-r--r-- | lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c b/lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c index 7100865f9..ef2a7bd58 100644 --- a/lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c +++ b/lib/mesa/src/gallium/drivers/etnaviv/etnaviv_texture_state.c @@ -131,6 +131,17 @@ etna_create_sampler_view_state(struct pipe_context *pctx, struct pipe_resource * return NULL; } + if (res->addressing_mode == ETNA_ADDRESSING_MODE_LINEAR) { + sv->TE_SAMPLER_CONFIG0 |= VIVS_TE_SAMPLER_CONFIG0_ADDRESSING_MODE(TEXTURE_ADDRESSING_MODE_LINEAR); + + for (int lod = 0; lod <= res->base.last_level; ++lod) + sv->TE_SAMPLER_LINEAR_STRIDE[lod] = res->levels[lod].stride; + + } else { + sv->TE_SAMPLER_CONFIG0 |= VIVS_TE_SAMPLER_CONFIG0_ADDRESSING_MODE(TEXTURE_ADDRESSING_MODE_TILED); + memset(&sv->TE_SAMPLER_LINEAR_STRIDE, 0, sizeof(sv->TE_SAMPLER_LINEAR_STRIDE)); + } + sv->TE_SAMPLER_CONFIG1 = COND(ext, VIVS_TE_SAMPLER_CONFIG1_FORMAT_EXT(format)) | COND(astc, VIVS_TE_SAMPLER_CONFIG1_FORMAT_EXT(TEXTURE_FORMAT_EXT_ASTC)) | VIVS_TE_SAMPLER_CONFIG1_HALIGN(res->halign) | swiz; @@ -294,6 +305,16 @@ etna_emit_texture_state(struct etna_context *ctx) } } } + if (unlikely(dirty & (ETNA_DIRTY_SAMPLER_VIEWS))) { + for (int y = 0; y < VIVS_TE_SAMPLER_LINEAR_STRIDE__LEN; ++y) { + for (int x = 0; x < VIVS_TE_SAMPLER__LEN; ++x) { + if ((1 << x) & active_samplers) { + struct etna_sampler_view *sv = etna_sampler_view(ctx->sampler_view[x]); + /*02C00*/ EMIT_STATE(TE_SAMPLER_LINEAR_STRIDE(x, y), sv->TE_SAMPLER_LINEAR_STRIDE[y]); + } + } + } + } if (unlikely(ctx->specs.tex_astc && (dirty & (ETNA_DIRTY_SAMPLER_VIEWS)))) { for (int x = 0; x < VIVS_TE_SAMPLER__LEN; ++x) { if ((1 << x) & active_samplers) { |