static struct pipe_sampler_view *views[PIPE_MAX_SHADER_SAMPLER_VIEWS] = { NULL };
static void *zeros[PIPE_MAX_SAMPLERS] = { NULL };
struct pipe_screen *scr = ctx->pipe->screen;
- unsigned sh;
+ enum pipe_shader_type sh;
for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) {
int maxsam = scr->get_shader_param(scr, sh,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
* Send staged sampler state to the driver.
*/
void
-cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
+cso_single_sampler_done(struct cso_context *ctx,
+ enum pipe_shader_type shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
const unsigned old_nr_samplers = info->nr_samplers;
*/
enum pipe_error
cso_set_samplers(struct cso_context *ctx,
- unsigned shader_stage,
+ enum pipe_shader_type shader_stage,
unsigned nr,
const struct pipe_sampler_state **templates)
{
enum pipe_error
cso_set_samplers(struct cso_context *cso,
- unsigned shader_stage,
+ enum pipe_shader_type shader_stage,
unsigned count,
const struct pipe_sampler_state **states);
unsigned idx, const struct pipe_sampler_state *states);
void
-cso_single_sampler_done(struct cso_context *cso, unsigned shader_stage);
+cso_single_sampler_done(struct cso_context *cso,
+ enum pipe_shader_type shader_stage);
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
void (*driver_bind_fs_state)(struct pipe_context *, void *);
void (*driver_delete_fs_state)(struct pipe_context *, void *);
- void (*driver_bind_sampler_states)(struct pipe_context *, unsigned, unsigned,
+ void (*driver_bind_sampler_states)(struct pipe_context *,
+ enum pipe_shader_type, unsigned,
unsigned, void **);
- void (*driver_set_sampler_views)(struct pipe_context *, unsigned shader,
+ void (*driver_set_sampler_views)(struct pipe_context *,
+ enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view **);
};
static void
-aaline_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+aaline_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned num, void **sampler)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
void (*driver_bind_fs_state)(struct pipe_context *, void *);
void (*driver_delete_fs_state)(struct pipe_context *, void *);
- void (*driver_bind_sampler_states)(struct pipe_context *, unsigned,
+ void (*driver_bind_sampler_states)(struct pipe_context *,
+ enum pipe_shader_type,
unsigned, unsigned, void **);
void (*driver_set_sampler_views)(struct pipe_context *,
stage->tri(stage, header);
return;
}
-
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
static void
-pstip_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+pstip_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned num, void **sampler)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
DD_CSO_DELETE(sampler)
static void
-dd_context_bind_sampler_states(struct pipe_context *_pipe, unsigned shader,
+dd_context_bind_sampler_states(struct pipe_context *_pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned count, void **states)
{
struct dd_context *dctx = dd_context(_pipe);
static void
fd2_sampler_states_bind(struct pipe_context *pctx,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned nr, void **hwcso)
{
if (!hwcso)
static void
fd3_sampler_states_bind(struct pipe_context *pctx,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned nr, void **hwcso)
{
struct fd_context *ctx = fd_context(pctx);
static void
fd4_sampler_states_bind(struct pipe_context *pctx,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned nr, void **hwcso)
{
struct fd_context *ctx = fd_context(pctx);
void
fd_sampler_states_bind(struct pipe_context *pctx,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned nr, void **hwcso)
{
struct fd_context *ctx = fd_context(pctx);
static void
-i915_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+i915_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned num_samplers,
void **samplers)
{
}
static void
-ilo_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+ilo_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned count, void **samplers)
{
struct ilo_state_vector *vec = &ilo_context(pipe)->state_vector;
static void
llvmpipe_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned num,
void **samplers)
{
}
-static void noop_bind_sampler_states(struct pipe_context *ctx, unsigned shader,
+static void noop_bind_sampler_states(struct pipe_context *ctx,
+ enum pipe_shader_type shader,
unsigned start, unsigned count,
void **states)
{
static void
nv30_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader, unsigned start_slot,
+ enum pipe_shader_type shader, unsigned start_slot,
unsigned num_samplers, void **samplers)
{
switch (shader) {
case PIPE_SHADER_FRAGMENT:
nv30_fragtex_sampler_states_bind(pipe, num_samplers, samplers);
break;
+ default:
+ assert(!"unexpected shader type");
+ break;
}
}
static void
nv50_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned num_samplers, void **samplers)
{
assert(start == 0);
case PIPE_SHADER_FRAGMENT:
nv50_fp_sampler_states_bind(pipe, num_samplers, samplers);
break;
+ default:
+ assert(!"unexpected shader type");
+ break;
}
}
}
static inline void
-nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0, int s,
+nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0,
+ enum pipe_shader_type s,
unsigned nr, void **hwcso)
{
unsigned i;
static void
nvc0_stage_sampler_states_bind_range(struct nvc0_context *nvc0,
- const unsigned s,
+ const enum pipe_shader_type s,
unsigned start, unsigned nr, void **cso)
{
const unsigned end = start + nr;
}
static void
-nvc0_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+nvc0_bind_sampler_states(struct pipe_context *pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned nr, void **s)
{
switch (shader) {
start, nr, s);
nvc0_context(pipe)->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
break;
+ default:
+ assert(!"unexpected shader type");
+ break;
}
}
}
static void r300_bind_sampler_states(struct pipe_context* pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start, unsigned count,
void** states)
{
}
static void r600_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned count, void **states)
{
/* SAMPLER STATES */
-static void si_bind_sampler_states(struct pipe_context *ctx, unsigned shader,
+static void si_bind_sampler_states(struct pipe_context *ctx,
+ enum pipe_shader_type shader,
unsigned start, unsigned count, void **states)
{
struct si_context *sctx = (struct si_context *)ctx;
}
static void
-rbug_bind_sampler_states(struct pipe_context *_pipe, unsigned shader,
+rbug_bind_sampler_states(struct pipe_context *_pipe,
+ enum pipe_shader_type shader,
unsigned start, unsigned count,
void **samplers)
{
*/
static void
softpipe_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned num,
void **samplers)
static void
svga_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned num,
void **samplers)
static void
swr_bind_sampler_states(struct pipe_context *pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned num,
void **samplers)
static void
trace_context_bind_sampler_states(struct pipe_context *_pipe,
- unsigned shader,
+ enum pipe_shader_type shader,
unsigned start,
unsigned num_states,
void **states)
static void
vc4_sampler_states_bind(struct pipe_context *pctx,
- unsigned shader, unsigned start,
+ enum pipe_shader_type shader, unsigned start,
unsigned nr, void **hwcso)
{
struct vc4_context *vc4 = vc4_context(pctx);
}
static void virgl_bind_sampler_states(struct pipe_context *ctx,
- unsigned shader, unsigned start_slot,
+ enum pipe_shader_type shader,
+ unsigned start_slot,
unsigned num_samplers,
void **samplers)
{
void * (*create_sampler_state)(struct pipe_context *,
const struct pipe_sampler_state *);
void (*bind_sampler_states)(struct pipe_context *,
- unsigned shader, unsigned start_slot,
- unsigned num_samplers, void **samplers);
+ enum pipe_shader_type shader,
+ unsigned start_slot, unsigned num_samplers,
+ void **samplers);
void (*delete_sampler_state)(struct pipe_context *, void *);
void * (*create_rasterizer_state)(struct pipe_context *,
*/
static void
update_shader_samplers(struct st_context *st,
- unsigned shader_stage,
+ enum pipe_shader_type shader_stage,
const struct gl_program *prog,
unsigned max_units,
struct pipe_sampler_state *samplers,