Beispiel #1
0
void
fd_set_sampler_views(struct pipe_context *pctx, unsigned shader,
		unsigned start, unsigned nr,
		struct pipe_sampler_view **views)
{
	struct fd_context *ctx = fd_context(pctx);

	switch (shader) {
	case PIPE_SHADER_FRAGMENT:
		/* on a2xx, since there is a flat address space for textures/samplers,
		 * a change in # of fragment textures/samplers will trigger patching
		 * and re-emitting the vertex shader:
		 *
		 * (note: later gen's ignore FD_DIRTY_TEXSTATE so fine to set it)
		 */
		if (nr != ctx->fragtex.num_textures)
			ctx->dirty |= FD_DIRTY_TEXSTATE;

		set_sampler_views(&ctx->fragtex, start, nr, views);
		ctx->dirty |= FD_DIRTY_FRAGTEX;
		break;
	case PIPE_SHADER_VERTEX:
		set_sampler_views(&ctx->verttex, start, nr, views);
		ctx->dirty |= FD_DIRTY_VERTTEX;
		break;
	default:
		break;
	}
}
static void
fd_verttex_set_sampler_views(struct pipe_context *pctx, unsigned nr,
		struct pipe_sampler_view **views)
{
	struct fd_context *ctx = fd_context(pctx);
	set_sampler_views(&ctx->verttex, nr, views);
	ctx->dirty |= FD_DIRTY_VERTTEX;
}
Beispiel #3
0
void
cso_set_vertex_sampler_views(struct cso_context *ctx,
                             uint count,
                             struct pipe_sampler_view **views)
{
   set_sampler_views(ctx, &ctx->vertex_samplers,
                     ctx->pipe->set_vertex_sampler_views,
                     count, views);
}
static inline void
etna_vertex_set_sampler_views(struct etna_context *ctx, unsigned nr,
                              struct pipe_sampler_view **views)
{
   unsigned start = ctx->specs.vertex_sampler_offset;
   unsigned end = start + ctx->specs.vertex_sampler_count;

   set_sampler_views(ctx, start, end, nr, views);
}
static inline void
etna_fragtex_set_sampler_views(struct etna_context *ctx, unsigned nr,
                               struct pipe_sampler_view **views)
{
   unsigned start = 0;
   unsigned end = start + ctx->specs.fragment_sampler_count;

   set_sampler_views(ctx, start, end, nr, views);
   ctx->num_fragment_sampler_views = nr;
}