void
nv40_verttex_validate(struct nv30_context *nv30);
+void
+nv30_fragtex_sampler_states_bind(struct pipe_context *pipe,
+ unsigned nr, void **hwcso);
+
+void
+nv40_verttex_sampler_states_bind(struct pipe_context *pipe,
+ unsigned nr, void **hwcso);
+
void
nv30_push_vbo(struct nv30_context *nv30, const struct pipe_draw_info *info);
nv30->fragprog.dirty_samplers = 0;
}
-static void
+void
nv30_fragtex_sampler_states_bind(struct pipe_context *pipe,
unsigned nr, void **hwcso)
{
FREE(hwcso);
}
+static void
+nv30_bind_sampler_states(struct pipe_context *pipe,
+ unsigned shader, unsigned start_slot,
+ unsigned num_samplers, void **samplers)
+{
+ switch (shader) {
+ case PIPE_SHADER_VERTEX:
+ nv40_verttex_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ case PIPE_SHADER_FRAGMENT:
+ nv30_fragtex_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ }
+}
+
static INLINE uint32_t
swizzle(const struct nv30_texfmt *fmt, unsigned cmp, unsigned swz)
{
{
pipe->create_sampler_state = nv30_sampler_state_create;
pipe->delete_sampler_state = nv30_sampler_state_delete;
+ pipe->bind_sampler_states = nv30_bind_sampler_states;
+
pipe->create_sampler_view = nv30_sampler_view_create;
pipe->sampler_view_destroy = nv30_sampler_view_destroy;
}
nv30->vertprog.dirty_samplers = 0;
}
-static void
+void
nv40_verttex_sampler_states_bind(struct pipe_context *pipe,
unsigned nr, void **hwcso)
{
nv50_stage_sampler_states_bind(nv50_context(pipe), 1, nr, s);
}
+static void
+nv50_bind_sampler_states(struct pipe_context *pipe,
+ unsigned shader, unsigned start,
+ unsigned num_samplers, void **samplers)
+{
+ assert(start == 0);
+ switch (shader) {
+ case PIPE_SHADER_VERTEX:
+ nv50_vp_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ nv50_gp_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ case PIPE_SHADER_FRAGMENT:
+ nv50_fp_sampler_states_bind(pipe, num_samplers, samplers);
+ break;
+ }
+}
+
+
+
/* NOTE: only called when not referenced anywhere, won't be bound */
static void
nv50_sampler_view_destroy(struct pipe_context *pipe,
pipe->create_sampler_state = nv50_sampler_state_create;
pipe->delete_sampler_state = nv50_sampler_state_delete;
+ pipe->bind_sampler_states = nv50_bind_sampler_states;
pipe->bind_vertex_sampler_states = nv50_vp_sampler_states_bind;
pipe->bind_fragment_sampler_states = nv50_fp_sampler_states_bind;
pipe->bind_geometry_sampler_states = nv50_gp_sampler_states_bind;
nvc0_context(pipe)->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
}
+static void
+nvc0_bind_sampler_states(struct pipe_context *pipe, unsigned shader,
+ unsigned start, unsigned nr, void **s)
+{
+ switch (shader) {
+ case PIPE_SHADER_VERTEX:
+ assert(start == 0);
+ nvc0_stage_sampler_states_bind(nvc0_context(pipe), 0, nr, s);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ assert(start == 0);
+ nvc0_stage_sampler_states_bind(nvc0_context(pipe), 3, nr, s);
+ break;
+ case PIPE_SHADER_FRAGMENT:
+ assert(start == 0);
+ nvc0_stage_sampler_states_bind(nvc0_context(pipe), 4, nr, s);
+ break;
+ case PIPE_SHADER_COMPUTE:
+ nvc0_stage_sampler_states_bind_range(nvc0_context(pipe), 5,
+ start, nr, s);
+ nvc0_context(pipe)->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
+ break;
+ }
+}
+
+
/* NOTE: only called when not referenced anywhere, won't be bound */
static void
nvc0_sampler_view_destroy(struct pipe_context *pipe,
pipe->create_sampler_state = nv50_sampler_state_create;
pipe->delete_sampler_state = nvc0_sampler_state_delete;
+ pipe->bind_sampler_states = nvc0_bind_sampler_states;
pipe->bind_vertex_sampler_states = nvc0_vp_sampler_states_bind;
pipe->bind_fragment_sampler_states = nvc0_fp_sampler_states_bind;
pipe->bind_geometry_sampler_states = nvc0_gp_sampler_states_bind;