llvmpipe->samplers[shader],
llvmpipe->num_samplers[shader]);
}
-
- llvmpipe->dirty |= LP_NEW_SAMPLER;
+ else {
+ llvmpipe->dirty |= LP_NEW_SAMPLER;
+ }
}
llvmpipe->sampler_views[shader],
llvmpipe->num_sampler_views[shader]);
}
-
- llvmpipe->dirty |= LP_NEW_SAMPLER_VIEW;
+ else {
+ llvmpipe->dirty |= LP_NEW_SAMPLER_VIEW;
+ }
}
struct llvmpipe_context *lp,
unsigned num,
struct pipe_sampler_view **views,
- unsigned shader_type,
- struct pipe_resource *mapped_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS])
+ unsigned shader_type)
{
unsigned i;
if (!num)
return;
- for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
+ for (i = 0; i < num; i++) {
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
if (view) {
unsigned first_level = 0;
unsigned last_level = 0;
- /* We're referencing the texture's internal data, so save a
- * reference to it.
- */
- pipe_resource_reference(&mapped_tex[i], tex);
-
if (!lp_tex->dt) {
/* regular texture - setup array of mipmap level offsets */
struct pipe_resource *res = view->texture;
/**
- * Called during state validation when LP_NEW_SAMPLER_VIEW is set.
+ * Called whenever we're about to draw (no dirty flag, FIXME?).
*/
void
llvmpipe_prepare_vertex_sampling(struct llvmpipe_context *lp,
unsigned num,
struct pipe_sampler_view **views)
{
- prepare_shader_sampling(lp, num, views, PIPE_SHADER_VERTEX,
- lp->mapped_vs_tex);
-}
-
-void
-llvmpipe_cleanup_vertex_sampling(struct llvmpipe_context *ctx)
-{
- unsigned i;
- for (i = 0; i < Elements(ctx->mapped_vs_tex); i++) {
- pipe_resource_reference(&ctx->mapped_vs_tex[i], NULL);
- }
+ prepare_shader_sampling(lp, num, views, PIPE_SHADER_VERTEX);
}
/**
- * Called during state validation when LP_NEW_SAMPLER_VIEW is set.
+ * Called whenever we're about to draw (no dirty flag, FIXME?).
*/
void
llvmpipe_prepare_geometry_sampling(struct llvmpipe_context *lp,
unsigned num,
struct pipe_sampler_view **views)
{
- prepare_shader_sampling(lp, num, views, PIPE_SHADER_GEOMETRY,
- lp->mapped_gs_tex);
+ prepare_shader_sampling(lp, num, views, PIPE_SHADER_GEOMETRY);
}
-void
-llvmpipe_cleanup_geometry_sampling(struct llvmpipe_context *ctx)
-{
- unsigned i;
- for (i = 0; i < Elements(ctx->mapped_gs_tex); i++) {
- pipe_resource_reference(&ctx->mapped_gs_tex[i], NULL);
- }
-}
void
llvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe)