}
static void
-etna_bind_sampler_states(struct pipe_context *pctx, unsigned shader,
+etna_bind_sampler_states(struct pipe_context *pctx, enum pipe_shader_type shader,
unsigned start_slot, unsigned num_samplers,
void **samplers)
{
if (util_format_is_compressed(res->base.format))
return true;
- /* The sampler (as we currently know it) only accepts tiled layouts */
+ struct etna_screen *screen = etna_screen(res->base.screen);
+ /* This GPU supports texturing from supertiled textures? */
+ if (res->layout == ETNA_LAYOUT_SUPER_TILED && VIV_FEATURE(screen, chipMinorFeatures2, SUPERTILED_TEXTURE))
+ return true;
+
+ /* TODO: LINEAR_TEXTURE_SUPPORT */
+
+ /* Otherwise, only support tiled layouts */
if (res->layout != ETNA_LAYOUT_TILED)
return false;
/* If we have HALIGN support, we can allow for the RS padding */
- struct etna_screen *screen = etna_screen(res->base.screen);
if (VIV_FEATURE(screen, chipMinorFeatures1, TEXTURE_HALIGN))
return true;
}
sv->base = *so;
- pipe_reference(NULL, &prsc->reference);
- sv->base.texture = prsc;
- sv->base.reference.count = 1;
+ pipe_reference_init(&sv->base.reference, 1);
+ sv->base.texture = NULL;
+ pipe_resource_reference(&sv->base.texture, prsc);
sv->base.context = pctx;
/* merged with sampler state */
* but set T wrap to repeat */
sv->TE_SAMPLER_CONFIG0_MASK = ~VIVS_TE_SAMPLER_CONFIG0_VWRAP__MASK;
sv->TE_SAMPLER_CONFIG0 |= VIVS_TE_SAMPLER_CONFIG0_VWRAP(TEXTURE_WRAPMODE_REPEAT);
+ /* fallthrough */
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_RECT:
sv->TE_SAMPLER_CONFIG0 |= VIVS_TE_SAMPLER_CONFIG0_TYPE(TEXTURE_TYPE_2D);
}
static void
-etna_set_sampler_views(struct pipe_context *pctx, unsigned shader,
+etna_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
unsigned start_slot, unsigned num_views,
struct pipe_sampler_view **views)
{
}
static void
-etna_texture_barrier(struct pipe_context *pctx)
+etna_texture_barrier(struct pipe_context *pctx, unsigned flags)
{
struct etna_context *ctx = etna_context(pctx);
/* clear color and texture cache to make sure that texture unit reads