static void softpipe_set_geometry_sampler_views(struct pipe_context *pipe, unsigned num, struct pipe_sampler_view **views) { softpipe_set_sampler_views(pipe, PIPE_SHADER_GEOMETRY, 0, num, views); }
static void softpipe_set_fragment_sampler_views(struct pipe_context *pipe, unsigned num, struct pipe_sampler_view **views) { softpipe_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, views); }
static void softpipe_set_vertex_sampler_views(struct pipe_context *pipe, unsigned num, struct pipe_sampler_view **views) { softpipe_set_sampler_views(pipe, PIPE_SHADER_VERTEX, 0, num, views); }
/** * Should be called when polygon stipple is enabled/disabled or when * the fragment shader changes. * We add/update the fragment sampler and sampler views to sample from * the polygon stipple texture. The texture unit that we use depends on * the fragment shader (we need to use a unit not otherwise used by the * shader). */ static void update_polygon_stipple_enable(struct softpipe_context *softpipe, unsigned prim) { if (prim == PIPE_PRIM_TRIANGLES && softpipe->fs_variant->key.polygon_stipple) { const unsigned unit = softpipe->fs_variant->stipple_sampler_unit; /* sampler state */ softpipe->samplers[PIPE_SHADER_FRAGMENT][unit] = softpipe->pstipple.sampler; /* sampler view state */ softpipe_set_sampler_views(&softpipe->pipe, PIPE_SHADER_FRAGMENT, unit, 1, &softpipe->pstipple.sampler_view); softpipe->dirty |= SP_NEW_SAMPLER; } }